OdysseyDecomp
OdysseyDecomp copied to clipboard
The file list should be sorted alphabetically
The object names in the file list should be ordered alphabetically since we've come to the conclusion that Nintendo probably used a globber that links object in alphabetical order based on their names. For this reason I added the --check-object-ordering flag to tools/check a while ago. The idea is that this flag would be added to the "compile and verify" workflow to make sure that PRs don't break the alphabetical ordering when adding, removing or renaming splits. However the current file list has 70+ alphabetical ordering issues and these issues need to be fixed by coming up with new names for the objects that break the ordering before it can be enforced in a workflow
Your test does not cover some special cases yet, see these examples:
A:
warning: Object Boss/GiantWanderBoss/GiantWanderBossStateOnGlass.o is placed before Boss/GKShip/GKShip.o, breaking the alphabetical ordering
warning: Object Boss/Koopa/KoopaCappyEyes2D.o is placed before Boss/Koopa/KoopaCapScaleAnimator.o, breaking the alphabetical ordering
warning: Object Enemy/Togezo2D.o is placed before Enemy/TRex.o, breaking the alphabetical ordering
B:
warning: Object Boss/Stacker/StackerStatePanic.o is placed before Boss/GateKeeperDemo.o, breaking the alphabetical ordering
For A, make sure you ignore the case of entries - For the example of KoopaCappyEyes2D followed by KoopaCapScaleAnimator, the names are pretty definitely correct. Note that p comes before s in the alphabet, but as the second one uses an uppercase, your script assumes that it should've been ordered before the other one - which is not the case, so p followed by S should be allowed.
For B, note that the files in the upper directory are handled after all subdirectories. Alternatively, I'm wrong about this and the file should be moved into Boss/Util/GateKeeperDemo.o, if you can find examples that show the other way being wrong as well.
Regarding the uppercase thing: It does that because uppercase letters are first in the ASCII range and rust sorts Strings by byte value. I can of course change it to normalise the strings, but what matters isn’t what “makes sense”, but rather how the globber Nintendo used works. I asked about how I should do this uppercase thing on discord a few months ago and we came to the conclusion that alphabetical sorting is most commonly done how my code (or more specifically the rust std lib) does it. If you have some reason to think that N’s globber worked differently though, then I can change it
I listed a few example in A above already, here are some more:
warning: Object MapObj/BreakablePole.o is placed before MapObj/BreakMapParts.o, breaking the alphabetical ordering
warning: Object MapObj/CardboardBox.o is placed before MapObj/CarWatcher.o, breaking the alphabetical ordering
warning: Object MapObj/PlayerSubjectiveWatchCheckObj.o is placed before MapObj/PlayGuideBoard.o, breaking the alphabetical ordering
warning: Object MapObj/ShoppingWatcherStateWear.o is placed before MapObj/ShopStateInShop.o, breaking the alphabetical ordering
warning: Object MapObj/TreasureBoxSequentialDirector.o is placed before MapObj/TRexScrollBreakMapParts.o, breaking the alphabetical ordering
warning: Object MapObj/WaterfallWorldWaterfall.o is placed before MapObj/WaterLauncherCork.o, breaking the alphabetical ordering
warning: Object ModeBalloon/TimeBalloonPlayerPlayerHolder.o is placed before ModeBalloon/TimeBalloonPlayInput.o, breaking the alphabetical ordering
For all of these, case-insensitive sorting would solve the issue. I believe the names are correct, as they match the objects very well and finding different names that match the order based on current rules is very hard in some cases.
Additionally, the game was compiled on a windows machine (as visible from file names starting with D:/ and similar), which ignores casing by default - I'm not sure how globbers handle it, but I don't find it unlikely that those ignore casing in filenames too.
Alright. I pushed a change to my file-list-tools branch that makes the check normalize the object paths by making them lowercase, so this part should be fixed in the next tools cache repo update (once we decide to do all the viking updates)