Commit Graph

4 Commits

Author SHA1 Message Date
Adam Bird 8b178f9386 RandoV3 fixes for mix/decouple boss entrances 2024-02-20 16:52:42 -05:00
Malkierian 467ee7ad12
Logic class (#3812)
* Convert `Rando::Logic` to a class.

* Readd `LogicReset` as `Logic::Reset` for resetting logic mid-generation-cycle to allow seed generation to actually work.

* Change `IsChild` and `IsAdult` to `CanBe` variants.

* Make it buildable.

* First LogicVar class.

* Revert CanBe changes to Is (adult & child) as I'm no longer sure that it's a good one.

* Update soh/soh/OTRGlobals.cpp

Use existing gRandoContext reference.

Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com>

* Conflict resolution cleanup (plus removing SaveContext references).

---------

Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com>
2024-01-08 08:39:15 -06:00
Pepper0ni c5790d9284
Move Barren handling to before hint generation, Add RandomizerArea enum 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
2023-12-07 18:11:44 -05:00
Christopher Leggett 2698d453bb
More gap-bridging (#3323)
* Initial StaticData and RandoItem class definitions

* Initial implementation of RandoItem class.

* Rerranges RandoItem Constructor parameters

The parameters were rearranged for easy copy-paste from the GET_ITEM macro calls later on.

* Switches static data from map to static array.

Array is all that is needed, since the item list will be contiguous and indexed by the RandomizerGet Enum values.

* Defines part of the randomizer item list.

* Adds more item class instances to item_list.cpp

Up through bottles, many more items still to go.

* Adds song items

* Adds Maps and Compasses to the item_list

* Added Key Items to item_list

* Added Key Rings to item_list

* Added Dungeon Rewards to item_list

* Adds generic items and refills to item_list

* Adds shop items, triforce, and hints

Also added constructors that put the GET_ITEM_NONE data in for these items, since there is no corresponding GetItemEntry for them.

* Adds in the stages of progressive items

These are present for GetItemEntry purposes, and aren't really meant to be used in seed generation (unless we find a need for it later on.)

* Remove GetItemEntry data from progressive items

* Moves/adds function definitions to item/item_list

* Refactors GetItemEntry data

It's now a pointer to memory instantiated on the heap in the constructor. These are shared pointers so the memory is freed if any of the item instances get deconstructed (which they shouldn't but just in case.)

* Adds item class member for if item is progressive

* Removes unneeded stuff from initializer list macro

* Replaces relevant `uint32_t`s w/ `RandomizerGet`s

Also replaces calls to the ItemTable method with StaticData::RetrieveItem

* Switches our runtime code to use the new itemList.

* Changes just enough hint gen code to compile

* Initial Definition of Location Class

* Initial Implementation of Location

* Fixes some names and definitions.

* Extracts ActorID and SceneID enums to separate files.

This allows importing them without causing weird conflicts in cpp files when importing the z64scene.h and z64actor.h files directly. Now you can just import z64scene_enum.h and z64actor_enum.h instead. The two old files also import these new files so that existing setups still work as expected.

* Replaces the forward definitions with the new imports.

* Adds missing data for RandomizerCheckObjects.

* Definition and first entry of locationTable

* Added Mido's House Locations

* Added locations up through lost woods.

* Adds in Hyrule Field locations.

* Adds Lake Hylia locations

* Adds location name comments

* Adds Gerudo Valley Locations

* Adds Gerudo Fortress locations.

* Adds the Wasteland and Collosus locations

* Adds Market locations

* Adds Hyrule Castle locations.

* Adds Kakariko and Graveyard locations.

* Adds Death Mountain checks.

* Adds Goron City locations

* Adds Death Mountain Crater locations

* Adds Zora's River locations

* Added Zora's Domain Locations.

* Added Zora's Fountain locations

* Adds Lon Lon Ranch locations.

* Adds Deku Tree locations

* Adds Dodongo's Cavern Locations.

* Adds Jabu Jabu's Belly Locations

* Adds Forest Temple Locations

* Adds Fire Temple Locations

* Adds Water Temple Locations

* Added Spirit Temple Locations

* Some of shadow temple locations.

* Adds remaining Shadow Temple locations

* Fixes a leftover merge conflict

* Adds Bottom of the Well locations.

* Adds Ice Cavern locations

* Adds GTG locations.

* Adds Ganon's Castle and Tower locations

* Adds dungeon Gold Skulltula locations.

* Adds Overworld Gold Skulltula locations

* Adds dungeon reward locations

* Adds Heart Container Locations

* Adds Cutscene and Song locations

* Adds Cow locations

* Adds Shop locations.

* Adds hint locations

* Adds function for retrieving the Location data.

* Initial definition of ItemLocation structure for tracking runtime data

* First push on converting code to use new location definitions

* Changes hints to use the new tables

* Further conversion of hints to new definitions.

* Adds new Hint and Location IDs to area tables

* Moves areaTable to use new RandomizerRegion keys

* Removal of 3drando/item_location files.

* Uses new RandomizerRegion keys in entrance.cpp

* Final push for removal of massive keys.hpp enum

* Uses new SceneID Enum Values

* Remove RandomizerCheckObject structs in favor of new location list.

* Fix a few stragglers to successfully build

* Rename of RandoItem to just Item, but in the Rando namespace

* Adds static hints (Light Arrows, Altar text, etc) to the new Hint table.

* More hint related fixes/edits

* small fix for #include path

* Fix various miscellaneous issues related to seed gen and spoiler parsing.

* Handle progressive items correctly.

* Fixes some hint generation logic

* Fix a few GetItemEntry niche bugs.

* Adds missing shop GI Entries

* Formatting fixes

* small formatting fix

* Namespace StaticData under Rando

* Added a note about a potential use-after-free.

I confirmed the actual pointer in question isn't currently being used, but I added the note as a reminder to fix it later and/or as a warning to anyone who changes how the return value is used.

* Fixes missing location table entries

* Fixes LUS submodule and removes now-unused code

* Resolves weird duplicate definition issue

* Fix missing include

It was missed because not being included wasn't an issue on Windows.

* Fixes error present on Linux builds

* Fixes some issues with excluding locations

* Updates the Resolve Exclusion conflicts function

not sure if actually used, will look into that more later

* Removes some duplicate RGs

* More fixes of duplicate RG values.

* Fix a few duplication issues in the check tracker.

* Fix progressive bombchus.

* Minor typo fix, shouldn't really be affecting anything though

* Should fix some of the remaining check tracker issues.

* oops wrong boolean operator

* Fix skulltulas in the check tracker.

* oops, missing comma

* re-formatting of HintStone locations

* Fixes issue when picking up second Progressive Bullet Bag

* Hide bombchu bowling bombchus

* Fixes missed skullScene in location_list

* Reformats shop items

* Re-formats cow checks

* reformat song locations

* reformat "cutscene" checks

* reformat heart container locaitons

* reformat Boss/Dungeon reward checks

* Hide Triforce Completed if not playing Triforce Hunt

* Fixes incorrect chest param

* reformat GS Tokens locations and cuts down on duplicate data

* reformat Ganons Castle checks

* reformat GTG check locations

* Prevents Gift from Raoru from appearing in the check tracker

* more reformatting (botw, ice cavern, shadow temple)

* Should fix a couple more check tracker checks

* reformat spirit temple checks

* reformat water and fire temple checks

* fix RC_ZR_GS_ABOVE_BRIDGE flag typo

* reformat Forest Temple checks

* Fix RC_LW_TRADE_ODD_POTION in check tracker

* reformat child dungeon locations

* reformat overworld locations

* reformat item entries

* New Item Override system

* use new ItemOverrides and use ItemLocations table for getting items

* Saves/Loads directly from/to new ItemLocation table with overrides for traps

* Removes gSaveContext.itemLocations

* Don't load spoiler file on boot automatically.

Currently this means the old spoiler will have to be manually dropped or a new one generated in order to make a new rando file. Next I want to make it so that:
1. The Randomizer Quest button on the file select menu is always unlocked, even if a spoiler is not loaded.
2. If it's selected and a spoiler is not loaded, a menu will appear that asks if you want to generate a new seed or re-generate the previous one (if a spoiler file is present).
3. On choosing to generate a new one, you may also get an in-game menu to quickly apply a preset before generating (not sure if I'm going that far just yet).
4. After that, a seed is generated and you are taken back to the file select screen with the new file present.
5. If a seed is generated via the menu ahead of time, the CVar for loading the spoiler file will be set, but the spoiler file will not be parsed. All the data needed to actually play the randomizer at that point is
already in memory and in the save file (or at least I'll make it so that it is if it isn't already).
6. If a spoiler file is dropped over the window, the spoiler file is loaded, but it will only be parsed to get the seed and the settings, then the playthrough will be generated from scratch with that data. Thus allowing
for hints to be in the user's language of choice no matter what language the spoiler file was generated in.
7. Additionally, there will be a plandomizer mode that, if enabled, causes dragging and dropping a spoiler file to read the entire spoiler file instead of just the seed, and making a new file will use the data from there
instead of generating a new seed. This in particular may be expanded to have a "plando file" that contains more info than a spoiler file would normally have, such as cosmetic data and a more fleshed out
custom message syntax for various types of custom hints and whatnot. But that will be probably much later.

* Auto-gen rando seed when making a new rando file.

Also adds new logic for displaying the seed hash icons. Now, it is displayed in the following situations:
1. On the confirmation page when loading a rando save, the hash icons for *that save* are displayed.
2. On the name select screen after generating a seed, the hash icons for the seed that was just generated will be shown.
3. If you have dragged a spoiler log onto the window, the hash icons for that seed will be displayed while randomizer is selected on the quest select screen.
Currently the spoiler is just ignored, as the logic for pulling the settings from the spoiler file and regenerating the same seed has not been coded yet.

* Fix a few typos/bugs

* Partial conversion to new Settings/Option class

* Further conversion to new settings/options classes

* New settings struct (not fully working, need to wire it up to SaveManager)

* Move save files to new settings struct. Also fixes MQ options to match 3drando

* Fixes some spoilerfile related issues

* Cleans up now unused arrays

* Fixes some unhandled entries in parse settings switch case

* Reimplements parsing of settings on file drop to re-generate seeds

* Move merchantPrices into ItemLocation tables.

* Move hints to new struct

* Fixes a few seed gen bugs surrounding hints

* Fix treasure chest game.

* Relocate Entrance Shuffle code into ctx

* Move entrances to new context at runtime

* Remove now unused code from SaveContext and randomizer.cpp/.h

* Fix non-windows builds?

* Moves Dungeon Quests to new context

* Move trials into new context

* Whoops, forgot to construct the Trials in the context.

* Fixes accidental nullptr reference

* Fixes bug with saving MQ dungeons

* Implements plando mode and removes now unused code.

Largely untested, expect some bugfixes.

* prevent a multiple definition bug

* another attempt to fix the gSeedTextures multiple def error

* Fixes some minor hint issues from conflict resolution

* Some additional glue needed for merge

* Fixes another couple of miscellaneous issues/inconsistencies.

* A few french corrections

* Makes CVar gRandomizeWarpSongText match the checkbox default value.
2023-11-13 13:25:37 -05:00