Share with us how are you using the powerrrr of the force
Moderator: Alain
by darqSHADOW » Thu Oct 28, 2004 2:45 pm
Here's a quick demo that one of our users managed to do using the new Newton Vehicle support directly inside of TV3D. It features a loop that was created to test how the vehicile would react to something we've all seen in arcade-style driving games. Enjoy!
http://www.truevision3d.com/download.ph ... arloop.mpg
DS
-
darqSHADOW
-
- Posts: 11
- Joined: Fri Aug 13, 2004 2:04 pm
-
by The unProfessional » Thu Oct 28, 2004 2:58 pm
Big Pimpin'
Do you know if he is managing physics only on the server-side, or if he's somehow managing them on each client?
-
The unProfessional
-
- Posts: 131
- Joined: Sun May 02, 2004 9:08 pm
- Location: Southern California
-
by darqSHADOW » Thu Oct 28, 2004 3:41 pm
He's actually come up with a rather inventive way to do multiplayer. Each client is responsible for its own physics, and sends those along to the server (which then sends them to the other clients). Now, when an update is received from another client, he grabs the existing matrix and the "new" matrix and uses the Lerp function of the TVMathLibrary, and then updates the body matrix. In the end, its a poor mans prediction, and works very well.
DS
-
darqSHADOW
-
- Posts: 11
- Joined: Fri Aug 13, 2004 2:04 pm
-
by Trounce » Fri Oct 29, 2004 2:29 am
Yes, that's exactly how I'm doing it.
Instead of the server managing the physics state, I have each client manage everyone's physics at the same time. However, the client only sends its physics information to the server -- which the server relays to the rest of the clients.
When a client gets a packet, it compares it with what it predicted locally, and then interpolates the remote car's position. Depending on your connection to the server, you can have it favor your local prediction over the remote or vice versa.
I've been testing it with pings up to 500ms, and it's pretty good. Pretty much anything 250ms and under is unnoticeable.
Trounce
-
Trounce
-
- Posts: 2
- Joined: Fri Oct 29, 2004 2:21 am
by The unProfessional » Fri Oct 29, 2004 2:34 am
Beautiful job, Trounce.
so every client is aware of every other client's physical state, and chooses to factor or / discard the incoming values?
Are you using any dead reckoning?
I assume the only data the clients are send to each other are quaternions or matrices... or are you sending velocity/omega values as well?
Any issues with bandwidth?
Sorry for all the Qs... I'm still mapping out how I'm going to do it myself, hence the interest.
-
The unProfessional
-
- Posts: 131
- Joined: Sun May 02, 2004 9:08 pm
- Location: Southern California
-
by Trounce » Mon Nov 01, 2004 12:34 pm
Thanks for the encouragement.
Yes, every client has their own version of the remote car's physical state. When a packet comes in, the client will read it, determine how inaccurate its local prediction was, and correct it slightly.
I'm sending the physical matrix, the speed, and angle/linear forces. This tends to make a big packet though, and I haven't optimised it. I haven't noticed bandwidth being an issue, but we haven't gotten more than 7 or so people connected at once yet.
-
Trounce
-
- Posts: 2
- Joined: Fri Oct 29, 2004 2:21 am
Return to User Gallery
Who is online
Users browsing this forum: No registered users and 23 guests