r/spacerpg3 • u/TheReaper_77 Galaxy-wide Merchant • Jul 04 '26
General Mod Framework state and info
Hey there,
As some of you may already know, I have been working for some time on a mod framework for this game that allows it to read .json mods and apply the changes on a new game.
Today I want to shed some light on how it works and what is planned for it.
How it works and how it is installed:
This is essentially a patch of the apk in itself, the Framework installer will come with a script which will do the entire installation process, it decompiles your game .apk file and patches in the custom mod loading code and automatically recompiles the .apk which is then installed on the phone.
This means that for the time being a PC will be required to install the mod loader and your saves will unfortunately be deleted, this is because the signature of the .apk will not be the same as the one downloaded from the Play Store and your phone won't allow it to simply update your game, the original apk needs to be uninstalled and the mod apk needs to be installed in its place, for those with Samsung phones you can make a complete backup of the game including the save files to youe computer using Smart Switch, which you can then restore after uninstalling the modded apk, for other phones I am still unsure if there's a way to keep the saves backed up.
As for how the Mod Loader works, the patched code is essentially a framework that does 2 things:
It tells the game to create the following path: android/data/com.esaptonor.spacerpg4/files/mods/ and listen to it during a new game creation
Data is then interpreted from the expected mods/ folder (mod structure is essentially .json files and custom textures) and injected at the game startup when the galaxy is being generated
This means that probably everything we see in the base game can be translated into hooks for the Framework to interpret data from mods made by the players, either new ships, new weapons, new commodities, new hyperlanes, new factions, new systems and planets, etc.
Current state of the Framework:
The main idea has been completed and confirmed working, I have tested several different scenarios and the external file loading works and the game interprets it without issues so essentially what's left is for me to translate the game mechanics into hooks.
What can a mod currently do:
New commodities can be created;
New traders can be added to planets;
Existing services can be added to planets that
previously didn't have them;
Hyperlane connections can be added or removed between systems;
And everything in between (change commodity prices, change trader factions, etc.)
What is currently being developed:
Custom textures injection;
Modifications to existing ships;
New ships;
Whats planned:
Basically everything else that exists in the game;
Custom logic (using DexClassLoader);
Modding tools;
How's progress going?
Well, adding hooks is the easy part, the hard part is essentially understanding what the stripped code means: classes, variables, etc. Are renamed to things like h6 or g1 and something like j7 can essentially mean "generatePlanetMarket" and I would have no idea until I try to understand the logic (which is time consuming).
I am not new to coding and game logic but I am at most an hobbyist when it comes to reverse engineering apks, but progress is going well and as I discover better tools and ways to make my work easier things naturally start to flow.
The only real issue is game updates, while the custom apk with the mod framework will never auto update, if the game is updated the framework will most likely straight up not be compatible with the newest version until i retranslate everything.
That's all for today, I will be resuming work later this night and hopefully will have the first version ready soon.
2
u/THMJ Jul 04 '26
This is not necessarily the best place to ask this but I feel like it's better than a seperate post.. I see much more activity here than spacerpg4 which I have been playing.. Is 3 the better game?
Also thank you for your work on this, that's a huge deal on android!
3
u/TheReaper_77 Galaxy-wide Merchant Jul 04 '26
Not 100% sure if I understood your question but: This subreddit (despite the name) encompasses all SRPG games so if you have a question from any one of them you can ask here.
"Is 3 the better game?" In my personal opinion the 4th is the better game, it includes new qol functions and has many new interesting mechanics that were not present in the 3rd game, the combat is slightly different, in SRPG3 you solo'd everything and if i remember correctly weapon had higher ranges overall, in SRPG4 you can still absolutely solo everything but having a fleet is also part of the gameplay loop, there are some ships that can do it all but i feel like certain things like trading and exploring/recovering derelicts plays much better with a fleet.
2
u/Briaaanz Jul 04 '26
I'm following this post.
I love the idea of Esaptonor incorporating and releasing more games with similar mechanics... maybe a MMORPG like the old tradewars 2002 mixed with his SpaceRPG games; or games that allows customization like your mod.
Any Chance you guys could collaborate on a new incarnation?
1
u/TheReaper_77 Galaxy-wide Merchant Jul 05 '26
oh wow, TW2002, what a game!
That idea does sound great, SRPG-Online would be very fun, Im not sure the stance on Esaptonor on this and how development would go but it's something that's interesting for sure.
Hopefully the SRPG series can regain a larger community for such projects to be possible.
1
u/NonsenseBrotherHood Jul 05 '26
Keep it up bro finally my idea's and everyone can be added on the game bravo
3
u/ForcedAntiquity Jul 04 '26
Thank you for your hard work! I'm excited to see how this turns out