• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

What are Domains and FormationClasses?

ITcore

Warlord
Joined
Dec 25, 2016
Messages
248
Location
127.0.0.1
I'm wondering what they are used for. If I change, let's say, the Helicopters Domain to DOMAIN_AIR, how will that fundamentally impact that unit?
 
Unit Domains specify the map terrain "class" (for lack of a better word) that the unit naturally operates on.
  1. DOMAIN_LAND = the unit naturally operates on land tiles and has to be able to 'embark' to cross water tiles.
  2. DOMAIN_SEA = the unit naturally operates on sea tiles and cannot operate on land tiles except for like a city-center tile (which even then now that I think of it I am not sure they can pass through in civ6)
  3. DOMAIN_AIR essentially specifies the unit is an airplance and will act like an airplane.
But in civ6 as near as I can tell these are merely convenience "tags" that let the rest of the game's code organize the treatment of units. I haven't found anywhere wherein DOMAIN_LAND for example is defined as a "Type" like a Building is defined as a "Type"

FormationClass appears to be what really tells the game how to use the unit for purposes of combat beyond the fact that reference to a unit's Domain is made by various parts of the code. This would be for purposes of whether the unit fights on land, or on sea, or in the air, or not at all.
  1. FORMATION_CLASS_CIVILIAN
    • Religious units have those additional tags that allow them to participate in religous "battle"
  2. FORMATION_CLASS_LAND_COMBAT
  3. FORMATION_CLASS_NAVAL
  4. FORMATION_CLASS_SUPPORT
  5. FORMATION_CLASS_AIR

DOMAIN_LAND, DOMAIN_SEA is also used in specifying what sort of units a Building's effects should apply to, for example. Leader Agendas refer to unit Domain-Types for whether the leader hates people with large armies or loves people with large navies or whatever.
 
Last edited:
So if I were to change the Helicopters domain to AIR but leave the formation class as LAND, it should attack like a normal land unit but be able to fly over any terrain like...a helicopter? Or will the Air domain force it to be stacked in an Aerodrome?
 
I suspect it is more likely to cause the game to crash, but who knows.

Just because a thing is not defined anywhere as a true "type" in the xml-files that I have found as yet does not mean that the dll-level executing software will not go *poof* from such a conflict.

On the other hand it might be just fine with it, but you will find only the effects from wonders, traits, etc, that are looking to DOMAIN_AIR would effect such a unit.

I think if such a setup works at all it will force the unit to act like an airplane and be placed in an airedrome, on a carrier, etc.

-----------------------------------------

but the only way we modders find out what occurs in such cases is to try them and watch what (if anything) happens. A lot of the time what happens is instant CTD :lol:
 
Back
Top Bottom