Racing Theory
okay, all you guys making racing games, or anybody who would happen to know how to do this:
how do you keep track of player''s positions on the track? like, how do you keep track of who''s the leader, who''s second, third, etc?
a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Maybe it''s a good idea to divide the track into multiple areas.
Each player has a max area. Set player max area to current are he/she is in if previous area was lower.
This way you can''t cheat by driving backwards. Also usefull in "complex" roads (crossings...)
And to get a players position, you have to check which player reaches the highest area first.
This area can be a simple bounding quad, but you could also use uge polygons...
Each player has a max area. Set player max area to current are he/she is in if previous area was lower.
This way you can''t cheat by driving backwards. Also usefull in "complex" roads (crossings...)
And to get a players position, you have to check which player reaches the highest area first.
This area can be a simple bounding quad, but you could also use uge polygons...
i was thinking about using my very oversimplified BSP as to keep track of which sector a player is in as position, but some sectors are huge, and many players can be in them at once.
a2k
a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
I''ve split all sections of road up into fairly equally sized sectors, which go in order from the start up to the finish line, and so the higher sector the player is in the higher position he is in, but I suppose if you have large sectors and more than 1 car is in the sector then just get the distance from the end of that sector, and the closest to the end, is in front. I know its not very accurate, but it should work reasonably well.
----------------
Freeride Designs
----------------
----------------
Freeride Designs
----------------
hey hey. good idea. thanks. several levels of checking, just like collision detection''s spheres and planes, right? cool.
anyway, i''ll slice up my sectors to smaller ones anyway. that''ll allow for more interesting looking tracks. thanks.
a2k
anyway, i''ll slice up my sectors to smaller ones anyway. that''ll allow for more interesting looking tracks. thanks.
a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement