jpk
25-01-2006 22:09:13
I just had a look at the paging landscape scene manager and I was quite impressed with the grand canyon example... (It might be fun to do something with a _really big_ game area.)
However, I think there is an obvious problem with landscapes that large. The single precision float number accuracy really can't handle that big values.
The accuracy should be ok at the middle of the map, but what happens when you move to the near-edge of a large map - the position values grow over 100k magnitude. Given a 100k float value, you pretty much lose the ability to handle any value in accuracy smaller than 1.
So if we were using metric values, this would mean that a 100km map cannot be used in a game where positions need to be more accurate than 1m - or similarly, if it was a 10km map, values smaller than 1cm would be inaccurate. In case of a first/third person game, this might not be acceptable... (of course, someone might ask what is the point in making a first person game with a 10x10 km map, but lets not get into that now.)
Now, obviosly there is a "simple" fix for this problem.. just use double precision floating points instead (or proper 32bit fixed point numbers). However, the PLSM demo app does not seem to be doing so.(?) I don't know if this is due to Ogre3d or just the demo app.
I'm sure at least some of you guys have already though about this and this may be trivial to you, but I'm still pondering about this issue. After all, it will be a problem if I should try to create a huge walkable map like that.
Just wanted to share my thoughts and maybe get some insights into this.
However, I think there is an obvious problem with landscapes that large. The single precision float number accuracy really can't handle that big values.
The accuracy should be ok at the middle of the map, but what happens when you move to the near-edge of a large map - the position values grow over 100k magnitude. Given a 100k float value, you pretty much lose the ability to handle any value in accuracy smaller than 1.
So if we were using metric values, this would mean that a 100km map cannot be used in a game where positions need to be more accurate than 1m - or similarly, if it was a 10km map, values smaller than 1cm would be inaccurate. In case of a first/third person game, this might not be acceptable... (of course, someone might ask what is the point in making a first person game with a 10x10 km map, but lets not get into that now.)
Now, obviosly there is a "simple" fix for this problem.. just use double precision floating points instead (or proper 32bit fixed point numbers). However, the PLSM demo app does not seem to be doing so.(?) I don't know if this is due to Ogre3d or just the demo app.
I'm sure at least some of you guys have already though about this and this may be trivial to you, but I'm still pondering about this issue. After all, it will be a problem if I should try to create a huge walkable map like that.
Just wanted to share my thoughts and maybe get some insights into this.