Physics + network
-
- Posts: 199
- Joined: Tue Dec 09, 2008 2:55 am
Physics + network
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();}
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.
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.
-
- Posts: 199
- Joined: Tue Dec 09, 2008 2:55 am
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
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
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.
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.
-
- Posts: 199
- Joined: Tue Dec 09, 2008 2:55 am
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.
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();}