Walking.

Started by
2 comments, last by JohnBolton 18 years, 3 months ago
In a game like Everquest, I have a question regarding the player and terrains. The player obviously has the ability to walk on the terrain as it slopes etc. How is the terrain represented in a client, and how would you use this terrain object to determine the height at which the player should be drawn at.
Advertisement
not sure what you mean by "how is it represented in a client" but as for how to check where the player is to be drawn my best guess would be that the engine checks the bottom of the player's model to the faces(triangles) that make up the terrain (mesh (big collection of faces) ) If the model collides with a face then that's where it will be standing as far as the y-axis is concerned.
Some times cheating is used, you know the height of whichever model then have them drawn up the right amount based on that. and you can use math to determine the grade it goes up based on the points your between, the 3 vertices of the particular triangle of the terrain mesh you in, and use those values to make it so the player doesnt pop up to the next height as this may cause it to appear as tho the play in inside the terain at times. I have the math somewhere in one of my old terrain map programs if it could be useful, but it may take some time to find, havent messed with terrain maps for a while, I like space games
The terrain is generally represented by a grid of height values (a "height map" or "height field") or a mesh. Determining the height at which the player is drawn is usually done by finding the height of the point on the triangle he is over. With a mesh it means simply finding the triangle, but with a height field, you must know (or assume) how the height field is triangulated in order to figure out which triangle.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement