I've been working on a difficulty mod that adds a lot of features and big changes to Starsector, and the only way I could do it without breaking compatibility with content mods (which is very important), or do it at all, was to overwrite some of the class files in the starfarer.api.JAR. Is it okay to upload a mod like that to this forum? It's compatible with every mod on the forum since no other mods do this, but since it overwrites some game files I thought I'd ask.
I've been working on a difficulty mod that adds a lot of features and big changes to Starsector,Look like a "balance mod", we have already 5-6 mods like that ^^, so no issue to post it. If you want post it on the mod list, this thing will be probably a total conversion mod, i think, or Megamods.
I've been working on a difficulty mod that adds a lot of features and big changes to Starsector, and the only way I could do it without breaking compatibility with content mods (which is very important), or do it at all, was to overwrite some of the class files in the starfarer.api.JAR. Is it okay to upload a mod like that to this forum? It's compatible with every mod on the forum since no other mods do this, but since it overwrites some game files I thought I'd ask.
Many mods do that, but for the part of compatibility, you have really checked every top-tier popular mods?
Nexerelin overwrite many files of the game like the market and you need to override marketAPI of Nexerelin if you want have special market per exemple.
Release it on the Modding first and people will see if this is really compatible with many mods.
To answer the question, I have some reservations about a mod doing this. Not the least is that *right now* this would be the only mod doing it, but if this was an accepted way of doing things, that would change in a hurry, and we'd have a bunch of mutually-incompatible mods.
I'd much rather these kinds of things be done through the modding API, and, where that's not possible, result in requests for API changes/additions, since in that case, we'd be improving the API for everyone. That's slower going, certainly, but I think things would end up in a better place in the long run.
There's a lot of stuff I can't do within the API, like changing how FleetFactoryV3 works and generates fleets, and how ship salvaging works. If there's a way to overwrite or alter vanilla plugins through the API, then the total changes to the API would be FleetFactoryV3, RemnantSeededFleetManager, DmodManager, BuffmanagerAPI, LuddicPathCellsIntel, and ShipRecoverySpecial. There's about a dozen alterations to existing plugins.
It's a pretty big project and I'd love to see people in the community using it. I'd like to release the mod soon and then update it when the API gets updated, but if that's not okay with you I'll keep the mod between friends so it doesn't become a thing.
I've been working on a difficulty mod that adds a lot of features and big changes to StarsectorI'm looking forward to finding out how this turns out! Hopefully this means you've already implemented some of my plans for ruthless sector so I can cross a few things off my list ;D
As far as RemnantSeededFleetManager and LuddicPathCellsIntel, as well as ShipRecoverySpecial - it *seems* like it should be possible to override these "normally"; am I missing some aspect of this?
Yeah, I'd hate to say "no" given that you've already put a bunch of work into it, and, frankly, it sounds interesting. So I'd say, at least provisionally, go for it!
Since we cannot really anticipate any possible issues without it, can you please post a list of replaced scripts and also maybe broadly what you did overall? I would like to believe you, but to be perfectly honest, I can't help but to suspect that what you been working on will affect some current or future mods.
Unless something also alters the same files in the .api in the future, there shouldn't be any conflicts even in future content or feature mods, except maybe with anything that replaces vanilla plugins like FleetEncounterContext to add features. Nexerelin and Ruthless Sector both do that and are compatible though.FleetEncounterContext is already contested real estate. In addition to Nex and ruthless sector, SWP overwrites it for IBB bounties and MesoTroniK's upcoming THI update will overwrite it as well. The only reason ruthless sector doesn't conflict with those other mods is that I wrote a FleetEncounterContext specifically for each one of them that provides the functionality of both ruthless sector and the other mod. If your mod overwrites FleetEncounterContextImpl directly in starfarer.api.jar, then I suspect all five of these mods will overwrite your own since they normally overwrite vanilla.
Oof... given 5 (!) mods overwrite that one, what API changes do you think would be needed to remove that?Well, the API could maybe provide listeners for some of the functionality people get from overriding FleetEncounterContexts, but that would have complications, most of which I probably wouldn't anticipate. Alex might have some bright ideas, but I can't come up with anything better than "if it ain't broke don't fix it."
I'm changing getRecoverableShips() in FleetEncounterContext, which doesn't get modified by RS, Nex, or SWP currently.
... and those mods then derive from it, so if they don't change getRecoverableShips(), they'll just inherit the functionality and it would work. At least, that's what I'm getting from this.Oh, that's right. I was thinking custom FleetEncounterContexts would continue to extend the vanilla Impl version, but obviously that wouldn't be the case if it were replaced in starfarer.api.jar.
@NoFoodAfterMidnight: Another potential issue is that any exception that occurs within your code will look like it took place in vanilla code. That could make things very difficult to troubleshoot, especially for anyone who doesn't know about this aspect of your mod's implementation. It might be worth catching and re-throwing any error that occurs in your overriden API methods so you can add a message to the log about how your mod encountered an error.
@NoFoodAfterMidnight: Another potential issue is that any exception that occurs within your code will look like it took place in vanilla code. That could make things very difficult to troubleshoot, especially for anyone who doesn't know about this aspect of your mod's implementation. It might be worth catching and re-throwing any error that occurs in your overriden API methods so you can add a message to the log about how your mod encountered an error.
public class FleetFactoryV3 {
public static CampaignFleetAPI createFleet(FleetParamsV3 params) {
try {
myObject.doModStuff();
vanillaObject.doVanillaStuff();
} catch (Exception e) {
Global.getLogger(FleetFactoryV3.class).error("NoFoodAfterMidnight's difficulty mod encountered an error!");
throw e;
}
}
}