[[DAT file explanation]] # Content Overview We'll go over the basic structure first, then the overview of the data for each unit. Use this page as a reference point that links to all other relevant material for designing a unit. ## Basic Structure *Remember, lines starting with // are comment blocks and are ignored by the game code* The structure of Unit.dat is comprised of (separated by newlines): ``` {0 INDEX START "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* } INDEX END ``` \*It is possible to to have up to 12 units (Unit Data) in a single index. ### Index Index is just a categorical and numerical identifier the system uses to refer to specific units. The data lines of units are surrounded above and below by an index start and index end. ``` {0 INDEX START "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* } INDEX END {1 INDEX START "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* } INDEX END ``` The pattern of -index start-, -unit data-, -index end- can repeat. #### tLvl tLvl denotes the position within a certain index, the first is always 0, second 1 and so on. tLvl is used whenever you wish to to have multiple units under a single index. ``` {0 INDEX START "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* tLvl 0 "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* tLvl 1 } INDEX END {1 INDEX START "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* tLvl 0 "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* tLvl 1 "name"..."efsunit.bin" (or ..."file.bmp") UNIT DATA* tLvl 2 } INDEX END ``` Whenever the game references a specific units, it requires both the index and the tLvl. ## Unit Data This is the very meat of the what the data of all units entails. Oftentimes, data signifiers like "name" or "abbrev" will be present and be required at certain points (columns) in the dat file. An explanation will of these will be at the end. >[!info]- Unique Names >*Names need not be unique, but it is recommended for both parameters* >>[!test]+ Name >>The name of the unit. Up to 29 charaters long #unverified >> > >>[!test]+ Nickname >>A short name used in the stack detail screen and the build screen. Max 8 characters #unverified > >>Abbreviations are used whenever you gain a unit from ruins. >>> [!info]- Abbreviation Value >>> The value immediately preceeding "abbrev" defines the type of plural extension. >>> - 0 means none >>> - 1 means 's' >>> - 2 means 'es' >>> - 3 means replace 'y' with 'ies' >>> >>>> [!example]- Abbreviation Value Examples >>>> 0: Officer Corp -> (multiple) Officer Corp >>>> 0: Clergy -> (multiple) Clergy >>>> 1: Engineer -> (multiple) Engineer**s** >>>> 2: Dervish -> (multiple) Dervish**es** >>>> 3: Spy -> (multiple) Sp**ies** >[!info]- Behavior >>[!warning]- Move Type >>A unit has one single movement type (written as a string/text) that specifies both hardcoded and non-hardcoded behaviors about a certain unit. From movement and combat, to special behaviors, Move Type is likely one of the most important attributes a unit has. >>- - - >> >>>[!danger]- Hardcoded behavior: >>>*If you specify a certain Move Type, a certain behavior will always tag along* >>>- Certain Move Types can exist in space without being transported and takeoff/land >>>- Certain Move Types can jump through gates into another system. >>>- Certain Move Types will never be active while on a planet surface and will never participate in combat (including PTS fire) and be auto-captured independent on non-combat status. >>>- A single move type (Air) will require fuel to sustain it's survival outside of refueling points. >>>- Two movement types(Naval/Underwater) will only show up in the build list if the producing city is adjacent to a body of water. >>> #hardcoded >>> It is recommended to read on the specific movement types to get more details. >>- - - >>>[!check]- Non-Hardcoded behavior: >>>*Several behaviors are completely specifiable through other DATs.* >>>- [[TerrCost.Dat]] - Whether or not a unit can move and the costs associated >>>- [[Agility.Dat]] - Unit receives defensive agility modifiers based on terrain >>>- [[UnitSpot.Dat]] - Terrain modifiers for camoflage based on terrain >>>- [[Ruin.Dat]], [[AlienRuin.Dat]] and [[RandGal.Dat]] - Ruin generation and random galaxy spawning >>- - - >> >>>[!example]- Move Type List >>>In the order specified in [[target.dat]]: >>>- [[Foot]] >>>- [[Wheel]] >>>- [[Tread]] >>>- [[Air]] >>>- [[Naval]] >>>- [[Space]] >>>- [[Hover]] >>>- [[Jump]] >>>- [[Crawler]] >>>- [[Lander]] >>>- [[Mech]] >>>- [[Gate]] >>>- [[Underwater]] > >>[!warning]- Kind >>The Kind is one of two ways to define additional behaviors, the other being [[Unit Functions]] >>A kind is a single numerical value to group units that is used for two purposes. >>1. To specify a hardcoded Unit Function set to replicate unit behavior from vanilla. Setting a unit to have kind number 45 will mean that the unit is a Noble. #hardcoded >>2. Kind can be referenced in [[Ruin.Dat]], [[AlienRuin.Dat]] and [[RandGal.Dat]] for generation purposes. >> >>>[!example]- Kind List >>>- -1: Normal (nothing special) or a number not in this list >>>- 11: Stealth Ship (can attack in space above Byzantium II) >>>- 16: Space Carrier (can launch cargo during space battles) >>>- 23: Submarine (can attack on the surface of Byzantium II) >>>- 26: Naval Carrier (can refuel aircraft) >>>- 28: Sceptor (act like game sceptor) >>>- 29: Relic (acts like game relic) >>>- 37: Vau Worker (can build Vau cities) >>>- 44: Symbiot Nester (can build Symbiot cities) >>>- 45: Noble (acts like game Noble) >>>- 46: Warlock (acts like game Warlock) >>>- 47: Inquisitor (unit will be built and used by The Church to attack player houses) >>>- 48: Dervish (ranks the unit as a Noble for combat) >>>- 49: Spy (acts like game Spy and can attack on the surface of Byzantium II) >>>- 51: Officer (acts like game Officer) >>>- 52: Clergy (acts like game Clergy) >>>- 53: Engineer (the unit can build cities just like an Engineer) >>>- 71: Plague Artillery (acts like game Plague Artillery) >>>- 83: Infantry (acts like game Infantry) >>>- 84: Militia (acts like game Militia) >>>- 85: Anti-Air Gun (acts like game Anti-Air Gun) >>>- 86: Anti-Tank Gun (acts like game Anti-Tank Gun) >>>- 87: Artillery (acts like game Artillery) >>>- 88: Plague Bomb (acts like game Plague Bomb) >>>- 91: Cargo Pod (this one is technically tied to its unit slot) #wip >[!info]- Unit Statistics >The following parameters are all numerical and represent some core characteristics related to movement, reccoinnassance potential, stealth and defensive properties. >>[!info]- Move >>The total amount of movement points a unit starts it's turn with. >>Units expend movement points for certain actions, some costs can be tweaked through DATs. >>There are two theatres that a unit can operate it: Space and Planetside >>>[!danger]- Space >>>Movement Costs in space are #hardcoded, so if the unit can takeoff and land, Move defines it's capacity for movement entirely. The following actions all require 1 movement point: >>>- Takeoff >>>- Landing >>>- Jumping >>>- Attacking >>>- Bombarding >> >>>[!check]- Planetside >>>Units moving on the planet surface expend movement depending on the terrain they are on and what Move Type they are. See [[TerrCost.Dat]] for what Move Types can move on what terrain and how many Movement Points they consume per Hex moved. >>> >>>> [!warning]- Exceptions >>>**Attack Adjacent**: A unit can attack into the adjacent hex without moving if the setting is enabled in [[TerrCost.Dat]] per Move Type >>>**Loading into Transports**: A unit can, for instance, move into an adjacent hex where there is a naval transport and spend a single movement point regardless of standard move costs. > > >>[!info]- Spot >>Spotting simply increases it's potential to spot enemies. See [[Spotting and Camoflage]] for more details. > >>[!info]- Camo >>Camo is the numerical value representing how stealthy a unit is. See [[Spotting and Camoflage]]. > >>[!info]- Ag >>Agility defines how hard a unit is to hit in combat. See [[Accuracy and Agility]] for more details. > >>[!info]- Armor >>Armor is part in how much damage a unit takes if an attack connects. See [[Damage]] > >>[!info]- PsyDef >> If the attack that connects if of the [[Weapon-Psy]] type, then we use PsyDef instead of Armor. See [[Damage]]. >[!info]- Combat Weaponry >#### Accuracy and Strength >Each weapon has two numerical parameters: Accuracy and Strength. >If either of those are 0, the weapon will not show up in the game or be utilized. >Numbers can be negative. > >#### Targeting >The weapons themselves are listed in [[target.dat]] and defines which Move Type they can target. >If there is a zero in the Move Type / Weapon matrix, any attack will simply skip trying to target that specific unit that has that Move Type (only if it is 0). > >#### Hardcoded Weapon Behavior Types >Before we list the weapons, we must define certain hardcoded behaviors that is tied to each weapon. >>[!danger]- Hardcoded Weapon Behavior Types List >>###### 💥Collatoral Damage >>Certain weapon types can roll separately against a [[Structure]](city) if and only if it misses it's attack on the unit is targeting. See [[Collatoral Damage]] for more info. >> #💥collatoral-damage >> >>###### 🌑Space-only Weapon >>Some attacks never triggers while on the surface of a planet (except PTS). >> #🌑space-only-weapon >>*Note that all attacks triggers in space, but this is usually not experienced often in vanilla* >> >>###### ☄️Orbital Bombardment >>A unit is capable of bombarding the selected hex from orbit and acts as PTS. >> #☄️bombardment-and-pts >> >>###### 👁Psy Attack >>Any unit with this type of attack will force the attacked unit to use [[PsyDef]] instead of [[Armor]] for that specific weapon phase. >> #👁psy > >>[!example]- Weapon List >>- Water #💥collatoral-damage >>- Indirect #💥collatoral-damage >>- Air >>- Direct #💥collatoral-damage >>- Close >>- Psy #👁psy >>- RangedSp #☄️bombardment-and-pts #🌑space-only-weapon >>- DirectSp #🌑space-only-weapon >>- CloseSp #🌑space-only-weapon >[!info]- Cargo >>[!info]+ Cargo >>Dictates how many cargo slots a unit has. Valid range is 0-4. > >>[!info]+ CanBCargo >>Defines whether a unit can be loaded into the cargo slots of units with a positive Cargo value (see above). 1 means the unit is allowed to be transported, 0 prevents it. > >Note that units that can both serve as as a transport and be cargo themselves may behave slightly erratically in certain situations. >[!info]- Unit Function >This is a column that can house a single positive integer. The integer tells the game which function codes to assign the unit, where the function codes changes special behavior for the unit. >Bitwise addition of function codes allow combining different values into one. >>[!tip]- Explanation >>Imagine that every function code is either a 0 or 1. >>0 means we do not use the function code, but a 1 means we are giving this attribute to the unit. >> >>A single unit can have several function codes, but yet we only have a single column in Unit.Dat where we can write a numeric value. >> >>We now need a way to count the 0 or 1 for every single function code, from a single integer value. This is solved and explained below. >> >>##### First three function codes >>The first function code is 1 for Non-Combat. Any unit with 1 in it's Unit Function column (Unit.Dat) will be a Non-Combat unit. >>The second function code is 2 for giving a unit the Assassination ability. >>The third function code is 4 for giving a unit the ability to attack on Byzantium II. >> >> >>##### How this works >>Notice that for each new function code listed, we double the previous value. 1, 2, 4, 8, 16... etc. >>When we *double* a value, we know mathematically that the combinations of previous numbers can never reach or surpass the current value. 1+2 < 4 and 1+2+4 > 8. >>This continues infinitely, and the combinations of previous numbers will always be lesser than the next doubling. 1+2+4+8 < 16 and 1+2+4+8+16 < 32 >>This means that adding the numbers together into a single value will always resolve properly and all the function codes will be found without issues. >>This is a mathematical guarantee using *Bitwise Operation*. >> >>##### 2 to the power of n >>Be warned that you must always write the combination with the doubled numbers as a base. You *will* get errors -unless- you only combine 2<sup>n</sup> with each other and *not* the combined values. >>2<sup>0</sup> = 1 >>2<sup>1</sup> = 2 >>2<sup>2</sup> = 4 >>The final value we write in Unit.Dat can be anything, but you should always only combine values that follows the doubling above, or is a product of 2<sup>n</sup>. >> >>Essentially, it's much safer only using the numeric values of the type above instead of using combinations of different function codes. >> >>If you try to combine 3+2, trying to add a combination of Assassination and Non-Combat with Assassination (again), you'll have broken the bitwise operation and you might get erroneous results. In this case, you'd get a 4+1 = Can Attack on Byzantium II and Non-Combat. >> >>##### Example using addition >>If we want to give a unit both the Non-Combat trait and the Assassination ability, we write a 3 in the Unit Function column (Unit.Dat). If we also want the unit to be able to attack on Byzantium II we add a 4, so we write a 7. >>*The Non-Combat trait would render further functions related to combat useless, this is only used as an example.* >> >>##### Keeping Track with tools >>It's recommended to use a tool to automatically combine the values you need, like Excel or a List with presets. Large numbers become unwieldly relatively quickly. > >>[!example]- Function List >> >[!info]- Costs >Costs refer to the monetary costs associated with building and maintaining a unit. >>[!info]- Crd/Trn >>Credits Per Turn dictates how many firebirds per turn a faction must pay for the unit's maintenance. This value scales with unit pay, can be affected by relics and sects, and the value can be negative. Player-controlled ministries do not pay this maintenance fee. > >>[!info] Cred >>The one-time up-front firebird cost of a unit. This amount must always be paid. If you do not possess the required amount of firebirds, you will be unable to build the unit. >[!info]- Resources Required To Build >The amount of the listed resources is required up-front before building the unit. If you attempt to build on a planet and there is a League Agora with sufficient resources (and you are not at war), you might be prompted if you wish to purchase the lacking resources when building a certain unit. > >Costs of resources can be scaled with sects. > >>[!example]- Resource List >>Food >>Energy >>Metal >>Trace >>Exotica >>Chemicals >>Biochems >>Electronics >>CeramSteel >>Wetware >>Monopols >>Gems >>Singularities >[!info]- Build Needs >Other requirements and specifications related to how long it takes for the building of a unit to complete, whom can build the unit, where the unit can be built and what input unit is required for building it (upgrade). #wip >>[!info]- Unit and tLvl >>Both of these in combination define which unit is required for the upgrade. >>-1 means no requirement. >> >>>[!info] Unit >>>Which Index is the required unit located in? >>>Index is the number after the left bracket, for instance the Grappler {0 >> >>>[!info] tLvl >>>If "Unit" is not -1, which tLvl has the unit? >> >>"Unit" and "tLvl" are both used together when the game references specific files. >>The unit 0 0 refers to the Grappler. >>17 1 refers to the Cyber Fighter. > >> > >>[!info]- Bldgs >>What is the *Index* of the Structure where is the unit built? >>in [[STRBUILD.DAT]], each row is the data belonging to one building. Dissimilar to how Unit.Dat operates, STRBUILD implicitly declares the index by the order of appearance. The first structure is the Palace with an Index of 0. >>-1 means the unit can never be built anywhere (except through a buggy AI). >>Any number larger than this represents the Index of the appropriate Structure. >>Except if the number is 99. Then the unit can be built in any valid Structure. >>Note that setting the Bldgs to an Index that does not exist is the equivalent of setting -1. > >> > >>[!info]- Owner >>What is the Owner ID that specifies what factions can build the unit? >>#wip > >> > >>[!info]- Turns2Bld >>How many turns to build the select unit? >[!info]- Tech Requirements >10 columns, from 0-9 >Each line corresponds to a single technology. >[!info]- Miscellaneous > >>[!info]- Tax >>Utterly unused by the game #unused > > >> > >>[!info]- Flock >>Flock tells the game whether or not the game contributes to the #flock of a certain Sect. >>1 tells the game that you should include this unit in the count. 0 excludes the unit from it. > > >> > >>[!info]- Range >>Range tells the game how many of the units can be found as reward in Ruins (ruin reward). >>0 means you can never find the unit in a ruin reward. >>1 or higher means you can find it. >>The game will only ever select a single unit type, but can have multiple units as a reward #unverified >> > > >> > >>[!info]- Eat >>Eat just clarifies whether or not the unit consumes food while planetside. >>1 means it consumes food. >>0 means it does not. > > >> > >>[!info]- Rank >>Rank is a bit complex #wip >> > >> > >>[!info]- RoP >>RoP stands for Rate-of-Plague >>#unverified #wip >> > >> > >>[!info]- Disband >>Can one disband the unit or not? >>1 means you are free to dsiband the unit. 0 means you are not. >> >[!info]- Artwork >>[!info] Animation >>FLC file the game should render > >> > >>[!info] Icon >>BMP file the game should show >