Model Modding Documentation
By Slaps.
Prerequisite tools and things you should know how to use before hand:
This guide is solely focused on documenting information related to model modding and the steps to successfully inject models in Atlyss.
- Asset Studio – where you can export game models as FBX.
- UABE – what you need to inject and overwrite model dump data.
- Unity Engine editor – so you can make your own file dumps for your custom model.
- Blender – you should come with your own model prepared.
- Notepad/Text editor – that ‘find’ function sure is useful.
- An Atlyss Build.
Warning: I highly recommend making a safety copy of any and all Atlyss build files before modifying them in case you mess up and need to start with a clean copy.
To Get The Modified Model to Load in Game in The First Place
Export the models as FBX from blender.
Apply transform for unity scaling on export if its an original model. If not, in my case I was using a model FBX dumped from the game files with Asset Studio. I exported the kobold model at 50 times scale manually because it was sooo small in blender. That scaling number gets it close enough to the size of the actual game model.
Next, using a copy of the unity engine editor, make a game project in it.
Throw the model fbx’s from blender you want into a scene. Careful to check if blend shapes actually exported from blender into your fbx using the unity inspector that should list them.
You must have all modifiers applied in Blender on export to have shape keys work (I also got a miracle blender python script for if you use modifiers and it won’t let you apply them because shapekeys are preventing it. It preserves shape keys and applies modifiers working perfectly on export).
Once the models are in the unity scene make a build of the game.
Use UABE to look at the assets in your game build and ‘Export Dump’ the models your trying to inject as txt files. The names don’t matter. I recommend exporting a second dump as a clean reference in case you need to start over on the next steps.
Use UABE to dump the actual models your swapping out as txt. Were going to use this as a ref to copy and paste necessary data to let the modded model just run in game.
Copy the top part of the REAL model dump to your mod model dump file:
If your mod model’s m_Submesh array does not match the real model it will fuck up in game and not render. Additionally if theres any extra ‘0 SubMesh data’ entries copy over the unique ones while preserving the ones already in your mod model file.
They are listed in order with [0], [1], [2], etc…. copy the ones that go passed your models submesh array entries.
From here to here for each submesh:
Doing this alone should let the model load in game at least. In my case I didn’t get any warnings either.
To check your work in game. Use UABE and go to the model file entry your swapping and finally import your modded dump into the real models entry. Apply and save your resource.assets and replace it in atlyss data folder and your set to run the game to see your work in action.
Heres the blender python script that saved me alot of time in applying modifiers in blender on a model that already has shape keys. It saves so much time:
Unity Model Dump File Format
UABE Happens to have a display of the model’s file format and structure when you choose to view the model data in the software. Pretty nice for quick and easy reference of data when picking through what to take or keep.
I noticed certain points in the dump file that are triggers related to getting a custom player race model replacement to animate and jiggle. Like a toggle.
m_MeshCompression when set to a value > than 0 will cause the model to animate and move properly but the shape key scaling will be messed up and normalized to only scale within a very small range. It basically looks like its base shape but the parts that scale do grow very slightly.
More testing is needed to but ‘keepIndices’ will break the animation rig to not animate while keeping the same quirks noted above.
Model Replacement and Vertex Count
Swapping a player model with another that has a different number of vertices does not cause any issues or warnings. The whole model will appear in game just fine and can even still be animated by the original player armatature in game.
More testing needed but I think its safe to assume that replacing models with a completely different one will work just fine given that a mod model was able to go as far as to animate without error notifications.
Replacing Modded Mesh Data with the Original
Testing to see if the object data at the beginning fo the dump file will animate and allow the modded shape keys to work.
Replacing the modded dump file’s submesh data without the original mesh data while preserving the modded blend shape key data results in a slight better model in game that can be scaled correctly by the width and hight sliders in the character creator screen.
MeshCompression was set to 0 and keeps mesh. Producing the above results. Video recorded of the slider working.
MeshCompression was set to 2 and the proportions became normalized to be perma-skinny.
Animation rigging broken too…
MeshCompression was set to 1 and… same results as 2…
Getting Custom Models Animated
You’ll need to copy these data segments related to animation bones from the original model dump file. Here’s a compacted list of the key headers to search for and copy all the data of:
- m_BindPose
- m_BoneNameHashes
- m_RootBoneNameHash
- m_VariableBoneCountWeights (it seems empty and prolly can be ignored.)
- m_MeshCompression
- m_IsReadable
- m_KeepVertices
- m_KeepIndices
Once these are copied into the modded dump file correctly the model should animate and jiggle!
Unfortunately still seeing scaling issues with the shape keys not working but the model moves and looks normal skinny.
Can’t say for certain it’ll work on models that have completely different mesh from the one they are replacing but my kobold had more verts than the original and it animated fine. Needs more testing for those willing to troubleshoot testing different kinds of model replacements.
Now I’m testing with removing compressed data to be from the modded dump file instead. Basically replaced the while bottom portion of the dump file.
List of Name Headers to Model File Format (in Order)
Blendshape Data and Indice Ordering
I presume this is basically showing a list of vertex groups for the different parts of the player race body. It starts with the index of the first vertex in the group then lists how many vertices are in that group.
I’m noting the normals and tangents listed because getting the custom model to animate and Have working blendshapes has not been possible so far. Something could be missing and it may be those 2 things: normal and tangent data. Of course more testing is needed to verify this
Alternative to Breaking the Size Cap Script
found an alternative way to break the body slider cap from the model dump files itself. Letting you set a scaling multipler to the body parts you want. Weird and impractical but interesting non-code way to do this. It should get passed the size check too because its on the asset level and not in the code base:
- Weight 100 is normal. Set to a number lower than that to get larger sizes.
- Weird trivia lmao.
Be the first to comment