Attack on Toys

Attack on Toys

Not enough ratings
Creating a Soldier (From Knowing Nothing to Knowing Enough)
By Mantis
This guide is to help streamline the process of creating a soldier for any inspired tinkerers. The other guides made by the developer are good and useful, but they don't cover everything you need to know.
   
Award
Favorite
Favorited
Unfavorite
Preface
I spent about two months learning Blender and Unity for the first time specifically for this game. Thankfully, considering amateurs like me, the developer has kindly given this game mod support. This does not mean it is a simple drag and drop. What they have done is allow people like me to bypass the most dreaded, cursed existence in all of game development. Scripting. *shudder*

Something else to keep in mind is that this will not be a 'quick' process. All you aspirants will need to spend time learning these two programs, varying by how deep you wish to go. I will cover things as they become relevant, but I may forget something or just plain don't know. Included in the Mod Builder download are zip files containing great example mods (Cowboy and Origami) to compare with.
Before You Start
First off, read though and follow these developer guides:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2872658512
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2893398316
For practice, I recommend following along with the developer's PROP creation:


Prop creation isn't the same as creating a unit, but it is a good place to familiarize yourself with the process. And please don't upload your chicken practice mod. If at any time you come across an error, look at this guide:

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2890892879
If the error isn't listed, please post about it.

Since we work with FBX files, I use Blender v2.92 for most of my process. Why? Because: 1) It's more user friendly, 2) The files work fine as long as they are exported as FBX into your mod and not blend files, 3) It is the last known version to work with windows 7, and 4) It doesn't break the bones of models.

Things you might need:
Asset Ripper
Asset Studio
GIMP 2.8
Audacity
Blender 2.92
Blender 2.79
Foobar2000 w/ vgmstream plugin
KeeMap Animation plugin for Blender
Getting Base Game Assets
If you want to make unit creation as simple as possible, this is the most important step for you. Having the base files allows us to turn placeholder units into real soldiers. Specifically, we'll have every mesh in the game at our fingertips. For basic Army Men, Action Men, and Blocks Men, all we'd have to do later is place the skin on the model in Unity. That's half the work done in an instant!

This magical process does require a ritual. You must install and use a program called Asset Ripper. Asset Ripper is a tool that extracts all files from a Unity game to be used or toyed with.

Don't be alarmed when you open the program. I know I panicked a bit when I saw the command console pop up and a window open. Go to the View -> Commands in the window and select the installation folder of Attack on Toys. Load the file and wait.

When it is done, the browser will return to the home page. Go back to Commands and choose an empty destination folder. Hit extract and watch the black screen flood with text. A few errors might pop up, but they're mostly some sort of failure to extract the scripting. We don't really need these.

Close Asset Ripper after the extraction is finished and take a look. What we want is a folder named Mesh. In here, all the mesh files are listed, complete with .001 and .002 alternates. Meshes aren't the only thing here. There are plenty of sound files we can borrow too. Be mindful when importing into Unity. If you try to port the whole project, the whole system will break and you'll have to delete it (the extracted files, not the project). It might work if it was ported into a fresh Unity Project, but I didn't want to risk two hours of my time trying.

One last thing! If you import the mesh file in (not a copy) and lose it somehow, you will have to rextract everything from the beginning.
Blender - Attachments
The hardest part of doing anything is taking the first step. If you are here, good job! This section is to make some minor changes to a model and make it look a little different from other units. Feel free to skip this step if you want to jump straight into making something.



A brief overview of the UI:
  1. You can do things to stuff you have selected without shortcuts.
  2. Different prearranged layouts to easily switch what you want to do. You can change what your doing from anywhere by clicking on the space where it says object mode or the tick-tac-toe like symbol at 2b.
  3. This is where your objects and models are. You can click the eyeball near the edge of the text to hide them from view.
  4. You change a selected object's properties here. Some tabs appear/disappear based on what type of object you have selected.
  5. Change your action here. Easily switch between grab, scale, and rotate without memorizing shortcuts.
  6. The little circles are used to change how you are looking at a model. i.e. See it's shading or see through it.
  7. A special jack to quickly change perspective and know direction. You can also drag the little arrow at 7b to see details of your alterations to the object as well as any plugins installed.
  8. A side menu for manual zoom in, panning, looking through the camera (not really needed), and isometric/2-D mode. Use the middle mouse button for panning and zoom. Hold shift as well to pan a different way.
  9. These squares help to gauge scaling. They are the same size in Unity and can be used as a measurement without bringing in another model.
  10. The red line is the X-axis and the green line is the y-axis. Always ensure you model is facing forward with its arms on the red line. If you look at the jack, the back direction is labeled with 'Y'. Usually, models come with the correct, default orientation. When changing an object's properties, hold and release the middle mouse button to snap the changes to a single axis.

The simplest way to change the way your model looks is with attachments. The attachment follow section we'll learn about later in Unity allows us to swap and place any mesh or model on a character easily. You get four slots with at least one dedicated to a weapon. Don't fret over this yet, just know that we have three decoration slots to work with.

For this demonstration, I'm gonna make one from scratch. I could just get models from other sources and use those, but I wanna show how easy it is to make something simple and make your unit stand out. I'm gonna make a bandanna. I recommend keeping similar meshes together in the same file to keep your folders from getting cluttered. Make sure to use proper file safety techniques!

I want my headpiece to be circular and the best starting point is by doing Add->Mesh->UV Sphere. This will create mesh I can alter to suit my needs. Now, the fewer faces we have to use for our shape, the better, and I only need one row. In the menu at the bottom left, I change the amount of rings (rows) the sphere is made of. Three is the minimum.



In edit mode, I select and delete all unwanted faces. I also go to the object's material tab (red sphere icon) and change the base color node in the Principled BDSF menu. A material is simply a collection of faces that can be altered together. We'll come back to this later.



I readjust the headband to approximately the right size and center it.



To shape my attachment correctly, I import the army man model and move it until my attachment lines up where I'd want to place it. From there, I spend some time fine tuning the headpiece until I'm satisfied. Remember that the attachment must be at 0/0/0 when we're done.



