Originally Posted By: Carlos3DGS
I had the very same idea for an infinite terrain system (endless world) I came up with and am running into the same problems...

I load a certain number of terrains around the player and I also load a heightmap to terrains at runtime depending on the character's position. I first tried to move them (like your first attempts) but they cannot move. So I started to remove the ones left behind and create the new ones the player is coming close to...

Then I found this thread and it is like a slap on the face, lol!

If I understood you correctly, you are trying to achieve the same thing as I am? And the old entities being removed never free the memory? So I will end up running out of memory even though I always only have 25 (5x5) terrain entities loaded at once?
Yes, Im trying to do the same thing. Ive been trying on and off for over a year.
MOST of the entities memory gets removed, but always some remains, so eventually it WILL reach critical levels.


Did I understand everything correclty? even when removing entities the memory usage just keeps growing and growing?
So then your solution is to make huge models with lots of vertices that look like a terrain so you can use them instead and move them around?
Yup, you got it ALL right, and have both hit, and foretold, the same problems that are giving me so much grief.
By re-using the same models/entities over and over, in different places, we dont have the memory problem.


This does not seem like a viable solution to me if all other entities also behave this way (I don't know how your game works, if your game is empty and only uses terrains and a player model it might work fine. But in mine I need to load more things on the terrains).
If all models behave this way with memory, this brings another concern for me: what about other types of entities? (my plants, enemies, and buildings are the frist examples that come to mind...)
Im HOPING the solution will be to pre-create a ship-load of entities and keep unused ones in storage,
and just use ent_morph on them when I need some. And put em back in storage when they are no
longer need to be 'active'.


Even if I start using entities to simulate terrains like you do, so I can move them and never have to remove/create them all the time, won't the other entites (enemies, plants) that are also being created/removed leave behind alot of unused memory?
Yes. See my above comment.

I am not sure if I understood everything correctly, but if I did... Then even if I fix the memory problem for terrains like you did (using huge models and moving them), everything else that gets leaded/removed will still produce this memory problem?
Yes. See my above comment.

What are your thoughts on this new problem? Have you already thought about it? Do you have a solution for this also?
Yes. See my above comment.


Hope this helps clarify things a bit...

YOU ... ARE ... NOT .. ALONE


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial