I now have working player collision! This took a lot longer than I expected, and there is still quite a bit of work needed to clean this up, but it is working well.
The problem was that a variable was not being updated on the server, only on the client, and so the server didn’t have access to the polylist for the collision calculations. This is now fixed.
I can now begin work on large terrains, and optimisation of the collision system and rendering. I need to implement a system which only renders and collides with the polygons close to the player, and then updates these polys as the player walks around the surface of the planet.
I also need to deal with the famous 10,000 unit problem in Torque. Torque uses 32-bit floats to store position transforms, and when the player gets to about 10,000 units from the origin, these 32-bit values lose precision, and this causes a noticeable “jitter” effect. To deal with this, I would either have to replace all of the 32-bit floats with 64-bit floats, which would require major reworking of the engine, or, implement a system where the player actually remains at the origin, and the world moves around them.
This system is the one that I used in my Icarus Rocket Simulator, and it works quite well. This project is multiplayer however, which does make things more complex, since I will need absolute coordinates on the server (in the database) and I will need to translate those to local coordinates for each player (centered about the origin).
