Jump to content
  • Advertisement
Sign in to follow this  
solve

How to import tracks in server?

This topic is 4437 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 want to develop a game server for a 3D car racing game. To decrease the load of the server, I'm not going to do any physics in server, just broadcast the player's state instead. I also want to do some simple check in server. For example, i want to check whether the car's coordinate is on the track. Here comes the problem: how does the program know the track's area? how can i import the racing track? Any ideas? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by hplus0603
How do you know whether the car is on the track on the client?
Do the same thing on the server.


Thanks!

When the client sends its coordinate to the server, if the server knows the track's area, it can know whether the car is on the track. If the car isn't on the track on the client actually and the client sends a fake coordinate, it won't affect the game result, because the result is desided by the server. And other clients will see that the car is still on the track as long as the coordiante sent to the server is on the track.

Anyway, how can the server know the track's area?

Share this post


Link to post
Share on other sites
Here's one suggestion:

In your track editor, mark the triangles that are "track" (as opposed to scenery). When you export your track geometry, also export a file that contains only the "Track" triangles, projected to a 2D flat plane. Load these triangles into a quadtree.

When you need to test "is coordinate X on the track", simply run the coordinate through the quadtree, and test the triangles that you find in the terminal nodes; if the point is inside a triangle, it's "on the track."

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
Here's one suggestion:

In your track editor, mark the triangles that are "track" (as opposed to scenery). When you export your track geometry, also export a file that contains only the "Track" triangles, projected to a 2D flat plane. Load these triangles into a quadtree.

When you need to test "is coordinate X on the track", simply run the coordinate through the quadtree, and test the triangles that you find in the terminal nodes; if the point is inside a triangle, it's "on the track."


Thanks a lot!

I don't know about graphics very well. Can u explain more about how to load triangles from the file(is it a .mesh file?), or is there any article about that?

Share this post


Link to post
Share on other sites
I have read some basic articles about graphics and i know that triangles can be imported from a .x file. Is that right?

However, i still don't know how to load them into a quadtree. Can u explain more?

Thanks!

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!