Jump to content

Question regarding importing assets / size of the resulting game


Mordred
 Share

Recommended Posts

Hi fellow Leadwerkers,

 

a question came to my mind the day before and i hope you're able to answer it.

 

If i, say, add 10GB of data to my project, but i do not use those assets, maybe only 1GB of data is actually placed ingame, thus the remaining 9GB are not used at all. What happens if i now compile the game and make it an executable?

 

Is the game 10GB+ in size, or is it 1GB+ in size (and thus the unneccesary assets were removed)?

 

I'm just wondering if i'm able to add all the assets (Textures, models, animations and such) that i have to a project at once in advance without blowing the gamesize too much.

Link to comment
Share on other sites

Well instead of opening a thread in the forum for it and waiting for answers wouldn't it be much quicker to build a project and take a look at the resulting file hierarchy in the installed game?

 

As far as I know Leadwerks does not omit unused files on build currently, just does not load them if they are not used in a map.

Link to comment
Share on other sites

Hell SarperSoher,

 

thanks for your reply. If i could test that, i would've done it on my own, but fact is: I bought the preorderedition recently and do not have access to any version (neither the steamedition, nor the full edition) to test that. That's why i asked here :)

Link to comment
Share on other sites

Everything what is into your project folder will be compiled I guess. When you dont need some assets in your game than you should not integrate them. I think an engine couldnt know which assets the software will be using @runtime when the code will be compiled.

 

When I have a game and there is a choosePlayerModel() function (like male/female) than you need 2 models but only 1 is really used. The engine doesnt know which model you need at runtime so it have to compile the worst case -> compile everything.

It doesn´t work... why? mhmmm It works... why?

Link to comment
Share on other sites

I bought the preorderedition recently and do not have access to any version (neither the steamedition, nor the full edition) to test that. That's why i asked here smile.png

 

My apologies then, seeing that you're in the "Developer" group, I thought you had it.

 

I think an engine couldnt know which assets the software will be using @runtime when the code will be compiled.

 

Actually all the engines I know of remove the unused assets on build. If you reference an asset in a script it's count as being used.

Link to comment
Share on other sites

My apologies then, seeing that you're in the "Developer" group, I thought you had it.

 

 

 

Actually all the engines I know of remove the unused assets on build. If you reference an asset in a script it's count as being used.

 

A lot of the ones I've used don't. Unreal Engine and Source definitely don't: there's a lot of cut content in several games that's pretty well documented. It's not without precedent.

Link to comment
Share on other sites

Actually all the engines I know of remove the unused assets on build. If you reference an asset in a script it's count as being used.

And what if you load files from a custom list file you created? I think it's safer for the engine to assume that you may use any files you put into the project. Though in a perfect world there would be options and settings for this in the editor:

1. checkbox to automatically remove what it feels are unused resources

2. give you a list of unused resources with the option to highlight and include them

Link to comment
Share on other sites

A lot of the ones I've used don't. Unreal Engine and Source definitely don't: there's a lot of cut content in several games that's pretty well documented. It's not without precedent.

 

Unreal Engine has content culling. It does not load the unused assets in the packages in the editor by default and does not include them in a build afaik. Don't know about the Source, maybe it's a limitation about the mods.

 

My point is, someone said it's impossible for the engine to know which assets are used and which are not, so I've proven that it's possible. And what is your point?

Link to comment
Share on other sites

i also think it is not really possible.

 

If you for example have code which loads multiple models?:

pseudocode:

models = {}
for i=1, 100 do
 models[i] = Model:Load("Models/model"..i..".mdl")
end

 

how should the engine know what models you are including? It would need to analyze your code and whatnot.

Link to comment
Share on other sites

ok I agree. I dont know something like content culling but how can the compiler detect something like this:

 

When I have a Textbox where I have to type in the Modelname as String? (sure its a bad coding technique but I think the compiler cant know it because there is no relationship or reference)

 

 

 

$model = ""; //string

function getModelNameFromTextInputBox(){ //function returns my string from the textbox where I write the String in runtime (like in a browser textbox)

 

return ValueFromTheTextBox;

}

 

$model = getModelNameFromTextInputBox(); // e.g. "test.mdl"

 

Model:Load(getModelNameFromTextInputBox()); //load my model "test.mdl"

It doesn´t work... why? mhmmm It works... why?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...