I chose this point to set my rotations for the Unity export later. This could be done at any time, but I remembered at this point.



It wouldn't be a bandanna without a knot and trailing ends. I bring in another UV sphere to simulate the knot. Again, I don't want too many faces, but enough to look alright, so I choose six rings. I scale and relocate to a good spot.



For the ends, I want them to be the same width of the band. I add a plane and enter 2-D mode, scaling to match as close as possible.



I take my plane and, after adjusting the length a bit, move it into position on the knot. Then I duplicate the plane for a second end and adjust its position too. When I'm done, I select all the objects with the bandanna set as the target (ctrl-select object (different colored name)). I join all the objects into one. You could potentially alter any model this way for a permanent change.



In the decimate modifier (wrench icon) I added, do you notice that number labeled Face Count? This is the reason we decimate a model to begin with. The fewer faces a model has, the better the game maintains the model's existence. I decimate the 'high quality' model to reduce the count because this simple piece doesn't need many. I stop when I notice the quality of the model begins to change. I use this decimation as a starting point for the other 'lower quality' models. Shade Smooth rounds the knot and other sharp edges.



This bandanna is nice, but I want it to always be red no matter team the unit is on. To do this, we go back to that BDSF menu and click that little circle next to base color (the node). I want it to get color information from an image, so I chose image texture. I want to select the Color Pack from the AOT Unity project. You should recognize these instructions from the developer guide.

Don't panic from the rainbow colors. What is happening is that each face on the model corresponds to a different spot on the image. We change this using the UV editor. Ensure you are in face selection mode and select all the faces you wish to change; the whole model in my case using the tool command 'select all'. You should see all the vertices/faces on the image.



It's simple from here. I select all the faces in the UV editor and scale it really small, then move it to the color I want. Now, when I use this texture file as a source in Unity, it'll be the color I chose here. Objects must be selected in the layout tab to be eligible in the UV editor.



I admire my model for a final check up, applying scale. Time to export the file to Unity.



When I import the model into Unity, the inside of the bandanna will be transparent and not render. This is called back culling and helps Unity with optimization and lighting.



I don't need this object to be seen from both sides, but the cure for it is simple. You need to duplicate the model, flip the normals of the second object, and then join them into one object. You can use the backcull setting to check if it worked. This will double the amount of faces and vertices you have, so avoid this for more complex objects. You can duplicate a group of faces instead of the entire object in edit mode. Separate them from the object to work on before merging back.

Very Important Blender and FBX Export Information
I spent a very long time troubleshooting an issue of scaling distortion, rotation problems, and additional bones being added whenever you export from Blender. I finally managed to solve these things and it is so important, it deserves its own section.

Let's discuss the rotation first. In the developer's prop tutorial, his instructions were to set rotation to -90 degrees and then tilt the prop back. An easily forgettable step if you don't understand why this is done. In Blender, X and Y are ground based axises with Z acting as height. In Unity, Y and Z switch roles where Z is measured on the ground and Y is used for height. In short, everything in Blender must have their rotation set to -90 degress on the X-axis (making the model lie on its back). After the rotation is applied, the model must be rotated back 90 degrees without applying the rotation. This allows the model and mesh to be the correct orientation in both programs.



The other two problems occur during the exportation process. In Blender, there are three options you need to change to fix the scaling problem and the extra bones. To fix the scaling, you need to change the Apply Scalings setting to FBX Units Scale and un-tick Apply Unit. This will fix the mesh shrinking to 100th the size it should be. Un-tick Add Leaf Bones to prevent FBX from adding additional bone ends to limbs. It is intended to be used if you are taking the model to another editing program.



After changing the FBX settings, save them as an operator to save the preset. You'll have to select the preset every time you reopen Blender.

There is another important step you must complete so your model will bake properly in Unity. Both of the .001 and .002 duplicates must have their periods changed to underscores. The LODs won't bake properly otherwise and all three meshes will overlap at once. For a visual aid: '_001' and '_002'.
Unity - Creating a Basic Soldier and Weapon
Unity is where we turn our raw ingredients into an edible dish. The skill of the cook makes a difference, and while I can't promise gourmet, I can serve a mean microwave dinner.



A brief overview of the UI:
  1. This is where the things you're working with are listed. The object with the grey box is a scene, which all you need to know is that it represents the creation space and contains the tools/scripting prearranged for your convenience. The objects with the blue boxes mean those are prefabs. If it has a grey side, that means it is a variant. If the lines are white, that means you are looking at the original placement of the game objects. You can dig into any prefab by clicking the arrow next to them. You should understand prefabs from the 'basic modding' developer guide. You can also hide the ugly boxes by clicking the eyeball to the left of the object.
  2. The data of your selected object is changed here. You can ignore that occlusion sub-menu at the top. If you are comparing with examples, you can see what data has been changed by looking at the sections highlighted white.
  3. By default, this is your project folder. The project tab is used to find the resources for your modding. You create new prefab variants here as well. If you ever want to delete something important, delete from the folder so that you can recover it if need to. You can't recover it if you delete from within Unity. Oh, and if you ever need to move files around, ALWAYS either move from within Unity or move them with their corresponding meta files to keep configurations intact.
  4. I point these out because these are different tabs to different functions. You can drag these tabs around to place them around the UI for easier access. You can also add new tabs from the window menu indicated by 4c.
  5. The default scene location. It will change to editing mode when you have a prefab loaded, but you can move up the hierarchy by clicking the back arrow near the tab name. Similar to Blender, you can change the way you move the view if you hold 'alt'.
  6. The return of the jack from Blender. If you click the box in the middle, you switch to 2-D view. Very useful for micro adjustments.
  7. The action changer. If you don't know the shortcuts, use these.
  8. Allows you to do game object stuff. It is also accessed by right clicking in the hierarchy.

