A closer look at config.cpp and model.cfg (for the assets made in the prev. post)

I try to explain a little I did in order to get all the models (from the previous post) working in ARMA3.

First of all lets start with the easy ones (broken distric 13 plate, cornucopia and the arena fence).
These models do not have any strange stuff needed for the configuration part. For them it is enough to just create a config.cpp file and add three sections to it.
I’ll go from top to buttom of my configuration.

class CfgPatches
{
	class spawnD13
	{
		units[] = {spawnD13};
		weapons[] = {};
		requiredVersion = 1.0;
	};
};

This part tells the engine that there is an addon and it consists of one object. For the unit array there is currently only the object itself. No weapons attached to this class and we want the required version to be 1.0 (choose anything you want – 1.0 is referring to the release version of ARMA 3 – I guess).

class CfgVehicleClasses 
{
	class hgClass {
	displayName = "+HungerGames";
	};
};

This class just defines a group which I’ll use to put all my models in (this is the group seen in the mission editor).
The “+” sign is just for me to see my added group faster.

class CfgVehicles
{
	class All {};
	class Static: All {};
	class Building: Static {};
	class NonStrategic: Building {};
	
	class spawnD13: NonStrategic
	{
		vehicleClass = "hgClass";
		mapSize=5;
		icon="\hgAssets\sd13icon.paa";
		model="\hgAssets\spawnDistrict13.p3d";
		armor=20000;
		scope=2;
		displayName="District 13 - Spawn";
	};
};

This part is the main part for my configuration. The first four lines defining the classes I want to inherit from. Just to get close to BIs configuration of structures.
The last big block is the one where I define my own class of the building. vehicleClass is the one created in the CfgVehicleClasses in order to put the model in the right category. mapSize defines the size (in meter) of my map icon (which is defined by icon directly below).
model is the attribute which defines the actual p3d model to use for this object. armor is defining the *drumRoll* armor of the object (20 equals approx. one bullet). scope defines the accessibility for the game (0 = private, 1 = protected, 2 = public). At the end displayName defines the name which is displayed in the editor (in the menu beside the icon and in the edior itself if you’re hovering over the object).

This should be everything you’ll need to get simple objects into the game (ok, beside packing your addon with BinPBO).

After we’ve added a simple model we now try to add the spawn area with animation we prepared in the last post.
In general the CfgPatches and CfgVehicleClasses part is the same (if the object is defined in the same config.cpp you can reuse the categry name).
In the CfgVehicles part we need to add something called an animation source:

	class spawnD1: NonStrategic
	{
		vehicleClass = "hgClass";
		mapSize=3;
		icon="\hgAssets\sd1icon.paa";
		model="\hgAssets\spawnDistrict1full.p3d";
		armor=20000;
		scope=2;
		displayName="District 1 - Spawn";
		class AnimationSources
		{
			class cageControl
			{
				source = "user";
				animPeriod = 3.5;
			};
		};
	};

At this point we just add one animation source called “cageControl”. This one is controlled by the user (e.g. script) which is defined by the source attribute. And we define a time frame of 3.5 seconds for the animation to run (by setting animPeriod).

This is all we need to add to our config.cpp file. The next steps taking place in the model.cfg file.

First of all we want to define a new skeleton for our model.

class CfgSkeletons
{
	class Default;

	class spawnCageSkel:Default
	{
		skeletonInherit = "";
		skeletonBones[]=
		{
			"spawnCage",""
		};
	};
};

For this model we only got one bone. It is named spawnCage and is not linked to anything else. So we do not need to write any complex stuff into this section.

The actual animation itself is defined in the CfgModels section:

class CfgModels
{
	class Default
	{
		class Animations;
		class translation;
	};

	class spawnDistrict1full:Default
	{
		skeletonName = "spawnCageSkel";
		class Animations
		{
			class cageControl
			{
				type="translation";
				source="cageControl";
				selection="spawnCage";
				axis="spawnCage_axis";
				memory=1;
				minValue="0";
				maxValue="1";
				offset0=0;
				offset1=-1;
				begin=0;
				end=1;
			};
		};
	};
};

Lets go through the last part of our configuration. At the top I defined my default class which inherits from the general Animation class and the translation class because we want to translate a part of the model.
The I created a Default class for my model (I think you need to use the model.p3d file name in order to get these properties matched to the model itself). The skeltonName attribute tells the model to use the skeleton defined before. Then I started my Animation class with the cageControl class which will have all the poperties needed to animate the model. The type defines the type of the animation (here we want to do a translation so we tell the engine to do so). As source we need to put the name of the source we defined in the config.cpp before. The selection parameter defines the named selection made in oxygen (remember that we got two named selection with the same name, one in LOD0 and the other one in the geometry LOD – both will be animated with this string). The axis defines the axis we created in the memory LOD (this is the axis we move our part along). memory tells the engine to look into the memory LOD for our axis object (needs to be 1 in order to find anything there). minValue and maxValue are defining the source start and end value (so animation starts at an value of 0 and it will end at the value 1 – these are values passed by the source). offset0 defines the offset in meter the phase is starting (phase 0) the offset1 is defining the position at the end phase (1). begin and end are defining the start end end point on the axis (I don’t know if this is really needed in this case but it is working – so I didn’t touch it anymore).

That is all I did in order to get all my models work in the engine.
Next step will be to bring everything together in the mission editor (but not in this arcticle).

What you see is not what you get (visible LOD, collision, memory and road ways)

Sorry for not posting anything the last weeks but I had some trouble getting everything to work.
Finally I managed to get the features I wanted.

Lets start with an easy one. The destroyed platform of district 13.

First of all I used the same geometry for the visible LOD0 as before.

LOD0 in Oxygen of broken district 13 spawn plate
LOD0 in Oxygen of broken district 13 spawn plate

The object is imported straight away. The only thing I needed to fix is the texture path (pointing to the converted paa and the right addon folder).
You can ctrl+doubleclick a texture in the material library in order to select the faces connected to it. Then just press E to get the property window. In there you can edit the texture path to point to your actual texture.
You’ll need a named selection for all components of your model. This can be easily done by using the Find Components tool in Structure -> Topology. If you don’t need any special named selection this is enough for the model to work.
This is everything we need to do for the LOD0.

To get collision working for this model I created a convex hull for the whole object and imported it into the Geometry LOD.
For this LOD you need to be sure that the component is convex! You can check this by using the Find Non-Convexities tool in Structure -> Convexity. This tool will highlight non convex parts. If you want to get a quick result just use Component Convex Hull in the same Structure menu as before.

Geometry LOD in Oxygen of broken district 13 spawn plate
Geometry LOD in Oxygen of broken district 13 spawn plate

Before we can use that gemotry LOD we need to assign some weight to the components in the gemoetry LOD. If you can not see a input field for Mass just press shift+F7 to get it. If you want to quickly finish this just select all parts in the gemotry lod and assign the mass in kg (will automaticly devide the total mass to all components – lets say you got two components and assign 500kg you’ll end up with 250kg on each component). Visually you’ll see gray squares for each vertex to represent a mass point.
That is all we need to have a working model with collision. The rest is done in the config.cpp and/or model.cfg.

Lets go on with another model: the cornucopia.

This model is a little more complex than the spawn plate of district 13. The main difference is a collision setup where you can walk in (you need more than the geomtry LOD to get this working). But first of all we reuse the LOD0 from the object.

LOD0 in Oxygen of cornucopia
LOD0 in Oxygen of cornucopia

The only thing done with this part is to fix the path for the texture as mentioned in the text for the spawn plate of district 13.

For the Geometry LOD we need to create some boxes which form a hole for the inside of the horn. I came up with this first setup (needs some more work for the final version):

Geometry LOD of cornucopia (first version just to get the hole I wanted - needs some more work)
Geometry LOD of cornucopia (first version just to get the hole I wanted – needs some more work)

Again wee need to assign some mass to the object. Remember that part from the text before.

Additionally to the geometry LOD we need a RoadWay LOD in order to tell the engine where a player or AI can walk. As far as we don’t have this LOD we will not able to walk into our model (we just get strange collision problems). I made some quick face creation and imported them into the RoadWay LOD:

Polygons for the RoadWay LOD of cornucopia
Polygons for the RoadWay LOD of cornucopia

There is no need to do anything with these faces beside to make again some named selections from them (remember the Find Components tool).
I think that is it for the modelling part of that object so far. Rest is config work.

Lets get on with another model and an additional LOD we need (Memory LOD). The final version for the spawn area of a district.

Frist of all I want only one model for the spawn place. So I needed to import the old cage object into each working spawn plate (I did that only one time because the only thing changed from dictrict to district is the texture assigned to the indication plate). Additionally to the normal find component stuff is that I need a named selection for the full cage geometry (need that name in the config later to indicate the moving part). Everything else is mentioned before (like texture assignment).

LOD0 in Oxygen of spawn area for district 1 (with cage inside of the model - in order to have one model instead of two as before).
LOD0 in Oxygen of spawn area for district 1 (with cage inside of the model – in order to have one model instead of two as before).

Because I wrote down all the steps again and again I’ll post pictures of the different LODs and just explain important changes.
Here you see the gemetry LOD with asisgned weights and automaticly created named selections:
Geometry LOD in Oxygen of spawn are for district 1 (with boxes 8 components to get the collision right - additionally one named selection for the full cage collision)
Geometry LOD in Oxygen of spawn are for district 1 (with boxes 8 components to get the collision right – additionally one named selection for the full cage collision)

There is just one thing to keep in mind. We want collision of the cage animated the same way as the visual selection in the LOD0. For that we need to create a named selection for all the collison parts of the cage. This selection needs to get the same name as the one made in the LOD0!
Next thing to do is a roadway LOD to step onto the plate (nothing special here).
RoadWay LOD in Oxygen of district 1 spawn area (in order to step onto the plate).
RoadWay LOD in Oxygen of district 1 spawn area (in order to step onto the plate).

One new LOD is needed in this object: the Memory LOD. This part consists two vertecies which define the axis the cage will be transformed on. Again we need a named selection for that. This time it should not be the same name as the ones before (I took the name and added just _axis to it).
Memory LOD in Oxygen of district 1 spawn area (two points are defining the animation axis)
Memory LOD in Oxygen of district 1 spawn area (two points are defining the animation axis)

I think that is it for the modelling part of the object.

Finally I created another model. The fence which will seperate the arena from the rest of the terrain. For this object we just need the LOD0:

LOD0 in Oxygen of arena fence
LOD0 in Oxygen of arena fence

The geometry LOD for collision:
Geometry LOD in Oxygen of arena fence (just as collision model)
Geometry LOD in Oxygen of arena fence (just as collision model)

And one more “new” LOD named LandContact. This one defines points which are used to place the object onto the terrain (if you don’t have any the origin will be used – jsut one point I guess). I created four points to get some kind of good placement behavior:
RoadWay LOD in Oxygen of arena fence (in order to get rid of strange placement in mission editor - one point for a fence is not enough)
RoadWay LOD in Oxygen of arena fence (in order to get rid of strange placement in mission editor – one point for a fence is not enough)

I think that is much text and maybe not all of you will understand what I did but for that leave a comment and I’ll try to answer your questions (or maybe add some more info into this article).

Assets for spawn area

I did an export session and a little collision tuning.
All assets needed for the spawn area are now included.
Even the icons for the editor are available.

Spawn area in mission editor
Spawn area in mission editor

I managed to place an entity in one of the cages but collision is not working for him.
For the player seems the collision to be working but needs more tuning on all the objects.
The cornucopia is a little strange because of that hole in the front. The bottom collision box needs to be improved too.

Spawn area in the game
Spawn area in the game

Still much to do but it is some progress 🙂

Something inside…

Finally I got three assets in the Engine. One is the destroyed spawn plate of district 13 and the other two are forming the spawn plate for distric 1.

Spawn district 1 and district 13
Spawn district 1 and district 13

Here you’ll the the plates at the bottom a little closer.

Spawn district 1 plate
Spawn district 1 plate
Spawn district 13 plate
Spawn district 13 plate

Aditionaly I managed to create some icons for the assets. From left to right you see the spawn plate and cage from district 1. On the right you see a detailed icon for the destroyed plate.

Icons of spawn and cage of district 1. On the right destroyed district 13.
Icons of spawn and cage of district 1. On the right destroyed district 13.

The config.cpp is kind of copy & paste. I’ll clean that up later.

class CfgPatches
{
	class spawnD13
	{
		units[] = {spawnD13};
		weapons[] = {};
		requiredVersion = 1.0;
	};

	class spawnD1
	{
		units[] = {spawnD1};
		weapons[] = {};
		requiredVersion = 1.0;
	};

	class spawnD1cage
	{
		units[] = {spawnD1cage};
		weapons[] = {};
		requiredVersion = 1.0;
	};
};

class CfgVehicleClasses
{
	class hgClass
	{
		displayName = "+HungerGames";
	};
};

class CfgVehicles
{
	class All {};
	class Static: All {};
	class Building: Static {};
	class NonStrategic: Building {};

	class spawnD13: NonStrategic
	{
		vehicleClass = "hgClass";
		mapSize=5;
		icon="\hgAssets\sd13icon.paa";
		model="\hgAssets\spawnDistrict13.p3d";
		armor=20000;
		scope=2;
		displayName="District 13 - Spawn";
	};

	class spawnD1: NonStrategic
	{
		vehicleClass = "hgClass";
		mapSize=3;
		icon="\hgAssets\sd1icon.paa";
		model="\hgAssets\spawnDistrict1.p3d";
		armor=20000;
		scope=2;
		displayName="District 1 - Spawn";
	};

	class spawnD1cage: NonStrategic
	{
		vehicleClass = "hgClass";
		mapSize=3;
		icon="\hgAssets\sd1cageIcon.paa";
		model="\hgAssets\spawnDistrict1cage.p3d";
		armor=20000;
		scope=2;
		displayName="District 1 - Spawn Cage";
	};
};

I got collision working on the cage. The other two objects got a Geometry LOD but it’s currently not working 🙁

One last thing before I got everything for a spawn area…

Ok, I really want to get to the point of edit this stuff in Oxygen2 but there is just one more thing I need for my spawn area. The cornucopia.

Texturing and geometry is not really got and far from final but I got something that will work (hopefully).

first version of the cornucopia
first version of the cornucopia

Btw. the cubes are 1x1x1m just in case someone wants to know.

Next step will be to import these assets into O2 and write some config stuff. Maybe I’ll add some map icons too (just to cover the whole package).

Where to start (spawn)?

I liked the movie and it’s kind of interpretation of panem tech. Because I can’t really go down into the ground (if I don’t want to create my own terrain) I just took the idea of the plates the tributes are starting on.

district 1 spawn plate

district 1 spawn plate

But instead of elevating the player I decided to go with some cage around the plate.

cage on spawn plate
cage on spawn plate

I want to create a map with 12 players so why not put in some district 13 stuff as kind of easter egg?

destroyed district 13 spawn plate
destroyed district 13 spawn plate

As you can see these assets are modelled party below 0 and I hope that I’ll be able to place them a little under ground in the engine (we’ll see if this will work).

An arena dome is too big 4 ARMA

Hi,

I’ve started with the hunger games idea and first thing I thought of was this massive energy field, that surrounds the arena (like in the movie). Ok that’s an easy one in modelling.
I started to build a hemisphere with a 3km diameter. Textured it with a semi-transparend plasma texture and followed an easy tut on config.cpp, PBO and addon creation in order to get my model into the ARMA engine.

Created a mission just with me as a player and my newly created asset (with an ugly default icon – I’ll deal with that in a later post).

*pressed preview*

First I thought it does not work but then I turned and started to walk around. At some angle I’ve spotted weird color changes at the horizon. It turned out that a dome with that size is not that optimal for clipping.

First thing to do: Strike out dome as a seperator for the arena.

Beside the visual problem I remembered some limitiations of ARMA engines. There are poly and size limits in order to get collision working. As for ARMA2 there was a poly limit about 19k, I think. Additionally there is a size limit of roughly 50m. I’ve found some post on this in the BI forums (OA section I think, but I’m pretty sure that there are similar limitations in ARMA3).

At the end I decided to go with something that is working already. You remember these hesco walls? I thought of them and started modelling a big fence. Because I like the idea of seperating the arena in a modern way I kept the energy field stuff and ended up with this:

arena fence
arena fence
fence connection
fence connection

capitol district logo

capitol district logo

At this point I should test it in the engine but I desided to model some more assets before that.

Blogging as kind of reminder

Hi all,

this is my newly created blog covering my work on an addon for ARMA3. Because I’m lazy and need something to write stuff down I decided to start a blog. If nobody is reading this stuff it’s fine for me. As long as I can just paste some script snippets and some progress picture I’m happy 😀

Have fun…
Pheenics

P.S.
First posts will be covering multiple steps because I started modelling before blog installation.