Original Post
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.