Before we continue, It's time to read more developer guides!
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2897225913&s
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2896755765
A lot of things we'll be doing are explained here. You should keep all assets related to your mod in the same folder, except for the AOT Asset folder and those you're using from another mod. At the very least, all of your final products must be.

We need to get all the meshes we want to use from the extracted assets and put them into Unity. I plan to use the M60 Machine Gun and Army Man. We also need to create a prefab variant of the SKINNED MESH Army man and TROOP Base Army man. All that we need to do is put the proper army man meshes into the missing mesh section and the SKINNED MESH is done. Swap out the skinned mesh in the TROOP prefab and the base troop is done too! Well, we also need to add a MOLD to the world root section, and then its done!



Before we make the actual troop unit, we need to make a weapon. Here is yet another Developer guide: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2897310168
So, if you search for weapon, you'll find a heap of prefabs. All [ITEM] weapons are player variants of the corresponding base weapon types. AI only uses non-item weapons, so we want a base [WEAPON] (can be made a player weapon later). In the weapon prefab variant, drag [MESH PART] LOD Parent into it. This will create a singular instance of the prefab we can modify since we don't need to have a unique prefab dedicated to the mesh. Place all the gun meshes into the mesh filter of the parts. As a general rule, unit models use the light colors while weapons use the dark colors.

I can use the M60 Machine Gun mesh from my extracted files as is, but I want to remove the bipod. To make .mesh files compatible with Blender, we need to convert them into an FBX file to port to Blender and back again. With the M60 LOD prefab meshed, right click on the game object and hit export. Make sure to export using binary as Blender won't read ASCII. The rotation configurations don't need to be changed, but we will need to apply the scale.

Similar to how the UV sphere faces were deleted, we enter edit mode and start removing bits off the tripod. Now, you can remove by faces, but you will need to check for any stray vertices. They are essentially all the corners of a face shown as dots. Switch to vertices selection mode and remove all the bits until the bipod is gone.



Then, do this for the other two meshes. There is a higher likelihood of floating vertices in these decimated versions. With that done, we can export back to Unity.



For simplicity, we are gonna copy the values of the M16 Rifle in the guide's screenshot. The sounds of the M60 are found in the extraction folder and should be imported now for us to use. The sound files need to be part of a prefab, so we drag the [SOUNDS] Base prefab into the weapon prefab. The sound could be modified to sound different here if we want (the values can go higher/lower than the slider). Definitely set the volume to 0.04 to start for all gunfire sounds.

The last thing the weapon needs is the effect of the muzzle flash placed within the prefab LOD Parent and assigned. All weapons need a muzzle flash, which is why the null version exists for those who don't want one. The flash can be put into the weapon if there is no LOD parent. Relocate the position to where you want the effect to be. If the muzzle is greyed out (can't see effect), you can reactivate the object at the top of the inspector. Don't forget to adjust the invisible mesh. Pro tip, hit the lock in the top right corner of the inspector to lock onto that page.



Now comes the part where we make a variant of the base troop that will be the actual unit. We attach the weapon, the bandanna, and a hat. The attachments aren't aligned, so we'll adjust them in a bit. The final product looks pretty good.



We are almost done, but I want to check and make sure animations are working properly. Use the window toolbar to add an animations tab. Play any animation you want and check any ones you may have overridden.



If you see your attachments floating around, don't worry. Everything is and will work as intended. The attachment followers don't follow the animation because they aren't built directly into the bones, but instead follow the points placed in the bones.

For creating a hero unit, make sure to give them a Real Name or they won't be recuitable as a squadmate.
Unity - Altering Preexisting Units and Attachments
Sometimes, you want to put even less effort into making a unit. You can simply use a premade collection of assets. The cowboy mod is a perfect example. If you import the mod into Unity, everything you need is already done. You should leave the mod assets where they are, but remove all the bits you don't need. This is to keep your console free of useless errors. Later, you should list the mod as a requirement in the workshop. If you make your mod standalone, it can create unnecessary bloat on storage (multiple mods can use cowboy mod for assets instead of having the cowboy assets built into each mod individually). The required mod(s) don't need to be activated in the game.

A new unit is created by making a variant of the base troop and assigning the weapon onto it. Damage and attack radius can be easily changed when you assign the troop's weapon in the component, but if you want other changes, you'll need to select the weapon within the troop prefab. I want to change the amount from shots my cowboy's revolver fires from two to six. Bullets and firings are listed under Muzzle Rotations -> Muzzle Ends. Any changes from the original prefab are shown as bold white. And with that, a totally different cowboy is made.



My unique cowboy could use some flair. If you have an attachment or model with multiple materials, you can hide some of them for an alternate costume. Take the cowboy's hat for instance. It has two materials consisting of the hat and the face covering. If i deliberately reduce the size of the materials to one, the face covering is removed and only the hat remains. If I wanted just the face covering, I'd have to go into Blender and rearrange the order of the materials. This method can help create some variety with attachments you may get from other sources using little effort. Just like the hat and mask are one piece, you can also combine other decoration bits into one object for a more efficient attachment slot.



If you don't want to bother with attachments, there is another way to alter a unit's appearance. Simply play around with the shader settings within each material. I wanted my cowboy to have a slightly more tanned complexion, so I adjusted the albedo's color box. The albedo is the model's main texture. Be sure to change these settings for all LODs! Just so you know, any model could be transmogrified like this; Even the revolver if I felt so inclined. Oh, and keep in mind that these changes apply to all uses of the texture. You will need to make a new material if you only want to affect one object's textures. Don't alter AOT asset colors.

Unity - Baking a Model
Now is a good time to set your unit's stats. The most important one is to assign all equipped weapons and give them a damage scale and radius. Rambo will have a simple 2x damage scale (double damage) with a 25% increase to range, and John Marston already has a six shooter instead of a two shooter. These weapon changes are done on the troop itself so the changes only affect that instance of the weapon.

Warm up the ovens because its time to bake. Follow the developer guide on ghosts, but don't bake until the baking guide.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2896224549

An interesting setting in the ghost called Versus Chance needs some clarification. When an AI decides to spawn something, it randomly chooses something from all possible spawns. Then, it rolls this versus chance to see if it will spawn it. Afterwards, it will move on to the next unit. Not only does the AI need the plastic and need to select your custom unit from a list, it also needs to succeed in the d100 rolled from this ghost setting. This can mean you might almost never see the AI spawn the unit if it is too low.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2892740786
When you get to the actual baking part, bake with one check box at time. Have the console tab open to identify any errors. Some you can ignore, like 'Unsupported Vector' or "Unsupported Dynamic Mesh'. Others, like 'weapon.script', you'll need to fix before moving to the next baking step. The check error box is useful, but wait until all the baking is done.

The baking script is supposed to auto generate an ID for your troop, but it currently doesn't. Instead, go to your final troop variant and add the component 'Prefab Source ID Script'. Copy the entire name of the prefab and add 'ID#{Insert number here}'. Make this number whatever you like, but never change it after your mod becomes official, and no duplicate IDs. Ghosts generate IDs just fine (notice they have negative IDs). Generally, anything that spawns needs one. [WEAPON} prefabs don't because they are just used, not spawned. Bullets do, however.

If you forgot to rename your meshes' periods to underscores, you can still fix the broken and overlapping LODs. First, you'll need to save a separate copy of the FBX into Unity or mesh 2 and 3 won't process for some reason. Simply swap the meshes out from the new FBX and delete the old FBX. For any troops based on the model you will need to go to the LOD component and choose the reset command. Now, you'll need to bake the 3D optimized box, followed by the ROOT LOD box. Check if the final troop prefab (not the base troop) only displays the highest quality model with no bumps poking out. If you had a specific avatar, you will need to reapply it as well as any animations you may have overridden. Everything should be good to go and you can bake the troops to confirm the changes. You will need to rebake the ghost.

After the prefabs are baked, animations and attachments need testing. Untick the baking boxes and click play. Activate your soldier in the scene and it should play the idle animation. If any attachments aren't where you want them, the attachment positions built into the bones need to be adjusted. You can see the change if you do it while playing the scene, but you must make the real change in the skinned mesh prefab. Make sure not to accidentally change bone or item positions.

Now we can bundle the mod and ship to testing! You may have already seen this video, but here it is again.


The built in quick mod testing doesn't work for me, so I use a set up like this.



Don't actually upload your mod yet as it isn't quite done. Make sure that all your custom assets and final variants are in the same mod bundle folder. Unlabel all the folders that aren't the mod you're building.
Unity - Creating a Builder Tool
Making units is all fine and dandy, but there is more tinkering to be done to fully utilize them. I'll start by explaining about factions.

Every unit or building is assigned to a faction. Whenever you create something, it will be counted as the faction it is based on or the army men by default. Every custom asset can be assigned a different faction using the Toys Category info block within the components.



Being the right faction isn't enough for total access to your units. You need to have a builder weapon to build them in-game or you will only be able to recruit during the deployment phase. This weapon will also be faction based, so you'd need to create multiple variations to have them available for all factions.

Import in the clipboard meshes from the extraction folder and make a variant of the [ITEM] [WEAPON] [ABILITY] Builder Base prefab. Drag in a LOD parent prefab into the world root and assign the meshes. This mesh has three materials and should use similar shaders to the picture.



Put the [SOUNDS] Item Equip Builder prefab into the builder and Sound Pickup data block.

For customized sounds, put whatever sound you want to play on pickup into the prefab using a [SOUND] prefab. Assign the pickup sound in the [ITEM] [WEAPON] [ABILITY] 'builder tool name' prefab. For equip sounds, you need to change a component in the [SOUNDS LIBRARY] in the prefab. Change the size to however many variations you want and assign them, no need to put them in the tool prefab.

Next, we want to adjust the left hand position. Grab the mod helper hand prefab and place it in the left hand position. Move the position point until you reach your desired location and remove the hand.



The object itself is now done and we now need to assign spawnables. The bottom component All Spawnables List Script is what we're looking for. The All Spawnables size should only be one. For objects type, you are only going to choose between Land, Air, or Water. The other options are not for a player builder tool and the custom type requires some set-up.

You can have as many tabs as you want, but the soft-cap is six. Any tab past six does not display in the UI. The most common icons to use for the tabs can be found by searching 'tab' when you click the little round circle. The ghosts of your units are assigned next.



This list is solidified by the last baking option. Any time you change this list, you'll need to rebake the spawnables list. If you ever change the cost of a unit, you'll need to bake the ghosts too, or the tool will use the old cost.

The build tool will keep any spawn limits between tabs, however, a player can circumvent the spawn limit by buying another builder tool. It is for this reason you shouldn't set any heroes on a tool. I will be doing this for demonstration purposes, and because it's funny.
GIMP - Creating an Icon
When all the baking and testing is done, the icons can be made. This step should be left until you've tested all other aspects in the mod tester. Make sure the camera is not active to prevent unwanted lighting when taking the picture and disable LOD 1 and 2 for the best quality picture.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2895553888
Now, the developer guide does tell you what you need, but it assumes you already know how to use an editor. I used GIMP 2.8 instead of Paint Net. You can pour through the instruction manual like I did, or simply learn from me. Manual = https://docs.gimp.org/2.8/en/index.html

With a picture in the size stated in the guide above, open it in Gimp. The first thing we want is to create an Alpha Channel. This is the part of the picture that will be transparent or invisible. Go to Layers -> Transparency -> Add Alpha Channel.

There are three ways to separate the background. The first way is to use the Color to Alpha function under the Colors toolbar. You can use the droplet to pick the bright purple background and it instantly removes it (pick from the center of the purple). The second, longer way to do this is to use the Lasso/Free Selection tool under Tools. Drag and click around your entire model bit by bit until you have everything selected. Then, go to the Select toolbar and Invert it. This selects the background, which you can then delete. The final (and recommended) method, is to use the color selection tool, choose the purple, and hit delete.

Color Picker =
Cut Myself =
Color Selection =

Quick sidebar before the next step, you can edit the BACKGROUND mesh filter when taking the screenshot to get a better image. The 3 main ones I've used are to change the background color if it is too close to what the model uses and changing the light and reflection probe setting from on to off. This can help clean up the shot if your model gets color bleed through from the background.

Now, go to Image next and select Canvas Size. Change the numbers and align the picture where you want it. You can also choose to scale the picture smaller before resizing it.



The next task is to create a new Layer From Visible layer under the Layers toolbar. Go to the Windows toolbar and under Dockable Dialogs, choose Layers. This menu creates tabs that allow us to see more details of certain properties. You should see two layers with your model.

Use the Free Selection tool to surround either the part that changes color or won't change color, whichever takes less effort. You can be less accurate in the checkered area. With the part selected, go to Layers -> Mask -> Add Layer Mask can choose selection. If you have multiple sections, create a new layer from visible and create a new mask for each part.



Apply each mask and merge the layers down. Hide the base image to check your work.



Clear all your selections by using the none command. Then, ensure only the separated parts are visible and the layer is selected. Go to Layers -> Transparancy -> Add to Selection.



Hide the layer and make the unaltered layer visible and chosen. Add a mask and invert the selection. Hit apply mask.



We have both of the images we need, but the colored one needs to be greyscaled. For the dynamic colors, go to the Colors toolbar and hit desaturate. I leave this on lightness. Go back to colors and change the brightness contrast to the 70/30 listed in the guide.



Our icons are complete. Hide and export one at a time so they are separate images. They should be .png files if it isn't automatically tagged. When separating the colored parts from the front, it is better to cut more into the front than to leave a colored spot behind that will look ugly (e.g. a bit of green showing up on all colored teams).

For hero icons, Scale (or canvas) the image 64 x 64 and export again. For the best hero icon, it is better to take a closer picture and work from the new image if it isn't a close-up already.

When you make a 500 x 500 background, be sure to use the blur effect under Filters. I recommend the gaussian blur, but you can use the blur function multiple times to get a similar effect.

One last step before the icons are usable. Select the .png in Unity, go to texture type, and swap it to Sprite (2D and UI). Remember that the front is the unchanging color picture. Once you set them into your troop and bake, your creation is complete! You can now upload your mod at any time. It will probably need balance testing, but that's another beast entirely. You can still use your creation in-game even if you don't want to upload it. If you are simply updating your mod, you can leave the description blank in game to avoid overwriting the descriptions you may have put onto the workshop page already.

You can make your thumbnail in the mod test sandbox, but close the development log at the bottom. Use the Photo Mode feature in the pause menu to take a screenshot. You will need to convert the image into a .png, but there is no need to scale your image down as Steam will do that for you upon upload. Use the sprite 2D option to add the image in the mod bundle builder. The thumbnail will be blurrier than your original image because of how steam handles data storage, but any screenshots you add to the workshop will have their full quality when enlarged.

Blender - Models Not in a T-Pose or Without an Armature
When you get a humanoid model, it'll usually be in a T-pose or come with an armature (a collection of bones). You don't have to do any extra steps in those cases. But sometimes, they don't. You'll have to realign it yourself, but check if the model has any animations named T-Pose to skip unnecessary realignment.

For this demonstration, we are going to use the Strong Chicken model from the developer tutorial. Import in an army man model (converting to Blender 2.92 using the export FBX function) and the chicken model. Delete all the army man meshes, but make sure the armature remains. Similar to the tutorial, scale, join parts, and change the origin point on the chicken. Finally, clean-up the chicken model by selecting it, going to mesh, going to clean-up, and delete loose. As an additional step, merge by distance to remove stray vertices. These last two steps help optimize the model, but aren't required.



Scale the model (or armature) to be approximately the same size. Move the armature to line up with the feet if your model is a quadruped or otherwise. Then, copy and paste the armature data.
Block and hide it for now. Go into edit mode and move the bones to appropriate spots on the model. You can see through the model using the icons above the XYZ jack. In order to mirror the bones, move one side into position, then copy and paste the transform values onto the opposite bone, inverting the X-axis. When you move a bone, make sure it is the bone and not the joint (circle) you are moving.

The next thing to do is to select your mesh and armature in object mode and parent with automatic weights (armature needs to be the parent). Test that it works by moving a bone in pose mode.



Now we need to set the model into a T-pose. Begin rotating and moving all the bones into a proper stance. You can use the extra armature as a reference, but there's no need to be exactly straight if it breaks your mesh. If you accidentally go into edit mode, you can undo to return your progress.

With the T-pose set, we want to make it the rest pose. In Object mode, apply all transforms with both the armature and mesh selected. Then, go into the mesh's modifiers (wrench icon), go to armature, and apply all (drop down arrow). Finally, select everything in pose mode and apply pose as rest pose. You will need to re-parent the armature and mesh, but you can delete the extra reference armature. You only need to create the two duplicated/decimated meshes and the model is done!



Now, the model will work as is if we make an avatar form this model in Unity (more on that later). The alternative is to do the same thing we did earlier. Import in either the blocks man, army man, or action man depending on how big you want the unit to be and remove their meshes. Delete our model's armature, rescale the mesh, and bind the new baseline armature. Now, the model should be able to use the base avatars and upload to Mixamo. Mixamo only takes conformed humanoid armatures.
Blender - Making a Model be Whatever You Want
I want to spike your creativity for a second. Just because a mesh is a chicken or a gun does not mean you can't use the chicken as a gun or have the gun as a soldier. I'm talking about mad scientist vibes; Splicing and cutting and shaping it to fit your vision. As an example, I'm gonna turn Strong Chicken into an Egg Launcher.

A mesh needs bones for me to change it's pose, so I load up my Chad Chicken to save time. I save as a new file to not lose my Chad. First, I want to delete his giblets in edit mode. Then, I dissolve the faces on his crown bit by bit. The model now looks more like a hen than a rooster. It is easier to do this now before I change the posture. I should have also set the color materials here as well, but I forgot and did them later. The head is a bit misshapen, so I scale the large face small and lift it up.



I rotate Chad with his butt facing forward (armature Z axis) and use pose mode to move his limbs into a 'firing' position. I also remove the extra meshes. I double check the pose and apply the armature modifier.

I delete the armature now that it has served its purpose. I rotate and apply the mesh in the correct position. The origin point needs be where a 'grip' would be on a gun, so I line up Chad and set a new origin point. Snap the cursor to world and then origin to cursor. I then scale it bigger to be easier to work on.



We aren't going to be using the same texture as Chad. I'd love to have the gun be brown like a hen, but having the gun take on dynamic colors makes it easier to identify whose team the unit is on. So, I separate the eyes, feet, and beak into a different material. I could separate more parts that I want to maintain their color, but I feel this is good enough. I use the Blender colors to ensure all the parts are assigned to a material before I use the color texture pack to color the separated parts. The rest of Chad goes dark green in Blender.



I change the scale, then I make the .001 and .002 versions to end off. Unfortunatly, the model doesn't have a normal map .png. Without a normal map texture, the model won't have the detailed shadows that give it depth.

Our egg launcher is now complete, but we need some egg shaped bullets. I hide the egg launcher and create a UV sphere. I feel nine rings are enough. I then use scaling to elongate the sphere into an egg shape.



I decide I want white eggs and assign the UVs to the texture pack again. I pick the angle I want the eggs to be launched. I smooth the shading and my bullet is done.



The Egg Launcher is finished.



I plan to use these, but there are so many other options I could have done. I could have taken only the chicken head and turned it into a grenade. I could have taken that same chicken head and turned it into an attachment or even scaled it to building size and turned it into a spawner. Heck, I could have grafted extra arms and heads onto Mr. Chicken and made him a mutant. It might affect how the animations look, but I could do it. All I'm trying to get across is that you don't have to make something glamorous, just make something you find fun.
Unity - Creating a Unique Soldier, Weapon, and Bullet
So far, we have set each model to humanoid and used an avatar from a different model. We've done this without really knowing why. Well, imagine an avatar is like the muscles that move your bones and skin. This tells Unity what bones the game engine should read and where they are. Unless a model has the same bone size and structure, an avatar from another model won't work. This is where you'd need to create one from the current model. The army man animations will only work if you have the bones named and pathed correctly; more on that later.

On the off chance Unity doesn't create the avatar properly, you can configure a humanoid avatar under rig. You can check if Unity auto adjusted the model into T-pose or if some bones are mislabeled. You can also move them around if the mesh doesn't line up how it should be.



Begin by making a duplicate of a base skinned mesh of the appropriate size. i'll reiterate; a duplicate, not a variant, must be made. The source of the prefab must lead to the super base or the baking process will not work. Go ahead and input your data. Delete all the attachment and collider follow objects. They will be generated automatically later.

Don't be fooled by the textures you may see. They will disappear during the baking. We actually need to go to the project folder and create a new material. Then, take the texture file(s) and apply it to this material. Use this material for your model. Your model may look too bright in just albedo, so try putting the material in emission too. Emission has something to do with emitting light or coloring on the model.

I hope you deleted the old bones and imported the model's bones. The model won't work otherwise. Our mesh's new bones need colliders. A collider represents hit detection and the physical space the model takes up (collides against other objects), and it may differ from the mesh's look. We don't need to add every collider manually as the developer has made a ragdoll script under the game object toolbar. Assign the bones and give an appropriate strength. Excerpt from soldier guide:

Here some Recommended Ragdoll Mass & Strength:
Army Man Category: 20 & 500
Blocks Man Category: 40 & 500
Robots Category: 50 & 500
Action Figure Category: 70 & 500

You will need to change at least 2 colliders: The spine and waist. If you have a non-spherical head, use the capsule collider. Replace the spine and waist box collider components with capsule ones and shape all colliders to your liking. Try to avoid too much overlap. Now, the component 'Playerbase Damageable Part Script' needs to be added to every bone with a collider. Make the bone's rigidbody the target for the component. I recommend changing the damage scale of the head to two.



All attachments need to be made into the bones and assigned. Do not create the object within the area you want it, it'll change the scaling. The names are non-negotiable, but the position is more of a suggestion. Unfortunately, the followers don't work quite like I thought they did. If you move the backpack attachment position to the hat position, the backpack follower attachment will not maintain the proper rotation required for a hat during animations. This means that if you want multiple decorations for a slot that line up a certain way, you will need to make a single mesh containing all the decorations. You will also need to do extensive testing if you put your attachment points in odd positions. Don't forget your hit point.

You may want your model to drive or other static actions. If so, make a variant of the skinned mesh and rename it. Change the static animations components to what you need. If your model will have any decorations, put them on this mesh.



Make a duplicate of the corresponding troop now that the mesh is done. Replace the mesh and put in a mold. Under the animations component, slot in the new avatar that was created. Only the army man sounds library has voice clips built in, so use it as a starting point. Adjust the sliders (can go over the limit) however you want, but it'll need to be baked before you can hear the results. The sounds library does not go under the world root section. See the following developer guide for more details. Speaking from experience, set the volume to 0.04 for weapons sounds and 0.08 for voices, make minuet changes to pitch, and don't use negative numbers.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2898616658

It's weapon time! Once again, a prefab is made of the base weapon, but the egg launcher I made earlier needs to have a different kind of bullet than the basic hitscan shot (hits as soon as it fires). So, I search though all the bullets and find the Rocket bullet. I'd rather have a grenade launcher bullet, but the AI can't aim those types of weapons. It has a rocket as the default mesh, but I also don't want to change this base asset. So, I duplicate the bullet prefab to make my egg bullet and delete all the data in the source ID component. I will have to add this bullet into the my mod pool prefab. IDs are generated for you.



The size of the bullet listed is related to the rate of fire. I believe the rate of fire is multiplied by this number to get the true RoF. Use the base bullets as a benchmark for any custom bullets you make. You can find the size of base bullets in the toybox prefab. Since I want my egg to be rocket-like, I set the size to 150.

