Jump to content
  • Advertisement
Sign in to follow this  
Hawkins8

How Terrain is Handled on Server Side

This topic is 3709 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am clueless about how it's done in a 3D engine. I think it's easy in 2D engines, like this, Server side: A height map stores the coordinates of tiles. When the player drags his mouse to move his toon forward. Server side detects the mouse action then move the toon in a one step per tile movement. The player continue to drag his mouse to move forward, on the server side, the coordinates of next tile is retrieved and the toon is moved one step forward. That says, on the server side, one step always equal to one tile. Client side: The player drags the mouse to move forward, his toon thus move one tile forward, each tile is covered with its corresponding texture. That says, on the client side, each step always equal to one tile, and one tile is always covered by one 2D texture graphic. I think that's how a character moves in a 2D MMORPG. So would anyone tell me the theory how the same character moves in a 3D MMORPG? Does a 3D terrain map still use a "one step = one tile = one texture graphic" method to move the character? How the coordinates and terrain type are detected on the server side? Thanks very much.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Hawkins8
I am clueless about how it's done in a 3D engine.

I think it's easy in 2D engines, like this,

Server side:
A height map stores the coordinates of tiles. When the player drags his mouse to move his toon forward. Server side detects the mouse action then move the toon in a one step per tile movement.

The player continue to drag his mouse to move forward, on the server side, the coordinates of next tile is retrieved and the toon is moved one step forward.

That says, on the server side, one step always equal to one tile.


Client side:
The player drags the mouse to move forward, his toon thus move one tile forward, each tile is covered with its corresponding texture.

That says, on the client side, each step always equal to one tile, and one tile is always covered by one 2D texture graphic.


I think that's how a character moves in a 2D MMORPG.


So would anyone tell me the theory how the same character moves in a 3D MMORPG?
Does a 3D terrain map still use a "one step = one tile = one texture graphic" method to move the character?
How the coordinates and terrain type are detected on the server side?

Thanks very much.




Not all 2D game move the units in one tile increments. In UO you moved in small fractions of tile incremnts.

In 3D they can use a tile like system but usually there is a surface 'nav mesh' of triangles simplified from the more detailed terrain. The player always has to stay on the nav-mesh (use of point intersect triangle computation...).

Some games which are true 3D movement actually do collision checking against th 3D meshes (which can be simplifications of the viewed meshes) .


You can have alot of the movement validation done on the client side to prevent a delayed reaction when the unit smacks into a wall (the server usually still also does the validation but the client normally would not send movements that caused expensive collision resolving)

Share this post


Link to post
Share on other sites
Quote:
Original post by wodinoneeye
Not all 2D game move the units in one tile increments. In UO you moved in small fractions of tile incremnts.

In 3D they can use a tile like system but usually there is a surface 'nav mesh' of triangles simplified from the more detailed terrain. The player always has to stay on the nav-mesh (use of point intersect triangle computation...).


Ok, thanks very much. My question is, is the nav-mesh calculated on the server side or the client side?

Quote:

Some games which are true 3D movement actually do collision checking against th 3D meshes (which can be simplifications of the viewed meshes) .


You can have alot of the movement validation done on the client side to prevent a delayed reaction when the unit smacks into a wall (the server usually still also does the validation but the client normally would not send movements that caused expensive collision resolving)


So if terrain calculations are mostly done on the client side, is it a risk that the server can thus be fooled? Say, if collision is detected on client side, yet a hack sends the false result to the server, then the server will allow the player pass a wall or mountain.

Share this post


Link to post
Share on other sites
No, the server will check it also. The client just does the check first so that it can begin to display the correct results in 99.9% of cases before the server replies.

Share this post


Link to post
Share on other sites
If it isn't obvious the client does requests. "I want to move forward. I want to do action X". The server verifies the requests and send the clients information they need to correct them. The client interpolates and extrapolates given the server data. (the server sends position and velocity so that the client can perform predictions about the next server state. If you know a player is moving forward one moment chances are he's still moving forward the next frames.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
No, the server will check it also. The client just does the check first so that it can begin to display the correct results in 99.9% of cases before the server replies.


Yes, I understand that. Thanks.

Yet my point is, in order for the server to do the check correctly, it has to keep the same information as the client does, and to a certain extent, does the same calcualtions as the client does, basing on the same information.

As a result, my question is to what extent the same information is kept on the server side, and to what extent the same calculations are synchronized on both sides to be considered proper or balanced?

Share this post


Link to post
Share on other sites
For client side prediction to work correctly the client would need the same information that the server would have about the world. Also to render it the client needs to know where the vertices are how to render them. This means the client would know basically everything about the terrain.

The server on the other hand does not need to render anything so the server could ignore textures, blending data if there is any, and mostly anything else relating to actually rendering the terrain.

Usually the server and client are both working with the same calculations except that the client is predicting where other players will be between messages from the server. In the case that the client got that prediction wrong it will try to move into the correct position, but this too will be a prediction because by the time the player moves from the incorrect position into the server's sent position the real player has already moved, so that can be predicted as well.

Share this post


Link to post
Share on other sites
Also, it can be assumed in many cases that a client submits its data in a form that is either correct or incorrect. This means that the server [in these cases] needs only check to see if data is correct, and responds with a comment to the client about whether or not the data that was sent was correct. The client performs things like path finding, path smoothing, position prediction for moving objects, etc, to produce a path that is assumed correct. Thus, much of the complicated computation doesn't need to be done on the server. The server simply needs to be able to check to see if the data it was given is valid, and provide a correction in the case of invalid data. These computations become more complicated in the case of game with a continuous environment, as most 3d games have, as compared to a tile-based game.

Share this post


Link to post
Share on other sites
Lol can't you just load the whole map to the client, then tell the server where the player is? That's how most games do it, isn't it?

Share this post


Link to post
Share on other sites
Quote:
Original post by Wolfdog
For client side prediction to work correctly the client would need the same information that the server would have about the world. Also to render it the client needs to know where the vertices are how to render them. This means the client would know basically everything about the terrain.

The server on the other hand does not need to render anything so the server could ignore textures, blending data if there is any, and mostly anything else relating to actually rendering the terrain.

Usually the server and client are both working with the same calculations except that the client is predicting where other players will be between messages from the server. In the case that the client got that prediction wrong it will try to move into the correct position, but this too will be a prediction because by the time the player moves from the incorrect position into the server's sent position the real player has already moved, so that can be predicted as well.


That makes alot of sense now. Thanks very much.

Here's my summary, please correct me if I am wrong.

A tile is still the smallest unit in a 3D game world, A height map storing the tile coordinates is kept on both the server side and client side. Whether each tile is a passable to the players or not is also stored on both server side and client side to determine on both sides whether players are allowed to stand on the tile or not.

On the other hand, the client side will generate more detailed polygons for each tile to be visually realistic, and to calculate more precisely, such as collision detections to allow flying objects to be visually represented correctly and realistically.

By assuming a player (or a moving object) is currently in tile A, detailed calculations are thus done on the client side precisely such that everything moving will be presented realistically when rendered. However, if when "tile A" information reaches the server side and is judged to be not the case, say the player has already left tile A, the "detailed" pre-rendered information calculated by the client side will thus be cancelled. If on the other hand, the tile information as determined by the server is true, the calculations done by the client side will thus be put to the rendering pipeline.

Is this the case in a 3D MMORPG desgin?


Alternatively, you can still place impassable items onto a passible tile, then rely on collision detection algorithm on both the server and client side to determine whether a player (or a moving object) can pass through or not.

So which is the case?

[Edited by - Hawkins8 on June 19, 2008 1:09:45 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!