Multiplayer?

Discussion in 'Ideas and Suggestions' started by Xkiller1200, Jan 30, 2014.

  1. bratska77

    bratska77
    Expand Collapse

    Joined:
    Nov 19, 2013
    Messages:
    54
    Ok.... I'm stopping the ranting here about using the search bar to make a simple response. As of right now, the physics cause too heavy of a load to make server based gameplay possible, unless you have an insane computer and an even more insane Internet speed. Then whoever was running the server would have to have an EVEN MORE insane machine to run the server. Until optimization is maximized and CPU load is minimized, I wouldn't get my hopes up. Most people can't spawn more than 2 cars (standing still) without FPS dropping through the floor (you can't make delicious bagels and play games with the same machine). So, it wouldn't be practical, or even feasible to have 10 vehicles from different players running into each other, unless someone found a way to ship all the calculations to a central hub, and them ship the results back to keep lag at a minimum, provided you have an awesome Internet connection/speed. Long story short... The game runs WAY to hard on most hardware to make it possible to run multiplayer.
     
  2. Jack Attack

    Jack Attack
    Expand Collapse

    Joined:
    Aug 21, 2013
    Messages:
    230
    True, however Rigs of Rods used soft body physics (I don't believe the engine was as advanced as BeamNG's) and multiplayer servers worked pretty well. You could run one on your computer, and if you had good internet and a good computer, you actually wouldn't lag while playing with someone else. I can see how lag might be a little more of a problem for BeamNG multiplayer, but I doubt it will be that bad.
     
  3. bratska77

    bratska77
    Expand Collapse

    Joined:
    Nov 19, 2013
    Messages:
    54
    Rigs of Rods doesn't have the complexity (to my understanding) of BeamNG, but something I missed is that even if the CPU isn't the bottleneck in a multiplayer setup, the GPU most likely would. It just seems like a heck of a lot of load to try to put in a multiplayer set up when so many people are having to tone down their settings to just play by themselves.... I'm no expert on servers, so if anyone who operates a multiplayer server wants to chime in, I'd definitely be interested in what you have to say. My statements are simply my understanding of the matter (of which I am pretty sure of....) but hey, I could be really ignorant, and quite honestly, would like I be proven wrong, as that would point to a greater possibility of it happening:)

    Edit: Rigs of Rods DOESN'T... Not didn't... The game still exists...

    Edit 2: I apparently am a self imposed grammar nazi....
     
  4. logoster

    logoster
    Expand Collapse

    Joined:
    Sep 5, 2012
    Messages:
    2,082

    what? no, the server most certainly would not have a gpu limit, it wouldn't have to render anything at all, it's the player's that render everything on there pc, cpu and network would be the main limits of an online server, a lan mode should work fine though (provided you're actually on lan, obviously if you hamachi it or anything, it probably wont work well, unless the host and the player both have a really good internet connection (both speed AND ping wise)
     
  5. Jack Attack

    Jack Attack
    Expand Collapse

    Joined:
    Aug 21, 2013
    Messages:
    230
    The easiest way to set up a server is simply to port forward. Almost all routers allow you to do it and it will allow anyone to join.
     
  6. logoster

    logoster
    Expand Collapse

    Joined:
    Sep 5, 2012
    Messages:
    2,082

    im talking about LAN, which would be built into the client, and I'm sure they'd do something to make it so it only actually WORKS, on lan(or at least something that looks like lan) (also, a lot of people don't even know what a port is, let alone how to port forward, hence why they make programs like hamachi, so that said people can do things that would usually require port forwarding, WITHOUT, port forwarding)
     
  7. bratska77

    bratska77
    Expand Collapse

    Joined:
    Nov 19, 2013
    Messages:
    54
    I wasn't talking about the sever itself having a GPU limit :p wouldn't the players GPU have to render what's on screen? I know there's quite a few cases of the GPU being the bottleneck but I also know that settings can be turned down to a point that it SHOULD be playable. I'm not familiar with this porting forwarding.... Where would all of the physics calculations be handled? I'm genuinely curious at this point... Do all calculations get taken care of for each players vehicle on their respective machines, then simply sent across the network as a sort of "render data" to display the end result on the other machines? I acknowledge that I was incorrect in my understanding, and would like you know how it actually works.
     
  8. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    Cars arent quite so significant as to be a major bottleneck graphically.


    As for where calculations occur. Welcome to why BeamNG doesnt have multiplayer :p Do it server side, its a huge CPU hog, do it client side and you have the potential for cheating/hacking or synchronisation issues. To top that off you have a huge amount of data per vehicle to sync across a network, 1 car would likely generate more network traffic than a full match in Call Of Duty.


    Port forwarding vs Hamachi is just a way for the computers to actually access each other across the internet. Neither is needed for LAN play. Hamachi sucks, really sucks, both players run the hamachi client and all network traffic is then redirected via the hamachi servers (no secrecy ftw), as a result though both players do appear to be on the same LAN as each other when they are not, any game with LAN play will now function over the internet. Hamachi adds huge communication overheads both in terms of data throughput and latency, I highly recommend against it.
    Port forwarding is what is really used for a client on one network to connect to a host on another network. The router for this very webserver hosting the BeamNG forums will have port 80 on the router forwarded to port 80 (or possibly 8080 or 81, all 3 are commonly used HTTP ports) on a machine on the LAN, any device which then attempts to connect to the BeamNG router on port 80 will be piped through to the BeamNG server. This is the setup most people normally use. Takes less than 2 minutes to configure port forwarding on my wireless router at home. If I set my router to forward port 6677 to my laptop, run the minecraft server on my laptop on port 6677, go to google and enter "my ip" which might be 1.2.3.4 (it isn't) then tell a friend to try to connect to the server "1.2.3.4:6677" from minecraft on their computer then it will connect, hamachi is not required, the client has to do nothing except attempt to connect to my IP address (client router doesnt have to do anything).
    Without port forwarding or hamachi then a computer running at your house has no way to communicate with a computer running at my house, our routers would get in the way.
    Oh, for the minecraft example, if you don't add :<port number> to the end then it automatically substitutes 25565 to the end as a default, therefore if I ran minecraft server on port 25565 and just forwarded 25565 on the router to my machine then the other dude would only need my IP address.
    Google "port forward" and your router or modem name and you can usually find instructions on how to configure it for your machine. My router makes it abnormally easy but I have set it up for mates before and its usually a fairly simple process.
     
  9. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208
    the lols ITT
     
  10. bratska77

    bratska77
    Expand Collapse

    Joined:
    Nov 19, 2013
    Messages:
    54
    Learn something new every day! I figured all the calculations would be hard pressed to do server side. to have 10 people playing... that's what I was trying to get at when i said it would have to be a ridiculous machine server side to do that, and a crazy connection to transport all of that data. The GPU bottleneck i was referring to would be from having to render all of the player vehicles... that would cause a lot of GPU load wouldn't it? Even though the actual physics calculations could (theoretically in a perfect world) be calculated server side, all of the graphical rendering still would have to take place client side.
     
  11. logoster

    logoster
    Expand Collapse

    Joined:
    Sep 5, 2012
    Messages:
    2,082
    Yeah, the clients would have the gpu bottleneck, but as stated, one of the biggest reasons for no more atm: network connection

    Sent from my SAMSUNG-SGH-I747 using Tapatalk
     
  12. gabester

    gabester
    Expand Collapse
    Vehicle Director
    BeamNG Team

    Joined:
    Jun 6, 2012
    Messages:
    2,653
    I'm going to try to make some kind of definitive statement here about multiplayer, and why it's somewhat unfeasible (at least in the traditional sense).

    We have 400 nodes and 4000 beams being simulated 2000 times per second. That's a lot of data. We've done the math and even sending that 30 times a second is too much. If you're playing online, there's going to be latency - anywhere from 50 ms to 300 ms, or more. That latency is the difference of several meters of car position if the car is moving at speed, which will completely throw off the physics calculations and synchronization, especially collisions. The only option is to have clientside physics with no collisions (like RoR), or serverside physics with input lag. The third alternative would be to delay the clientside physics so that they synchronize with the server. The effect would be the same - input lag - but it would work better from a bandwidth point of view.

    Anyone who has played an online racing/driving game will know that there has never been a good or flawless collision system. Cars warp, teleport, get stuck inside each other, and explode apart, and they're only accounting for 5 points of data per car. We're several magnitudes above that. Multiplayer is a goliath to tackle, and we will certainly approach it, but in the short term we are focusing on the single player. We might see what we can do with local/same PC multiplayer, since that basically eliminates the latency problem.
     
  13. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    Lets say there are 10 properties that need sending for each node or beam (Incredibly rough guess but not too unrealistic). Some of those properties seem to be full 32 bit integers which is 4 bytes. 10 * 4 = 40 bytes per node or beam. 400+4000 = 4400. 4400 * 40 = 176000 bytes for the vehicle state, if anything I would guess this to be an underestimate but we'll carry on. Vehicle state is updated 2000 times per second. 176000*2000 = 352000000 bytes for 1 seconds worth of updates *IGNORING* packet overhead. That is about 300 megabytes of data for 1 second. For a local machine, that's no problem because it doesn't store the last 2000 states and its simply re-using the same memory allocations.
    But I doubt anyone here has a 300 megabyte per second internet connection, for reference internet speeds are in megabits not megabytes so in reality you want a 2.34 gigabit download speed, and upload too, you can't even sustain that between 2 machines connected direct on Ethernet considering most people only have 10/100 Ethernet cards or at most gigabit Ethernet cards.

    Scary thing is that this is before any overhead from packet headers and packet loss threatens the integrity of the entire vehicle too.

    Come back in 2 decades and then we'll talk BeamNG online multiplayer, although by that point there will probably be even more data and we will be back at square 1 again.
     
  14. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    just saying, you got some things wrong in there, but the general problem is correct: its a massive amount of data resulting in about 15kB/s for one client in upload. Maybe we will find another solution :)
     
  15. Forklift Cat

    Forklift Cat
    Expand Collapse

    Joined:
    Feb 7, 2014
    Messages:
    4
    You could have it so that players' cars don't collide with eachother for the first version of multiplayer. All other cars are simulated on everyones computer locally so collisions with the world can still happen. You would need to only send and receive controls from other players like throttle,steering,brakes etc (and initially the vehicles they select and the parts configuration) that control the other cars in your game.
     
    #35 Forklift Cat, Feb 13, 2014
    Last edited: Feb 13, 2014
  16. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208
    I've played games online where when I crash into another player, the damage isn't the same on both computers, its however the clients pc rendered the collision, this might be the only way to do it for beamNG for now


    as long as you can get the players in sync with everything else, i say let the clients pc's handle the collisions and if your buddy on your screen lost his wheel but is still driving because on his screen it didn't fall off... well whatever.. better than " ghosts " lol
     
  17. logoster

    logoster
    Expand Collapse

    Joined:
    Sep 5, 2012
    Messages:
    2,082
    LAN MP would probably be the best real multiplayer we can get AT THIS MOMENT, due to BANDWIDTH bottlencks
     
  18. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    Only transmit the information for the root node or something and let each PC keep track of damage? Eh, it would work but probably only take a few seconds to fall out of sync.
     
  19. Cardinal799

    Cardinal799
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    1,070
    Maybe, if there is a way to quickly compress something, the deformed mesh could be transmitted?
     
  20. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208

    what would fall out of sync? just keep track of players position, like I said if the car looks like a soccer ball on your screen but not their screen, well whatever it is what it is.

    For example i play gta V online with some friends and sometimes on my screen there car has a flat tire or a HUGE dent on it, but for them its fine.

    To me... it doesn't effect game play, not to the point where we would say "it would of been better if they didn't even try to do multiplayer gameplay"


    track the position accurately and the damage should not be too far behind, u cant possibly try to sync the damage.. thats ridiculous IMO.

    One thing I would sync would be when players reset their cars and the damage is zero, that would be obviously helpful.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice