I am after some ideas / advice on how best to do this.
My MMORPG server at the moment is broken down into funcitonal chunks, where possible. I have a message server for handling all text messages, I have a login server to handle all players logging in and out of the game, and finally I have a main server which does everything else.
At the moment the main server simply tracks player map positions and updates the database each time a movement packet is sent. Now this, although lightning fast on 30+ clients, may well be a slow thing to do? Should I be updating the map positions in memory, and then dumping the new positions every x number of seconds?
On the same sort of note... I need to somehow keep track of up to 1000 players per server. (this is gonna be run on sh1t hot hardware), but how to do this is another matter...
Messages are simple, they are initiated by the client, the server gets the destination chars IP address and inturn forwards the message on. Interms of the main server it's going to be much more complex. I need to have a loop that does the following:-
1) Process Characters (position, stats, action)
2) Process Monsters (position, stats, action)
3) Process Objects on map
3) Update Clients
How should I approach this? Any ideas?
My first thought was to have a massive array of 1000 chars (or how ever many chars are online) and just loop through for all players, then all monsters, then object, finally update clients. But tracking clients is a nightmare.. I mean, if someone has logged out from slot 103 in the array, how can I use 103 for a new player without some complex index list or something to keep track of array slots... Plus, this isn't very efficient either!
Just after ideas really...
EDIT:
A few more things that complicate things:-
The Monsters will be in the number of around 500+... That's a lot of monsters to update every loop.... Maybe I should be updating monsters that players ONLY can see? So monsters that aren't on someones screen don't get a hit...
Bookmarks