Online MultiPlayer

Blitz3D Forums/Blitz3D Programming/Online MultiPlayer

Stevie G(Posted 2006) [#1]
I hope to attempt online play with my verlet engine - at least to see if it works. May fail miserably but I'll try.

First off I have little or no knowledge of networking but have a few questions which hopefully some can answer.

Can this be done with the inbuilt network commands alone?

Are there any good examples of this anywhere, specifically for physics based games?

For movement, am I correct in assuming that I only need each machine to send details of the user inputs to the server.. e.g. left/right accelerate etc... which inturn sends this information to each local machine to then apply this to the netplayers vehicle? I'm sure there's alot more to it but is this the general idea?

I've read a bit about TCP and UDP methods ... one being quicker with no guaratee of packets being received and the other the opposite. I'd imagine that using TCP will involve some form of positional interpolation should a packet be lost. I think with physics games this really has to be avoided as lag would cause massive forces to be applied. Is this others experience and are their nifty ways around it?

The thing which I'm struggling to get my head around is that it's entirely possible, with lag & missed packets, that each player would not see each user vehicle in the position they are on that players local machine. What is the best way to get around this?

Also, how do I go about testing this kind of thing on a single machine. Can I set it up to be the server and client?

Cheers
Stevie


KuRiX(Posted 2006) [#2]
Well, i would vote for three basic choices:

1 - Use in-built TCP (easy and secure, not fast)
2 - Use BlitzPlayPRO (almost in-built, because is a library using B3D only commands)
3 - Use my Raknet Wrapper

You can test it in your computer just launching two application in window mode, with some delay command in the main loop so they can work at 50% of the CPU.

And to avoid lag issues, try searching for Dead Reckoning algorithms, here in blitz forums (i use it for my Granada Racer game), and in google.

Good Luck! (i was the one suggesting you to do it)


Weetbix(Posted 2006) [#3]
This sounds good :) looks like youll eventually be needing some beta testers... :D


IPete2(Posted 2006) [#4]
BlitzPlay Pro has spline thingy too... which - if I remember rightly - helps keep everyone/everything in sync with each other.

IPete2


LineOf7s(Posted 2006) [#5]
Actually, from what I understand of it, the 'spline thingy' (aka cubic spline interpolation) keeps the remote objects moving nice and smoothly, so they don't 'warp' from update to update.

The aspect of BlitzPlay Pro that 'helps keep everyone/everything in sync with each other' is its implementation of 'game time' which attempts to ensure each machine is at the same point in time as far as the game universe is concerned.

None of which is particularly helping Stevie with his original post... but we can't have everything. :o)


Damien Sturdy(Posted 2006) [#6]
Stevie, In the racer I used BlitzPlay Lite, and It worked quite well really. I had to format the data regarding every entity carefully so it all fit into as small a packet as possible. How I got around the lag was to have a "frame counter" and only update the machines if the other machines are less than say, 3 frames behind (3 frames behind can be alot but it worked really nicely when I tested the racer from America to the UK. LAN play can be set so that every game has to be on the *same* frame to continue.)

Anyhow, i wish you luck. I'm no expert but I do have experience getting networked vehicles working.

*sigh* I wish I had more time to work on that!