Page 1 of 1

"physics and Multiplayer"/"collision sounds"/"neg. bouncines

Posted: Fri Mar 09, 2012 6:27 pm
by fredlllll
well 3 problems:
1)i have a multiplayer game, and synchronous collision detection is essential for it. does anyone know a good protocol model for synchronizing 2 or more games? i already have something but i have issues cause when i collide on game one and update before the collision and after, the collision is maybe not recognized by game 2. so im bouncing of my enemy and he does not get any force. baaaad

2)i want sounds when 2 players collide (they are just spheres) , when they collide with the ground, when they move on the ground( when they are faster its louder) (sound when in mid air is not good)
but i dont know where to get the events when 2 things collide =/

3)when my players collide it looks pretty lame. both should collide with more force (bounciness should be like 1 to 1.3) but when they collide they are catapulted in the air. so i dont want any friction between the players. but they should still have normal friction with all other objects in the game. and they should have a bounciness like 0.2 to 0.4 when colliding with the ground. so is there something like a negative bounciness for the ground? cause if the ground has 0 the players still bounce with their 1 of bounciness. or is there some way for this?

much work to do and a dumbass like me who wants to do it :P

Re: "physics and Multiplayer"/"collision sounds"/"neg. bounc

Posted: Fri Mar 09, 2012 9:01 pm
by Norbo
1)i have a multiplayer game, and synchronous collision detection is essential for it. does anyone know a good protocol model for synchronizing 2 or more games? i already have something but i have issues cause when i collide on game one and update before the collision and after, the collision is maybe not recognized by game 2. so im bouncing of my enemy and he does not get any force. baaaad
I would recommend Glenn Fiedler's articles and presentations: http://gafferongames.com/

The 'best' approach for networking depends on what kind of requirements exist.

I would offer one important note: avoid networking models which require strict determinism. While it's possible to get BEPUphysics to be deterministic on one platform (your local PC, or Xbox360s), it degrades performance and it would require quite a bit more effort to ensure determinism across all platforms. If you need perfect long-term reproducibility and cross-platform support, sending replays of motion is a decent alternative.
2)i want sounds when 2 players collide (they are just spheres) , when they collide with the ground, when they move on the ground( when they are faster its louder) (sound when in mid air is not good)
but i dont know where to get the events when 2 things collide =/
Events can be found in the entity.CollisionInformation.Events property. However, for your purposes, you may find it easier to use the entity.CollisionInformation.Pairs list which store the actual collision pairs associated with the entity's collision proxy.

Each pair has a list of Contacts in it. If there are any contacts with nonnegative penetration depth in a contact list, then the two objects in the collision pair are colliding. Each contact entry also shows the relative velocity at the contact, the normal force at the contact, and other data you can use to scale the sound.
3)when my players collide it looks pretty lame. both should collide with more force (bounciness should be like 1 to 1.3) but when they collide they are catapulted in the air. so i dont want any friction between the players. but they should still have normal friction with all other objects in the game. and they should have a bounciness like 0.2 to 0.4 when colliding with the ground. so is there something like a negative bounciness for the ground? cause if the ground has 0 the players still bounce with their 1 of bounciness. or is there some way for this?
If you're using v1.1, the default method of blending friction and bounciness is to average the coefficient from each object in the collision. So, an object with 0 bounciness and an object of 1 bounciness would produce a result of 0.5 bounciness. You can change the blending mode in the MaterialManager.

In addition, the MaterialManager allows you to specify specific material pair interactions using MaterialManager.MaterialInteractions. You could give one Material to every character and one Material to the environment and then directly specify the relationships between those materials (bypassing the default blender completely).

Note that the in-development version changes the materials system slightly for more customizability. In addition, the default blending is changed to multiplicative.