I place my LOD parts and assign their data. My weapon has four different materials, so I increase the size. After that, i finish the gun by giving it the sounds, muzzle flash and stats. I choose the RocketSmall effect and move its position to the end of the gun. I bring in the grenade launcher sound from the extraction folder.



With that, Chad here is pretty much done. I'll need to perform the steps earlier in this guide, but I now have a new chicken soldier with an egg launcher. Arrange your attachments before you bake, or you'll have to use the previous method. This includes rotating them, and remember to do it from the skinned mesh. You'll need to move attachments to the follower's version mid-bake.
Extracting from Non-Unity Games
Asset Ripper is great for Unity games, but what about other engines? If you have access to their .bin, .text, .WEM, and .BNK files, you can snatch data from them. Bin files contain the assets of a game while the text files contain the coding. Game music is contained within WEM files and sound effects are in BNK ones.

Asset Studio is the tool we need to examine and extract from .bins (and .text if you need coding). Drag and drop a .bin or two to see everything contained in the bundle. In the first menu, you can see the models, but you can switch to the other menu to see each individual asset. You can extract the model wholly, or select all the individual assets and extract them separately. To get the animation clips, you'll have to select each one from the asset list and then extract using either option.

To read the sound files, you need Foobar2000 with the vgmstream plugin. Just drag and drop the file in. Nothing will be named, so I hope the files themselves tell you what they contain. You'll have to listen to each clip and make your own distinction.
Blender - Model Animations
When you take a model from another game, more likely than not, you'll want to keep the animations. Well, it's a little complicated. It is doable, more so when you have someone like me guiding you.

When you extract your model with animations, there are a few things to keep in mind. These specific animations require a specific bone path. This ruins the compatibility with other animations unless they're similar with the same bone names. You'll also need to have an animation for each action the AOT AI will take. It can be any animation or even duplicates, but it must have one. Your model may not have all the needed animations, but I'll show you how you can splice some yourself.

Upon booting up the FBX file in Blender, delete all objects that aren't the armature or mesh (nevermind my screenshots) and switch to the animations tab. Click the Dope Sheet and swap to action editor. From here, we can swap which animation/pose the model is in. Look and see if the model has a T-pose animation and select it. My model is technically in an A-pose, but those are also fine for what we plan to do in Unity.



Do you see the slight difference from the T-pose and rest pose? Those flying bones are called ik bones. Those are bones for animation movement only. The rest pose has his eyelids closed and will ruin the eye movement of the animations if we use this as the model base. You don't need to worry about this because when we export the file, it shouldn't matter. Just be aware of this in case an issue crops up and you need to set the rest pose or export in T-Pose.

Before you start tinkering, a very important warning. The Skinned Mesh Ragdoll Script reads the scale of the model from the armature. This is a problem because when you apply the scale to the armature in Blender, all the ik bones go haywire and cause the animations to distort. Most of the solutions to the scaling problem aren't applicable because the script reads the scale from the armature itself, and no where else. The solution to our issue is solved using the method described in the following video.


In a nutshell, we need to scale each animation's/action's Y location by the same amount we scaled the armature. Use the method described in the video, but open the resize sub menu that pops up to input the exact scale value. Apply the scale in object mode when you're finished. I also recommend saving a backup original file in case something goes wrong.

Look though all of the actions and make a checklist of ones that fit AOT actions and which actions you need to be filled. My lemurian doesn't have a dead pose, so i need to borrow from another animation. I load up the Death2 animation because the creature is lying down at the end. I Make a new copy of this animation using the paper icon next to the name. I rename it to be easier to find. Feel free to rename other animations as you go.

I play the animation to find a point to splice. I can shorten how long the clip plays in Blender using the start and end frame in the corner of the tab. Since I only want the last frame, I delete all other shape keys and move my keys to the start (Use 'g' to quick move). I shorten the frame limit to one and check the animation.



Lemmy here has two separate interconnected animations; one to charge his fireball and one to fire. I want these to both be a single animation. I duplicate his charging animation and copy/paste all the shape keys from his firing one onto the end. I hit play and move them for a smoother flow. Now I have a shooting animation. I also have a separate bite animation I can use for a melee 'shoot' animation.



I decide to also make a down animation. So, I make another copy of the death animation and delete half of it. Movements are linked (green lines) and I can lengthen or shorten the transition. Here is a photo of me playing around with it.



I duplicate the keys and shift the duplicates to be the inverse of the original. Then, I move them around while the animation is playing until I'm satisfied. The bright yellow line indicates where I spliced the duplicate.



I don't really have a get up animation, so I'm going to reverse the death action. The mirror function helps make this easy. It isn't perfect, but it'll do and I play around to make it a bit smoother. If you want to delete animations, delete all the shape keys and hit the x. It'll disappear when you next load the file.



I make a water animation by using a piece of the leap attack animation. I duplicate it and trim down some keys to get a smoother loop. You can find the right spot to cut using the Jump to Keyframe button next to play. I'll probably reuse this animation for most water animations, but I can always make more if I change my mind. The animation speed can be adjusted in the animator, so don't feel pressured to change the keys if the only difference you want is the speed. Do change it if you want it to be slower at a certain point.

Two animations that AOT needs must be named StandUp and StandUp_Water. You can change these names in Blender or in Unity (animation tab next to rig). You may need to reimport the file for the second method. For some reason, an error occurs when baking if this is not done.



My Run Forward animation does not stay at the 0/0 mark and must do so for it to work properly in Unity. We go back to the graph editor for this and look at all the bone movements. We want the one that has a line that starts at the bottom and ends up at the top right corner at the end of the animation, usually the Z-axis. For most models, this bone is the Hip, but for me it was the ROOT bone.



With the bone selected in the graph editor, I hit Shift-H to hide all but the selected. I ensure all the shape keys are selected and that the cursor is centered at 0/0/0. I use the snap -> To Cursor function and the animation is fixed. You'll need to do this for every animation not centered.



