Physics + network

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
nathanf534
Posts: 199
Joined: Tue Dec 09, 2008 2:55 am

Physics + network

Post by nathanf534 »

Ive decided to make a little game in which you will go around building towers out of blocks. I want to add physics to the game so I can have them realistically fall down, but I'm not sure how I could do this as a network game. How would I update the physics on all the clients without using an extreme amount of bandwidth? (a tower could be up to 500 square blocks or more). Ill probably be using Newton physics, but I don't have any code yet because I'm still planning how this would actually work.
while(signatureEmpty){cout<<wittyComment();}
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well thats really not an easy task. Moreover most networklibs are not really abled to handle so much objects nativily so you are mostlikely forced to implement your own "message/data-batching" system. If you want to keep the server and client state synchron you need to use inter and extrapolation and timestamps.
Maybe http://syncsys.sf.net is useful for your situation except you want to deal with the synchronisation 'manually'.
For the inter- and extrapolation stuff are many tutorials out there. Just look a bit around.
nathanf534
Posts: 199
Joined: Tue Dec 09, 2008 2:55 am

Post by nathanf534 »

Thanks, I googled the extrapolation and timestamps. Ill just mess around with what I have learned and hopefully get something to work.
while(signatureEmpty){cout<<wittyComment();}
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Can you keep us updated? I'm currently using the "brute force" approach to handle network in my project "stunt marble racers", I send a message with the position and rotation of each moved object on every simulation step. As in my game there are normally not more than 20 moving object at a time it works fine (at least in local networks), but a "more advanced" solution would be cool.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
yamashi
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Post by yamashi »

Use a heart beat system...
Let the client handle the physics but synchronize the world once every 10 secondes or so...
You have two approaches possible :
- The FPS approach : Keep refreshing the world all the time.
- The mmo approach : Use emats, send when a player starts doing something and when it stops, also you have to synchronize once in a while.
nathanf534
Posts: 199
Joined: Tue Dec 09, 2008 2:55 am

Post by nathanf534 »

Ill try to keep you updated, but it will be a while until I get any results considering I haven't really started the project yet. I was thinking of doing something similar to the heartbeat system. I will have each client do their own physics but have the server update the clients as often as it can.

Also, does anyone know where I can get information on how to set up Newton physics with eclipse? I have been searching the forum but haven't found anything helpful yet.
while(signatureEmpty){cout<<wittyComment();}
Post Reply