Skip to main content
gamedev.net
🔒 Locked

Multiplayer Server

Started by Pip Nov 22, 2003 at 1:36 PM 2 replies 650+ views
Original Post
Pip
Pip
Hello, Im tring to convert a single player RPG game I wrote to multiplayer. I understand sockets enough to get a client-server program running to send text back and forth like a chatroom. I am having trouble finding any information on how to actually set up a way to call functions on the server from the client. I want my server to handle all game processing and just update the clients of the changes. The game is all text based and runs as a console app. Its similar to a MUD but Im not sure if it falls under that same category cause I have a whole interface drawn to the screen with ascii maps and the like. Im totally new to running a game on a server. I imagine the correct way to do it is have the client handle drawing the interface and the ascii map to the players screen and have the server handle player and mob movement on the map along with changes to player skills/values from actions like fighting and such. All I have found from days of searching is one sample of creating "Protocols" for message handling between my server and client. I dont really understand how they were doing it cause it was exteremly brief and not very helpful. It also appeared they was using it in bytes. From what I have gathered I need to make a packet. The packet needs a ID for its type, a ID for the sender, size, and the actual data. I have also seen something about a timestamp. From what I understand that has something to do with syncing the clients movements with the server. Some of the places I have looked are flipcode.com and gametutorials among many others that I dont remember the sites name. I think Im on the right track maybe with the packet stuff but I have no idea how to implement it and make it work. Sorry for all the rambling. If anyone has any knowledge on this or knows where a good tutorial is on this particular subject I would be very grateful. Also if my concept is off on how a game server works please let me know. Thanks in advance.
leiavoia
leiavoia
@Pip

i''m dealing with the same issues. Basically, you want to have a variety of data packet types. each type does a different action. Each packet gets unpacked by it''s host and acted upon in some way (probably will depend on whether or not it''s a server or client).

A chat message is just one kind of data packet. You might also have a PACKET_TYPE_MOVE_PLAYER, PACKET_TYPE_ATTACK_ENEMY, etc etc. each packet has it''s own specific contents, data packing order, and actions.

@AP

for really simple chat samples, look up SDL_net and look for it''s included examples.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.