MMORPG Client/Server Architecture ? Such as Movement

Started by
23 comments, last by valleyman86 16 years, 2 months ago
Ok so I have a question that is pretty much the only thing bothering me atm. I am planning and developing a simple mmo probably just mo but you get the idea. I am wondering what technology or design would I go about implementing data sync with the server from the client. Like mostly if a player clicks a location and walks there the server has to validate this but send the command to others nearby. But how do I make sure both players are seeing the same exact thing especially if there is stuff in the way and path finding is used to get around it. If a play attacks another player it really has to be sync or there could be a dispute... Like "Dude you killed me before I knew you were there". I could implement a guess and it really doesn't matter if the player is close but then I would have to let the client say things like "I attacked this player" which I don't want as to prevent cheaters... They could just randomly send that if they figured out the tech involved. Its a measure of security I guess to not let the client do any important thinking. I would rather the server get the location and command chosen and decide yea you hit that player. Server is always right... Anyways what are your ideas on this. How do games like WoW and what not do data sync I guess. Im looking for simple explanations and ideas thanks.
-------------------------------------------
http://www.MurderDev.com - Developing Killer Software
http://www.MobileCellOut.com - Cell Phone Contract Exchange
Advertisement
well when the player clicks somewhere to move you send a message player x wants to move to xy. on the server, you check to see if this is a reasonable request(player alive in the right area etc.) generate the path the player is going to follow then send a message to all clients in the area: player x is currently at location xy and performing action move in direction st.
This might not be 100% obvious from what the last poster said, but client only send input. What this means is that the player clicks and a command is sent to the server. On the next server update the data is crunched and sent to ALL the players including the person that sent the message. The person that sent the message should not assume they should move. Not to mention a 100 ms delay isn't something they are going to notice.

This also corrects for a player clicking the screen a bunch. The client can cull away some clicks before sending it, but even if the server gets 100 clicks to go in 100 directions it will simply just replace the current goto position for the player. In this example nearly everyone will see the same thing give or take a few ms.

Oh yeah and don't forgot to put constraints on data. For instance, only allow new position numbers that are a certain distance from the player. You can see how this would help in keeping down path finding times.

<random thought>
Oh yeah and if your game is repetitive add small random numbers to the goto positions. Stops most newbs from creating macros, while the normal players would never realize. I believe runescape did this, but I can't say for sure.</random thought>

[Edited by - Sirisian on January 29, 2008 11:10:14 AM]
Awesome you guys are a huge help.
-------------------------------------------
http://www.MurderDev.com - Developing Killer Software
http://www.MobileCellOut.com - Cell Phone Contract Exchange
Should the server do the path finding or should this be client side? Seems cpu heavy to have the server do it? Is there any level of predicting that may be going on?
-------------------------------------------
http://www.MurderDev.com - Developing Killer Software
http://www.MobileCellOut.com - Cell Phone Contract Exchange
It always depends on implementation but usually it's all done server side.

In games like shooters, games that are "twitch" in nature you can allow the player to move on his own a bit and send his new current position to the server. The server then validates the new position by making sure it was possible to get there in the first place. You're not saving much CPU cycles there it's more about making very responsive.
Quote:Original post by valleyman86
Should the server do the path finding or should this be client side? Seems cpu heavy to have the server do it? Is there any level of predicting that may be going on?


Yes the server should do the pathfinding to verify the move. However, if you are asking if the server should send the pathfinding data to the client, then your answer is no, unless you have random numbers involved or something dealing with AI. A* is deterministic.
So I can safely assume all the clients will generate the same path based on the information provided by the server? The server just checks to prevent things such as walking through walls or teleporting...
-------------------------------------------
http://www.MurderDev.com - Developing Killer Software
http://www.MobileCellOut.com - Cell Phone Contract Exchange
yeah. You should have realized this when you did A* tests. Only thing you must make sure of is that all the players have the same start and end players. If for some unforeseen reason a player has a unit moving from point A to B and a new destination is sent for the player then you can run into problems. Quick fix is to send the starting position when a new destination is sent. If the player is displaced too much then snap the player or interpolate it to the position fast then make it go to the new position.
I always set up my movement packets to allow the client to be able to hit the correct end destination. Most of the time this can also be used to find the correct starting position, too. For example, if I say "Player is moving to (X,Y) in direction D", in a tile-based game it is pretty easy to assume the starting position. Correction often isn't needed for the starting position if you ensure they always end on the correct position. Even if they do not start on the correct position, it will just be an often no more than a very slight visual error.
NetGore - Open source multiplayer RPG engine

This topic is closed to new replies.

Advertisement