Concept of an two player platformer...

Started by
0 comments, last by hh10k 19 years, 2 months ago
Hi, I think I have come up with a pretty good idea of how a multiplayer playformer would be done. Tell me what you think. //Host send x cordniate recieve 2player x cord send y cord reviece 2player y cod //server recieve x send x recieve y send y I would run that during the game loop every time so no matter what happens it will always be sent over. Does that seem plausable before I go and code it?
Mark St. Jean - OwnerWastedInkVwmaggotwV@Yahoo.com
Advertisement
I wouldn't run it EVERY frame, Otherwise you could get a fast computer sending out thousands of updates every second :) Here's a few ideas:

- Try locking network updates to something like every 1/30th of a second (The exact update rate you need depends on your game).

- Remember that you're probably going to have more than two players moving around. Try to plan your network system around any number of objects.

- If you can predict the movement of an object, it is better to send events like "player 1 started a jump at (x, y)" or "create particle effect at (x, y) using this random seed", rather than specify every coordinate.

- For objects you can't predict, you'll need some sort of extrapolation to keep things looking as smooth as possible, and to handle network interruptions. Linear extrapolation often works well for many things.

- Don't keep resending the same information if it hasn't changed. If there are 50 pickups on the ground, you should only need to specify their position once each.

- Don't tie your updates to recieving bits of information each frame, otherwise you'll get bad framerates when the network is slow.

- Use UDP instead of TCP when sending information that you're going to be resending the next frame anyway. If a packet fails to get sent, UDP won't bother trying to resend it.

I hope I haven't said too much and confused you :)

This topic is closed to new replies.

Advertisement