Gildor's Forums

Author Topic: ActorX Importer issue with HP2  (Read 249 times)
metallicafan212
Newbie
*
Posts: 4


View Profile
ActorX Importer issue with HP2
« on: February 14, 2023, 08:41 »

Hey, I don't know if this is the right place to post this, but I found a very specific issue with the importer script and HP2 PSA files. For a while, people have been unable to import the PSA animations from the generic students or the professors since the animations seemed to get corrupted when imported into Max.

I finally did some digging, and it turns out that for some reason, there's duplicate bone names in the RefSkeleton of the animation, and Unreal seems to take the first valid anim track for a bone, while the script takes the last (since it maps the scene bones to the PSA bones without checking if the bone was mapped first).

The fix to get these animations to work was to just check if the bone was already mapped by the script, and if so, ignore that PSA bone. I haven't tested it completely yet, but it works for all the bad PSA files that I tested.

Duplicate bone names:


Before:

After:

I attached the script with my edits if you want to review them, but it's a really simple change (I'm not that great with MaxScript)

* ActorXImporter.ms (63.38 KB - downloaded 32 times.)
« Last Edit: February 15, 2023, 04:08 by Gildor » Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 1844


View Profile
ActorX Importer issue with HP2
« Reply #1 on: February 14, 2023, 21:23 »

@metallicafan212: Thank you for the fix. Could you please tell if it's for Harry Potter and the Prisoner of Azkaban game and also provide names of a few problem assets (meshes and animations), including names of packages, where such issue can be reproduced. Such info may be helpful at some point.
Logged
metallicafan212
Newbie
*
Posts: 4


View Profile
ActorX Importer issue with HP2
« Reply #2 on: February 14, 2023, 21:42 »

No, the problem game is Harry Potter and the Chamber of Secrets, which also isn't currently supported by UEViewer (it crashes the last time I checked). So you have to either get the data from the prototype's source code (on  archive.org), use Han's exporter from OldUnreal, or use my customized HP2 editor (which embedded Han's exporters).

KnowWonder seems to be the only UE1 dev to actually make use of the skeletalmesh subsystem added in later updates to UT99, so it doesn't surprise me that there's some issues with their approach/files.

Pretty much all animated skeletal meshes minus Harry himself have this issue, but in this case the specific mesh is skProfLockhartMesh and skProfLockhartAnims within the HPModels.u package.

I'm at work right now, so I can't provide the direct psa and psk files, but I can do so when I get back to my PC after work.

Here's a link to the prototype https://archive.org/details/Harry-Potter-2-PC-Prototype

« Last Edit: February 14, 2023, 21:44 by metallicafan212 » Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 1844


View Profile
ActorX Importer issue with HP2
« Reply #3 on: February 14, 2023, 22:17 »

@metallicafan212: Did you check custom umodel, mentioned in that topic? It seems to work fine with full game version.
Logged
metallicafan212
Newbie
*
Posts: 4


View Profile
ActorX Importer issue with HP2
« Reply #4 on: February 14, 2023, 22:57 »

No I haven't yet, I looked at their git history on their repo and they just took the source from the proto and put it into UModel, I believe the exact same issue is going to happen since it'll still export the PSA with the duplicate bone names.

Internally, in the game, it's saving bones that don't actually exist, but get indexes and are parented by their real bone. It's incredibly weird, and I'm assuming that there might've either been a bug with early actorx or an issue when they exported their animations back in 2002.

I can try to compile that version of UModel tonight and see what it does, but I doubt it will fix the double bone issue, since it's actually embedded into the data itself.
Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 1844


View Profile
ActorX Importer issue with HP2
« Reply #5 on: February 14, 2023, 23:38 »

@metallicafan212: Well, yes, the issue you've mentioned is obviously there if original actorX importer is used, since it's related to customized data. But the point is that it's not importer or umodel fault in general, it's just custom approach for particular data - and maybe it's possible to adjust umodel export accordingly.  
Logged
metallicafan212
Newbie
*
Posts: 4


View Profile
ActorX Importer issue with HP2
« Reply #6 on: February 14, 2023, 23:45 »

You can adjust UModel to compensate, but it should be solved at the importer side, as unreal engine has no issues with these PSA files; the prototype has the raw PSK and PSA files in the open that they actually used, direct from maya/max. They have the exact same "bug" in them.

I can export these PSA files with the duplicate bones, and them reimport them just fine, even into other games that have PSA/PSK support (like UE2 runtime for example).

Fixing the export in UModel will only fix the exported animations with the tool, not make the script correctly parse the data based on how Unreal is doing it.

Now, fixing the output for other uses is an option, but I don't see any downside to my fix in the importer script as it just ignores if a bone was already mapped in the scene.
Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 1844


View Profile
ActorX Importer issue with HP2
« Reply #7 on: February 15, 2023, 04:06 »

@metallicafan212: I agree that this issue should be somehow addressed, but please understand that current actorX importer works like expected for almost all other games except this one (or at least it's the first time I hear about this particular issue, while search doesn't reveal any related topics as well). Current fix for duplicates in form of axFixBoneNames function in the importer was added in 2009 according to logs, and apparently it's the only game having this kind of issue among UE1-4 games. Without tests it's really hard to tell if this change will not affect anything else, even if theoretically it shouldn't. After a quick lookup it appeared that, for example, in blender plugin for psk/psa import duplicates are handled a bit differently through comparison bone names in loaded psk and loading psa, and only in case if skeleton from psk (armature) doesn't have respective duplicates, but psa has, corresponding bone will not be loaded.

The reason why I said about umodel is because importer is universal and it doesn't know what it's loading, thus you can't create possible conditions for separate games, while for umodel you can modify things conditionally to avoid possible issues with other games. As for native UE SDK, I guess they're much more advanced in terms of possible fallbacks and parsing unexpected input than tools we have here, though there is always a way for further development.
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS