Kosmora provides a virtualized file system for game assets to be stored within, allowing for improved performance, more efficent memory usage, and a smaller storage footprint.
Kosmora is a specialized virtual file system (VFS) designed for game development, enabling developers to efficiently manage, load, and access game assets. By abstracting the underlying file system, Kosmora provides a unified interface regardless of where files are physically stored.
1.**Virtual Path System** - Provides normalized path handling across all platforms
2.**Mount Registry** - Manages mount points and their mappings to physical locations
3.**Asset Loaders** - Type-specific handlers for loading different asset formats
4.**Package System** - Tools for creating and accessing compressed asset packages (.kpkg files)
5.**Memory Management** - Intelligent caching and memory optimization for loaded assets
### Key Features
#### Unified Access Layer
Kosmora presents a single, consistent interface for accessing game assets regardless of their physical location. This simplifies development by eliminating the need to manage multiple file paths or storage systems.
#### Asset Packaging
The `.kpkg` format allows developers to bundle related assets together, reducing file count and improving load times. These packages can be mounted directly into the virtual filesystem, providing transparent access to their contents.
#### Hot-Reloading Support
Assets can be monitored for changes and automatically reloaded during development, streamlining the iteration process without requiring game restarts.
#### Cross-Platform Compatibility
Kosmora handles platform-specific path differences, ensuring your game's asset loading code works consistently across Windows, macOS, Linux, and more.
#### Memory-Mapped I/O
For supported platforms, Kosmora can use memory-mapped I/O to improve loading performance and reduce memory fragmentation.
#### Asynchronous Loading
Built-in support for async loading operations allows games to load assets in the background without blocking the main thread.
### Installation
Add Kosmora to your `Cargo.toml`:
```toml
[dependencies]
kosmora = "0.4.2"
```
For Nix users, add the following to your `flake.nix`: