iminashi/Rocksmith2014.NET

Exception importing Red Hot Chili Peppers - Otherside

Closed this issue · 4 comments

An exception is thrown when trying to import Red Hot Chili Peppers - Otherside (https://ignition4.customsforge.com/user/collectedcdlcs/toggle/9074?platform=pc). I'm guessing this is because it's packaged incorrectly, but figured I'd open an issue in case it's something DLC Builder can work around.

This exception is thrown while deserializing othersidesong_rhythm.json:

AggregateException: One or more errors occurred. (One or more errors occurred. (Failed to parse type Rocksmith2014.Common.Manifest.ToneDto: expected JSON object, found Null))

Inner exception:
AggregateException: One or more errors occurred. (Failed to parse type Rocksmith2014.Common.Manifest.ToneDto: expected JSON object, found Null)
   at Rocksmith2014.DLCProject.PsarcImporter.import@14.MoveNext() in C:\Programming\Rocksmith2014.NET\src\Rocksmith2014.DLCProject\PsarcImport\PsarcImporter.fs:line 221
   at DLCBuilder.StateUtils.importPsarc@416.MoveNext() in C:\Programming\Rocksmith2014.NET\samples\DLCBuilder.Domain\StateUtils.fs:line 420
   at DLCBuilder.Main.task@228-22.MoveNext() in C:\Programming\Rocksmith2014.NET\samples\DLCBuilder.Domain\Main.fs:line 229

Looking at the json, I see this is what the Tones array looks like (with element 2 and 3 snipped to keep the paste short):

                "Tones": [
                    null,
                    { snipped_object_1 with "Key" and "Name" of "RhythmDistortion" },
                    { snipped_object_2 with "Key" and "Name" of "RyhthmClean" }
                ],

I used the Custom Song Toolkit to extract the psarc, remove the null element, and repack the psarc. This repacked psarc loads in DLC Builder, but it reports "Following tones are missing definitions: RhythmClean" for the Rhythm arrangement. In the Tones list it does show an entry for RhythmClean though (and when I click Edit, it shows the same settings as LeadClean from the Lead arrangement)

Both the original and repacked psarcs work fine in Rocksmith. Not 100% sure whether they're using RhythmClean, or maybe falling back to a default tone though.

If there's no easy work around/fix, I wouldn't worry too much about it -- I've successfully imported the base RS2014 songs, the RS1DLC songs, and the top 100 most downloaded songs on Customs Forge, and this is the only one that's thrown an exception, so manually fixing one in more than 100 isn't a huge deal.

Hmm, I recall adding a fix for that null issue previously, but maybe something has changed in the serializer since then. I'll fix it in a different way then.

As for the missing tone, the base tone key has a typo in it: "RyhthmClean".

Hmm, I recall adding a fix for that null issue previously, but maybe something has changed in the serializer since then. I'll fix it in a different way then.

Yes, looks like that's the case. Release 2.5.3 loads the psarc, and comparing that to 3.0.0 I can see FSharp.SystemTextJson was updated from 1.1.23 to 1.2.42.

If I take the current codebase and revert the two projects using FSharp.SystemTextJson to 1.1.23, the psarc loads correctly.

Edited to add: 1.2.34 also throws an exception, so presumably one of the changes introduced in that release is the culprit.

As for the missing tone, the base tone key has a typo in it: "RyhthmClean".

Ahh good catch, didn't notice that typo!

Should be fixed in v3.1.0.

It is, thanks!