Popular Post wutdahax Posted April 27, 2020 Popular Post Share Posted April 27, 2020 Don't be afraid to ask for help. I'm making changes to this tutorial all the time. Your feedback is greatly appreciated! Step 1: Install UE 4.22 with Epic Games Launcher Hide contents You need the correct version of UE4 to mod each game. For Trials of Mana this is 4.22.* Use the install options to uncheck all the optional components. We don’t need them for modding. Step 2: Extract Assets Hide contents We need UModel: https://www.gildor.org/en/projects/umodel The amazing oscateexor has modded UModel to export morph targets which are necessary for lip-sync to work on our modded characters: umodel_morph.zip (this is 04/30 version) UModel can export selected uasset files in a format that we can bring into Blender. It also exports textures in a variety of image formats. It will help you a lot to learn UModel’s features. This video is very useful: Unzip UModel to your game’s Content directory, it will look something like this: Open UModel. Notice the “Path to game files” is correct. That’s because we put UModel in this directory. The default settings here fine but you can choose “Override game detection” “Unreal engine 4.22” now if you want. The next window is titled “Choose a package to open”. For now we are going to open Angela’s first costume. Navigate to /Game/Character/Player/pc02/Model/pc02_01a/SK_pc02_01a.uasset Double-click the file, or select it and use the Open button at the bottom. If you are prompted for a version now, Choose Unreal Engine 4.22 You Should see the model with debug textures now. Notice there are no animations (bottom-left corner). We are going to load the animations now, but just for preview. We are not going to cover exporting and modding animations in this tutorial. We want to use SkeletalMesh -> Find Animations … (Ctrl+A) but there is a problem: UModel is 32-bit, which means there is a memory limit. If you try to do a search for animations, it will run out of memory and crash because the pak file is way bigger than 4GB. However, we already know where to find all the animations for this model. Press O to go back to the package selection screen and find “Animation” in the parent directory. Right-click on it and choose “Open folder content (append)” – much more efficient way of loading all the animations Now you can see the animations are loaded Check out the animations and morph targets we just loaded. You can see all the shortcuts by pressing H. If you want to load materials and textures you can do that too, but they won’t show up on the mesh yet because this is an untextured model. Now go to Tools -> Export current object (Ctrl + X) We want ActorX format. You can choose whatever texture image format you prefer. Now you should see "SK_pc02_01a.psk" and a bunch of extra files with "Morph" in the name. Step 3: Import to 3D modelling application Hide contents In this tutorial we will use blender but if you already have a 3D modelling application that you prefer you can use that instead. You will need a psk/psa/actorX importer and fbx export. Import/Export for 3DS Max: https://www.gildor.org/projects/unactorx Import for Blender: https://github.com/Befzz/blender3d_import_psk_psa (we will use built-in FBX export) A very good guide by TrixzZy: https://www.youtube.com/watch?v=C4jzNMwosV8 Step 3a: Import the base mesh to Blender Hide contents Open Blender, install Befzz's addon. Press A to select all, then Delete. That will remove the default cube, camera and any lights. When we import from PSK make sure you have “Reorient bones” OFF and “Don’t invert root bone” ON. If you are using a newer version of the import addon, do not enable "Scale down". I don’t know about other options, but they seem to work fine if I leave them alone Use the “Import PSK button” and find your files. Import the main file first, and make sure the "All" option is selected on the right. Note: Once it appears in Blender it will be 100x too big but DO NOT RESIZE IT. Now you can zoom out and have a good look at the mesh. USe "Import PSK" again, but this time select all the morph files and select "Mesh" on the right. It will take a few seconds to load all of the meshes. You should have something like this: The bones look wrong, but that’s ok. If we ticked “Reorient bones” before importing, they would look good in Blender, but they would be all wrong when we export. We have a long list of objects in the outliner now. The top one "SK_pc02_01a.ao" is our base mesh. We must rename this to "armature" so that UE4 ignores the first bone in the skeleton because the second bones is called “root” and we want that to be first. Double-click on it, or click it and press F2 to begin renaming it. After renaming it, right click and choose View -> Show One Level (Numpad +) It should look like this: Step 3b: Rename everything Hide contents We must remove all of the extensions (such as ".ad") We must also remove the morph target prefixes so "SK_pc02_01a_Morph0_eyebrow_wink1.mo" becomes "eyebrow_wink1" Press Ctrl+F2 to open up the Batch Rename window. We're going to do a few quick tidy-ups: First, remove all the .mo extensions from objects and .md from Meshes Second, remove the prefix such as "SK_pc02_01a_Morph" from Objects. Then do it again for Meshes: Now you should have something like "0_eyebrow_wink1" at the top. We can change "Find/Replace" to "Strip Characters" Remove Digits and Punctuation (shift-click to select both buttons) from the Start of Objects. Do it again for Meshes. One final rename we can do manually: remove .ad from "SK_pc02_01a.ad". You should have something like this: Step 3c: Apply the morph targets Hide contents Now right-click and choose View -> Hide One Level (Numpad -) Expand "armature". Select ALL of the meshes. You can click the bottom one, then shift-click the top one. The mesh inside armature must be your active selection (the last one clicked/selected). Probably best to select all of the morph meshes first and then ctrl+click the base mesh to make sure it's the active selection. It should look like this: Now in the Object Data Properties panel (green triangle icon) click the downward arrow to the right of Shape Keys and choose Join as Shapes: You should have all your meshes appear as shape keys, plus your "Basis" at the top: You can delete all the original morph meshes now (everything outside of "armature") The outliner should look like this: Note: Some screenshots in Step 4 may have incorrect outliner contents. Please ignore the mistakes. This screenshot of the outliner above is correct. This is a good time to save your .blend file! Step 4: Edit the mesh. Step 4a: Get artsy! Hide contents Now you can make whatever changes you like. For this tutorial, I’m just going to select some parts of the mesh and delete them. I won’t go into details on how to use Blender here, but there are plenty of “blender mesh editing beginner” tutorials on YouTube. [redacted image] [redacted image] The mesh already has materials assigned to the correct regions, but they are empty. There are blueprints elsewhere in the game files that automatically load texture files based on these material names. Remember, for most cases you can just replace the textures without touching the materials at all. I don’t know much about making materials correctly in this game or in blender so I’m just going to move on now. Step 4b: Split the face from the rest Hide contents Most costumes have materials which do not support morph targets. In those cases your character will look normal at first, but after a few seconds they will emote which triggers a morph (e.g. close eyes) and suddenly all the clothes turn grey. Before you begin editing the mesh, we must separate the "face" from the rest of the costume to ensure morph targets only affect the face. Since there are multiple materials in the project and the face is the only one which causes problems, we are going to split this part out into an new mesh (you can split by material but this is my preferred method) Select your mesh. Go to Edit Mode. Open the Material Properties tab. Click the face material and the Select button below it to only select the face vertices. Now right click in the viewport and choose Separate (P) -> Selection. You just created a new object in your collection. Rename it "Face" to make working with this file easier to manage. In the mesh that does not have a face, find "Key" in the collection and delete it. Also, in the material properties tab for the face and the part which is not the face, remove the materials that no longer apply. There is an option in the down-arrow button to the right of the material list that can remove all unused material slots for you automatically. You should have something like this: You can split the mesh however you like, for example face, hair, eyes, body in one mesh and wear01, wear02 etc in the other mesh. That would allow you to weld vertex seams etc. but is beyond the scope of this tutorial. Step 5: Export FBX file. Hide contents Back to object mode, Press A to select all again. Go to File -> Export -> FBX Now save your FBX some place where it will be easy to find. Set “Scale” to 0.01 and turn off “Add Leaf Bones”. We don’t want to bake animations. If you have problems when you view your model in game, come back and check that your FBX export settings match these. Make sure you name your file the same as the uasset it came from. You can just copy the name from the mesh in the collection view if that’s easier. In this case, my file is “SK_pc02_01a.fbx” Step 6: Import FBX to Unreal Engine 4.22 Hide contents Open up UE4.22 and make a new blank project with no starter content. Name it whatever you like. I called mine “ToM” Click this little icon to show the folder tree Now we need to recreate the folder structure in our project exactly the same as the pak file we extracted from. Go back to UModel and look at the path at the top where it says “Package: /Game/Character…” Right-click in the content panel (under the “Search Assets” text field) and New Folder. The first folder is “Character”. Hover your mouse over it to see that the path already begins with “/Game/” Open it and keep going! Remember, all of the filenames and paths in UE4 are CASE-SENSITIVE. You must type them exactly correct. Don’t worry if you make a mistake, you can just rename and move things later. Now we are ready to drop our FBX file here. The default options are fine. Notice “Material Import Method: Create New Materials” You will get errors about bones and a “Ref pose”. We can avoid that by expanding the Mesh section and ticking this box: “Use T0 As Ref Pose” NOTE: enable Import Morph Targets. The screenshot above is old. The game will not use any baked animations from this skeleton anyway because we aren’t going to pack it later. You will get an error “No smoothing group information was found” ignore it. Now we have 7 empty materials, a skeletal mesh, a physics asset, and a skeleton. If we go back to UModel, we can see the materials belong in a subfolder. Let’s create it and move the files (remember case-sensitive!) by selecting the first one with click, and the last one with shift+click and then dragging to the new folder Your skeletal mesh has been updated with the new location of the materials. Step 7: Create new assets. Hide contents There’s one more thing we have to do before we package up our files. If you skip forward and package the files, you will notice we have a skeleton file in our output, but the original pak did not… Also “PhysicsAsset” is missing but there is a “shadow_PhysicsAsset” Step 7a: Make a list of required files Hide contents Skip to 7b if you don’t want technical info and just want to finish modding Angela's first costume. Don't skip if you are modding other costumes. This game uses a common skeleton for all player characters. We can see that by opening up the original uasset file in a text editor. We will use u4pak to package our files later, we can also use it to upack files now. Get it here: u4pak_TOM.zip [file mirror notice] and extract it somewhere. It should be on the same drive where you installed the game. Drag the original “Trials of Mana-WindowsNoEditor.pak” onto UNPACK-TOM.bat It will take a while to unpack. It’s a lot of files. Let’s find SK_pc02_01a.uasset and open it in a text editor. It’s messy, but there are a bunch of file paths at the top. This is what we found: /Game/Character/Common/skeleton/SK_pc_common_Skeleton /Game/Character/Player/pc02/Blueprint/sub/pc02_01a_sub_ABP_kawaii /Game/Character/Player/pc02/Model/pc02_01a/Material/MI_pc02_01a_body01 /Game/Character/Player/pc02/Model/pc02_01a/Material/MI_pc02_01a_eye01 /Game/Character/Player/pc02/Model/pc02_01a/Material/MI_pc02_01a_eye01b /Game/Character/Player/pc02/Model/pc02_01a/Material/MI_pc02_01a_face01 /Game/Character/Player/pc02/Model/pc02_01a/Material/MI_pc02_01a_hair01 /Game/Character/Player/pc02/Model/pc02_01a/Material/MI_pc02_01a_wear01 /Game/Character/Player/pc02/Model/pc02_01a/Material/MI_pc02_01a_wear02 /Game/Character/Player/pc02/Model/pc02_01a/SK_pc02_01a /Game/Character/Player/pc02/Model/pc02_01a/SK_pc02_01a_shadow_PhysicsAsset Our skeleton file is missing, but there is a common skeleton! There is also an animation blueprint (ABP_Kawaii). After that we have our Materials and skeletal mesh, but the physics asset is missing and a shadow physics asset is in it’s place... Let’s recreate these missing pieces in UE4. Step 7b: Common Skeleton Hide contents First the easy part; we need to move and rename our skeleton to match the original file structure: When we import more characters, we can use this skeleton instead of letting UE4 create a new one from the FBX file. Step 7c: Animation Blueprint and Shadow Physics Asset Hide contents For this SkeletalMesh we need to create the folder “Character/Player/pc02/Blueprint/sub” and inside, create a new Animation -> Animation Blueprint. Choose our common skeleton in the popup and name the file “pc02_01a_sub_ABP_kawaii” Now open up SK_pc02_01a. You can collapse parameter groups that we don’t need. Click the little yellow undo icon to remove the physics asset. Select the Post Process Animation named pc02_01a_sub_ABP_kawaii we created earlier. And make a new Shadow Physics Asset named SK_pc02_01a_shadow_PhysicsAsset (in the correct folder). Default options for the shadow physics object are fine – we won’t include them in our packaged mod anyway. Save All (Ctrl+Shift+S) Now delete the old PhysicsAsset from the content browser because we don’t need it any more. Step 8: “Package” Project files Hide contents Whenever you want to package, do File -> Save All (Ctrl+Shift+S) just to be sure. Anything that isn’t saved (thumbnail has * icon) won’t be up to date in you packaged files. We need to update packaging settings: Make sure “Use Pak file” is not ticked and then close that window. Now you can export the files: You can export anywhere you like, but I usually just put a “Packaged” folder in the project folder and select that. Your files are now exported as uassets! Yay! Step 9: “Pak” Project files Hide contents First, get “u4pak_TOM” if you didnt already get it in step 7: and extract it somewhere. u4pak_TOM.zip [file mirror notice] Now we are going to make a NEW folder structure that only contains these two files: I want my mod to be named “Angela No-Frills 1” but it’s better to name it “AngelaNoFrills_1” so I can do “AngelaNoFrills_2” later and we must also have “_P” at the end of the file name to make the game actually load it. It needs to be on the same drive as the u4pak scripts. In the end I have this: Now I can drag “AngelaNoFrills_1_P” onto DROP_MOD_FOLDER_HERE-TOM.bat and let the script run My “AngelaNoFrills_1_P.pak” appears in the “pak” folder. Let’s find the game files and put a new folder named “~mod” Put your pak file in there NOTE: Your pak file must contain "_P" for the game to load it! Step 10: Textures Hide contents Now when I run the game, Angela appears with my edits! Replacing textures is easy to figure out if you have been following so far. Export the textures with UModel, put them in the right place in UE4, include them in your pak. For details, see this post: Step 11: Further reading / Advanced modding Hide contents In this section I will post links to important information that I think is optional but can help you make better mods. oscateexor has made another custom build of UModel to export glTF while preserving normals: 26 Link to comment
wutdahax Posted April 27, 2020 Author Share Posted April 27, 2020 The mod i created in this guide is here in case anyone wants it [redacted link] 8 Link to comment
me3 Posted April 27, 2020 Share Posted April 27, 2020 good lord, you went thru hell and back for this good tutorial, tyvm. Link to comment
wutdahax Posted April 27, 2020 Author Share Posted April 27, 2020 On 4/27/2020 at 6:39 PM, me3 said: good lord, you went thru hell and back for this good tutorial, tyvm. Bruh. I bought this game just to mod it and yeah, it has been hell, but I hope it helps some talented artists to make cool mods xD 4 Link to comment
azerty96 Posted April 27, 2020 Share Posted April 27, 2020 Ok I followed your tutorial step by step doing exactly the same things as you but it seems my mod brings to a fatal error and crash... Link to comment
wutdahax Posted April 27, 2020 Author Share Posted April 27, 2020 On 4/27/2020 at 8:51 PM, azerty96 said: Ok I followed your tutorial step by step doing exactly the same things as you but it seems my mod brings to a fatal error and crash... can i see your pak file? maybe there will be a clue inside Link to comment
azerty96 Posted April 27, 2020 Share Posted April 27, 2020 On 4/27/2020 at 9:02 PM, wutdahax said: can i see your pak file? maybe there will be a clue inside I just tried to make a pak with all the files like it comes out from UE and I have this here is the first pak I made when I finished your tutorial angela_mod_P.pakUnavailable Link to comment
wutdahax Posted April 27, 2020 Author Share Posted April 27, 2020 you need to create a "skeleton" folder and move your skeleton file like this: Character/Common/skeleton/SK_pc_common_Skeleton That will fix the T-pose. I don't know what's happening with the textures though. Can you open SK_pc02_01a and check the import settings? Link to comment
wutdahax Posted April 27, 2020 Author Share Posted April 27, 2020 On 4/27/2020 at 9:15 PM, azerty96 said: I just tried to make a pak with all the files like it comes out from UE and I have this Oh yeah, that's why the textures are white - they are the empty materials we created in UE4. Youre supposed to delete them before you make a pak so that the defaults are used instead. I think if you just move the skeleton like I said but don't do anything else it will fix the crash (file was not found) Link to comment
suogrey Posted April 27, 2020 Share Posted April 27, 2020 Thank you for this! Great guide Link to comment
Blehbreh Posted April 28, 2020 Share Posted April 28, 2020 Say no more, I am 100% on board with making a mod for this game. Link to comment
oscateexor Posted April 28, 2020 Share Posted April 28, 2020 Thanks, I've been trying to retain the MorphTargets with exported model, but to no avail. Ended up just hex-editing the whole vertex buffer (manually selectively zero-ing 3554 vertices out of 27632). https://imgur.com/a/KNIbmAq same stuff as OP's, but with LipSync Morph.zipUnavailable If you don't like the recolor, SK_pc02_01a_noskirt_noneck_nolod_nohat.uexp is the model file I packed in the .pak file. For packing I used this tool by FluffyQuack http://modderbase.com/showthread.php?tid=834 A few things I've noticed. https://www.gildor.org/smf/index.php?topic=6831 They seem to not intend to implement the MorphTarget exporting function (rip). Unreal Package Extractor on their site however, it does extract MorphTarget components into dump files. Though combining them back into .psk or .fbx file is equally difficult. Also this tool can extract NameTable/ImportTable from SkeletalMesh or MaterialInstance (or any) .asset files. Which is useful for modifying certain parameters in the file. For example I changed "LODHysteresis" property in the SK_pc02_01a.uexp file to prevent the low poly models to appear in the game, otherwise I had to hex-edit another 30000 vertices. If you choose the Current/latest version of Blender .psk Import plugin instead of Stable/master one, there is an import option called "Scale Down". It is checked by default but you need to uncheck this before import. And set the "Unit Scale" in Scene Properties tab to 0.01 , then when you export, check the "Apply Unit" option to properly scale down the exported object. I think the scaling function in the latest version is broken. (OP is using the stable version in the tutorial) You can hide a surface group by changing "NumFaces" property to zero in Lod.Sections array. Useless because you can't reassign the material slot to meshes without export -> import process. 2 Link to comment
serkerth Posted April 28, 2020 Share Posted April 28, 2020 On 4/27/2020 at 6:36 PM, wutdahax said: The mod i created in this guide is here in case anyone wants it AngelaNofrills_1_P.pak 2.08 MB · 38 downloads Edit: Lipsync is broken in this mod - I still need to figure out how to keep the morphs from Umodel to Blender to UE4. I will update this post when i figure it out and add similar mods to all of Angela's and Riesz' costumes I put pak file in ~ mod folder, but mod does not work. What is the problem? Sorry for the translator's English. Link to comment
wutdahax Posted April 28, 2020 Author Share Posted April 28, 2020 wow @oscateexor that's some serious haxxorz I saw that updated psk importer and tried it out. I got the same results as you. In fact I can recreate the results if I import normally, select all, scale 0.01, apply, then export at scale 1. I think the importer just runs those commands like a macro at the end of the import rather than adjust numbers as they are read from the psk. Anyway, since the instructions in my tutorial haven't changed and the new features don't add anything helpful, I just left it alone for now. In the mean time I was struggling to make a decent eye material just for editor preview purposes so I started digging and found that the material files we export with umodel are actually supposed to be instances. This is good news because it means all the characters skin, eyes, etc. are derived from common skin, eyes etc. master blueprints. We just need to create a master material blueprint with the right parameters set up and plug in the values from text files exported like MI_pc02_01a_body01.props.txt With that in mind, it's possible that with enough time and effort we can create a template project with a bunch of materials and blueprints so everyone can just open it up in UE4 and drop their FBX and PNG files. On 4/28/2020 at 1:46 AM, serkerth said: I put pak file in ~ mod folder, but mod does not work. What is the problem? Sorry for the translator's English. it's not supposed to have a space after ~ Link to comment
serkerth Posted April 28, 2020 Share Posted April 28, 2020 It seems that spaces have been added by the translator. And the mode works, but only when start a new game. It does not apply when loading a saved game. Will it be applied when changing clothes by changing jobs? Thank you for answer. Sorry for stupid english. Link to comment
wutdahax Posted April 28, 2020 Author Share Posted April 28, 2020 On 4/28/2020 at 2:49 AM, serkerth said: It seems that spaces have been added by the translator. And the mode works, but only when start a new game. It does not apply when loading a saved game. Will it be applied when changing clothes by changing jobs? Thank you for answer. Sorry for stupid english. Expand I'm confused. This has never happened to me. Try this file. If it works, I may have to edit my instructions. AngelaNofrills_1_P.pakUnavailable 2 Link to comment
serkerth Posted April 28, 2020 Share Posted April 28, 2020 On 4/28/2020 at 3:06 AM, wutdahax said: I'm confused. This has never happened to me. Try this file. If it works, I may have to edit my instructions. AngelaNofrills_1_P.pak 4.16 MB · 0 downloads It works perfectly! Thank you. I guess I found the cause too. Now, even if wear Ravi's Ring, the mod will work! Link to comment
wutdahax Posted April 28, 2020 Author Share Posted April 28, 2020 On 4/28/2020 at 3:12 AM, serkerth said: It works perfectly! Thank you. I guess I found the cause too. Now, even if wear Ravi's Ring, the mod will work! So the problem was that I didn't understand the purpose of pc02_01b This is actually a different model because it has the necklace so I had to copy _01a to _01b. I will need to mention that next time I update the tutorial ? Link to comment
serkerth Posted April 28, 2020 Share Posted April 28, 2020 On 4/28/2020 at 3:26 AM, wutdahax said: So the problem was that I didn't understand the purpose of pc02_01b This is actually a different model because it has the necklace so I had to copy _01a to _01b. I will need to mention that next time I update the tutorial ? Your tutorial is really the best. I will also challenge the modding. Thank you. Link to comment
azerty96 Posted April 28, 2020 Share Posted April 28, 2020 On 4/27/2020 at 9:41 PM, wutdahax said: Oh yeah, that's why the textures are white - they are the empty materials we created in UE4. Youre supposed to delete them before you make a pak so that the defaults are used instead. I think if you just move the skeleton like I said but don't do anything else it will fix the crash (file was not found) ok I already have skeleton in Character/Common/SK_pc_common_Skeleton got the texture on but stuck on T pose, and I just find out that skeleton folder is missing Link to comment
azerty96 Posted April 28, 2020 Share Posted April 28, 2020 On 4/28/2020 at 4:46 AM, azerty96 said: ok I already have skeleton in Character/Common/SK_pc_common_Skeleton got the texture on but stuck on T pose, and I just find out that skeleton folder is missing alright so with Character/Common/SK_pc_common_Skeleton I got T pose and with Character/Common/skeleton/SK_pc_common_Skeleton it cause fatal error and crash edit : here is my pak if you want to check Angela_mod_P.pakUnavailable Link to comment
azerty96 Posted April 28, 2020 Share Posted April 28, 2020 On 4/28/2020 at 4:52 AM, azerty96 said: alright so with Character/Common/SK_pc_common_Skeleton I got T pose and with Character/Common/skeleton/SK_pc_common_Skeleton it cause fatal error and crash YEEEEEEEEEEEEEES, IT'S FINALLY WORKING!!!!!!!! here is the pak Angela_mod_P.pakUnavailable 3 Link to comment
yock0723 Posted April 28, 2020 Share Posted April 28, 2020 I tried following this tutorial.but unfortunately it has failed... The character will be invisible. Where I failed? please check my file. Sorry for the poor English. AngelaNoFrills_1_P.pakUnavailable Link to comment
wutdahax Posted April 28, 2020 Author Share Posted April 28, 2020 On 4/28/2020 at 8:02 AM, yock0723 said: I tried following this tutorial.but unfortunately it has failed... The character will be invisible. Where I failed? please check my file. Sorry for the poor English. AngelaNoFrills_1_P.pak 2.08 MB · 1 download Expand This happens when you scale the mesh and skeleton in blender or let the importer do it. Don't do that! Let the exporter handle scale for you. 2 Link to comment
Heart76 Posted April 28, 2020 Share Posted April 28, 2020 Thank you great tutorial! My only issue is I don't know how to add stand alone materials. I overwrote Durans main textures It works though. Just want to be able to add different hairstyles and colors for different outfits. 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now