Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Basic StageHandler #421

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from
Draft

[DRAFT] Basic StageHandler #421

wants to merge 50 commits into from

Conversation

namishere
Copy link
Collaborator

@namishere namishere commented Apr 22, 2024

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 namishere marked this pull request as draft April 22, 2024 21:25
@namishere namishere self-assigned this Apr 23, 2024
@namishere
Copy link
Collaborator Author

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

@nyabinary
Copy link

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

@namishere
Copy link
Collaborator Author

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

@nyabinary
Copy link

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?

@Busybody64
Copy link

What sneeded so far?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants