Skip to content

Conversation

@Pepper0ni
Copy link
Contributor

@Pepper0ni Pepper0ni commented Sep 16, 2023

To avoid conflicts, This commit includes #3060. It is intended for that to be reviewed and merged in first, or to be skipped altogether in favour of this. This PR is to bring awareness of my other work relying on it, so this can have have more eyes on it for longer, and for closure on my end.

A refactor of hints.cpp designed to minimise copied code and implement some unimplemented features.

User-facing features:

  • Hint copies are now implemented. Note that due to the already existing settings this means strong and very strong hint settings will have 2 copies of all woth and always hints.
  • In the Spoiler log hints list, hint type will now describe the exact pool the hint was pulled from (Song, Dungeon, Overworld, Always etc:) instead of just "Item".

Codebase changes:

  • Fixed hint settings are working, but are not currently implemented into any settings default.
  • Most of the "create X hints" functions have been merged into 1 "CreateRandomHint" function, taking an argument for hint type. The exceptions are for junk hints and trial hints.
  • HINT_TYPE_ITEM has been removed, with the current "any item" implementation being move to HINT_TYPE_RANDOM due to the latter being more descriptive of what it does (it's a truly random location) and to clear up some cases where the same hint type would use HINT_TYPE_ITEM and HINT_TYPE_NAMED_ITEM in different contexts.
  • The hint type enum has been reordered to allow for cleaner code in CreateRandomHint.
  • The weighted randomness system used in hint selection has been rewritten to not rely on a vector of hint types the size of the weights allowing for better handling of running out of hints by letting me easily change the weights mid-generation.
  • The code now chooses what types of hints to place before placing any, then places the hints in order of type. This mitigates an already existing bug where a non-always hint could point to a barren location if it was generated first, by ensuring that barren hints are generated first if at all possible. The issue can still occur if one of the later hints fails to place, and then a barren hint is generated to fill the space.
  • .order has been removed from hint settings as it was unused, is not a part of my vision for future hint settings updates and I am placing hints in a hardcoded "sane" order to mitigate the above bug.
  • Entrance hints have had their weight removed and left in a comment until they are implemented
  • HintTypeNames is now an array instead of a map, to simplify code and as a minor optimisation.
  • Junk is hard coded to be 1 copy, to avoid insane settings causing problems with low numbers of hint stones.
  • Dampe, Grep and Sarias hints now share a function, and the text has moved to the HintTable
  • Sheik and Ganondorf's text function has been merged due to both referencing light arrows, and the fun text has been moved separate as that function is something i would convert to use the the aforementioned function once the special "start with" handling is ported (I am not confident with the initial items systems yet, so don't want to mess with it)
  • The Hint text category "LightArrows" was converted to "OtherHints", and also holds things like the dampe and greg hint text.

Build Artifacts

@Pepper0ni Pepper0ni changed the title Refactor CreateAllHints and add support for hint Copies and fixed number of hints. Refactor Hint Creation and add support for hint Copies and fixed number of hints. Oct 12, 2023
@Pepper0ni Pepper0ni changed the base branch from develop to develop-rando October 15, 2023 22:05
@garrettjoecox
Copy link
Contributor

@Pepper0ni was the LUS update intentional? Seems like that should probably go in separately, I can't imagine it enables any of the other changes

@Pepper0ni
Copy link
Contributor Author

Bad submodule conflict handling, and trying to do it properly may have just destroyed a separate PR. Am going back to this once I have figured out exactly what state that screwup left me in

@garrettjoecox
Copy link
Contributor

garrettjoecox commented Oct 15, 2023

Bad submodule conflict handling, and trying to do it properly may have just destroyed a separate PR. Am going back to this once I have figured out exactly what state that screwup left me in

It looks like that might just be the last commit that's the culprit, you could just try resetting that last commit git reset HEAD^1 and force pushing (but obviously make a backup)

@Pepper0ni Pepper0ni force-pushed the HintCopies branch 3 times, most recently from 032fb64 to a4e6da7 Compare October 22, 2023 15:54
Pepper0ni added a commit to Pepper0ni/Shipwright that referenced this pull request Oct 27, 2023
@garrettjoecox garrettjoecox merged commit 051314e into HarbourMasters:develop-rando Nov 2, 2023
Pepper0ni added a commit to Pepper0ni/Shipwright that referenced this pull request Nov 4, 2023
Pepper0ni added a commit to Pepper0ni/Shipwright that referenced this pull request Nov 9, 2023
Pepper0ni added a commit to Pepper0ni/Shipwright that referenced this pull request Nov 16, 2023
Pepper0ni added a commit to Pepper0ni/Shipwright that referenced this pull request Nov 30, 2023
Pepper0ni added a commit to Pepper0ni/Shipwright that referenced this pull request Dec 7, 2023
leggettc18 pushed a commit that referenced this pull request Dec 7, 2023
…um and other cleanups (#3339)

* Initial wothCandidates change, pushed early foreseeing conflicts

* Implement better barren handling, waiting on #3205

* pls save next time VS code

* Finish implementation of barren and randomizer area refactor

* Apply function changes to develop merge

* Fix double default decleration issue

* change some var types for uniformity

* Fix post merge differences to the point of building and generating randos

* Address reviews

* address more reviews
@Pepper0ni Pepper0ni deleted the HintCopies branch March 13, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants