Skip to content

Superweapons

Charges one timer per house for every superweapon a rules section declares, and delivers that section's hard-coded effect where the shot is aimed.

Features & systemsCombat & weaponsSuperweapons & special systems

Changed in 0.1.0

A superweapon exists in two layers. The rules section declares one weapon for the whole game and fixes its recharge delay, its cameo, its mouse action and its behavior. Every house then carries its own copy of that weapon, with its own countdown and its own availability, so two houses holding the same weapon share nothing but the settings.

Three words carry that split through the rest of the page. A weapon’s behavior is one of seven effects wired into the engine and chosen by Type=; a section picks one of the seven and cannot add to them. The declared list is the order [SuperWeaponTypes] puts the sections in, and a weapon’s position in that list is the only name every later reference uses for it. Everything a house’s own copy holds — whether the house has the weapon, whether it is suspended, and where its countdown stands — is per house and is written in no section.

[SuperWeaponTypes] is a numbered list whose values name the sections that describe each weapon.

rules.ini
[SuperWeaponTypes]
1=MultiSpecial
2=EMPulseSpecial
3=FirestormSpecial
4=IonCannonSpecial
5=HuntSeekSpecial
6=ChemicalSpecial
7=DropPodSpecial

The list is read in order and each name the game has not already heard of takes the next position at the end of the declared set. FIRESTRM.INI and a scenario’s own rules override are read afterward through the same path, so a name that appears only there is appended after everything rules.ini declared. Every house is given one copy of each declared weapon, in the same order, as it is created. That position is the number every later reference uses: SuperWeapon= on a structure, the parameter of the two granting trigger actions, and the place a house’s copy occupies among its own set.

A name listed with no matching section is still declared. It keeps every default, which means it charges for five minutes, shows no artwork at all, and does nothing when fired.

Type= chooses which of seven hard-coded behaviors the section delivers. Several sections may name the same behavior; each still gets its own cameo, its own timer and its own grant condition, and a section left with no recognized behavior charges and shows a cameo like any other but delivers no effect.

A house re-examines its superweapons on its own turn, whenever something has flagged its build options for a rebuild — a structure placed, sold, destroyed, captured, switched on or off, or fitted with a plug. Two passes then run in sequence: one takes away or suspends what the house can no longer support, the other switches on everything its structures now grant. A house that has been defeated is stripped by the first pass and skipped entirely by the second. A power balance that crosses the full-power line runs the first pass on its own, without the second.

For every weapon the house does not already hold, the engine walks the structure list from its end backward and keeps the entries this house owns that are active and out of limbo. The first such structure that either names the weapon in SuperWeapon= or SuperWeapon2=, or carries a plug whose type does, grants it. When the house is the local player’s, the same step puts the cameo on the sidebar.

rules.ini
[NAMISL] ; Missile Silo
SuperWeapon=MultiSpecial
SuperWeapon2=ChemicalSpecial
NukeSilo=yes
[GAPLUG3] ; Ion Cannon Uplink, a plug for the GDI Upgrade Center
PowersUpBuilding=GAPLUG
SuperWeapon=IonCannonSpecial

AuxBuilding= is tested on the structure’s own grant: a weapon that names one is withheld unless its house has at least one standing structure of that BuildingType.

A weapon that becomes available while its house is already below full power is granted suspended, whatever IsPowered= says. Suspension by power, and what it costs a charge-draining weapon, are covered by power output and drain.

Two paths hand out a single-use weapon. The Add 1-time special weapon trigger action names the position of a weapon in the declared list; a missile crate picks one of its own. A one-time weapon is forced to full charge the instant it is granted, is never suspended, and is taken away from the house the moment it discharges.

The Add repeating special weapon trigger action grants a weapon and cancels its dependence on a building at the same time. Such a weapon recharges for as long as the house lives: the removal pass no longer examines it, so no structure can be sold to take it away, and low power can never suspend it. Only defeat removes it.

RechargeTime= is authored in minutes and converted to game frames at 900 frames to the minute. The timer counts down toward zero and the weapon becomes ready when it arrives.

Every event that touches that timer is listed below, with what it leaves on the clock. Two distinctions are what the table is for: which events put the full delay back rather than resuming from where the clock stopped, and which leave the timer stopped, because a stopped timer never reaches zero on its own and the weapon waits for something else to start it.

