Archipelago
Archipelago copied to clipboard
Core: move PlandoConnections and PlandoTexts to the options system
What is this fixing or adding?
Moves plando connections and texts to the options system. In order to use plando connections and texts, worlds will need to define the option in their options dataclass/definitions, and supported games will have plando connections and texts appear within the template yaml. Additionally, rolled plando connections/texts will appear in the spoiler log.
This includes changes to LttP, OoT, Minecraft, and TUNIC as they use plando connections currently (or plan to in the near future).
How was this tested?
Manually, by generating games using plando connections and confirming that the resulting connection was proper.
Texts was tested by generating a game using the mercenary mode trigger block, and confirming that the text was correctly placed.
No automated testing has been added.
If this makes graphical changes, please attach screenshots.
Excerpt from LttP template:
plando_connections:
# Generic connections plando. Format is:
# - entrance: "Entrance Name"
# exit: "Exit Name"
# direction: "Direction"
# percentage: 100
# Direction must be one of 'entrance', 'exit', or 'both', and defaults to 'both' if omitted.
# Percentage is an integer from 1 to 100, and defaults to 100 when omitted.
[]
plando_texts:
# Text plando. Format is:
# - text: 'This is your text'
# at: text_key
# percentage: 100
# Percentage is an integer from 1 to 100, and defaults to 100 when omitted.
[]
Excerpt from spoiler log:
Plando Connections: Eastern Palace => Tower of Hera (Bottom)
Plando Texts: {'kakariko_tavern_fisherman': 'hey @\nYour mark schemes within a den of evil.', 'sign_ganon': "A hit has been put out on one of Ganon's generals."}
@espeon65536 @silent-destroyer
I'm the one doing the ER and connection plando stuff for Tunic, so I'm approving this in Silent's stead. I currently have this PR up for implementing connection plando: https://github.com/ArchipelagoMW/Archipelago/pull/2864 If the PR I have up gets merged first, I'll PR to your branch to fix any merge conflicts/errors. And if your PR gets merged first, I'll update mine accordingly.
Well, approving the Tunic change anyway. I'll try to remember to actually review this tonight -- it looked fine already just skimming the code, but I want to do test gens and such for an actual review.
@Silvris https://github.com/Silvris/Archipelago/pull/4
Updated for KDL3.
i'm not really sure some of these typing hints are useful since they have
Any
in them and it might be better to force/assert them as the correct type at some point instead?
after thinking about this some I'm not really convinced that the default behavior for Direction makes much sense. I think it's only really that way because of LTTP, but in most of the games does the differentiation between entrance and exit actually mean anything? It certainly doesn't for mine and I worry it might just cause more confusion
Currently, I think just OoT and LttP actually use Direction. Realistically it can probably be added to Messenger/TUNIC should you ever want to support decoupled entrances, but MC and KDL3 will likely never support it. I think defaulting to "both" is fine though, since that covers the most common use cases of connections. Alternatively, we just break really old LttP plando.
Messenger does do decoupled entrances for transitions, but it's still basically just "one way" or "both" for directions; but yes it's completely meaningless for portals. I'll probably end up having plando for portals and transitions as separate options to make that a bit more explicit and give better text. My point is more so that "exit' and "entrance" seem meaningless for most games; is there even a difference between those for oot? I don't necessarily think we have to break LTTP, but it might make sense to make the supported directions customizable by the world :shrug:
With this current system, I can't do
self.options.plando_connections.remove(connection)
, nor can I doself.options.plando_connections.exit = "Shop Portal"
, nor can I doself.options.plando_connections[index] = replacement
, so as far as I can tell there's no way for me to modify the player's plando connections like I used to.
self.options.plando_connections.value.remove(cxn)
. That being said, you will need to explicitly define "Shop" as a valid entrance/exit.
With this current system, I can't do
self.options.plando_connections.remove(connection)
, nor can I doself.options.plando_connections.exit = "Shop Portal"
, nor can I doself.options.plando_connections[index] = replacement
, so as far as I can tell there's no way for me to modify the player's plando connections like I used to.
self.options.plando_connections.value.remove(cxn)
. That being said, you will need to explicitly define "Shop" as a valid entrance/exit.
is there a reason they don't just inherit from OptionList? it has the necessary overrides to do exactly as requested here
is there a reason they don't just inherit from OptionList? it has the necessary overrides to do exactly as requested here
This code would also fail on an OptionList, as it does not override explicit "insert" and "remove", nor does it inherit it from Option or VerifyKeys.