Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: coffeesoft on January 06, 2014, 05:56:00 am

Title: Models and textures management
Post by: coffeesoft on January 06, 2014, 05:56:00 am
Hello, i´m working and testing some things and i have a little doubt.

I want to ask if when we take out a model from the scene with FRED,  textures and polys are totally deleted from memory ?
I think yes, is the logical way, but i want to be sure because i´m using some models only for intro cutscenes and i have to be sure that are not loaded in memory when the cutscene is over and all the models are in "Home". Just to use the memory for the game action.

I think that simply just take more time to load at the beginning of the mission ...

Thanks.





Title: Re: Models and textures management
Post by: The E on January 06, 2014, 06:05:42 am
This is not something you should be worried about. The engine will take care of any memory management for you, and aside from a few edge cases (Like the intro cutscene to WiH: Tenebra), it will do an acceptable job of managing assets.

(To answer your question more specifically, FSO uses a strategy whereby assets will remain in memory for as long as possible, on the assumption that any given mission will share a number of assets with the ones preceding and succeeding it. When memory gets tight, the least used assets are unloaded; this process can not be manipulated by users or modders)
Title: Re: Models and textures management
Post by: coffeesoft on January 06, 2014, 06:13:04 am
Thanks for the quick reply, then I leave the hard work for the machines   :p
Title: Re: Models and textures management
Post by: zookeeper on January 06, 2014, 07:57:36 am
Yeah, don't worry about things like that unless you happen to have a very specific reason to assume that it will be a problem.

That said, it seems that textures (but not models) can be unloaded from memory via scripting if you'd ever really really really need to. Like if you needed twenty 4096^2 textures for a cutscene and have a player complaining that their old computer is running out of video memory because of it, then it might make sense.
Title: Re: Models and textures management
Post by: coffeesoft on January 06, 2014, 10:09:58 am
Well, actually the engine has not given me any problem, just i want to be sure that not all the data is stored on memory limiting the available resources just for a cutscene, as well i´m more quiet working on the models  :)


And also always is better to know a bit more of the engine and learn a bit about how it manages the data, thanks.