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?

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?

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...)
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?

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?

What are your thoughts on this new problem? Have you already thought about it? Do you have a solution for this also?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1