EventEffect on the timer
Granted, ordinary weaponstarted at the full delay
Granted, ManualControl=yesset to the full delay and stopped
Granted as a one-time weaponforced to zero, ready at once
Suspendedstopped where it stands
Resumed, ordinary weaponcontinues from where it stopped
Resumed, UseChargeDrain=yesset back to the full delay
Discharged, repeating weaponrestarted at the full delay
Discharged, ManualControl=yesset to the full delay and stopped
Discharged, one-time weaponthe weapon is removed from the house

Only the local player’s own weapon is announced: ChargingVoice= speaks as an ordinary weapon starts its charge and RechargeVoice= as it reaches zero. Every other house charges silently. A charge-draining weapon still speaks ChargingVoice= on the grant that starts it, but announces neither end of its running cycle after that.

ManualControl=yes leaves the timer stopped when the weapon is granted and stops it again after every discharge, so the weapon does not count down on its own and something else has to start it. The engine has exactly one such starter, and it is tied to the chem missile: on each of the house’s turns, a Type=ChemMissile weapon that is present and not already charged restarts its charge when its house’s weed pool is not empty and holds exactly WeedCapacity units, and that pool is then spent.

UseChargeDrain=yes replaces the ordinary ready-or-charging pair with three states: charging, ready, and discharged. Firing a ready weapon moves it to the discharged state and rescales the timer by ChargeToDrainRatio, so the clock now measures how long the effect lasts. Firing it again returns it to the ready state with the ratio applied in the other direction. Letting the drain run to zero returns the weapon to charging with a full delay on the clock and takes the effect down.

The two conversions are inverses of each other, and the arithmetic is short enough to follow. The charge a weapon has built up is RechargeTime less whatever is still on the clock, so firing puts that difference times the ratio on the clock as drain; firing again puts RechargeTime less the remaining drain divided by the ratio back on it as charge. An effect switched off the instant it came on therefore runs the second conversion on the whole drain and reads RechargeTime - (RechargeTime * ratio) / ratio, which is zero: the weapon is ready again with nothing left to charge. An effect switched off with half its drain still standing leaves half of RechargeTime on the clock, which is a half-charged weapon, and any other share comes back in the same proportion.

The flag, rather than Type=, is also what shapes the cameo: a charge-draining weapon always reports itself as charging, so it always carries a clock and never shows the plain ready face, and it can be fired from any state but charging or suspended.

The whole three-state cycle runs only for a house under human control. Firing the weapon in any other house toggles its effect on or off and touches neither the state nor the clock.

Type=Firestorm is the one behavior wired to this machinery. Firing the weapon raises every FirestormWall=yes structure the house owns and firing it again lowers them; damage aimed at a raised section is converted through DamageToFirestormDamageCoefficient into charge taken off this weapon’s clock instead of health taken off the section; and losing the last working GDIFirestormGenerator structure while the wall is up discharges the weapon outright. The firestorm wall covers the wall itself — what a raised section does to what it touches, through FirestormWarhead and the animations beside it, and how the two halves of the cycle are measured.

A superweapon’s artwork is the shape file named by SidebarImage=, falling back to XXICON.SHP when that file cannot be found. There is no numeric countdown anywhere on the cameo; the charge readout is a clock and a short caption. The sidebar covers where the cameo sits, how it is announced, how it is captioned, and when it leaves.

The table gives the caption each state carries. The rows to read together are the two charge-draining ones: such a weapon is captioned while it charges where an ordinary weapon is captioned with nothing, and it reaches a fourth state that no ordinary weapon has.

Weapon stateCaption
Suspended“On Hold”
Chargingnone, or “Charging…” for a charge-draining weapon
Ready“Ready”, or “Release” for Type=HunterSeeker
Discharged, charge-draining“Activated”

The clock is drawn while the weapon is not fully charged, and because a charge-draining weapon is always treated as charging, its cameo always carries one. Two clock shapes are used: the charge-up art while the weapon cannot be fired and the discharge art once it can.

Clicking a cameo that cannot be fired speaks SuspendVoice= when the timer is stopped and ImpatientVoice= otherwise. A ManualControl=yes weapon sits with its timer stopped between firings, so it answers with the suspend voice rather than the impatient one.

Clicking a cameo that can be fired takes one of two paths, decided by Action=. Action=None fires the weapon immediately at cell 0,0 with no targeting step at all; that is how the firestorm and the hunter seeker are fired, neither of which has a mouse action of its own. Any other value arms targeting mode, deselects everything, and speaks the select-target announcement.

While targeting mode is armed, the cursor over the map reports the weapon’s Action= in place of the ordinary one, and releasing the left button fires the weapon at the cell under the pointer. A right click on the cameo or on the map cancels targeting, and band selection is suppressed while it is armed. The minimap does not accept superweapon actions, so a shot cannot be aimed there.

Every left click that resolves to an action searches the declared list for the first section whose Action= matches, whether or not targeting mode was armed and without asking which weapon armed it. Two sections sharing one Action= therefore always fire the earlier of the two, and an Action= that ordinary orders also produce discharges a charged weapon on the next such order.

A computer house fires its superweapons from its periodic decision pass, which re-arms itself with 7 to 7.5 seconds each time it runs. Outside a campaign that pass always reaches the superweapon step. In a campaign it is reached only when the house’s IQ= is at least SuperWeapons in [IQ], and a campaign house’s intelligence is whatever its own scenario section sets, starting at 0.

Every weapon that has finished charging is then handed to the handler for its Type=. There is no handler for EMPulse and none for Firestorm, so a computer house never fires either from this pass; its wall is raised only by the Activate Firestorm Defense trigger action.

Every handler refuses to fire while the house has no declared enemy. The computer’s own enemy pick is skipped in a campaign, so a campaign house has no declared enemy — and its superweapons stay charged and unused — until damage or a trigger raises its anger against someone.

  • Multi missile and chem missile take the enemy structure whose cell carries the highest figure on the firing house’s own threat map. A building at full translucency — one whose cloak fade has run all the way to the last step, where the building counts as cloaked — is rated at a random 0 to 100 instead of by the threat map. Nothing on this loop tests limbo, strength or alliance.
  • Hunter seeker is fired with no target at all.
  • Drop pods pick a random point in one of the four compass quadrants of the firing house’s own base, between one and two base radii out from its center, and then the closest cell to that point that infantry could walk into. The computer’s pods land around its own base, not the enemy’s.
  • Ion cannon rates every object the enemy house owns and strikes one of the best rated.

The ion cannon’s rating is the only one of the four with settings behind it, and the rest of this section is about that rating.

Only an enemy object on the ground layer, active and out of limbo, is a candidate at all — except in difficulty slot 0, where an object still inside a factory that is running and not suspended also qualifies. Every candidate opens at a rating of 1 and a structure at 3, and those two opening figures are what the table below replaces. The table is consulted only for a candidate whose current strength is at or below IonCannonDamage; anything above that keeps its opening figure whatever it is. The comparison is against the raw figure alone, not a prediction that the blast will kill the object.

What a rating decides is rank, not worth. The routine remembers the highest rating it has seen, collects every candidate that ties with it, and fires at one of those at random. A premium of 4 and a premium of 40 therefore pick out the same object as long as nothing outrates it, and because a premium replaces the opening figure rather than adding to it, a premium below that figure demotes its object: an AIIonCannonHarvesterValue entry of 1 leaves a nearly destroyed harvester rated below an untouched structure standing beside it.

The rows are tested top to bottom and the first match wins, so a base defense that also produces vehicles is rated as a war factory and never reaches the base defense row. The right-hand column is what the rating column alone hides: three rows are numbers fixed in the engine, and no rules file can move them; every other row names a per-difficulty list read at the position of the firing house’s own difficulty slot, never the target’s. None of those lists carries a built-in value, so each needs one entry per difficulty written for it.

CandidateRatingWhere the figure comes from
EngineerAIIonCannonEngineerValuePer-difficulty list
Vehicle thiefAIIonCannonThiefValuePer-difficulty list
Any other infantry2Fixed in the engine
Factory=BuildingType structureAIIonCannonConYardValuePer-difficulty list
Factory=UnitType structureAIIonCannonWarFactoryValuePer-difficulty list
Structure whose rated output beats its rated drainAIIonCannonPowerValuePer-difficulty list
IsBaseDefense=yes structureAIIonCannonBaseDefenseValuePer-difficulty list
IsPlug=yes structureAIIonCannonPlugValuePer-difficulty list
IsTemple=yes structureAIIonCannonTempleValuePer-difficulty list
HoverPad=yes structureAIIonCannonHelipadValuePer-difficulty list
Any other structure4Fixed in the engine
Harvester=yes vehicleAIIonCannonHarvesterValuePer-difficulty list
Vehicle whose DeploysInto is the first BuildConst typeAIIonCannonMCVValuePer-difficulty list
Vehicle with Passengers above zeroAIIonCannonAPCValuePer-difficulty list
Any other vehicle2Fixed in the engine

Nothing else the enemy owns matches a row, so an aircraft standing on the ground is a candidate rated 1 however badly damaged it is.

