maximum map size (x,y,z values)

Posted By: Carlos3DGS

maximum map size (x,y,z values) - 07/19/11 15:02

I have been experimenting a little with an idea I had but I would like to know the limits of the engine to implement it.

What I am doing is not loading any level. I just load a null one and randomly generate the surroundings of the player. as the player moves I remove the parts of the world he has left behind and randomly generate his new surroundings as he advances.

Initially this idea was only aimed at solving the problem of having a huge world that could not be loaded all at one time, but avoiding annoying load screens. Afterwards I added something else to that mix: randomly generated worlds.

Seeing how these two ideas worked so well together I realized the potencial behind this combination and the natural evolution of this seemed obvious to me: infinite worlds!

Memory is not an issue since I remove all the entities that are not within a certain range of the player when he moves.
The next problem I thought about was disk space, But with today's disk sizes and the little information I have to store it will take very long to become a real problem.

Then another problem came to my mind... The maximum size of the variable used for the engine's coordinate system.
So my question to you 3DGS gurus out there is: What is the limit of the coordinate system? (maximum value for x,y,z coordinates of an entity)
Posted By: Lukas

Re: maximum map size (x,y,z values) - 07/19/11 15:16

The coordinates are vars which range between ca. -1000000 to +1000000. In Lite-C it's seems to be rather -2000000 to +2000000, but apperently only 1 million is officially supported.

http://manual.conitec.net/aarray.htm
Posted By: Carlos3DGS

Re: maximum map size (x,y,z values) - 07/19/11 15:43

OUCH! Well that is going to be a problem...
http://manual.conitec.net/aentity-x.htm

The first idea that comes to mind to solve that is having a second vector that represents sub-areas.

So when the player x exceeds 1000000 (of area 0,0,0) he is considered to be in the next area and x will be -1000000 (in area 1,0,0)

Not too sure, I'll have to think about it and see if I end up using a method like this, or come up with a better solution, or trash the infinite world idea if it is too problematic.
Any ideas are welcome!
Posted By: Joey

Re: maximum map size (x,y,z values) - 07/19/11 15:55

For stuff like that you should use local coordinates (e.g. a camera-bound triad) and move the stuff around the camera, not vice versa as is usually done.
Posted By: Carlos3DGS

Re: maximum map size (x,y,z values) - 07/19/11 16:26

I considered that aproach but it creates a new problem when i store the map entities' positions in the database (save game)...
What coordinate do I give them with your aproach?
Posted By: Joey

Re: maximum map size (x,y,z values) - 07/19/11 18:41

store them as double valued positions. you're of course keeping track of the camera's "real" position as a double vector, or, if you're really serious about it, a fixed point 64 bit variable - though, depending on the effort you want to undertake, there'll always be some kind of limit.
Posted By: MrGuest

Re: maximum map size (x,y,z values) - 07/19/11 21:48

scale everthing down by 10% or 100, though may decrease precision of positions
Posted By: Redeemer

Re: maximum map size (x,y,z values) - 07/19/11 22:04

Storage space is not a problem, since we can always make a bigger hard-drive. Your biggest road-block when dealing with "infinite" worlds is the CPU itself, since you will get overflow errors when dealing with exceptionally large amounts of data. It will be up to you to devise a dynamic system that can slice up this data into consumable pieces for the CPU.
Posted By: Carlos3DGS

Re: maximum map size (x,y,z values) - 07/21/11 21:39

the world itself will be on the hard drive in a database. The only loaded parts are the surroundings of the player so cpu should not be an issue
© 2024 lite-C Forums