Unity Extracting rig to add animations to Unity game mod

asdfgghjkg

Newbie
Oct 18, 2018
77
117
TL;DR:

I made a mod for a Unity game and I'm able to import and play animations from asset bundles. Something is going wrong in my process of extracting the rig from the game's files and creating my own animations, so all I'm getting is T-posing. I have no experience with modeling/animation, so any pointers are appreciated.

Problem

I'm the author of Pleasure Party Plus, a mod for the game Pleasure Party. My ultimate goal for the mod is to make a framework for others to import their own animations/positions into the game. I have experience as a developer, but not as an artist/animator.

I've gotten to the point where I can import assets from asset bundles and override animations in the game. But I'm having problems extracting the rig from the game's files and making usable animations from it. From what I can tell, there are two rigs in the game: male and female.

I followed on how to rip assets from Unity games using AssetStudio and Noesis. When I import the .dae file into Unity, the character's right arm is messed up:

1650415041202.png

I made a simple animation from this, but when imported into the game the character just T-poses. I assume because the rig is messed up.

As a sanity check, I also tried ripping an existing animation from the game and building an asset bundle from that. When imported and run in game, the character crumples into a ball and squirms in horrifying fashion:

1650415552486.png

My best guess is that the rig is getting messed up when I extract it, but I have no idea how to fix it or where to go from here.

Does anyone here with more animation experience have any tips or pointers? And is there anyone that's interested in making a simple animation or two, assuming I get the rig issues worked out?

Thanks.
 

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,011
You say you have experience as a developer, is that particular to unity? I can't say I know much since I mostly stick to 2D and custom scripts.

I find with unity, the only way I can reliable import characters in to unity (and their animations) is FBX format. I haven't had luck with other formats, but I don't dabble too much with 3D.

From what little I've learned about modding (mainly trying to get mod support for a game I want to distribute on steam), games like Tabletop simulator work because they load in assets as unity prefabs, but this is something that still needs to be designed and built into the game (aka I don't know how it would be possible to add such support of framework without somehow injecting code into the game). When it comes to injecting code and really changing the behavior of a game, I have no experience, only just familiar with the concept. I don't even know how you're testing or could test trying to import or inject models into an arbitrary game.
 
  • Like
Reactions: asdfgghjkg

asdfgghjkg

Newbie
Oct 18, 2018
77
117
You say you have experience as a developer, is that particular to unity? I can't say I know much since I mostly stick to 2D and custom scripts.

I find with unity, the only way I can reliable import characters in to unity (and their animations) is FBX format. I haven't had luck with other formats, but I don't dabble too much with 3D.

From what little I've learned about modding (mainly trying to get mod support for a game I want to distribute on steam), games like Tabletop simulator work because they load in assets as unity prefabs, but this is something that still needs to be designed and built into the game (aka I don't know how it would be possible to add such support of framework without somehow injecting code into the game). When it comes to injecting code and really changing the behavior of a game, I have no experience, only just familiar with the concept. I don't even know how you're testing or could test trying to import or inject models into an arbitrary game.
I skipped the step to convert it to .dae with Noesis and just imported the .fbx. And wow, that worked! My (crappy) imported animation works in game as expected now. Thanks for the suggestion!

And yeah, I'm injecting code into the game using BepInEx, which under the hood is using Harmony. My injected code is then loading an asset bundle I built and I can instantiate assets from there. That side of things I'm comfortable with. Modeling and animation not so much.
 

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,011
Glad to hear! I'll save your technique as notes for later for when I get back into modding.

I don't dabble much with 3D in engine, but I do make custom models and animations from time to time (Blender). A few others do as well so questions about it is something we can probably answer (which to be honest will mostly be people saying 'search a tutorial' or linking specific tutorials.

The design of animations can technical, dependent on code, since one can only make certain animations within the scope of what the framework may support (ie, how to know character positions and cueing the start of an animation, if two people need to have an co-op animation, some information is needed to help with the design of various animations). I would ask about if you have any plans for the framework, or going more by feel and needs as they arise, and then I would suggest the concept of shapekeys, but I've learned that with unity, shape keys are easier to import as baked into animations rather than individual actions. But I'll still suggest being aware of the concept as animations (my own typically) make use of them to add smoothing or nuanced movements (hair movement) without making skeleton rigs more complex than their default set-up.
 

asdfgghjkg

Newbie
Oct 18, 2018
77
117
Glad to hear! I'll save your technique as notes for later for when I get back into modding.
...
Thanks for all the tips. I definitely have the problem of "I don't know what I don't know" with animations. From what I can tell, the game has an animation for each character and just starts playing them both at frame 0. I think their positioning is set through code, but I haven't looked too close at that part of the code yet.

I have a loose idea of what I want the framework to look like, but some of the details will depend on parts of the game code I haven't looked at yet. My thoughts are to have a unity asset bundle containing the animations and some kind of configuration file to tell the framework how to handle what's in the bundle. The config will say which animations are in the bundle, how they're paired together, positioning data (maybe? If that's how the game is doing it), and some game specific stuff. Asset bundles can't contain scripts, otherwise I'd just include the config data that way.

If you ever want to dig into the code side of modding more, I don't mind sending you some example code or talking through my workflow.
 

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,011
Sounds good, I may actually take up your offer on that in the future, but for now I still need to put something together and ready in unity.

If it helps, when you get to a point where you need to start testing things, I could make some animations to stress test the framework (simple on the spot animations) and see what quirks about animations do and don't work (some animations only use keyframes, while some require every frame be baked). Then when you have the framework somewhat ready to show off, I could give it a test drive. After that, if you are making this framework so that you can put in your own animations, I can show you a set up that can help with making animations simple (doing lots of weird things with multiple rigs and bone constraints).
 

asdfgghjkg

Newbie
Oct 18, 2018
77
117
Sounds good, I may actually take up your offer on that in the future, but for now I still need to put something together and ready in unity.

If it helps, when you get to a point where you need to start testing things, I could make some animations to stress test the framework (simple on the spot animations) and see what quirks about animations do and don't work (some animations only use keyframes, while some require every frame be baked). Then when you have the framework somewhat ready to show off, I could give it a test drive. After that, if you are making this framework so that you can put in your own animations, I can show you a set up that can help with making animations simple (doing lots of weird things with multiple rigs and bone constraints).
That would be great, thanks. I've made a couple basic animations just to get me through the proof of concept stage. I have the foundation of the framework done now, I just need to wire a few more game specific things together and add some UI to make it actually usable.

I have figured out that keyframe animations work in game. There's definitely quirks I don't understand (the hand bones in the rig aren't animating in game for some reason?). Once I'm a little farther along I'll hit you up for more. And I could definitely use tips on a setup for making animations. I just used Unity's animation editor, which works but is very tedious.
 

asdfgghjkg

Newbie
Oct 18, 2018
77
117
Sounds good, I may actually take up your offer on that in the future, but for now I still need to put something together and ready in unity.

If it helps, when you get to a point where you need to start testing things, I could make some animations to stress test the framework (simple on the spot animations) and see what quirks about animations do and don't work (some animations only use keyframes, while some require every frame be baked). Then when you have the framework somewhat ready to show off, I could give it a test drive. After that, if you are making this framework so that you can put in your own animations, I can show you a set up that can help with making animations simple (doing lots of weird things with multiple rigs and bone constraints).
Hey, I released a mod version that can import animations.

I'm definitely at a point where I could use more insight into the animation side of things. I already have a few specific questions, but my first is if my process is even a good one. I have the models and rigs in a Unity scene and am just using the Unity animation editor to setup keyframes. That mostly works, but there's some weird issues:
  • Keyframes for hand bones in my animations just don't get animated in game
  • I've tried setting the character's general position (moving them up/down or forward/back), but either the bone I select does nothing or it sets their position permanently and the character will be moved in the game's native animations too.
I really don't know what I'm doing with animations, so any tips are appreciated. I can give you the step-by-step on how I extracted the models or just straight up send you a .zip if you'd like. And if you want to take a crack at making any animations, that'd be amazing.