Free my memory

Posted By: Maxim

Free my memory - 05/27/07 11:16

I'm making a huge level. To get a better texture quality i'm using around 100 hmp-terrains, which are dynamically loaded, if my player gets near them. (using ent_create). If player moves away - terrains are removed by ent_remove. Everything works fine, but when the entity is removed - the RAM memory (reserved for texture i supose) doesn't free - so it grows and grows!!! Can i manually clear it?
Oh, and one more thing: ent_create'ing a hmp-terrain in real-time kills my fps for a moment. Can this proccess work parallel without making the game process stop waiting for terrain to be loaded?
Posted By: jigalypuff

Re: Free my memory - 05/27/07 11:54

try ent_purge after ent_remove
Posted By: ChrisB

Re: Free my memory - 05/27/07 12:14

For deleting models/terrains in the cache you must load the level again, or use level_mark/level_free.
Posted By: Maxim

Re: Free my memory - 05/27/07 13:10

I wonder, how can i load a level in real-time in a racing game?
Posted By: vartan_s

Re: Free my memory - 05/27/07 15:23

I don't know, but maybe a good bet would be to use the two terrains, and deform them according to a 2d array of vertex values, and if required change the skin. That way, you can alternate between the terrains that the player is on. However, you would have to set up and array management system for the vertexes, and for alternating between terrains.
Posted By: Maxim

Re: Free my memory - 05/27/07 18:24

Too difficult and the result would be less than expected. So I guess the only way to do this is to find the ballance between my memory and my ideas. But I think it'll be really hard to fit 2sqr kilometers of reasonable quality of terrain in 100mb of RAM.
© 2023 lite-C Forums