again: performance
Since nobody seems to be interested in using the forum I'm going to give you some background information. Some people were surprised of the low fps rate of ETR/Tuxracer compared with other games. Working on the core functions I found some of the performance killers:
- The quadtree for rendering the terrains (of course). I'll try to solve this problem later, at the moment I've not time enough.
- The method of shaping Tux. Tux is composed of 34 (!) spheres, each with dozens or hundreds of polygons.
- The particles when braking or turning. It's quite expensive to calculate the params (velocity and motion) of the particles.
- The trackmarks. The entire track is stored and drawn when repeating a race. The trackmarks are not applied to the terrain polygons, they are special quads calculated in respekt to Tux's motion and orientation and overlayed on the terrain - really complex and complicated.
All these options work nice as long as there are no other enhancements like 3D models or real collision detection. I'm afraid they can't be kept completely in a rewrite. Fortunately commercial Tuxracer gives us some hints for a compromise:
- Tux can be shaped with less polygons by using a 3D program. The Tux of commercial Tuxracer looks less nice than the classic Tux but that seems to be unavoidable.
- The trackmarks are only stored for the current race. That reduces the number of marks.
- There might be less particles but the particels might appear with larger size.
- Last but not least: the visual range on the course should be reduced. That can be done by changing the fog planes. It's not a problem to scroll the upper edge of the fog plane upward (carefully) but perhaps the skybox images have to be adapted to the more foggy view (less detailed, coarser contours).
- The quadtree for rendering the terrains (of course). I'll try to solve this problem later, at the moment I've not time enough.
- The method of shaping Tux. Tux is composed of 34 (!) spheres, each with dozens or hundreds of polygons.
- The particles when braking or turning. It's quite expensive to calculate the params (velocity and motion) of the particles.
- The trackmarks. The entire track is stored and drawn when repeating a race. The trackmarks are not applied to the terrain polygons, they are special quads calculated in respekt to Tux's motion and orientation and overlayed on the terrain - really complex and complicated.
All these options work nice as long as there are no other enhancements like 3D models or real collision detection. I'm afraid they can't be kept completely in a rewrite. Fortunately commercial Tuxracer gives us some hints for a compromise:
- Tux can be shaped with less polygons by using a 3D program. The Tux of commercial Tuxracer looks less nice than the classic Tux but that seems to be unavoidable.
- The trackmarks are only stored for the current race. That reduces the number of marks.
- There might be less particles but the particels might appear with larger size.
- Last but not least: the visual range on the course should be reduced. That can be done by changing the fog planes. It's not a problem to scroll the upper edge of the fog plane upward (carefully) but perhaps the skybox images have to be adapted to the more foggy view (less detailed, coarser contours).