Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Network multiplayer game advice needed.

$
0
0

@Harag wrote:

Hi all

Hope someone can help me with this, I've been playing around with the Lidgren library recently and got a basic understanding of using it and sending "commands" between client and server. Now my next issue comes to Design - how & when to send information etc. Let me give you an example of a game, and what I need is advice on what information I need to send back and forth, what is worked out on the clients only etc.

OK, very basic game design - remember the game space invaders from the early days? now, turn that basic game into a 2 player game, where both players are moving the defender objects at the bottom of the screen and shooting up (at the same time), you have the invaders going left/right, the odd mother ship flying across the screen at the top, the defence bunkers that take damage. It's all action and fast past (vs a turn based game)

Now my idea is to build into the game (same application) a connection screen & a lobby, one of the players will be the SERVER and the other player would join, then the game will launch - so basically player one will have a ping of zero to the server, since it's the same machine/application, the other player could have a greater ping due to his location (say other side of our world).

Now since the host is both client and server I would need to store duplicate lists of objects, e.g. list of players the "player" knows about, and a list of players the server know about - when the server sends player information out to the players, the player list would get updated - sort of a client area & server area namespaces.

As for the rest of the information, how much info can you really send every update every 16ms (for 60 fps) can the server constantly send out the invader locations, the bullets, the movement, player scores, mother ship etc.

Any advice will be most helpful - or sample games if you've done something like this already I would welcome the code to look at.

Thanks again for any help / pointers.

EDIT - Just thought of something else - MOUSE - think of the game Missile Defence where the player moves the mouse and shoots the missiles - now what I want to do is have the turrets rotate at the bottom to point in the direction of the mouse location on screen - Great one player easy, no problem - but MULITIPLAYER - player two needs to see what direction player one is facing - so the mouse move location needs to be sent to the server constantly and out to the players (e.g. ever 16ms/update) it's this sort of thing I'm worried about.

Posts: 9

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles