Next in our series of tutorials for Modding is the topic of packaging for rFactor2. The Packaging is a new feature of rFactor enabling modders to deliver Mods as complete closed packages, that enforce untempered multiplayer racing. The packaging topic is still very much debated in Modding circles and we figured the available tutorials are not a good point to start. So Stefan Triefellner sat down to summarize his experience.
This tutorial is a how-to mainly aimed for car mods! It does not cover the topics of updating an existing mod. We will write another tutorial on this topic later.
This tutorial was written for rFactor2 build 60-90, newer builds may behave different and have different processes.
Talking about components and mod packages
Before we get into details how to package your stuff we should talk about the structure in the new packaging system.
So what are MAS, RFCMP and RFMOD files?
- MAS files are some sort of archive where you put your actual files (textures, models, physics etc) in. Think of it like a zip archive.
- RFCMP files are the so called components. A component consists of your actual files stored in those MAS files.
- RFMOD files are can be sort of a container for your components but their main purpose is to install a series. You don’t have to put components into it. You can actually just refer to the components you want to use in yout series.
You may still ask: what is a component and a mod anyway? Look at games like Forza Motorsport and Gran Turismo. You could say they use a similar concept. They also have components and mods. In their case components are the cars and tracks that you can drive. Mods are the championships that the single player career offers you. These championships just need to define which cars are allowed and on what tracks you’re racing.
So different championships (mods) just have to refer on the cars and tracks needed. It’s pretty much the same with rF2 but they divide the components more. For example if you make a car you have the actual vehicle component which defines graphics and physics and components for sounds and talent files. That makes sense as there are some cars out there that share the same engine so you could reuse an existing sound package. For example the IFM has a Honda K20A engine. So if that would already exist we could just use that component with our car.
So when we want to create a series, we create a mod package and just refer to the components we need. In our case there aren’t any sound and vehicle components available so we have to include them. But we will drive on tracks that are already available like Mills, so we don’t have to include them and only have to refer to those components in our mod package.
This is pretty useful if there are modders out there who don’t want to do a complete series but like one specific car. Maybe one day different modders have done so many cars and track components that the community just has to create a small mod file to recreate a specific series by just refering to those existing components.
Before starting the packaging process
When you start to put your files for testing into your ModDev folder be sure to create appropriate folders for your files. For the IFM mod we put our stuff into a folder named IFM2009. Therein we have two other folders: the maps-folder where we put all our models and textures and the teams-folder were we put our *.veh files and driver specific textures. The rest (physics, cam files, gen etc.) lies withing the root of the IFM2009 folder.
For the sounds I like to name the folder different than the folder in the Vehicles directory. We named it IFM2009Engine. Note that your sound component needs to have the same name as the directory your sound files are stored in.
When your mod development hits the stage where you think it should be packaged create a new working directory for the packaging.
Setting up the working directory
So create a new folder. Best would be not to put it into your rF2 folder 😉
Maybe D:\ModPackage or whatever – just DO NOT create this folder within the “rFactor2 Data”-folder as this may cause problems with the manifest-files. Copy the MAS2.exe (from “rFactor Data/Tools” directory) and ModMgr.exe (from “rFactor/Core” directory) files into that folder for easy access and you will need this later.
Create three subfolders called MAS, PACKAGES and COMPONENTS (again, you can choose names freely). There you’ll be saving your MAS, component and mod package files.
Starting MAS2 from this directory will also create an “Installed”-Folder later, which is important for creating the mod package at the end.
Starting the packaging process
Now it’s time to create our MAS files. Open MAS2.exe and drag your files from the maps directory (models and textures) into it, then save it as IFM2009.mas in your new MAS-directory. Create a new mas in the tool, then drag your stuff from the teams folder into it (veh-files and driver specific DDS) and save it as IFM2009_TEAMS.mas.
Next new mas: drag the files from the IFM2009 root dir (physics, gen, etc) into the tool and save it as IFM2009_MAIN.mas. Do the same with the sound files and name it IFM2009_SOUNDS.mas.
The last step would be to create a MAS for your rfm. However, this is not required if you don’t want to create a mod (series) but just a component. In our case we want to create a mod. So drag those three files (rfm and your two dds icons) into your tool and save it as IFM2009_RFM.mas. You can also create a MAS for the talent files and name it IFM2009_TALENTS.mas.
Creating the components
Let’s start with the sound component. “Create a new component” by clicking on the “C” icon in the MAS2.exe tool. Then click on the dropdown list down arrow on the top and select “Add new component”. Name it like the directory your sound files were located in. In our case that was IFM2009Engine. Then click on the file cabinet icon next to the File dropdown list. Navigate to your components subdir in your working folder and name it properly. A good name in our case could be IFM2009Engine_v10.rfcmp as it’s our first version of those files.
You can leave Version at 1.0 and as type chose “Sounds”. No need to check Update from as it’s our first version of that component. Then click the file cabinet icon next to MAS files in the bottom area and add our IFM2009_SOUNDS.mas from our MAS subdir. Click Info to check the meta data you can define within the mod. They are self-explanatory.
Click on Package, then on Install. You now can close the “Create Component” window by clicking on Done. You can now check your working folder and see that the tool created a new subfolder called “Installed”. (This is created in the working directory from which MAS2 was started, preferably in our Packaging-Directory) That’s the same folder structure like in rFactor2. In our case it also created the Sounds folder with our IFM2009Engine->1.0-> and then our MAS file.
Now create the vehicle component. Again click on the “C” icon the create a new component. Click again on “Add new component” and enter a proper name. We call our component IFM2009. Save it as IFM2009_v10.rfcmp in your components subdir and again leave version at 1.0. Do not check “Update from” and choose “Vehicle” as type. Then add your MAS files: these are IFM2009.mas, IFM2009_MAIN.mas and IFM2009_TEAMS.mas. Package your component file and install it.
You can now create another component used for the talent files with the above methods. We currently haven’t got talent files. But you’ll do basically the same as before but as type you need to chose Talent.
That’s it for the component creation.
Creating your mod package
Now we need to create our mod package.
ISI included a new MAS2.exe with build 85 which makes the mod packaging process a bit easier as it guides you through the creation of the package. Click on the P icon in the toolbar and a new window opens. It gives you two options: “Create New Mod” which is some sort of wizard that guides you through the process and “Edit existing mod” which gives you the old packaging window. Probably ISI want us to use the first one to create a new mod and create updates through the second one. I like the old way of packaging stuff as I don’t want to use the RFM.mas that the wizard generates for my mod (also it doesn’t include any graphics for the game UI). So we will start with the old packaging system.
Click on “Edit existing mod”. First thing to do is to get some infos about our mod. Click on the icon next to Select rFM. Choose your MAS that has your rFM stuff included. In our case that’s IFM2009_RFM.mas. You’ll notice that the mod name will be taken from your rFM. I think it’s best to give the mod a proper name in the rFM. Click on the file-cabinett icon next to File on the Package section. Save your package in your package subdir and name it properly using ISI’s naming scheme:
The scheme is: “<Company/ModTeam><ModID>_v<MajorVersion><MinorVersion>_<ModName>.rfmod”.
For us: “CTDPxxx_v10_IFM2009.rfmod”. You can add some infos to your package by clicking on the Info button.
Adding and selecting components
Now you need to add your components to the package. We’ll start with the vehicle and sound components. Click on the little file cabinet icons and a new window will pop up and show you the available components. Select your component and click on OK. Click on the added Vehicles component and you’ll see that it shows you all the teams that are in this component. Select the teams you’ll want in your mod (we want all of them).
(The ISI Mas-Utility has some very bad UI aspects, you select teams and layouts by marking them blue, don’t expect checkboxes, ticks or checkmarks. Also an important note: the tick infront of the component in the list signifies whether or not you want to include this component in the package, or create a reference thereby decreasing the package size.)
Next add your sound component. Click on the file cabinet icon next to the “Other” list field at the bottom and add your sound component.
At last, we want some tracks to drive on. As we haven’t made any tracks we’ll use existing ones. Click on the file cabinet icon next to the location stuff and you’ll notice that the tool won’t offer us any components. That’s because there aren’t any components located in the ModPackage/Installed”-subdir. First create a directory named “Locations” in your Installed subdir then go to your rFactor2-Data/Installed/Locations and copy the tracks that you want to use in your mod into your ModPackage/Installed/Locations folder.
Go back into the MAS2.exe tool and click done to close the create package window and open it again. Then click on the locations icon to add the locations into your package. You may see different versions of a location if it was updated before. In that case just use the version you want to drive on. Select your locations and click on OK. Click on each location and select the layouts that you want to use in your mod like you did with the teams for the vehicle.
Now we could package our mod. But as we don’t want to include those tracks and inflate the size of our mod package we uncheck “our locations”. That tells the package that we just want a reference on those locations. The user needs those components already installed to drive our mods. We don’t provide those components in our mod package.
Click on Package. A new window will open where you can easily register your mod and get a mod id. Your email and password should already be inserted into the respective fields. You can also include a mod group and click on “Register Now”. The tool then registers your mod and inserts the mod id into your package and creates the rfmod file. You could also just click on “Done” and get a rfmod package but without registering and getting a mod id to drive online.
Click on Install and then on Done. Congratulations, you’ve just created your first rFactor2 mod!
Using the wizard
As of rFactor build 85, the MAS utility got a new wizard to create new Mods more easy. As for the “Create New Mod” option it’s all pretty straight forward. You’ll be asked to enter a name for your mod, then to select the track(s) you want to drive on and finally to select the vehicle and sound components you’ve created. After clicking on “Done” you’ll get the same window as before, but the tool created a RFM.mas for you and already inserted the components based on your decisions. Note, that all components are just a reference and none of them are included in your package. So select the components you want to use (in our case the vehicle and sound components) and make sure the track layouts and teams that you want to include are selected. By default all track layouts and teams are pre-selected.
As already mentioned it’s almost the same as using the old way. You just got an wizard that fills out some stuff for you before getting to that window. Check your info stuff, click on Package (the same mod registering screen will appear) and Install. You’re done.