Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Adding Abyssal events?  (Read 382 times)

Talkie Toaster

  • Captain
  • ****
  • Posts: 259
    • View Profile
Adding Abyssal events?
« on: March 08, 2024, 07:42:41 AM »

I'd like to try adding some new possible spawns into Abyssal Hyperspace - but it doesn't look like the info on how has made it onto the wiki yet. From a quick poke, I'm assuming the process goes:

  • Create a new EncounterCreator, probably starting from a copy of AbyssalRogueStellarObjectDireHintsEPEC
     
    • This extends AbyssalRogueStellarObjectEPEC which generates the base system.
    • If you want to do custom systems, rather than just adding an encounter to a default random system, copy AbyssalRogueStellarObjectEPEC.
     
  • Create your own enums containing the list of encounters you want (or for a 'linear' quest chain a public static intwith quest_stage or similar).
  • Edit the addSpecials methods to write the encounters for your new enums/quest stages/whatever.
  • Register your new creator with EncounterManager.CREATORS.

I guess there's two bits I'm not quite sure on:
  • How to determine the frequency of your new encounters compared to the base Abyssal encounters.
    • The getFrequencyForPoint method calls AbyssalFrequencies.getAbyssalRogueStellarObjectDireHintsFrequency to get it.
    • This then refers to a hard-coded HyperspaceAbyssPluginImpl.DEPTH_THRESHOLD_FOR_XXX in HyperspaceAbyssPluginImpl.
    I'm not entirely sure if adding a new Abyssal EncounterManager without editing the base AbyssalFrequencies public static floats will end up upping the total number of encounters, or just add a new set to the pool?
  • Where to register your new creator with the vanilla EncounterManager (though this is probably just a 'I'm not a Java programmer so I don't know best practise' thing).

The basic outline of what I want to do is e.g.
  • Add a pool of 3 encounters
  • Once you've encountered all of them and they've removed themselves, add another 3 encounters to the pool.
  • Then probably do a single final encounter and zero the frequency of this new EncounterManager type (remove it from the EncounterManager.CREATORS array?)
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Adding Abyssal events?
« Reply #1 on: March 08, 2024, 08:35:00 AM »

yeah, this is all basically correct.

as for your questions -

1 - you just need to extend either BaseEPEncounterCreator or AbyssalRogueStellarObjectEPEC & override the getFrequencyForPoint() method, you can then have that return whatever value you'd like

1b - adding a new manager will probably be a bad idea, but just adding your creator to the CREATORS list should work fine.

2 - you can do this with your mod's modPlugin & it's various methods - if you want to go with multiple discrete creators for each encounter I'd use onGameLoad(), that gets called after the save has been loaded & will allow you to only add the encounters that haven't already been seen (though might cause some wierdness with loading saves after the encounters have already been added? could probably just brute force past that by removing them all before adding them again?).

Alternatively, you could have a single creator that gets added to the list in onApplicationLoad() (which gets called once when the game launches), then have that do the checking for what encounters should be allowed to spawn when the player is actually in-game.

hopefully my ramblings make sense

Talkie Toaster

  • Captain
  • ****
  • Posts: 259
    • View Profile
Re: Adding Abyssal events?
« Reply #2 on: March 08, 2024, 11:42:47 AM »

Alternatively, you could have a single creator that gets added to the list in onApplicationLoad() (which gets called once when the game launches), then have that do the checking for what encounters should be allowed to spawn when the player is actually in-game.

hopefully my ramblings make sense
Fab, thanks! I think I'd probably do that, as that seems more in line with how Alex's done his. Though interestingly it seems to work by removing options from the enums on AbyssalRogueStellarObjectEPEC. Is there anything I have to do ensure those changes persist across saves? I'd have assumed that each load adding a new AbyssalRogueStellarObjectDireHintsEPEC to the EncounterManager.CREATOR array would have default values for everything again, but I don't remember re-visiting abyssal encounters across loads. Though maybe you do, and I just haven't rolled doubles yet.
Logged