Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Physics Results, the same?

Author
Message
Zizaco
18
Years of Service
User Offline
Joined: 17th Apr 2006
Location: Brazil
Posted: 1st Sep 2006 21:22
I'm developing an online game wich uses physics to calculate each player turn in game, so its very important that the physics results be the same in both computers. So i need to know, if i apply the same forces, in same objects, in same applications but in different computers, the final result will be the same?
This s very important, because in this game, physics will be the essencialy needed. So, if the results are random we are in trouble.

Sorry for my bad inglish!
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 1st Sep 2006 21:51
I very much doubt it! the chances of getting the simulations to produce the exact same results is slim to say the least.

What you could do is have one machine i.e. the server do all the physics simulation for the dynamics objects then pass the rotation/translation data to the clients, but a draw back of this is, if there is a lot of dynamic objects then there is going to be a lot of network traffic.

I know the voices aren't real, but they have good ideas!
Zizaco
18
Years of Service
User Offline
Joined: 17th Apr 2006
Location: Brazil
Posted: 1st Sep 2006 22:01
Yea, i've tryed that... but it slowsown too much... no conditions
SO im thinking about the server send the position and the force applied to that... and all the clients see the same. but im having problemns at that too

Sorry for my bad inglish!
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 1st Sep 2006 22:10 Edited at: 1st Sep 2006 22:17
Yeah you are still gonna get dodgy results even though you are applying the same amount of force in the same place in the same direction there is no guarantee that the objects will act the same.
The whole idea behind using physics in a game is to make every experience different, otherwise you could just pre-animate everything.

The server handles all the dynamic objects physics route is the best way IMO, you just have to find a clever way of implementing it.

There isn't really that much more load on the CPU of the server, because the server knows where the other players are so if they crash into a box for instance then all the server has to do is send six floats (positionXYZ/rotationXYZ) and an integer or even a byte (id of the dynamic object moving), then when the clients get this they just apply the rotation/translation to the dynamic object with that id.

I know the voices aren't real, but they have good ideas!
Medieval Coder
18
Years of Service
User Offline
Joined: 31st Dec 2005
Location:
Posted: 1st Sep 2006 22:27
Well couldnt you have a value so that when the other player is in the area and opens for example a door have the server send the ammount of force. Then it checks that previous player to see where the door is. Then makes adjustments. Or have their computer calculate how much force will be needed to move the object where it is needed to be. So basicly you know the position you want it to go but then you need to set somthing up to find out how much force is needed to set that object the same way without the player wondering what is going on.

monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 1st Sep 2006 22:38
You see which ever PC calculates the physics simulation it is still going to have to send the position data etc to other machines. That's why you don't see many games with loads of dynamics for multiplayer maps, or they have the option for it but is only used on high speed LAN.

In my game I plan on having some dynamics for multiplayer, and the server is going to do all the dynamics simulation, because there is no difference in having 20 NPCs all running around knocking boxes over etc in singleplayer than there is in having 20 multiplayer opponents running around doing the same in terms of the physics calculation, the only difference is the network traffic, But like I say either way the translation and rotation data is going to have to be sent to the other PCs one way or another, so having one machine (server) doing this is much neater, plus because its the server doing the simulation they can select how many dynamics they want in the map depending on the speed of their machine. If I remember correctly FEAR had an option for multiplayer physics so that means that they used this method of simulation because a client can't change server settings to suit them so this is for when you create a srever.

I know the voices aren't real, but they have good ideas!
Medieval Coder
18
Years of Service
User Offline
Joined: 31st Dec 2005
Location:
Posted: 1st Sep 2006 23:07 Edited at: 1st Sep 2006 23:07
There must be a way to do this...i will keep thinking about it.

Zizaco
18
Years of Service
User Offline
Joined: 17th Apr 2006
Location: Brazil
Posted: 1st Sep 2006 23:19
thats bad...

Sorry for my bad inglish!
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 1st Sep 2006 23:34 Edited at: 1st Sep 2006 23:35
I wouldn't say its bad, but the fact is commercial games with million dollar budgets only have few dynamics in multiplayer maps (well the games I have played on) the reason being shear volume of data that needs to be sent/received.

Medieval Coder:

I've just been thinking about what you was saying about sending force values and force position values from one PC to another, a force vector is 3 floats and a force position is 3 floats and you still need the id of the object to act on, so sending forces costs no less net traffic than sending translation and position data the only difference is the latter is guaranteed to be accurate on all machines, so you have a dynamic object on the server and a kinematic object on the client whose matrices is updated via the server. And to be fair if commercial game developers keep multiplayer dynamics down then there must be a reason!

I know the voices aren't real, but they have good ideas!
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 4th Sep 2006 16:56
If you only send data for things that are in view and are rotating/moving, you could send data seperately:
an integer for the object
6 floats for xyz pos/angle.
You send them in order of importance, so objects further away are updated fewer times per second than objects very close. The further away objects take up less pixels so you should not notice any jerkiness.

There are three types of people, those that can count and those that can't.
Zizaco
18
Years of Service
User Offline
Joined: 17th Apr 2006
Location: Brazil
Posted: 4th Sep 2006 17:16
Quote: "I've just been thinking about what you was saying about sending force values and force position values from one PC to another, a force vector is 3 floats and a force position is 3 floats and you still need the id of the object to act on, so sending forces costs no less net traffic than sending translation and position data the only difference is the latter is guaranteed to be accurate on all machines, so you have a dynamic object on the server and a kinematic object on the client whose matrices is updated via the server. And to be fair if commercial game developers keep multiplayer dynamics down then there must be a reason!"


That exaclty what im doing... sending the exclty force, and dont work.

Sorry for my bad inglish!
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 4th Sep 2006 17:35 Edited at: 4th Sep 2006 17:36
Check this out. The exact same simulation, absolutely no changing variables. However, the results are totally different every single time.

Exploding Zombie Simulation


That's just how dynamics are, that's why they're great. You'll just have to either only run dynamics on one computer and feed the results to the clients, or confine dynamics to things that are not essential to gameplay.


Come see the WIP!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-23 10:15:44
Your offset time is: 2024-04-23 10:15:44