Hacker News new | ask | show | jobs
by orangecat 5891 days ago
What integer value in a game gets so big that it can potentially overflow a 64 bit integer?

2^64 meters is only around 1900 lightyears, which is woefully insufficient for a galaxy-scale RTS.

1 comments

But a game that uses integer meters for coordinates has galaxy-scale problems of another kind.
I've tried to write a space game, and let me tell you, 32 bit floating point is woefully inadequate. Unfortunately, most 3D hardware at the time was built around 32 bit floats. Those only give you about 1 in 100,000 resolution. I had to create scaled-down "billboards" for nearby celestial objects and park them 1000's of kilometers away. (When they were actually 10's or 100's of kilometers away.)

Even 64 bits wouldn't allow for a naive implementation of a realistically scaled space game. There would still have to be a lot of optimization tricks played.

EDIT: I realize that the parents posts are talking about Integers, but you can't send those directly to the GPU!