1
\$\begingroup\$

My SFML 2.0 release build has a file path to game assets relative to the .exe file, so folders such as Fonts, SoundEffects, etc. are explicitly listed in Windows Explorer with the .exe. I'd like to somehow have these game asset folders not appear in Explorer.

I know I can mark the folders "hidden" in folder properties, but I've seen games that only have an .exe and nothing else, yet the game plays properly. How do I do that?

The .exe file should only be visible - other folders should not be there

\$\endgroup\$
  • \$\begingroup\$ some people embed their assets to the executable, then it'll be more difficult (but not impossible) to extract them. \$\endgroup\$ – tp1 Mar 2 '15 at 1:20
  • \$\begingroup\$ How does one embed his assets to the executable? \$\endgroup\$ – bladematthewslp Mar 2 '15 at 7:05
1
\$\begingroup\$

The games that have nothing but an .exe have compiled their executable with the assets inside. This is generally poor practice. By embedding your assets into the executable, they will stay loaded into memory while the program is running, even when not in use. For your scale and with modern machines this might not be much of an issue, but as the executable gets larger, this can be an extremely large and unnecessary performance sink.

Similarly, keeping your assets separate enables the program to load into memory much faster as only the necessary data is put into memory on launch.

To give you an extreme example, think of a game like Deus Ex: Human Revolution. If it was all compiled into an executable, it would consume somewhere in the area of 8GB of memory at any given moment. However the recommended specs suggest 2GB of memory. These recommended specs are usually the maximum amount of data that the game may need stored in memory at any moment. 2GB "occasionally" is a lot better than "8GB all the time"

As for the actual process of embedding the assets, it depends a lot on how exactly you're developing. Many IDEs have functionality that will do it for you. In your situation it probably isn't a big deal for convenience sake, but a much better method would be to have an installer that extracts the assets and necessary executables for the user.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.