Skip to content

Improve script decompilation original filename heuristics#420

Merged
nikitalita merged 1 commit into
GDRETools:masterfrom
mrexodia:script-heuristics
Jul 5, 2026
Merged

Improve script decompilation original filename heuristics#420
nikitalita merged 1 commit into
GDRETools:masterfrom
mrexodia:script-heuristics

Conversation

@mrexodia

@mrexodia mrexodia commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fixes decompilation of the following files in STS2:

res://src/Core/Nodes/Screens/CardLibrary/NCardLibraryGrid.SortingOrders.cs
res://src/Core/Saves/Migrations/PrefsSaves/0000_PrefsSaveV1ToV2.cs
res://src/Core/Saves/Migrations/ProfileSaves/0000_ProfileSaveV1ToV2.cs
res://src/Core/Saves/Migrations/ProgressSaves/0020_ProgressSaveV20ToV21.cs
res://src/Core/Saves/Migrations/RunHistories/0007_RunHistoryV7ToV8.cs
res://src/Core/Saves/Migrations/RunHistories/0008_RunHistoryV8ToV9.cs
res://src/Core/Saves/Migrations/SerializableRuns/0012_SerializableRunV12ToV13.cs
res://src/Core/Saves/Migrations/SerializableRuns/0013_SerializableRunV13ToV14.cs
res://src/Core/Saves/Migrations/SerializableRuns/0014_SerializableRunV14ToV15.cs
res://src/Core/Saves/Migrations/SerializableRuns/0015_SerializableRunV15ToV16.cs
res://src/Core/Saves/Migrations/SettingsSaves/0003_SettingsSaveV3ToV4.cs
res://src/Core/Saves/Migrations/SettingsSaves/0004_SettingsSaveV4ToV5.cs

Also added a list of failing files to the log because I wasn't able to copy it from the UI.

@mrexodia mrexodia force-pushed the script-heuristics branch from da78d07 to 2359d6a Compare July 2, 2026 23:03
@nikitalita

Copy link
Copy Markdown
Collaborator

Thanks!

To be clear, were those files just not getting decompiled before, or were they decompiled to the wrong path?

@mrexodia mrexodia force-pushed the script-heuristics branch from c1dd183 to 2359d6a Compare July 3, 2026 10:39
@mrexodia

mrexodia commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

The root cause for all of them was the wrong path (there are no actual issues during decompilation itself):

res://src/Core/Nodes/Screens/CardLibrary/NCardLibraryGrid.SortingOrders.cs
  before: res://src/Core/Nodes/Screens/CardLibrary/SortingOrders.cs
  after:  res://src/Core/Nodes/Screens/CardLibrary/NCardLibraryGrid.SortingOrders.cs

res://src/Core/Saves/Migrations/PrefsSaves/0000_PrefsSaveV1ToV2.cs
  before: res://src/Core/Saves/Migrations/PrefsSaves/PrefsSaveV1ToV2.cs
  after:  res://src/Core/Saves/Migrations/PrefsSaves/0000_PrefsSaveV1ToV2.cs

res://src/Core/Saves/Migrations/ProfileSaves/0000_ProfileSaveV1ToV2.cs
  before: res://src/Core/Saves/Migrations/ProfileSaves/ProfileSaveV1ToV2.cs
  after:  res://src/Core/Saves/Migrations/ProfileSaves/0000_ProfileSaveV1ToV2.cs

res://src/Core/Saves/Migrations/ProgressSaves/0020_ProgressSaveV20ToV21.cs
  before: res://src/Core/Saves/Migrations/ProgressSaves/ProgressSaveV20ToV21.cs
  after:  res://src/Core/Saves/Migrations/ProgressSaves/0020_ProgressSaveV20ToV21.cs

res://src/Core/Saves/Migrations/RunHistories/0007_RunHistoryV7ToV8.cs
  before: res://src/Core/Saves/Migrations/RunHistories/RunHistoryV7ToV8.cs
  after:  res://src/Core/Saves/Migrations/RunHistories/0007_RunHistoryV7ToV8.cs

res://src/Core/Saves/Migrations/RunHistories/0008_RunHistoryV8ToV9.cs
  before: res://src/Core/Saves/Migrations/RunHistories/RunHistoryV8ToV9.cs
  after:  res://src/Core/Saves/Migrations/RunHistories/0008_RunHistoryV8ToV9.cs

res://src/Core/Saves/Migrations/SerializableRuns/0012_SerializableRunV12ToV13.cs
  before: res://src/Core/Saves/Migrations/SerializableRuns/SerializableRunV12ToV13.cs
  after:  res://src/Core/Saves/Migrations/SerializableRuns/0012_SerializableRunV12ToV13.cs

res://src/Core/Saves/Migrations/SerializableRuns/0013_SerializableRunV13ToV14.cs
  before: res://src/Core/Saves/Migrations/SerializableRuns/SerializableRunV13ToV14.cs
  after:  res://src/Core/Saves/Migrations/SerializableRuns/0013_SerialRunV13ToV14.cs

res://src/Core/Saves/Migrations/SerializableRuns/0014_SerializableRunV14ToV15.cs
  before: res://src/Core/Saves/Migrations/SerializableRuns/SerializableRunV14ToV15.cs
  after:  res://src/Core/Saves/Migrations/SerializableRuns/0014_SerializableRunV14ToV15.cs

res://src/Core/Saves/Migrations/SerializableRuns/0015_SerializableRunV15ToV16.cs
  before: res://src/Core/Saves/Migrations/SerializableRuns/SerializableRunV15ToV16.cs
  after:  res://src/Core/Saves/Migrations/SerializableRuns/0015_SerializableRunV15ToV16.cs

res://src/Core/Saves/Migrations/SettingsSaves/0003_SettingsSaveV3ToV4.cs
  before: res://src/Core/Saves/Migrations/SettingsSaves/SettingsSaveV3ToV4.cs
  after:  res://src/Core/Saves/Migrations/SettingsSaves/0003_SettingsSaveV3ToV4.cs

res://src/Core/Saves/Migrations/SettingsSaves/0004_SettingsSaveV4ToV5.cs
  before: res://src/Core/Saves/Migrations/SettingsSaves/SettingsSaveV4ToV5.cs
  after:  res://src/Core/Saves/Migrations/SettingsSaves/0004_SettingsSaveV4ToV5.cs

Happy to (privately) share the game files or any artifacts you might need. The CI is failing because XCode isn't discovered properly anymore btw.

@nikitalita

Copy link
Copy Markdown
Collaborator

Rebase on current master, this fixes the CI issue.

While this works fine on STS2, there's a bug where if two files have the same file name and the generated path doesn't match any of the candidates, it seems to not go through the namespace grouping processing (i.e. at processAgainAgain) and just goes with the generated path.

Observed this in Ascent of Ashes: https://store.steampowered.com/app/2209140/Ascent_of_Ashes/

image

Not sure exactly where this is caused in your code.

@mrexodia mrexodia force-pushed the script-heuristics branch from 2359d6a to 1db6ae9 Compare July 4, 2026 13:58
@nikitalita

Copy link
Copy Markdown
Collaborator

I figured out a hack to fix it; we just put it in both dupes and processAgainAgain if it's <multiple>, and take it out if it gets grouped via namespace. I think that's good enough for now; the whole logic that I wrote for that needs to be re-written, it's way, way too convoluted.

@nikitalita nikitalita merged commit b7aba36 into GDRETools:master Jul 5, 2026
18 checks passed
@mrexodia mrexodia deleted the script-heuristics branch July 5, 2026 21:50
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