Barony
39 ratings
Barony Official Models Workshop Tutorial
By WALL OF JUSTICE
This tutorial will show you the tools you need to create modified models voxel files and load them into your game.
3
   
Award
Favorite
Favorited
Unfavorite
Introduction and Software
Hi all, to celebrate our updated Workshop support, here's a new tutorial to edit Barony's model files and load them up in-game!

This tutorial will cover software necessary, what files to edit, and how to load the custom model in-game. We'll be delivering a recolored boulder model as something nice and simple to get started with models.

We first need a Voxel editor to edit our .vox format models, I personally use Black Flux's VoxelShop[blackflux.com] to create models to play around with. Grab it from the site and install on whatever OS you're running on (compatible with Linux/Mac/Windows) before we get started.

Another program that people have used is MagicaVoxel if you're looking for an alternative to VoxelShop. I personally haven't encountered any limitations with VoxelShop as it's fairly well featured and nice to use, we'll be using VoxelShop in this tutorial.
NOTE: When using MagicaVoxel, make sure to export using "slab" type in the bottom right menu rather than saving as .vox in the default save dialog.

Let's boot up Barony and jump into the Custom Content main menu option.



Standard procedure from the previous Workshop tutorial, click "new mod folder" in the new sub window that appears.



You'll be prompted for a mod folder name, since we're going to be recoloring some boulders, I've gone with RecoloredBoulders. Hit create once you're finished typing and you'll have a new directory inside the Barony mods/ folder.



Model File Locations
Now navigate to the Steam install directory of Barony. Install path on Windows should be something like C:\Program Files (x86)\Steam\SteamApps\common\Barony. You can also find this information by right clicking Barony in the Steam Library page, clicking properties and under the "LOCAL FILES" tab there is a button to "BROWSE LOCAL FILES" which will open up the install directory inside your OS file explorer.

If you open up the mods/ folder inside here, you'll see our new folder RecoloredBoulders.



All new mod directories start with a levels.txt file inside the maps/ folder. We want to delete this as we're not using custom map files for our mod.



Now we want to figure out the location of Barony's boulder model files. Go back to the base directory, and head into the models/ folder. You'll find monster limb models inside the creatures/ folder, doors and portals inside the doors/ folder, in-world item models inside the items/ folder, particles/magic effects inside the particles/ folder, and the rest of the miscellaneous in-game models like furniture/boulders/fountains/chests etc inside the decorations/ folder.



There is also a resource file called models.txt which refers to the location of all model files which you can search through inside a text editor to find the keywords you want. So in the case of boulders you can look for the search term "boulder" and you'll see this line:



The game looks for the line 246 specifically in this file to determine which file to use for the in-game model. So peeking inside the decorations/ folder we find our boulder.vox model to edit.



Now let's open up VoxelShop and import this file we just found!
VoxelShop Editing
When you boot up VoxelShop, you'll see an empty interface like this:



To import Barony's models, go to the file menu and select Import... or CTRL+I to open the dialogue. From here you'll need to navigate to the Steam install directory we found earlier (C:\Program Files (x86)\Steam\steamapps\common\Barony\models\decorations)



Open it up and you should see the pretty Boulder voxel model in front of you. There's plenty of tools in VoxelShop, the Camera or V key lets you drag around the model and zoom in/out with the mouse and holding left click or right click and dragging. You can draw new voxels with the Draw Voxel button or C key and select voxels to recolor or move/delete with the Selection tool or X key. We'll be recoloring the entire model so I'll use the CTRL+A shortcut to select all voxels. You'll see the model highlighted like this to show the selection.



Once all voxels are selected, you can recolor them all at once with the Color Adjuster toolbox in the right side of the interface. Play around with these sliders until you get a color you love. I like pink.



Once you're finished editing the selected voxels, press ESC to deselect all the voxels again and view the model without the gridlines. Now it's time to export to our mods/models/decorations folder. In the file menu once again, click the Export... button or CTRL+SHIFT+E hotkey to open the export dialogue.

Navigate to the Steam mods directory at C:\Program Files (x86)\Steam\steamapps\common\Barony\mods\RecoloredBoulders\models\decorations which is where we want to save the modded file. The location must mirror the path the game normally expects the model file to be. (models/decorations/)



From the dropdown box, select VoxLap Format (*.vox) which is the correct model format that Barony accepts. Any other selection likely won't work or may crash the game on load, so make sure this is correct! Keep the model name the same as the original (boulder.vox) as that's the filename specified inside the previous models.txt file we looked at earlier.

If we take a peek inside our mod folder now, we should see our exported boulder.vox file as below.



If you want to call it something else, you'll need to copy models.txt to your mod/models/ folder and change the name inside that copied file to match your desired name. (E.g we could call it boulderPink.vox and change the models.txt file to match at line 246.)

Editing the models.txt file is not recommended as it'll conflict when loading 2 or more mod files that edit the models.txt file. So if you want to name your exported models with descriptive filenames, I recommend just making a new directory somewhere else on your computer where you can keep all of your VoxelShop project files. You can manually copy/paste from here into the Steam directory which is a better workflow than just directly exporting from VoxelShop. You can name your revisions boulderV1, boulderV2 as you progress in your voxel artistry skills and play around with what works best, then finally renaming them to the proper boulder.vox filename in the Steam directory once you're ready to test in game.

Time to load this model in game!
Loading the Model In-Game
From here, the hard work is done. All that's left is selecting your local mod folder to load from the Custom Content window. Click "local mods" inside this window to look for all mod folders inside the Steam Directory, and hit "Load Item" to prepare the file for loading.



Now click "start modded game" to load the files up in Barony (You'll see a flicker of a black screen while this happens.). Shouldn't take too long to reload this single model, but could be a couple seconds if there is a lot of changed model files to load. Note that loading mods with just edited models will not affect your Steam Achievements.

The only thing that disables Steam Achievements is having content inside the mods/RecoloredBoulders/maps/ directory, which I mentioned before you should delete the levels.txt file when you first create the folder! So if you are at the Character Select window and in the bottom right there is a Steam Achievement disabled warning, check that the maps/ folder is empty inside your mod. It'll look like this if disabled:


Now we can run around the mines and look for a shiny boulder!



Looks fantastic.
Conclusion
That's all for this tutorial, hope it helps some of you along!

To upload the mod on Steam, I recommend reading my previous Workshop primer guide https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1359907800 to show the selection of mod files for Workshop upload. The process is identical for all sorts of Workshop content, doesn't matter if it's models or maps inside your mod. Remember to choose the models tag on the Workshop upload screen to let everyone know you've got some custom models to show off!

You can look up some guides online for VoxelShop if you'd like to know more about some editing features and tools available.

And some final notes explaining how model files are handled:
  • Their size does not change the collision box as that is entirely handled in the source code.
  • Changing total voxel model height sizes can make models float or sink into the ground. Their center point is expected to be fixed in the source code to determine how much to move the model around in the world. If the model is suddenly smaller, then it'll likely appear floating as the code anticipated a larger model to push up higher vertically into the world.
  • When editing monster limbs, you'll also see a limbs.txt file inside the monster folder e.g models/creatures/skeleton/limbs.txt which tells the game how much to offset each of the limbs for the monster.
  • For example, the text
    "# head 0 0 0 -1.5" says the model index 0 (head) should move 0 voxels horizontally, 0 voxels forward/backward and -1.5 voxels up/down. The head model skeleton_head.vox in this case is raised 1.5 voxels since it's higher up on the monster's body, otherwise it'd appear embedded inside the torso.
  • The limbs.txt file is not currently supported by the Workshop file loading, but you can play around yourself with the base game directory contents to see the effects. It's a lot of trial and error if you get around to resizing monster limbs, results will definitely vary when things start rotating and such.
  • To reload limbs files in-game, use the command /reloadlimbs between saving the limbs.txt file to better see the movement for yourself.

    Any comments/questions/concerns let me know how you go!

42 Comments
It'sGoogly 6 Jul, 2024 @ 10:54pm 
I figured it out actually was in the wrong Item folder. Ran into a new issue though VoxelShop wont detect the file I just made and I need to rotate the asset ingame
WALL OF JUSTICE  [author] 6 Jul, 2024 @ 10:51pm 
Might need to delete models.cache and launch the game or console command /loadmodels in chat to refresh
It'sGoogly 6 Jul, 2024 @ 10:47pm 
So i followed the steps and the vox name in my mod folder is the same as the one in the base game but it's not showing up in game. Though there is a "images" file in the modfilename/items folder am I suppose to put the vox in there? I am re texturing WoodenShield
Astral Ocean 8 Jun, 2024 @ 5:54am 
Alright then, thanks again for helping me out. I really appreciate it.
WALL OF JUSTICE  [author] 8 Jun, 2024 @ 5:26am 
No, you'd have to rotate the models 90 degrees only in the voxel editor
Astral Ocean 8 Jun, 2024 @ 5:23am 
what about rotations, is it possible for me to rotate the limbs?
WALL OF JUSTICE  [author] 8 Jun, 2024 @ 5:20am 
Example limbs.txt torso:

# torso
1 0 0 1

First 1 is the body part number, leave that. Then the other 3 numbers can be changed to move the part in 3 axis - left/right, forward/back, up/down. Can't recall which one is which but trial and error figures out the directions. Incrementing by 0.5 moves 1 whole voxel
Astral Ocean 8 Jun, 2024 @ 4:08am 
Can you explain the limb offset adjustments and how it works and how to edit them? I"m still very new to this so my apologies and thanks for clarifying the animation stuff.
WALL OF JUSTICE  [author] 8 Jun, 2024 @ 4:01am 
There's a limbs file in barony\models\creatures\insectoid\limbs.txt where you can adjust offsets (second row of numbers is usually the torso), /reloadlimbs command to see changes in-game.

Animation is all done in code, so not possible just by editing art files.
Astral Ocean 8 Jun, 2024 @ 3:53am 
if its possible i want to add an animated tail for my Argonian mod