Phodex Games Posted August 26, 2018 Share Posted August 26, 2018 I am not 100% sure about this for quiet a while now, so I though why not just ask :). I am not yet completely familiar with loading & releasing assets. Does an Asset, e.g an Sound which gets loaded, although I have loaded it before affect my memory, or does Leadwerks handle this automatically? So if I do something like below is the sound stored seperatly for every variable, or only once and loading him again has no effect? And what about models? If you load them they get placed in your scene for every load command. I have seen that sometimes you load in an asset use it for something and then directly release it again. I hardly release my assets and would appreciate every information about best practices for when to release your assets and when to best use instancing and when not, as I want to opimise this aspect as good as possible to increase speed & performance. function Script:Start() local sound1 = Sound:Load("mysound.wav") local sound2 = Sound:Load("mysound.wav") local sound3 = Sound:Load("mysound.wav") end Thanks in advance Markus from Phodex Games Quote Link to comment Share on other sites More sharing options...
Josh Posted August 26, 2018 Share Posted August 26, 2018 If you watch the program log you can see when assets are actually loaded. The code above would only load the sound once and then return a copy of it afterwards. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted August 26, 2018 Share Posted August 26, 2018 Sound:Release() modelPlayer:Release() You are loading the same sound into different variables. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.