aoemods / AOEMods.Essence

C# library and tools for working with Age of Empire 4's Essence engine (.sga, .rrtex, .rrgeom, .rgd currently)
http://aoemods.com
MIT License
32 stars 6 forks source link

RRTex decode format mismatch in s5 pup #4

Closed robertvanhoesel closed 11 months ago

robertvanhoesel commented 1 year ago

I'm a grateful users of the cli to unpack SGA archives, update unit stats and images for the AoE4 World explorer, but currently not equiped enough to figure out how to deal with the fact the RRTex header format seems to have changed a bit with the recent build versions in version 7 of aoe4 / season 5 pup.

Here's the CLI error and related discord discussion https://discord.com/channels/911038016179560529/913882758902857758/1105459391697797150

dotnet AOEMods.Essence.CLI.dll rrtex-decode ../art/ui/icons/races ../icons/races -b
Found 782 files matching ../art/ui/icons/races
Unhandled exception. System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'value')
   at System.IO.FileStream.set_Position(Int64 value)
   at AOEMods.Essence.Chunky.RRTex.RRTexReader.ReadMip(ChunkyFileReader reader, Int32 mip, RRTexDataTman tman, IImageFormat outputFormat, RRTexType textureType)
   at AOEMods.Essence.Chunky.RRTex.RRTexReader.ReadDataTdatLastMip(ChunkyFileReader reader, ChunkHeader header, RRTexDataTman tman, IImageFormat outputFormat, RRTexType textureType)
   at AOEMods.Essence.Chunky.RRTex.RRTexReader.ReadRRTexLastMip(Stream rrtexStream, IImageFormat outputFormat, RRTexType textureType)
   at AOEMods.Essence.CLI.Commands.<>c__DisplayClass3_0.<RRTexDecode>g__ConvertFile|0(String path, String outputPath)
   at AOEMods.Essence.CLI.Commands.BatchConvert(String inputDirectoryPath, String outputDirectoryPath, String pattern, String outputExtension, Action`2 convertFile)
   at AOEMods.Essence.CLI.Commands.RRTexDecode(RRTexDecodeOptions options)
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,T4,T5,T6,T7,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 parsedFunc4, Func`2 parsedFunc5, Func`2 parsedFunc6, Func`2 parsedFunc7, Func`2 notParsedFunc)

I'm not very experienced with binary file mappings so any help would be greatly appreciated!

LenaBullens commented 1 year ago

Similar issue for the actual Season 5 Update for Age of Empires IV. Also a grateful user of this tool for extracting icons for the wiki, so would be awesome if it could get resolved.

jensbuehl commented 1 year ago

There is a PR open that fixes it. Could you please review and merge? :) https://github.com/aoemods/AOEMods.Essence/pull/5

RobinKa commented 11 months ago

Thank you, didn't get notified about this sorry for the delay