Game Development Community

Torque 3D Double Precision

by Haydn Trigg · in Torque Game Engine · 03/23/2013 (7:48 pm) · 1 replies

I have been researching into creating a Space Game and I have found the biggest limitation in single precision/float/F32 for any space project that wishes to use large worlds. This would also apply to other large worlds as well.

Instead of doing something really silly like change any instance of F32 to F64 and kill a PC. I was thinking about how the objects would be sent over a network and then calculate their position based on a Camera at Zero, or another reference point.

Example:
Player is at Double Co-Ordinate 5000
Enemy is at Double Co-Ordinate 7000
Zero Player and Calculate Single/F32 Co-Ordinate : 2000

This way there is plenty of visual precision as a double has a much greater precision far beyond a single.
Basically, you are still in the very center of the world. Everything else is moving around you.

Is this possible?

About the author

I'm Haydn Trigg game Designer, Programmer and Artist the founder of Vagyr.

Recent Threads


#1
03/24/2013 (8:38 am)
Quote:
Instead of doing something really silly like change any instance of F32 to F64 and kill a PC.

Changing from F32 to F64 won't "kill a PC", and altough a double has better precision than a float, you're just delaying when the issue will show up again (ie, further away)..

It's possible to treat the player as the origin, and displace objects at an offset from the origin, yes. It's also possible to use zones with their own local coordinate system.