REPENTOGON icon indicating copy to clipboard operation
REPENTOGON copied to clipboard

[DRAFT] Basic StageHandler

Open namishere opened this issue 1 year ago • 8 comments

This new class allows a couple things currently:

  • Binaries can be loaded arbitrarily with StageHandler.LoadBinary([xml path])
  • Loaded binaries can be retrieved arbitrarily with StageHandler.GetBinary([xml path])
  • These binaries can be used with RoomConfig.GetRandomRoom/GetRoomByStageTypeAndVariant in place of the Stage variable
  • Room weights are automatically reset on starting a new run
  • Binary room weights can also be reset manually with StageHandler.ResetRoomWeights([xml path]/RoomConfigSet)/ResetAllRoomWeights()

While not feature complete, this also starts work on allowing custom stages:

  • content/stages.xml is now parsed
  • Allows specifying all params normally found in a stages.xml entry, with the change of name being used as an identifier and displayname being used as the string to show ingame
  • Content stages can be loaded with StageHandler.LoadStage([name])
  • Will be loaded into the basestage param
  • Base stage can be restored with StageHandler.RestoreStage(StbType)
  • content folder binaries can be appended onto existing ones with StageHandler.AppendBinary([path/RoomConfigSet], content stb path)
  • Provides helper functions IsStageOverriden, GetStageIdForToken, GetTokenForStageId

This does not currently add support for:

  • ~~Custom fxlayers.xml~~
  • Custom bosspools.xml
  • Any fiddling with the base stage beyond what's in stages.xml (will inherit all other properties such as stage health, damage to player, deal chance)
  • Saving what overridden stage the player is in
  • Auto loading and restoring of overridden stages between saves
  • Retention of binary room weights after closing the game

Additionally, entering an overridden stage, closing out of the game, and continuing the save without overriding the stage beforehand will crash.

Internally, this modifies how stage binaries are loaded by hooking the function to store the resulting RoomSet in a map, then on future loads checking if the requested binary was already loaded and retrieving the stored version instead. Testing will be required to see if this has any side effects with things like room weights, though my understanding suggests that won't be an issue. This is logged in the base log.txt, while StageHandler functions are logged in repentogon.log.

namishere avatar Apr 22 '24 20:04 namishere

Now has full fxlayers.xml stage (stages for fxRays) and backdrop support.

namishere avatar Apr 29 '24 22:04 namishere

So this would be a step into making the Custom Stage API mod obsolete?

nyabinary avatar Jul 27 '24 21:07 nyabinary

yes, but I'd really like to figure out how to make this work with continued runs + there's some other things that need doing like saving room weights

namishere avatar Jul 27 '24 21:07 namishere

yes, but I'd really like to figure out how to make this work with continued runs + there's some other things that need doing like saving room weights

What is needed to make it work with continued runs is there any specific blockers?

nyabinary avatar Jul 28 '24 17:07 nyabinary

What sneeded so far?

Busybody64 avatar Aug 29 '24 20:08 Busybody64

What sneeded so far?

I mean Rep+ got released, so I assume it has to be updated to support Rep+?

nyabinary avatar Feb 08 '25 19:02 nyabinary

REP+ support as a whole is our primary focus at the moment. Also, stage support is a big feature that still needs a lot of work to get right.

It will come eventually, please be patient and try to refrain from chatting in our pull requests.

ConnorForan avatar Feb 08 '25 19:02 ConnorForan

Alright, sorry. Best of luck to all you wonderful modders!

Busybody64 avatar Feb 09 '25 00:02 Busybody64