As mentioned above, some types of assets require compilation before they can be used. This can happen at runtime for desktop platforms in Debug mode, but you must precompile assets for mobile or release builds.
To compile assets, we use the Protogame asset tool, which is included in the solution you use to build your game.
The Protogame asset tool accepts the following options to determine how it will compile assets:
||This should be the “compiled” folder in your content project. It specifies the location to output the compiled assets for each target platform.|
This option is specified for each platform
you want to target. If you wanted to target Linux and Android,
you would specify
The supported platform names are (these are from the
||This specifies additional assemblies to load during asset compilation. This is required if you have defined custom asset types as the Protogame asset tool needs to know where to locate the loader, saver and (optionally) compiler classes for the custom assets.|
||This changes the behaviour of the Protogame asset tool so that instead of compiling assets, it instead listens for remote requests for asset compilation. See the Remote compilation section for more information on remote effect compilation.|
Often for large projects you will want to encapsulate this command in a batch or shell script so that you don’t need to type the command each time.
For a Windows machine, a batch script placed in the content project (such that this file resides next to the “assets” and “compiled” directories), might look like:
For Linux, the shell script might look like: