I need some suggestions for developing a MMORPG, in particular about the position of the players.
What do you suggest to send, (x,y,z) or walkDirection?
Currently I am sending the coordinates. When a client receives the coordinates of another player, knowing the position (x, y, z) start and end of the move, how to move the model? setTranslation(…)? move(…)? walkDirection? How to get the walkDirection starting from the start (x,y,z) and end (x,y,z)?
Really, if you are at this state it would be a massive effort trying to explain all the possible concepts to you. If you are asking about location, be aware that for an MMO you will have to partition your world because a single 32bit x coordinate cannot hold an infinitely high location value. I suggest you should go step by step, first implementing a basic game, then going to a networking game and then when you have more experience and understand the various documents on the web about MMO development concepts better try do work on a MMO. Have a look at the MonkeyZone code for example to see how you could do basic managing and syncing of entities etc. If creating a MMO was as easy as displaying some models and moving them the WoW devs wouldnt earn the money they do
Normen, I have already made the core of a client-server game. I just wanted some suggestions on how you deal with this problem. I just want to compare my solution with yours …
Well how should somebody answer that question? You know your system best so you know best whats needed. For sync in MZ I am using the basic parameters of the characters, yes, but for movement controls from the client side I am using special movement data, so yes an no really
I suggest flagging the class behind visual nodes as moving, rotating, etc… sending the current xyz & rotation with any update to the flags to ensure that any “out-of-sync” positioning is corrected when setting the new value of the flag. Allow each client to manage the nodes, based on movement speed, rotation speed, etc of each serializable obj represented by a node. This CONSIDERABLY minimized the amount of data you would need to send between client > server > clients. Using the above described method, I have been able to track 50 concurrent connections with over 100 pathing npcs without seeing a hitch, this includes AI for agro pathing, animation handling, etc. I am using headless clients to handle evaluation per zone (for AI… such as pathing to a target, navigating complex maze-like corridors and line-of-sight evaluation) on the server, and it seems to work great. I am sure that it will hold true at a much larger number.
I would also suggest, using distance to determine whether to send full update info or not. i.e. npcs eval what players are within range to care if they are jumping, swimming, running, walking, moving, whatever and only send full info to the clients that it matters for. Then do a global snapshot now and then (up to you how often) that updates general xyz, rotation of all movable objects in the zone. This helps sync those objects that enter the “sphere of influence” of the player when he starts receiving full update info
Also, don’t be afraid to rely on a client to do some work for you. For instance, it is far easier to evaluate things like npc agro to you player from the client than it is from the server npc code. Off-load everything you can onto a client before loading your server with unnecessary code.
Just my two cents.