Skip to content

[Bug] Professor Layton vs Phoenix Wright extraction fails #110

Description

@lukeaschenbrenner

Describe the bug
When running the latest nightly executable () with argument universal_asset_tool.exe professor_layton_vs_phoenix_wright, the extractor fails after extracting vs1.fa. No model files are viewable in the GUI.

Additional context
This is the full console log with stack trace when using the NTSC ROM:

Dumping ROM D:\professor_layton_vs_phoenix_wright.3ds...
Extracting XSFA \vs1.fa...
Unhandled exception. fin.util.asserts.AssertionException: Expected to find subdir 'c206' in 'D:\Games\Emulated\3DS\melty_tool\roms\professor_layton_vs_phoenix_wright\extracted\vs1\chr'
   at fin.io.hierarchy.CachedFileHierarchy.FileHierarchyDirectory.AssertGetExistingSubdir(ReadOnlySpan`1 relativePath) in D:\a\MeltyTool\MeltyTool\FinModelUtility\Fin\Fin\src\io\hierarchy\CachedFileHierarchy.cs:line 333
   at uni.games.professor_layton_vs_phoenix_wright.ProfessorLaytonVsPhoenixWrightFileBundleGatherer.GetSameFile(String name, IFileHierarchyDirectory directory, String modelFileName) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\professor_layton_vs_phoenix_wright\ProfessorLaytonVsPhoenixWrightFileBundleGatherer.cs:line 128
   at uni.games.professor_layton_vs_phoenix_wright.ProfessorLaytonVsPhoenixWrightFileBundleGatherer.<GatherFileBundlesFromHierarchy>b__2_0(IFileHierarchyDirectory directory, IFileBundleOrganizer organizer) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\professor_layton_vs_phoenix_wright\ProfessorLaytonVsPhoenixWrightFileBundleGatherer.cs:line 57
   at uni.util.io.FileHierarchyAssetBundleSeparator.GatherFileBundles(IFileBundleOrganizer organizer, IMutablePercentageProgress mutablePercentageProgress) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\util\io\FileHierarchyAssetBundleSeparator.cs:line 15
   at uni.games.professor_layton_vs_phoenix_wright.ProfessorLaytonVsPhoenixWrightFileBundleGatherer.GatherFileBundlesFromHierarchy(IFileBundleOrganizer organizer, IMutablePercentageProgress mutablePercentageProgress, IFileHierarchy fileHierarchy) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\professor_layton_vs_phoenix_wright\ProfessorLaytonVsPhoenixWrightFileBundleGatherer.cs:line 43
   at uni.games.B3dsFileBundleGatherer.GatherFileBundles(IFileBundleOrganizer organizer, IMutablePercentageProgress mutablePercentageProgress) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\B3dsFileBundleGatherer.cs:line 27
   at uni.games.ExporterUtil.GatherFileBundles(IAnnotatedFileBundleGatherer gatherer) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 127
   at uni.games.ExporterUtil.ExportAllForCli[T](IAnnotatedFileBundleGatherer gatherer, IModelImporter`1 reader) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 135
   at uni.games.professor_layton_vs_phoenix_wright.ProfessorLaytonVsPhoenixWrightMassExporter.ExportAll() in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\professor_layton_vs_phoenix_wright\ProfessorLaytonVsPhoenixWrightMassExporter.cs:line 7
   at uni.cli.Cli.<>c.<Run>b__0_0(IMassExporterOptions extractorOptions) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\cli\Cli.cs:line 36
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at uni.cli.Cli.Run(String[] args, Action launchUi, Action runDebug) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\cli\Cli.cs:line 33
   at uni.ui.Program.Main(String[] args) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool.Ui\src\Program.cs:line 21

When attempting to re-run the script after the first failure, it seems like the filesystem is in an inconsistent state and it prints errors like these in a loop:

Exporting model \vs1\nazo\ensp\chr\nk001.xc
System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   at level5.api.XcModelImporter.Import(XcModelFileBundle modelFileBundle) in D:\a\MeltyTool\MeltyTool\FinModelUtility\Libraries\Level5\Level5\src\api\XcModelImporter.cs:line 30
   at fin.model.processing.ModelProcessing.ImportAndProcess[T](IModelImporter`1 modelImporter, T fileBundle) in D:\a\MeltyTool\MeltyTool\FinModelUtility\Fin\Fin\src\model\processing\ModelProcessing.cs:line 13
   at uni.games.ExporterUtil.<>c__DisplayClass19_0`1.<Export>b__0() in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 213
   at uni.games.ExporterUtil.Export[T](T threeDFileBundle, Func`1 loaderHandler, ISystemDirectory outputDirectory, IReadOnlyList`1 formats, Boolean overwriteExistingFile, String overrideName) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 282

I patched out the assert to see how much further down the chain it would fail:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at level5.api.XcModelFileBundle.get_MainFile() in D:\a\MeltyTool\MeltyTool\FinModelUtility\Libraries\Level5\Level5\src\api\XcModelFileBundle.cs:line 12
   at uni.games.ExporterUtil.Export[T](T threeDFileBundle, Func`1 loaderHandler, IReadOnlySet`1 formats, Boolean overwriteExistingFile) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 223
   at uni.games.ExporterUtil.Export[T](T modelFileBundle, IModelImporter`1 reader, IReadOnlySet`1 formats, Boolean overwriteExistingFile) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 212
   at uni.games.ExporterUtil.ExportAllForCli_[T](IEnumerable`1 modelFileBundles, IModelImporter`1 reader, IReadOnlySet`1 formats, Boolean overwriteExistingFiles) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 174
   at uni.games.ExporterUtil.ExportAllForCli_[T](IEnumerable`1 fileBundles, IModelImporter`1 reader, IReadOnlySet`1 formats, Boolean overwriteExistingFiles) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 157
   at uni.games.ExporterUtil.ExportAllForCli[T](IAnnotatedFileBundleGatherer gatherer, IModelImporter`1 reader) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\ExporterUtil.cs:line 135
   at uni.games.professor_layton_vs_phoenix_wright.ProfessorLaytonVsPhoenixWrightMassExporter.ExportAll() in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\games\professor_layton_vs_phoenix_wright\ProfessorLaytonVsPhoenixWrightMassExporter.cs:line 7
   at uni.cli.Cli.<>c.<Run>b__0_0(IMassExporterOptions extractorOptions) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\cli\Cli.cs:line 36
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at uni.cli.Cli.Run(String[] args, Action launchUi, Action runDebug) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool\src\cli\Cli.cs:line 33
   at uni.ui.Program.Main(String[] args) in D:\a\MeltyTool\MeltyTool\FinModelUtility\UniversalAssetTool\UniversalAssetTool.Ui\src\Program.cs:line 15

I'd love to see this working so let me know if I can do anything to help debugging!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions