Eein / octopath-autosplitter

MIT License
2 stars 0 forks source link

Golden Axe split addition #29

Open yoszarian opened 2 years ago

yoszarian commented 2 years ago

There is a misc. category run where you steal the Golden Axe (https://www.speedrun.com/octopath#Golden_Axe). The end of the run is when the steal is executed in Clearbrook, so this would be a split similar to the 3% steal for Therion's story.

Eein commented 2 years ago

This one is a little tricky - therions 3% has a story flag attached to it, but unless this one does it would require some additional manual intervention.

This may require scanning all item slots for the golden axe or something if there isn't a good pointer to the item.

ak505188 commented 2 years ago

Yeah, this would probably require tracking the NPCs inventory or something of the sort. In terms of structure, maybe we can get some hints from the randomizer developers?

Eein commented 1 year ago

Did some additional work on this - based on my testing the inventory seems like a hashmap based tracker for items, and its not consistent at all (it sorts them when it loads them)

However after digging through the game files i found: AKSFieldNPCCharacter_C with some actions around targeting the specific character and how it loads in specific data around what items they have,

The Player Character class stores a reference to the character you're talking to - i'm thinking i can check their items from here; going to take a bit more work though :)

Edit: Found some information - just need to dive deeper:

UFieldCommandPurchase_C > 
TArray<struct FListWidgetItemData>                         ShopItemList;                                            // 0x02D8(0x0010)
TArray<int32_t>                                                        PurchaseIndexList;                                     // 0x02E8(0x0010)

FListWidgetItemData
// has some fields describing visibility, can maybe get the new state after purchase

edit: tested all options, and felt close, but digging into unreal TArrays on the heap seems very inconsistent and likely wont be ideal. It may not be worth chasing this unless we implement some more specific code on parsing TArrays and their contents

This may be easier with the new runtime, but no promises on when thats officially gonna be out :)