Fourteen Types of Units

Erebras

Prince
Joined
May 2, 2010
Messages
383
Location
Western North Carolina
Not considering great people, according to the civilopedia there are (by my count) a little over a dozen unique types of units: archery, melee, naval ranged, naval melee, recon, mounted, siege weapon, gunpowder, carriers, bomber, armored, submarines, fighter, and helicopter.

My question to modders and people-of-knowledge: does assigning type merely give a classification for global effects, such as "all melee and mounted units receive this promotion" or is there a hardcoded aspect I am unaware of, such as assigning an AI script, animation style, or automatically assigning promotions, such as "ignore terrain costs" for recon units or "must set up before attacking" for siege weapons?

What I am getting at is, can I, say, create a sci-fi mod and rename/reassign all gunpowder weapons to Laserblaster weapons and give them abilities like a helicopter or fighter unit, or will this create some sort of conflict or confusion for the computer processing since it will assume all Laserblaster weapons are land units?

Furthermore, is it possible or preferable to just create a new, additional class of weapons, since the divisions or distinctions depend on its promotions and abilities? Could I create a "Giant Reptile" class for a lost world scenario, and a "Giant Mammal" class as well?
 
Hopefully others will correct me if something here is wrong but those CombatClasses (that's how they are named in the database) have 2 effects :
  • They define which promotions are available when a unit gets a level (such as archers gaining Barrage or Precision while melee gain Drill or Shock)
  • They affect some bonuses granted by specific promotions (such as Lancers +50% against mounted units or Helicopter vs Tanks)
In addition, Units belong to a UnitClass. Most often they are the same the Swordman Unit belongs to the Swordman UnitClass but this is what allows unique units (a Kriss Swordman also belongs to the Swordman UnitClass). Unit and UnitClass is what defines free promotions.

Then comes unit Domain. There are basically 3 : Land, Sea and Air (but air is a strange beast). Those define some bonuses granted by specific promotions (such as Galeas being able to choose a bonus vs Naval or Land units).

Creating new CombatClasses should be possible but if you use a single one for Air and Land units, you'll have the same promotions for both. (on level-up). The Giant Reptile is certainly possible but you'll need some animations (CiV won't animate a static or even rigged model for you)
 
You'll want to try to reuse the existing CombatClasses, however (though they could be renamed and the unit membership can be shuffled), otherwise you'll lose your unit animations.
 
Thanks for the helpful information about combat classes, guys. Now, one thing that wasn't quite covered was if you were to create a new class, then how would the program know which promotions to give it? This question, of course, is about creating a new class completely out of whole cloth. If I was just going to rename an existing class, then it appears I'd be stuck with the promotions of the existing class, or is there a way to tweak this as well?

I haven't tried to, yet, but is there a functionality that would allow you to not only name a new feature, but assign a string of promotions to it as well. Using my Giant Reptile mentioned earlier -- even though I just made it up on the spot to illustrate my point -- could I assign the Giant Reptile promotions that units of that combat class receive? Am I understanding what you guys are saying?
 
Table UnitPromotions_UnitCombats tells the game which promotions are valid for which UnitCombat Types. So, for this snippet taken directly from C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Gameplay\XML\Units/CIV5UnitPromotions.xml, it tells the game that PROMOTION_EMBARKATION is valid for both UNITCOMBAT_RECON and UNITCOMBAT_ARCHER:
Code:
<UnitPromotions_UnitCombats>
	<Row>
		<PromotionType>PROMOTION_EMBARKATION</PromotionType>
		<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
	</Row>
	<Row>
		<PromotionType>PROMOTION_EMBARKATION</PromotionType>
		<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
	</Row>
</UnitPromotions_UnitCombats>
These are not the only "UnitCombatTypes" the promotion is valid for. They were just the top two from the table which I copied to show how this is handled in the game's code. Essentially, a promotion can be made valid for any or all UnitCombatType designations.

The data entered within this table is used by the game in various ways. Two of which are:
  • A unit can never select a promotion which is invalid for it when the unit gains an experience level
  • A unit can never recieve a promotion which is invalid for it from free promotions given by wonders or buildings
 
Thank you, LeeS. That clarifies things even more. I'll make those edits when I get around to creating a mod, but I'm too timid to attempt to make new classes, so I'll stick with either renaming the existing ones or just editing each class. I fear if I try to get fancy and create new unit classes, I'll end up with some needless game crashes just because I didn't just tweak what Firaxis has already wrought.
 
Top Bottom