Now I have all the animations I need, but there is an alternative to getting animations. The KeeMap Animation plugin allows you to transfer animations from one model to another. Using this plugin is not fast. You have to manually adjust the starting positions of each animation you wish to transfer. I did one for Lemmy to showcase transferring the army man crouch shoot animation.



I know it looks terrible, but I also didn't spend very long perfecting it. I don't intend to use this animation at all. It will work, though. This method can let you use any animation for any model if you're willing to put in the effort and still keep innate animations.

I finish the model by doing the previous steps including separating materials to color dynamically later. Don't forget to bake your new animations and hit the shield icon or you'll lose them.

One last thing; FBX export has a habit of adding extra pathways for models. If you use export multiple times for a single file, the pathways will not match the FBX file of a model that you export from the original. In other words, limit the number export branches to avoid pathing problems. If you can't, try assigning a root node in the rig menu.
Audacity - Combining Sound Files
I have combined my animation for the lemurian to charge and fire, but the sound files are still separate. That means I need to splice them together in Audacity. I don't know much about this program, but I don't really need to to combine audio files.

I place both files into the program. I cut a section from one and paste into the other. I redo this step to get a smooth enough sound. I export the file as an Ogg (which is what Unity wants) and I'm done.



The real reason you don't want to export as an mp3 file is because audacity puts a half second blank space at the beginning of the file. For that crisp no start-up sound bite, use Ogg.
Unity - Soldiers with Custom Animations
If you want your animations to work properly, we need to do things a little different than before. This time, we need to generate an avatar for the model using the Generic setting, not Humanoid, because my lizard doesn't have the same bone structure as other humanoid models. We can't configure it, but it should work fine if the model was in a T-pose or A-pose.

The first task before going any further is to tick some boxes. For almost every animation, you will need to tick these four boxes. The only exception would be for animations you don't want to loop, like the death animation. Something important to know is that 1 Unity second equals 30 frames. When assigning a firing animation later, you can use math to help line up the firerate and animation speed.



I'm going to duplicate the army man as my mesh and troop, but I want you to pay attention to the root [SKINNED MESH] Base and the [TROOP] BaseUnit. These are the root prefab for all units. If you compare the troop baseunit with the placeholder versions, you'll see that there are components missing from the prefabs. If you ever make a variant of this root base, make sure that you have all the necessary components. You'll need to put in a lot of data manually or copy components from the other placeholders. Oh, and do not duplicate the super base prefab as the script will not find it. Instead, use the Base Soldier prefabs to base your units on (similar prefabs are the Base Insect and Base Robot).

We repeat the previous steps and create our skinned mesh. My model comes with a normal texture .png. This goes in the normal map part of the shader. This texture file is used to create details and depth to your base texture without increasing complexity. It is like comparing a drawing of a brick wall and a drawing that has penciled in different shades of grey for shadows on that brick wall. My model also comes with an emission .png, so I use that, too.



My model looks weird, so I'm actually going to remove the normal map for now. I'll try again when I figure out why it makes the model semi-transparent. Another easy mistake to assigning the blood effect. Do not use the base blood as the model won't bake. If you want to simulate an organic, use the plastic red chunk blood.



I make a fireball bullet for my lizardman. I mainly mention this step because I play around with the particle effects. I have no knowledge of this component, so I just turn a few knobs here and there. I also have no idea how to create an actual fireball either. Instead, I remove the bullet trail, mesh filter, and mesh renderer and replace them with a particle system. I copy the components from the flame particle and paste them here.



Something else I should mention is that I added extra parts to my ragdoll to incorporate the tail. For each ligament, I added a character joint that also adds a rigid body. Each joint must be connected to the parent bone, i.e. tail1 connects to hip, tail2 connects to tail1, etc. We do this by assigning the rigidbody from the parent by simply dragging the bone itself into the empty slot. The mass of the rigidbodies can be changed to affect how strong the ragdolling is. The colliders and damageable parts can be done after the joints are created. For me, I liked the idea of the lizard taking half damage if hit on the tail, so I set the scale to 0.5.



I could use the animation override for my troop, but I actually want a variant of lemurian animations. I'm going to, instead, make a duplicate of the army man controller and use it as a base so my future overrides are simpler.

The controller looks scarier from the outside. All it really is is a kind of 'If, Then' flowchart. Every one of these boxes has an animation we need to replace. That yellow Idle is our resting point for all flows. The idle box also has rounded/pointy corners, which means it has another layer when can double click to enter. Idle 0 is standing idle, idle 1 is crouching, idle 2 is prone, and idle 3 is in water. This tiering applies to Shoot as well. Click the Up Base Layer to leave the layer.

You can set any animation for any action, even if it may not look great. I don't care about my lemurian shooting at any pose except standing, so I set all his shooting animations to his charge and fire. I do the same for his idle animations except swimming. I recommend putting forward animations for walking. When all animations are set, I can use an override of this controller to replace the charge and shoot with my bite animation and keep the others when I make a variant.



Animation speeds can be altered in the controller and it does apply to the override. I recommend altering the animations speeds from the troop components if you can before using these options. If you decide you want to make a player character, know that they need a lot more animations than AI units.

To finish my creation, I make a bite weapon and make Lemmy spawn allies. See the following developer guide for abilities you can give your soldiers.



https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2906474649

You will likely need to spend time fine tuning animations to get them right. For swimming, there is a water offset section in the player base script troop component that you can adjust if the model isn't deep enough in the water. You can alter the firing frame and animation attack speed here as well. Unfortunately, the firing frame cannot go past one second.

Conclusion
Modding AOT was far harder than I expected when I first started, but is simultaneously easy in hindsight. Because I had no Blender nor Unity experience, I had to smash my way through problems using brute force and research. Now I feel like I could make any soldier I want in this game. I hope my guide gives you a similar confidence and sparks your interest. Do check out the developer's other guides as they'll give you the basic info you need to make other stuff.