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

Check Tracker Update #2668

Merged

Conversation

Malkierian
Copy link
Contributor

@Malkierian Malkierian commented Apr 4, 2023

This is a rework of the check tracker system. Here's what's changed so far:

Checks only update on check collection, and most of the time the check to update is found directly without having to check through the pre-existing HasItemBeenCollected which does all of them. Because of this, there is no longer a need for a "performance mode".

Check tracker data has been implemented and stores RandomizerCheckShow, skipped status, and an as-of-yet unused hintItem for each RandomizerCheck in an array that holds every check. Tracker data saving has been tied into the Sectional Save functionality.

"Collected" and "scummed" item status has been fully implemented. When a check is collected, its status is changed to RCSHOW_COLLECTED and the data is saved. During tracker data save, anything marked as collected is converted to RCSHOW_SCUMMED in the save file itself, but stays RCSHOW_COLLECTED in memory. If the game is restarted without saving, then it will automatically be shown under the "seen" conditions (up with other uncollected checks), including color set in settings. When the game is saved, everything that is still marked as "collected" is converted to "saved", and then the data is saved. Nothing yet for items you've looked at but not collected (like freestanding PoH checks or shops. This is what hintItem is meant for later on).

Some checks require delays until after a textbox is closed for the check to be discoverable. This means that OnFrame and OnTransitionEnd are hooked into, as well as a temporary hook at the end of a message box close to trigger the frame counter (HasItemBeenCollected's checks mostly aren't updated until 2 frames after a textbox is closed).

Skipped items now count toward area totals for purposes of area completion calculation.

Vanilla runs are fully tracked with a tracker manually populated via new bool vanillaCheck on RandomizerCheckObject.

Autoscroll functionality works on all scenes/areas now, including grottos.

OnTransitionEnd now works for transitions between Haunted Wasteland and either Gerudo Fortress or Desert Colossus.

OnShopSlotChange hook added, which is used for the shop seen item functionality.

New option to remove shop items 1-4 (right side checks) from the check tracker, enabled by default.

All other functionality should be the same as what currently exists in develop when not overridden by these changes.

For anyone who tests this build, please report any broken checks in comments here or in the tracker rework thread on Discord. There shouldn't be many, if any, but I can't assume I got all the niche ones.

Build Artifacts

Malkierian and others added 30 commits February 28, 2023 16:30
Data file loads, saves, deletes, and is created properly.
 - Need to run `HasItemBeenCollected` when creating in case of mid-seed regen.
Organized checks into maps set by area.
Areas show in tracker.

 - Checks pulled from checkObjectsByArea are not currently listed.
 - Areas are being assumed completed and hidden at the start.
…d it in every time a save is load. rcObjects doesn't contain Link's Pocket location (duh).
Skipped items are properly sorted and formatted.

Saved items contribute to an area's gotten/skipped checks on load.

Changed skipped items default main color to gray.

General code cleanup.
Tried to enable scum checking on save.
…. Loading now works 100%, but entries in checkTrackerData are disappearing in code somewhere, causing issues with later checks.

Scummed color now displays properly.

Collected but unsaved displays properly.

Unchecked, Skipped, Seen and Scummed checks all have arrows for skipping/unskipping.

Counts a little messed up, probably double adding skips.
…ck` to PlayState to allow assigning of last actor to give an item. This allows precise tracking of GS, freestanding PoH, etc. Works for chests too. Currently does not work for shops, unknown for normal NPC gives. Doesn't track last gives for non-checks, like drops from grass, pots, crates, etc.
…checks. Implemented `pendingSaleCheck` to back out of an RC check cycle if `gSaveContext->pendingSale` is not NONE when `OnItemReceive` is called, processed through `OnSaleEnd`. This should be the final change necessary to streamline the checks.
…st actors that aren't added to `GetCheckFromActor`. This triggers a 2-frame countdown to check with `HasItemBeenCollected` since half of the methods in there aren't updated until after a text box closes.

Added scene tracking to get last scene so that checks in scenes that span several overworld areas could be tied to their areas properly.

Modified tracker data creation to apply Link's Pocket and Song from Impa conditionally based on randomizer settings instead of just being assumed to be done. May need modification for checking click and drag spoiler loading.

Removed the scene equivalence check from CheckChecks so that an entire area is checked each time to avoid issues with, e.g., leaving a shop before a pending sale finishes.
…or settings loaded from drag and drop spoilers.
Changed check color defaults.
Some individual check fixes.
This was referenced Sep 14, 2023
Malkierian and others added 3 commits September 14, 2023 14:55
…ku shield to trigger KF shop item 3 wherever you get the shield.

Renamed `vanillaCheck` to `vanillaHundoCheck` to (supposedly) clarify the meaning of the usage.
Copy link
Contributor

@briaguya-ai briaguya-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall this is looking really good! i'll want to read through all of it again in a bit more depth before approving, but based on what i've read so far i don't expect i'll find anything too problematic.

i left quite a few comments, mostly just questions that will hopefully spark some conversation

thanks for taking this on! i know it's been in progress for a long time, i'm super excited to see it all come together!

soh/soh/Enhancements/randomizer/randomizer.h Outdated Show resolved Hide resolved
soh/soh/Enhancements/randomizer/randomizerTypes.h Outdated Show resolved Hide resolved
soh/soh/Enhancements/randomizer/randomizer_check_objects.h Outdated Show resolved Hide resolved
soh/soh/OTRGlobals.cpp Outdated Show resolved Hide resolved
soh/soh/UIWidgets.cpp Show resolved Hide resolved
Malkierian and others added 2 commits September 18, 2023 09:11
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
@Malkierian
Copy link
Contributor Author

Making mention now, I've tested this with #3088 and it fixes poes and works with fishing, so I'm marking this as requiring #3088 and reverting the fishing check restoration.

Copy link
Contributor

@Archez Archez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm satisfied with where this is at for a V2 🚀
Great job on this and carrying it over through the changes with develop!
Excited to see the future of this after the rando changes 🙂

Copy link
Contributor

@Pepe20129 Pepe20129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After doing multiple randos with this build, I didn't see any issues remaining.
There are a few thing that could be added (hint tracking for example) but they're better left for a v3 to avoid even more scope creep.
Very good job with this!
These are really good improvements and I can't wait until its merged!

@garrettjoecox garrettjoecox merged commit 70a83f6 into HarbourMasters:develop Oct 4, 2023
8 checks passed
@Malkierian Malkierian deleted the check-tracker-availability branch November 5, 2023 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking This PR contains code that will be needed for another feature or bugfix to be PR'd later
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants