--- title: "Resources" type: docs --- # Resources Prosperon uses string paths to reference assets — images, sounds, fonts, scripts. The resource system resolves these paths and caches loaded assets. ## Module Resolution `use('path')` loads a module by searching for `path.cm` in this order: 1. The current module's directory 2. Mounted roots (the program's directory is always mounted) 3. Embedded/native modules if no script file is found Modules compile to bytecode (`.o` files) and are cached after first load. Subsequent `use()` calls return the cached value. ## Asset Resolution When you reference an asset like `"player.png"`, the resource system searches mounted paths for a match. Assets should generally be referenced **without** a file extension — the engine tries appropriate extensions based on context: - **Images:** png, qoi, gif, jpg, jpeg, ase - **Sounds:** wav, ogg, mp3 - **Fonts:** ttf Omitting extensions lets the engine swap optimized formats transparently. If you specify an extension, only that exact file is searched for. ## Caching All loaded assets are cached. When two sprites reference the same image path, they share one GPU texture. Sound data, fonts, and bytecode are similarly deduplicated. ## Mounts Prosperon uses a virtual filesystem. The write directory is set to the folder the engine runs from. That same folder is mounted as a read directory, along with the executable itself (which contains a zip archive of core engine assets). Additional folders or zip archives can be mounted, allowing mods to override specific files: ```javascript // A mod zip containing sprites/bug.png will override the game's bug.png ``` Because all asset references are string paths resolved through the mount system, modding is straightforward — mount a new archive and its files take priority. ## .prosperonignore A `.prosperonignore` file in a mounted directory excludes files from resolution, similar to `.gitignore`. This is useful for keeping source assets (e.g., Aseprite working files) out of the build.