Game can load ONE archives from memory?
No problem, here's another one at the FileSystem level.
Id: sonicheroes.utils.oneredirector
Archived. Superseded by FileEmulationFramework.
This is an experimental project and completely functional proof of concept. This mod creates .ONE archives, "Just in Time", as the game requests to read them from disk. Using some hooks, we then make the game load the file from memory instead of from disk.
Essentially, this allows for loading of files from outside .ONE archives, allowing mods to mix and match files rather than having one mod's files replace another mod's outright.
All done with ZERO knowledge of game code, for fun.
- Supported Applications
- How to Use - How to Use: Adding/Replacing Files - How to Use: Removing Files - Developing Mods: A Tip
- How it Works
- Sonic Heroes (PC)
Probably works with some standalone applications (e.g. HeroesONE-R
) and the console versions of the game, if emulated and ran from filesystem.
A. Add a dependency on this mod in your mod configuration.
"ModDependencies": ["sonicheroes.utils.oneredirector"]
B. Add a folder called OneRedirector
in your mod folder.
C. Make folders corresponding to ONE Archive names, e.g. s01_h.one
.
Then, simply place files in the directory.
In order to add (or replace an existing) file, simply place the file in your ONE directory. Both PRS compressed and uncompressed files are supported.
Uncompressed files should have the full name and extension of the file SHADOW_LOCATOR.DFF
.
Compressed files should end with the additional extension, .prs
e.g. SHADOW_LOCATOR.DFF.PRS
.
In order to delete a file, create an empty file with the name of the file and an additional extension .del
.
e.g. Adding SHADOW_LOCATOR.DFF.DEL
would prevent SHADOW_LOCATOR.DFF
from being added to the ONE archive.
Note: The archive builder works in the order Delete
then Add
, so if a file is first deleted, it can be re-added by either the same or another mod.
Disabled by default to improve performance (caching), the configuration has a setting allows for the replacement of files as the game is running exiting the game (i.e. New ONE archive is created every time it is requested from disk.)
This means that, when enabled, if you e.g. replace the files for a character model, exit the stage and start the stage, the new model would load.
Good luck 😛
This project is a spinoff of my AFS FileSystem Redirector.
It is somewhat simplified, gimped here as the file is read in all at once and as such I don't have to worry about the file being read in chunks.
Many of the basic principles from before still apply. Only large conceptual difference is we actually build the ONE archive and keep it in memory to feed to the game, as generally ONE archives are very small < 3MB.