Question on multiplayer games...

Started by
4 comments, last by wyrd 20 years, 5 months ago
I was looking at a multiplayer tutorial recently (for DirectPlay), and it seems easy enough to pass around a string of data. Unfortunately, there''s no tips given as to how you can design an actual multiplayer game. What sort of information would you send back and forth between clients? Is there any information I can find on designing a multiplayer game? Thanks in advance.
Advertisement
I shouldn't even be replying to this, as I probably know less than you.

As far as I know, there is no hidden "magic" behind it. You have to write your game to communicate with other running versions of itself over the connection. So it depends on the type of game you're writing as to what information gets sent back and forth. For example, in a checkers game, the only info you would need to send is the new location of the last checker moved, as the other computer would already have everything else.

There are some articles here. And there are some tutorials that come with DirectX if you're using that.

Jiia

[edited by - Jiia on November 13, 2003 10:56:34 PM]
Well, that''s fairly obvious with simple games. But I''m talking about things like an online RPG or action game (similar to Diablo perhaps). How do you send such information like what weapons the players are currently wielding, their attack, what monster is moving where, the damage of a monster, etc. There are a *ton* of things that can happen.

I assume some sort of unique identifier would be needed for every object in the game, but how would I handle messaging? The only thing I can think of would be to send messages to games, which are then sent to individual objects in the game (similar to windows). When an individual object gets a message, it translates it and updates its internal state appropriately.

Am I on the right track here?

BTW, what tutorials are you refering to? The only multiplayer tutorials I found just described how to connect with DirectInput. No game design techniques were given.
Directplay has messages built in, an id, and data. The data can be whatever you want, usualy a structure. What''s important here is that the structure should be as small as possible. Take a look at the examples that comes with the directx sdk. Also look at the tutorials in the documentation. I''m sure you will get started by doing that.

There''s tons of more things to explain, but I don''t have time to do that right now.
Hmm.. yes, I thought I've gone over the whole tutorial subject. All they show you how to do is send a simple string of data (the samples are usually chat programs). This doesn't help me with game design.

If there's a tutorial that actually shows how to send game data so games can communicate, then can you please show me a link? It'd be much appreciated, as I have not found one.

[edited by - wyrd on November 14, 2003 1:12:00 PM]
As I told in my previous post, send a struct that contains the game data. It works in the same way as sending strings. Just cast the structure to a (BYTE*) and initialize the DPN_BUFFER_DESC with the (BYTE*) pointer to your structure and the sizeof() of the structure.

Oh, and look at the maze examples programs in the directx9 sdk, they are definitely sending game data there.

[edited by - fredizzimo on November 14, 2003 1:26:54 PM]

This topic is closed to new replies.

Advertisement