Data Realms Fan Forums http://45.55.195.193/ |
|
NetCode http://45.55.195.193/viewtopic.php?f=4&t=31797 |
Page 1 of 1 |
Author: | Dylanhutch [ Mon Oct 01, 2012 3:39 am ] |
Post subject: | NetCode |
I'm sold on the idea that CC could possibly be multiplayer, even only through LAN. Let's say we have to send this: (posX,posY,mat,R,G,B) 2746,1293,00,255,255,255 That's 24 bytes for one pixel. Let's say that a shot of a Coalition Assualt Rifle destroys 10 pixels, and there are 10 players shooting these. That's 2.4 kilobytes, which by the way, anyone, even with dial-up speeds can download in less than half a second. Hmm.. Why not eh? Let's also say that we have to display players as well, well.. all that is is this: (posx,posy,ang,attached to,preset) 2387,1713,129,121,99 That's 20 bytes. With the other 9 parts of the body, it's 200b. Pixel: 24 Player/body: 200 20 bodies displacing 10 pixels each: 4800 + 4000 8.8kb every.. 5 frames at 30 fps = 52.8kb/s That is rather intensive playing though, as if all bodies were walking through snow. This is of course not counting the player count, but I'm thinking mainly of 1 vs 1. Possible. |
Author: | Asklar [ Mon Oct 01, 2012 3:50 am ] |
Post subject: | Re: NetCode |
Your estimations sound very intriguing, but what is the idea behind this? |
Author: | TheLastBanana [ Mon Oct 01, 2012 4:23 am ] |
Post subject: | Re: NetCode |
Multiplayer is entirely possible via LAN (or even through the Internet, as zalo proved), but it would require a lot of work. It's not really a question of whether it's doable, but whether Data is actually going to do it — to which the answer is "no." The next game will likely have networked multiplayer, but it's not going to happen for CC. Sorry. Even so, let's take a look at your estimations for the sake of learning: Quote: (posX,posY,mat,R,G,B) 2746,1293,00,255,255,255 That's 24 bytes for one pixel. I'm not entirely sure what you're sending here. It seems like you're just sending enough data to display the pixel, and not actually to apply physics to it. If so, why are you sending its material? Also, small correction: that's actually only 12 bytes — mat, R, G and B would be 1 byte each, as they're 8-bit integers. Even so, is this only for moving pixels? Keep in mind that you'd have to send the terrain data at some point, too, and that you'd need to keep the terrain data in sync for both copies of the game. There's far more data to be sent about pixels than just the ones that are currently moving. Quote: (posx,posy,ang,attached to,preset) 2387,1713,129,121,99 That's 20 bytes. Again, I'm not completely certain why you're sending the data about the arm's parent attachment here. How are you going to guarantee that both games have the exact same files, mods and all? If they don't, storing the preset as a number isn't going to work — you're going to have to send its name in string form. There's also much more data that needs to be sent in order to have smooth online play. Data would need to be sent regarding the player's input as well as the velocity and angular velocity of every object in order to predict what will happen in the next frame. Otherwise, small amounts of lag would cause a lot of jerkiness. The best way to do this (that I can think of) would be to have one person run the server, then send all of its files and modifications to clients before they join the game. Most of the simulation would be run server-side, but clients would also run predictive simulations in order to keep gameplay smooth. This implementation would require writing/rewriting all of the following:
So, could it be done? Yes. Would it be worth it? Maybe. Ultimately, though, it's a lot of work, and it comes down to whether Data is willing to implement all of this for a game which he's already spent over a decade making. For now, and for the foreseeable future, he's made it pretty clear that he isn't. |
Author: | YouKnowMe [ Mon Oct 01, 2012 5:16 am ] |
Post subject: | Re: NetCode |
I'm just gonna jump in here and say something. you only need 3 numbers, and a bool-eon. X coordinate, Y coordinate, Rotation (for MOs only), and 'is Horizontal flipped y/n' (for if actors are facing left or right) You do not need to store color, as the game already has all the sprites and particle colors. It would just need those bits of data attached to each and every object. particles, pixels, movable objects. all of them. it means you'd need to have the same exact content. As long as all players involved had the same content already at the start, it wouldn't have to share that data with a server. you don't need to sync images per frame, or audio, all you need to do is sync timescale, and when audio triggers, since everyone has the same files. I think it might be feasible if an extra program where involved... in theory steam could have done it. In fact if you're going for vanilla only content, steam already does. Delete all local content and re-download. No mods, and it guarantees your installs are all identical. Identical graphics, identical sounds, already synced up between players. Additionally if you're using mods, you'd need an external application to sync up all the mods to ensure that all the files are identical. Guess what, there's already such a program. It's called DROPBOX, and it's free. of course you'd have to sync each rte, and NOT the entire cortex command folder, as that would be piracy, though it would prevent 'teh hax'. since all the content between all players is synced up, they'd all join the same map. From there the games need to talk to eachother. Since the maps start identically, it doesn't need to track any data for anything that's settled into terrain, since it would send the exact coordinates for every object that COULD settle, and therefor would settle in exactly the same way per pixel, and even if it was a pixel or two off, the xyr sync would override how durable the settled material was. point being, syncing files isn't the issue. sound isn't the issue. just keeping track of all the objects is the issue. it's what, a maximum 200 MOs and an particle/pixel upper limit in the hundred millions before it causes instability? in moderation delete particles/pixels exceeding 10,000, and you're down to what 3-4 kb per sim update in bandwidth? that should be doable as far as bandwidth goes, right? how many sim updates per second? this gives us a sim updates per second * 4 kb for an upper limit on 1-way bandwidth in kbps. thats very doable even on shitty internet, but I digress. thats 10,200 different objects to track, per sim update, on top of the game already tracking it for physics. I can see this doubling resource costs all on its own. Wait... Didn't we do this exact conversation... like... 2-4 years ago? but with different words and without zalo having actually done it yet? what ever happened to what zalo made? Couldn't we just bring it up to date for the current version? we could use steam to verify installs, dropbox to verify mods, steam community events and chatroom for matchmaking, and all we would need is host servers, right? of course we'd still have to connect and run things manually, but most of it could be macro'd by on the main menu open the consol to launch a lua script that just asks for server IP or something that could be pasted from steam chat, and then ask for team color 0-3 (or 1-4, whatever), and it could do the rest, connect to server get map name from server, load map, and pause until all players are synced. I've been out of the loop, what happened to what zalo made, is it still a thing? |
Author: | dragonxp [ Mon Oct 01, 2012 5:55 am ] |
Post subject: | Re: NetCode |
I used to be involved in the Zalo 'internet' mod. By involved I mean I was hosting a different server. The previous mod is located here:http://forums.datarealms.com/viewtopic.php?f=24&t=19719 and My server page was listed here:http://forums.datarealms.com/viewtopic.php?f=24&t=19745 How it handled the game from my understanding was that the main server received byte/data about the position and the direction the actor is facing. This was then sent back to every other player in the server. [This kind of the basics on how almost every server works I know]. But what Zalo did was keep track of only a couple of things: The body parts of the actor that had collision boxes, and the projectiles of a special type of gun. It also relayed health information. Everything else was client side, [terrain etc]. What this meant was that if you had used your gun to slowly dig into the ground then you could potentially appear in other people's games to fade through the terrain. Any terrain changes were basically not transferred. Everything was done with Lua sockets and java based server program. Now if this were to be revamped I'd be happy to once again open the gates of Grimston! |
Author: | Duh102 [ Mon Oct 01, 2012 6:04 am ] |
Post subject: | Re: NetCode |
Can we please just let this subject die? The main stumbling block for any online mod/engine rewrite: it takes a lot of time and effort, which people don't want to spend. If you have that time and are willing to put in the effort, seeing a topic about how much people want it probably won't motivate you any more than you are already self-motivated. Data does not have the time, or is not willing to put in the effort, or both, so not going to happen from that direction. |
Author: | YouKnowMe [ Mon Oct 01, 2012 6:21 am ] |
Post subject: | Re: NetCode |
well thanks for that bit of info dragonxp! and also thanks duh, you ninja'd me. I had this long thing typed, allong with some other stuff, hit submit, and... you posted. soooo I'd like to point out an existing way to do multiplayer without having to program a new version of the game, or any mods. All we would need is someone to host a dedicated game server. 1600x1200* resolution. 4 player split screen. Each player is an 800x600* portion of the screen. One computer runs the game, and some software to simulate the inputs for 4 controllers (with data received from the players in real time), and manycam with 5 cams set up, 1 for each corner of the screen, and one for the fullscreen. the 4 players are on separate computers from the host, and send controller input to the program on the host. Meanwhile the players are each looking at a livestream hosted by the host. Each player gets an 800x600* full-screen set up and can't see the other players. Spectators get the 5th screen on livestream, that shows all 4 players at once. It's kind of retarded and bandwidth intensive, but the players don't need to be running the game. All we'd need is ONE bad-ass computer that can do 5 livestreams with separate manycam instances, AND cortex command in 1600x1200* at the same time. this... is a retarded idea. I feel dumb for that one. but i'm still sharing the idea in case someone does happen to have such a computer. all we'd need to do is make a thing that sends controller inputs over the internet. its the easy, quick, but expensive way. *Of course that resolution was just pulled out of my ass because 800x600 should be easy to stream, really it could be any resolution, i was just trying to think of one that would be acceptable to send 1/4 of to a player. |
Author: | Dylanhutch [ Mon Oct 01, 2012 6:47 am ] |
Post subject: | Re: NetCode |
TheLastBanana wrote: Multiplayer is entirely possible via LAN (or even through the Internet, as zalo proved), but it would require a lot of work. It's not really a question of whether it's doable, but whether Data is actually going to do it — to which the answer is "no." The next game will likely have networked multiplayer, but it's not going to happen for CC. Sorry. I knew it was not going to happen, I've seen many many topics saying they want multiplayer, I just wanted to say that despite popular belief, it's possible. YouKnowMe wrote: I'm just gonna jump in here and say something. you only need 3 numbers, and a bool-eon. X coordinate, Y coordinate, Rotation (for MOs only), and 'is Horizontal flipped y/n' (for if actors are facing left or right) You do not need to store color, as the game already has all the sprites and particle colors. It would just need those bits of data attached to each and every object. particles, pixels, movable objects. all of them. it means you'd need to have the same exact content. Naturally you would have vanilla only, as otherwise it just wouldn't work. Actually, you do need to send the color, or at least the variable that could be attached to a part of the palette, as you can displace terrain, which isn't always the same color, unlike most games cortex command doesn't use a centered texture, as in only the map's set starting pixels are set that way, if you dig some of this out it get's moved but stays the same color. If I were to give more information, which I guess I should have. What I mean is that the best way to send info across a network is to send as little information as possible and have the other end calculate it, that's what I meant by those numbers, it's possible to for example, in python do this: Code: if input=="12": print "Dirt" else: print "Air" So in theory you could use a single number to set a pixel to a certain material. Please understand this though, I'm talking about ingame displacements, not building maps pixel by pixel. I know that it's never going to get multiplayer because no-one's going to give it multiplayer, but why the hell is it that all topics about this are almost against forum rules? Please don't answer, I already know what you'd say. Duh102 wrote: Can we please just let this subject die? Feel free. Sorry for posting yet another topic about this, I just thought it would be useful information that's all. I'm either really bad at explaining or everyone on here doesn't know English.. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |