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 / Multiplayer and Dark Physics... How?

Author
Message
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 12th Jun 2007 17:56
Hi all.

I'm createing an pure physics LAN game, where the central thing is the environment. You're able to interact with it. But the problem is the LAN part. I can't get the physics to work right when several people are connected (even though I only played with one friend it got screwed up). The boxes and everything just jump around, and that's quite annoying. Can anyone please help me with how to make Dark Physics work with multiplayer (I'm using the tempest plugin, just so you know)?

In-game subrutine:


Recive data function:


Send data subrutine:


I just noticed there where two 'TSync' commands. Note that I once only had one, but it didn't work any better then.

And one more thing. The entire source covers 1966 lines at the moment, which is my reason for not posting it.

Please help me. I really need this to work.
Thanks for your help.
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 14th Jun 2007 12:52
Nevermind. I'm not that experienced with multiplayer, so I think I'll learn it from scratch rather then do the attempt to integrate it with Dark Physics right away. Got carryd away a bit, sorry.
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 22nd Jun 2007 02:49
For future reference - what you should do is have NO physics on the other player's computer. Have them simple objects. Have the host run the physics and send the object position and rotation to the players


Vote today and play the games!
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 22nd Jun 2007 13:37
Ok, thanks for the tip. Haven't thought of that, so it might come in handy later.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Jun 2007 23:02
I concur with Airslide. That is probably the best way to do it.

The tricky part is if an item - say a Crate - is launched through the air because player one rammed it with his car, and a multiplayer was driving in the path of the crate. How do you get the crate's inertia to respond to the multiplayer's inertia and likewise have the crate's inertia effect the multiplayer (bump him around a little perhaps?)

Basically this needs to be controlled in the host computer if the game is to be properly synced. This also would imply that the inertia information would need to be transmitted as well as coordinates for the multiplayer so that the host machine could calculate the interaction of the crate and the players, and then transmit the new coords for the things involved.

This is just my theory - so any comments and other ideas etc are welcome.

Know way to many languages - Master of none
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Jun 2007 23:07
Jason got it. Basically, you have to have the server send all physics data to clients, and then the clients have to set their objects' physics data to that. I'm not sure if it's possible to do it in DP, unless there is some way to obtain momentum information and such.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Jun 2007 00:14
Thanx Benjamin.

In response to your comment - the inertia information would likely be either "home-grown" data in the game itself or possibly information that is maintained and passed to either DarkPhysics or the Newton.dll (physics addon) I'd suspect.

I'm personally trying to implement a homegrown inertia system - not for ramming other objects just yet - but mostly for thrust and "slide" or "drift" effects. I'm HOPING having 3 coords for inertia is enough and correct. I'm not sure how vectors work but I THINK I've made my own sort of. I use three VelocityX, Y, Z (and those coords are relative to the model, not the world).

Its a lot of learning - but its a lot of fun.

Know way to many languages - Master of none
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 23rd Jun 2007 10:43
yeah,Im thinking the using the host computer to do all the physics calculations on would be smarter. It'd run slower for the host,but haha,oh well. I guess you could make your game have dedicated servers that host the physics for everyone. So theres an option,make a system for dedicated servers.

Hello
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 23rd Jun 2007 12:57
Thanks for the advice. But at the moment I'm in another multiplayer project that doesn't use physics. But after that, I'll resume this project. Will take some time though, before I start again.

Login to post a reply

Server time is: 2024-11-24 19:53:05
Your offset time is: 2024-11-24 19:53:05