Skip to content

Resources & Data

Prosperon, being text based, encourages you to reference assets - images, sounds, etc - as strings.

Module Loading and Discovery

Prosperon uses a set of search paths to locate modules. Each path in this list is consulted in order, and the first matching module file is loaded. prosperon.PATH is an array which is a list of directories in which it looks for resources. Developers can add or remove entries from this list, controlling where the engine will search. Assets are searched from prosperon.PATH[0] first.

Extension Matching: Assets should be referenced without a file extension. Based on the context of what asset is being searched for, a list of file extensions are iterated through to find the asset. When setting a sprite's texture, for example, first a 'png' may be searched for, then a 'gif', and so on. If a specific extension is requested, that specific extension - and only that one - will be searched for. it's very useful to not specify extensions at all, because that enables prosperon to optimize assets and replace them with backend specific ones, and the game will still work.

Prosperon caches each loaded assets. When a sprite references a 'png', if another one does, it uses the same GPU texture.

Mounts

Prosperon uses the idea of file mounting for all io operations. To start with, the write directory is set to the folder prosperon is ran from. That same folder is also mounted as a read directory, as well as the executable itself, which contains a zip file of the engine's core assets.

Folders or archives like zip records can be mounted, allowing for an easy way to overwrite specific files with new ones. Because prosperon deals with file systems and strings for its operations, this makes modding easy. For example, a mod mod.zip may have a file sprites/bug.png. Once mounted, when your game loads bug as a sprite, that would be grabbed instead of your game's natives bug.