Modding Tutorial: Adding new assets

This tutorial covers how to add anything that might have a 3D object representation in game.
This includes:

  • Furniture
  • Equipment (Tools, Weapons, Clothes, Armor)
  • Walls, Fortifications, Fences (all count as “walls”)
  • Floors
  • Pillars (counts as “furniture”)

For most of these items, you can find an example setup in the Unity Project and in the Example Mod contained in the FFModKit. If you’re unsure how to use any of the tools or how it’s supposed to be set up, have a look at these two places and see how it’s done there.

Example Walkthrough on how to make “furniture” objects

1. Make a folder for your asset(s)

In order to use your assets, we will use the Unity FFModKit to compile your 3D models, materials, textures and icons into one .ffasset file. For this purpose create a folder in the Resources folder in Unity. One folder will be compiled to one .ffasset file, no matter what’s in there. This way, you can organize your assets however you like.

image

2. Make a 3D model

Use blender or any other tool to make a 3D model of your idea. For inspiration and templates, you can have a look at google poly or other places where you can get assets. Make sure to not violate any licenses.

Put your model in the Resources/MyFurnitureAsset/ folder. This is my simple, yet awesome (programmer art) laser sword workbench:

3. Set up materials

Simply create a new Unity material using the Unity Standard Shader or any Shader in the Custom category.
For many people, the Standard Shader workflow is the easiest way of coloring your object, because it’s what they’re used to.

We devs often use the “Manual Shader” family so we can quickly set colors for the object in-engine. It basically works by using the objects UV coordinates to assign a color based on the settings in the material. There are some caveats however: If you use Manual or ManualDoubleSided you’ll need to “bake” the material before you can use it ingame. Otherwise, you will not be able to compile the .ffasset. We don’t recommend this workflow to newcomers and people used to working with the Standard Material. If you do want to know more about it, let me know.

4. Make Icons

Your assets need 2 Icons in order to be visible in the game:

  • yourFurnitureNameIcon.png at 128x128 px
  • yourFurnitureNameIconBig.png at 512x512 px

You can use any tool you want to make these Icons, but we have set up a special tool called “photoStudio”:

  • In Unity, navigate to Tools/photoStudio and open the photoStudio scene
  • Put your object in that scene. You might need to remove whatever example object is already in there
  • In the top bar of the “Game” window in Unity, set your resolution to something square, like 512x512
  • Find the MainCamera and position it such that your item is clearly visible and icon-ready
  • Be sure you always move the “parent camera”, so both camera are always in the exact same location. One camera is for you to look at the object, the other actually takes the picture.
  • Start the game
  • Enter the name of your object, for example yourFurnitureName
  • Click on “Shoot Photo!”
  • The game has now created and saved icons in various sizes in the FFModKit/Icons/... folders.


5. Add a drop shadow to the icons

Most icons in Founders’ Fortune have a white drop shadow. For most people it’s easiest to just open GIMP and add a white drop shadow themselves.

For our development purposes, we have created an automatic system that can quickly apply drop shadows to hundreds of object. However, this system takes some time to set up. If you’re interested, check the instructions on the FFModKit Readme.

Finally, copy your icon over to your asset folder and check if the settings in Unity are set correctly:
image

6. Compile the .ffasset file

First, make sure that all of these necessary files are in your Resources/MyFurnitureAsset folder:

  • The 3D objects you want to include
  • Any accompaning materials and textures
  • The icons, properly named

Next, select this folder in the Unity Hierarchy Panel - not in the tree view, but in the big panel.
Right click on the folder and click “Build Asset Bundle”.

In the folder FFModKit/BuiltAssetBundles the tool has now created a MyFurnitureAsset.ffasset file. This is the compiled version of all the work. Copy this folder in your mod folder and the game automatically has access to all the assets contained in it!

7. Configure your furniture.json file

In order to use any new object in the game, you need to tell Founders’ Fortune about it. This is done by writing json files. In this example, we create a configuration file for a furniture object. Put a file called furniture.json in your mod folder.

For guidance on how to configure your furniture, check the example furniture in the example mod contained in the ModKit. Link to online version here.

For more examples, check the game’s own configuration files. I uploaded them to the ModKit as well.

7.1 How to set up interaction transforms

If your object is not only decorative, you will need to tell the game where your villagers need to stand in order to properly interact with it. This is done through the interactionTransforms property of the element in furniture.json

In many cases it’s fine to simply copy the interactionTransform from a similar piece of furniture in the base game, but there are situations where you can’t find a similar furniture. In this case, check out the InteractionScene in the Scenes folder in Unity. You can find an example colonist working on a workbench. The transform of the workbench is set to (0,0,0) location and (0,0,0) rotation. Now, look at the location and rotation values of the example colonist and copy them over to your furniture.json interactionTransforms list. This way, the game knows how the colonist needs to stand relative to the interactable object.

8. Add a name and description for your object

Check example localization.json file in the Example Mod to find out how to add the necessary text for your object. If you want, you can even support different languages :smiley:

9. Test your object in the game!

Now it’s finally time to test your new object in the game! Once the furniture.json and MyFurnitureAsset.ffasset files are in your mods folder, you can start a new game and have a look in the build menu. Depending on the value set in buildPanelSection you can find it in different places in your build menu (see example mod).

Currently available sections are:

  • life
  • farming
  • work
  • military
  • lights
  • seating
  • tables
  • storage
  • decoration
  • rugs
  • doors
  • windows
  • pillars

Check if eveything works as intended. If it does, celebrate! Congrats! You made it!

In case anything went wrong…

  • check the console output for any errors
  • check if you kept your naming consistent. If your 3D model is called aSpecificName, you will need to call it aSpecificName in the furniture.json file and icons need to be called aSpecificNameIcon.png and aSpecificNameIconBig.png for the game to find them.
  • double check this tutorial if you forgot anything
  • check the Example Mod to see if your items are set up the same way
  • ask the community and the devs if they might be able to help you out :slight_smile:

Notes about making construction elements like walls and floors

Walls, floors, fences, fortifications and so on often consist of multiple models that are used for different situations. Therefore, the models need to follow a strict naming scheme.
Check the models in the example mod as well as their definition in the construction.json file in order to learn how to set it up for you.

Notes about making weapons and tools

All Equipment is needs to be available, equipmentNameEquipped and equipmentNameOnGround. As you’d expect, the equipped object is what’s actually spawned in colonist’s hand when they equip it. In order for this to work well, the object hierarchy needs to be set up like for the laser sword in the example mod.

The onGround is used in any place where equipment can be stored, for example in the tool racks.

Notes about making clothes and armor

Armor and clothes work similar to weapons and tools, having 2 versions for equipped and stored situations. The big difference is that clothes need to be animated. This type of modding is a lot more involved than static objects. In order to get started, I recommend using the StarMasterArmor as a template and building your new clothes for this rig.

The equipped version of the armor should be exported as .fbx. In blender 2.79 you can use these export settings:

When the modded clothes are imported into the game, their rig is deleted and all bones are instead mapped onto the animated rig of the colonist. That’s why it’s important to use the exact same rig we use for the colonists.

2 Likes

Final notes

  • You don’t need to name your configuration files exactly furniture.json. Only the beginning and the end of the name are important. If you want to organize it differently, you may also call it furnitureCoolBakery.json and it will work just as well.

Laser sword would need a lot of crystals :slight_smile: I mean A LOT!

1 Like

Can you also make a section explaining how to add for example different types of trees which are spawned randomly in the world and give resources?

1 Like

Hi Loikas,

Yes it would aid in adding different fruit types.

I’d like to add a couple of different grass types and maybe a few different shrubs for decoration.

I would, but world generation is not easily moddable yet :man_shrugging: :slight_smile:

theoretically, you could spawn them yourself with code, but that’s a bunch of effort.

1 Like

Thanks @Daniel :slight_smile:

My thoughts were a bit different to @Loikas. More along the line of adding fruit trees like an orchard through farming. The grass’s and shrubs would be for creating a lawned area and beautifying the houses so either through farming or decoration.

I sort of gathered that spawning new flora would be a major reshuffle of the world map system.

Would fishing be a hassle as well ?

Spawning flora in world generation is difficult for modders right now, but making your own orchards should be doable!

With fishing the difficulty is that modders can’t easily add animations or resources right now.