Forums

Full Version: I'd like to help too, on a network engine
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I use(d ?) to "work" for a other racing sim project, which is almost born dead. They are trying to make it the next rFactor (on the physical part), but it doesn't work out as they expected using standard libraries (ODE, Novodex). In the end the project is just dying, and I honestly don't think it will come back to life :lol:

but in the meantime I made a network engine (my specialty). Something optimized according to the bandwidth of each user. A bit hard to explain in a few words but it worked. But since the rest of the project is clone to nada, I was only able to run stupid tests on it
I thought about rewriting it and improving it using better libraries (OpenTNL), but just to see Teapots moving around, that's such a waste of time

then I heard about VDrift
you have graphics, cars, tracks, users, it talks about drift (I love it too), ...
I'm not saying I could do better than you guys, but I'd like to try if you don't mind Wink
Please do! I wrote the network code, and it was the first network code I'd ever written for a game before. On top of that, I just hacked it in, intending to eventually improve it with proper network code later. And, on top of THAT, I think it got broken somewhere in the last release cycle.

Some information:

VDrift network code is currently set up such that each player's version records their control inputs (in the form of deltas from each frame to the next) and send them to the other computer, where they are used as inputs for the other car. The other car's physics are ticked as player inputs come available. This results in fairly low bandwidth usage. VDrift also sends/receives car state every second or so, and this is used to correct for dropped packets. So it's basically like watching a real-time replay of the other car as it's recorded on the other computer, and no interaction between the cars is supported. Let me know if you have other questions.
thanks, I'll look throught the code Wink

joevenzon Wrote:VDrift network code is currently set up such that each player's version records their control inputs (in the form of deltas from each frame to the next) and send them to the other computer, where they are used as inputs for the other car. The other car's physics are ticked as player inputs come available
I'm not sure this is the best solution. The advantage is that you keep using the physical engine locally so the car is moving flawlessly... but the position might be quite unexact, especially if you lose packets
I'm not sure this is saving of lot of bandwidth either
the solution I used and I know is used in many commercial games (this is obvious in Grand Prix Legends, looking at the cars moving) is to send the position of the car (+ other informations), and let a algorithm calculate the position of the car between 2 received packets. Thus, the movement of the car highly depend of this algorithm, but the position of the car is not sliding during time
anyway, this is something to think about and try :wink:
Sure, whatever you want to try. As I said, it was my first attempt at network code, so I'm not that attached to the way I chose to do it. :-)
em... would you help me downloading the sources ? I'm not used to SVN...

C:\Documents and Settings\aspirine>svn checkout http://svn.vdrift.net/repos/vdrift/trunk vdrift
svn: PROPFIND request failed on '/repos/vdrift/trunk'
svn: PROPFIND of '/repos/vdrift/trunk': 403 Forbidden (http://svn.vdrift.net)

:?:
svn server is down, it is not your fault

EDIT: svn server is back
please try again
Sorry about that, I made a typo :?
ok thanks, that's downloading :wink: