For all Unity developers and developers-to-be, both beginners and professionals!

Post tutorial Report article RSS Feed How to set up a mod

In this tutorial we'll run through the basics of how to set up a mod and get it to load in the Editor.

Posted by Kelso on Apr 10th, 2012
Basic Client Side Coding.

In this tutorial we'll run through the basics of how to set up a mod and get it to load in the Editor. Once the proper folder structure is in place and we tell our config file where to look we'll take a stab at creating a new terrain option for maps. Onward!

First things first - navigate to the folder you installed Fractured State to. At the time of this writing Fractured State doesn't actually install - it's just a .zip file that you unpack to a destination of your choosing (but I'm sure that will totally change in the future...totally). The first step is to determine the location of your Root Folder. On Windows this is <location of fs.exe>/fs_Data/fsdata/ and on Mac it's <location of>/Contents/fsdata. Open this folder and then edit Config.xml in your favorite text editor (I prefer Dreamweaver for XML myself, but to each their own).

You'll see something like this

<?xml version="1.0" encoding="UTF-8"?>
	<dataPath isRelative="true">/fsdata/Mod</dataPath>

A few things here. <debugLevel /> controls the messages you see during startup of the app. verbose means you'll get messages when stuff loads and a general update on progress. Setting this to none or omitting the element entirely will suppress these messages. If something tanks you'll always see the exceptions and stack traces regardless of these settings (unless something really tanks in which case you should report a bug in the forum). The next element controls where Fractured State should try to load Mod data from. The isRelative property determines whether or not the given path is relative to the game's executable or not. If you wanted to designate a fully qualifier path (on your Desktop or a separate HDD for instance) you would set this to false and then provide the full path as the value of .

Let's add a third element to this. Add the following XML below the element.

<activeMod>My Awesome Mod</activeMod>

This will tell Fractured State that it needs to look for a mod called My Awesome Mod when it loads. So let's give it something to load. In Windows Explorer or Finder navigate to the folder you declared as the dataPath (this is fsdata/Mod by default). Create a new folder named My Awesome Mod and then inside this new folder create a file called Mod.xml.

Fill up Mod.xml with the following markup

<?xml version="1.0" encoding="UTF-8"?>
	<name>My Awesome Mod</name>

Save this file and launch the Editor. Once the loading procedure completes you'll see a message in the lower left corner of the screen indicating that My Awesome Mod is currently active.
Mod indicator

I painted some texture and sculpted a quick hill just for flavor. Your view will be much more boring. Note that the value in <activeMod /> controls the name of the folder to look in, whereas the value of <name /> in Mod.xml controls the value that appears in the Editor. (Eventually this will totally be expanded to include version numbers and other stuff...totally.)

Now - let's actually mod something. Create a new folder in My Awesome Mod called Art. Inside this folder create a new file called Terrain.xml. Let's put the following markup in this file

<?xml version="1.0" encoding="utf-8"?>
	<terrain name="Test Mod Grass">

Save this file and fire up the Editor again. In the New Map window you should now see a new terrain option called Test Mod Grass. Because this uses the same settings as the default grass terrain option you won't see any difference if you actually generate a map with this terrain.

Congratulations - you made your first (totally awesome) mod for Fractured State! The next step is to take a look at the SampleGrass material file and create a new one based on that. Terrains are loaded cumulatively so anything you add as part of your mod will be loaded on top of the base terrains. If you name a terrain the same as a base one, your modded one will win and overwrite the base one.

Have fun!

Post comment Comments
matfrem Apr 12 2012, 7:45am says:

Just one question :
Your game is not even released, not even alpha, not even playable that you already have a mod system ?
Well.. do you expect people to use it NOW ?

+1 vote     reply to comment
Kelso Author
Kelso Apr 12 2012, 5:06pm replied:

Of course. The game uses the same system as the mods for loading data so I have to develop the system in order to develop the game.

There's nothing stopping you from using it now. It wouldn't be very interesting because of the lack of features, but it's there to tinker with. :)

+1 vote   reply to comment
matfrem Apr 12 2012, 5:31pm replied:

Nice ! Sorry maybe I was a bit rude, but I've seen many games begin with "oh, you can dome plugins", and wasting time opening their tech instead of making the game...
Good to see you still have your objectives, so good luck !

+1 vote     reply to comment
Kelso Author
Kelso Apr 12 2012, 7:48pm replied:

No worries - I can see how it would appear odd. In reality, Fractured State is just a mod built using the framework.

Thanks for the interest!

+1 vote   reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Oct 31, 2010
Open to all members
Send Message
Join this group
Group Watch
Track this group
Report Abuse
Report article
Related Games
Fractured State
Fractured State Single & Multiplayer Real Time Strategy
Related Engines
Unity Commercial Released May 2005
Related Groups
Indie Devs
Indie Devs Hobbies & Interests group with 1,216 members
Mechanical Monocle
Mechanical Monocle Developer & Publisher with 4 members
Unity devs
Unity devs Hobbies & Interests group with 1,364 members