One override then runs on top of whatever the table produced. A cloaked object, and a building at full translucency, each take a rating drawn at random from zero up to ten above the best rating collected so far, so such an object’s rating depends on where it falls in the scan and can outrate everything found before it. This is not the same rule as the flat 0 to 100 the missile handlers draw for a fully translucent building. The two are separate scales measuring different things — threat-map figures there, these premiums here — and each random range is sized for its own scale, so neither figure can be read across from one handler to the other.

Type=DropPod calls the drop-pod delivery on the chosen cell, and Type=Firestorm toggles the firestorm defense. The rest are set out here.

The blast lands at the target cell, at the height of that cell’s terrain. Over water it draws the last entry of SplashList; over anything else it draws IonBlast, and the IonBeam animation is created in both cases. It then applies IonCannonDamage through IonCannonWarhead with no source, so the warhead’s Verses table, its spread falloff and Immune=yes all apply and no kill is credited, and lights the scene when that warhead is declared bright. A cell that lies under a bridge is detonated twice: once at bridge height and once at ground level. A shockwave then rolls outward over the following frames.

An ordinary weapon of either behavior searches the declared BuildingTypes for the first NukeSilo=yes type that names this weapon in SuperWeapon= or SuperWeapon2=, then looks for one of the house’s structures of that type. That silo takes the missile mission, and the target is stored on the house as a single value, so a second launch overwrites a destination the silo has not yet read. A missile already in flight keeps the cell it was launched against.

The silo opens its door, holds it, and launches a projectile drawn from the recorded weapon’s WeaponType=: its projectile, warhead, maximum speed and projectile range, carrying a hard-coded strength of 200, released 160 leptons — five eighths of a cell — north of the structure’s center and pointed straight up. The launch-detected announcement plays whenever the launching house is not player-controlled. The door then closes and the structure returns to guard.

A one-time missile has no silo at all. It is created from the map edge closest to the target, out of the hard-coded weapon MultiLauncher or ChemLauncher according to the behavior, at a hard-coded range of 100000, which is longer than any map is wide.

The house’s structures are scanned against HSBuilding and the last match is kept, not the first. The drone appears at the closest cell to that structure that infantry could walk into — the drone is a vehicle, but the search that places it asks for ground crossable on foot — and only if that cell lies inside the playable area, the region a scenario declares with [Map] LocalSize=. Otherwise nothing is created and the charge is spent. ActsLike= decides which type is used: a house acting as GDI gets GDIHunterSeeker and every other house NodHunterSeeker. A drone that cannot be placed is deleted; one that can acquires its own target and attacks.

The shot is handed to the EM pulse cannon the house owns nearest the target, and the EM pulse cannon covers everything the pulse then does.

Two trigger actions grant a weapon, and becoming available covers what each one does to it. Two more toggle the firestorm defense: Activate Firestorm Defense and Deactivate Firestorm Defense each fire the house’s first Type=Firestorm weapon at cell 0,0, and each does nothing when the wall is already in the state it asks for.

The three strike actions — Ion-cannon strike, Nuke strike and Chem-missile strike — do not touch this system at all. They create the effect directly at the waypoint, so they need no weapon, no charge, no silo and no house that owns one.

The Preferred target action sets a value no superweapon routine consults; a computer house’s aim is entirely the per-behavior choice above.

NukeProjectile and NukeDown in [SpecialWeapons] are read into the rules and never consulted; a silo takes its projectile from the firing weapon’s WeaponType= instead. EMPulseWarhead and EMPulseProjectile in the same section are inert too, and are covered by the EM pulse cannon they appear to describe.

40 of 40

KeyDescriptionValueWhen omitted
AIIonCannonAPCValueglobal rulesThe ion cannon rating a computer house gives an enemy vehicle that can carry passengers.list of integers(empty)
AIIonCannonBaseDefenseValueglobal rulesThe ion cannon rating a computer house gives an enemy IsBaseDefense structure.list of integers(empty)
AIIonCannonConYardValueglobal rulesThe ion cannon rating a computer house gives an enemy structure that produces buildings.list of integers(empty)
AIIonCannonEngineerValueglobal rulesThe ion cannon rating a computer house gives an enemy engineer.list of integers(empty)
AIIonCannonHarvesterValueglobal rulesThe ion cannon rating a computer house gives an enemy harvesting vehicle.list of integers(empty)
AIIonCannonHelipadValueglobal rulesThe ion cannon rating a computer house gives an enemy HoverPad structure.list of integers(empty)
AIIonCannonMCVValueglobal rulesThe ion cannon rating a computer house gives an enemy vehicle that deploys into a construction yard.list of integers(empty)
AIIonCannonPlugValueglobal rulesThe ion cannon rating a computer house gives an enemy IsPlug structure.list of integers(empty)
AIIonCannonPowerValueglobal rulesThe ion cannon rating a computer house gives an enemy structure that produces more power than it draws.list of integers(empty)
AIIonCannonTempleValueglobal rulesThe ion cannon rating a computer house gives an enemy IsTemple structure.list of integers(empty)
AIIonCannonThiefValueglobal rulesThe ion cannon rating a computer house gives an enemy vehicle thief.list of integers(empty)
AIIonCannonWarFactoryValueglobal rulesThe ion cannon rating a computer house gives an enemy structure that produces vehicles.list of integers(empty)
ActionSuperWeaponType, scenariosA superweapon's targeting cursor and firing path, or on a scenario the movie played as the mission begins.actiontypeVaries by type
AuxBuildingSuperWeaponTypeA BuildingType the house must own before a structure may grant this superweapon.classnone
ChargeToDrainRatioglobal rulesThe exchange rate between a charge-draining superweapon's stored charge and the time its effect runs.floating point3
ChargingVoiceSuperWeaponTypeThe EVA line spoken as the superweapon starts charging.EVA speechnone
DamageToFirestormDamageCoefficientglobal rulesHow much firestorm charge a raised wall loses per point of damage aimed at one of its sections.floating point0.1
FirestormWallBuildingTypeWhether the structure is a firestorm wall section, raised and lowered with its house's firestorm defense.booleanno
FirestormWarheadglobal rulesThe WarheadType a raised firestorm wall destroys objects with.classnone
GDIFirestormGeneratorglobal rulesThe BuildingType whose loss discharges a house's firestorm superweapon and brings down its wall.classnone
GDIHunterSeekerglobal rulesThe type created by a hunter-seeker superweapon fired by a house acting as GDI.classnone
HSBuildingglobal rulesThe BuildingTypes a hunter-seeker drone may walk out of.typelist(empty)
ImpatientVoiceSuperWeaponTypeThe EVA line spoken when the cameo of a still-charging superweapon is clicked.EVA speechnone
IonCannonDamageglobal rulesThe raw damage an ion cannon blast applies, and the strength ceiling the computer rates a target against.integer700
IonCannonWarheadglobal rulesThe WarheadType an ion cannon blast applies its damage through.classnone
IsPoweredSuperWeaponTypeWhether the superweapon stops charging while its house is short of power.booleanyes
ManualControlSuperWeaponTypeWhether the superweapon's charge timer is left stopped instead of counting down on its own.booleanno
NodHunterSeekerglobal rulesThe type created by a hunter-seeker superweapon fired by any house not acting as GDI.classnone
NukeSiloBuildingTypeWhether the structure can serve as the launch site of a MultiMissile or ChemMissile superweapon.booleanno
RechargeTimeSuperWeaponTypeThe minutes a superweapon takes to charge, and for a charge-draining weapon the base the drain is scaled from.floating point5
RechargeVoiceSuperWeaponTypeThe EVA line spoken as the superweapon finishes charging.EVA speechnone
SidebarImageSuperWeaponTypeThe name of the shape file drawn as the superweapon's sidebar cameo.stringComputed
SuperWeaponBuildingTypeThe superweapon a standing structure of this type grants its owner.SuperWeaponTypenone
SuperWeapon2BuildingTypeA second superweapon a standing structure of this type grants its owner.SuperWeaponTypenone
SuperWeaponsglobal rulesThe house intelligence level at which a computer house begins firing its superweapons in a campaign.integer4
SuspendVoiceSuperWeaponTypeThe EVA line spoken when the cameo of a superweapon whose timer is stopped is clicked.EVA speechnone
TypeNo effect in some scopesSuperWeaponType, multiplayer settingsA superweapon's hard-coded behavior, or under the sync-bug settings the object kind named for the playback trap.stringVaries by type
UseChargeDrainSuperWeaponTypeWhether the superweapon holds its effect for a timed spell instead of firing once.booleanno
WeaponTypeSuperWeaponTypeThe WeaponType a missile silo launches for this superweapon.classnone
WeedCapacityglobal rulesUnits of weed a house can hold.integer0

History

  1. Changed0.1.0In development

    Recount superweapons safely while a scenario is cleared