Hi. Took a look at this a couple of weeks ago, before I got really wrapped up in the AI stuff.
I'm interested in porting it into Vacuum, as it would certainly add a lot more things for players to do besides conquering the Sector, but it looks like the chief issue would be making it operate generically for each Station, so that the missions would be auto-generated anywhere in the game. Any thoughts on how I'd go about getting this set up more as a framework and less specifically would be appreciated
It's currently in the process of being revamped into a more generic system- the back-end is now split into Mission Handlers and Missions which are registered with the handler, and the missions have a set of default evaluations (after X time, on fleet combat, on NPC fleet combat) that lead to conclusions.
Calling these evaluations is done by plugins, and I'm currently working on being able to store the required plugins in a mission and have a fleet call its mission to find an appropriate plugin when required- but I'm running into problems with the Janino stack size or something. Planning on posting a thread about the bug sometime soon.
How it currently works:
-You create a handler SectorHandler
-You create a mission MissionA
-MissionA's constructor runs
(e.g. creates FleetA)-You register MissionA with SectorHandler, and it runs its initialisation
(e.g. spawns FleetA)-Every X time, SectorHandler evaluates MissionA (e.g. MissionA checks if FleetA is dead)
-FleetA gets into combat
-PluginPicker checks FleetA, sees it's from MissionA
-PluginPicker checks MissionA, pulls appropriate plugin from it <- this bit doesn't work yet-Plugin processes combat
-Plugin calls MissionA to evaluate if it is now complete
(e.g. MissionA checks if FleetA is dead)-If so, MissionA does whatever you've written for it
-Next X, SectorHandler evaluates MissionA, finds it's finished, unlists it, it goes to garbage
It should be easy to create a framework- basically you'd just define an extension of my MissionFleet class, with constructor arguments for the faction & location & whatever as appropriate, fill in the required functions like encounterDialog and encounterFleet with straightforward things (e.g.
if(!FleetA.isAlive)finish(success=true)), and finish to whatever (e.g.
GivePlayerPilesOfCash()), and have your station dialogs create & register those on your mission handler. However, given the fact that my current version is incomplete, and bodges the plugin selection I'd hold off for now.
(Actually I've just realised in writing this that it should also contain an option to completely replace the InteractionDialogPlugin, rather than just wrapping it in an evaluation after returning from combat)
I'm planning on writing a guide to how to use the framework once it's complete (
I've done so for other frameworky things I've made for my mods), so it may be worth waiting for that. Trying to work from the current BountyMissions is not really a good idea as it's a very specific implementation of a greater framework, and hammering it into a new shape will probably take more work than just building a new implementation of a MissionFleet that does what you want.
Equally my Java knowledge is still not great so the guide may just be teaching grandmothers to suck eggs! It depends how much effort you want to put into understanding my current poorly-documented code :/.
Edit: To be open about it, I'm a bit of a perfectionist and would really rather it not be copied until I'm happy with how it works.
I'll be happy for you to use it when it's finished but still full of bugs(!), but I'm not happy with the underlying framework itself yet.