Jump to content
  • entries
    943
  • comments
    5,899
  • views
    923,737

Selective File Inclusion (Beta)


Josh

3,987 views

 Share

A new update on the beta branch on Steam adds selective file inclusion on publishing a project. This works by scanning map files and building a list of required files, and only packing up files that are actually used in your game. Here's how it works:

  • All map files are always included, and scanned for required files.
  • All script files are always included, and scanned for required files.
  • Included prefab files are scanned for required files.
  • Included model files are scanned for required material files.
  • Included material files are scanned for required texture files.
  • All shaders are always included.

 

The bulk of file sizes in any project are textures, and to some extent, model files. Although it is possible for this system to generate some "false positives" it will greatly reduce the size of published projects, and errs on the side of caution.

 

I am concerned some required material files may not be caught. If you find a situation where this feature is not working properly please upload your project and send me a link to download it.

 

This is the default behavior, and is always active when publishing your project.

 

I hope to have this up on the default branch in time for the last few days of the Winter Games tournament.

  • Upvote 14
 Share

14 Comments


Recommended Comments

Nice update! Can we include C / C++ users with this? The theory would be that the program would scan the project file for source and header files used in it. Then it would scan those files for any model, texture and material files mentioned and include them.

  • Upvote 3
Link to comment

Knocked it out of the park Josh 7.96 GB project folder reduced to a published size of 136 MB.

 

How ever, my project fails to run from the published folder.

 

It begins to load, then it freezes and says " Zombies stopped working"

 

Tested a different project, That project folder is 20+Gb of asstes and was reduced to 3.70 GB but has textures missing.

Link to comment

@DerRidda, this system would fail in that scenario.

 

CPP files are scanned, as well as Lua scripts.

 

A good way to check your game's output is to create a text file called "run.bat" and set its contents to this:

zombies
pause

 

Double-click the bat file and it will run your game and display the output. It will probably say something like "Failed to load file..." just before it ends.

Link to comment

I updated the player script now so it actually lists the files it is loading in the script. Should work now if you update the project.

Link to comment

are comments scanned aswell?

 

Or can we mark directories/files as 'always include' ?

 

For instance my gui has all the textures it uses in it's xml files, so it would be good to be able to say always include "gui/*"

Link to comment

how is the code scanned?

 

I guess it will fail at things like

for i=1,10 do
   Model:Load("Models/Characters/char" .. tostring(i) .. ".mdl")
end

 

or else it would need to understand the code.

  • Upvote 1
Link to comment

I guess it will fail at things like

for i=1,10 do
Model:Load("Models/Characters/char" .. tostring(i) .. ".mdl")
end

Similar in my inventory code for example. I guess it would be better to simply allow users to select folders that they don't want to export, so they can place all their currently unneeded textures there.

 

Also, why do you even keep files that you don't need in the project folder?

Link to comment

Something like below would do the trick. Not only does this give Leadwerks a unified way of detecing export folders, it also gives the programmers a way of creating dynamic variables without having to worry about missing export errors.

ExportInclude "Sounds/Player/Footsteps"

  • Upvote 4
Link to comment

Just wondering is there a way to add other file types? Projects I work on use sqlite databases for some data saving for example. Is there a way to add some custom files that the publisher wont recognise?

Link to comment

@tjheldna - not currently, but I believe there is that we've by now demonstrated a need to somehow mark files as needed.

 

Preferable a non lua file you can add files/directories to in plain text format

Link to comment

because of much file duplicate i like to see a asset database

and in game i use a reference.

and in editor we can select the content we need, this put

a link in db.

:LoadFromDB("KeyName") unique key in database

then we can use a main database together also for a online asset store (also for free things)

but that means we need a asset manager app.

with this db the publish knows what it is used.

 

other idea is to make a asset template folder outside project folder

and all u need in game will copied to the project folder.

Link to comment

I don't buy that at all. If someone is capable of using a complicated "tagging" system, then surely they are able to just delete the files they don't want?

  • Upvote 2
Link to comment
Guest
Add a comment...

×   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.

×
×
  • Create New...