Jump to content

Classic bug: REP SYS omits damaged systems

From Galactic Empire wiki
Bug ID GE-BUG-047
Affected versions Classic 3.2e and published classic source
Status Verified in source; corrected in ge-next
Fixed in ge-next 0.1
Primary source Random system damage in randamage() in GEFUNCS.C and REPORT SYSTEMS in cmd_report() in GECMDS.C

Summary

Classic's REPORT SYSTEMS output does not provide a complete list of a ship's damaged systems. Random combat damage can disable six systems, but the report's damage section checks only four of them. Phaser and fire-control damage are omitted.

Phasers receive a limited indication elsewhere in the report: a damaged phaser is shown as <inoperable>. That same label is used when the phaser is merely empty and recharging, however, so the player cannot tell why it is unavailable. Fire-control damage has no report entry at all.

Classic also does not report damage to the warp engines. Warp damage is represented differently and is produced by the overspeed system rather than the random system-damage table. Adding it made ge-next's report more complete, but it is less clearly a correction of the specific omission that affects phasers and fire control.

The random damage table

When a sufficiently damaged ship is selected for additional system damage, classic chooses one of six cases in randamage():

Roll System Damage representation
0 Shields shieldstat = SHIELDDM and a negative shield value
1 Phasers Negative phasr value
2 Fire control Positive firecntl countdown
3 Cloak Negative cloak value
4 Tactical scanners Negative tactical value
5 Helm Negative helm value

The player is notified when the damage occurs. Damage Control subsequently repairs a negative phaser value toward zero and decrements a positive firecntl value toward zero. Separate messages announce when each system becomes functional again.

Those transient values remain part of the ship's current state between the initial damage and repair-complete messages. REP SYS is the natural way for a player to check which systems are still damaged.

The incomplete report

After displaying the ship's overall damage description, classic checks these four random-damage states:

if (warsptr->shieldstat == SHIELDDM)
    prfmsg(REP15);
if (warsptr->helm < 0)
    prfmsg(REP16);
if (warsptr->cloak < 0)
    prfmsg(REP17);
if (warsptr->tactical < 0)
    prfmsg(REP18);

There is no corresponding test for:

warsptr->phasr < 0
warsptr->firecntl > 0

This does not match the six-way damage table. Phaser and fire-control damage are genuine system states with automatic repair logic, failure behavior, and repair-complete messages, but they were left out of the list.

The general DCO reports ... damage line does not compensate for the omission. It describes overall structural damage through damstr(); it does not identify individual damaged systems.

Phaser damage is ambiguous

Classic prints the installed phaser near the top of the report using only the sign of phasr:

if (warsptr->phasr > 0)
    prfmsg(REP23,warsptr->phasrtype);
else
    prfmsg(REP24,warsptr->phasrtype);

The resulting labels are <operative> and <inoperable>. A negative value does therefore cause a damaged phaser to appear inoperable, but zero produces exactly the same output.

Zero is the ordinary post-firing state: firing sets the phaser charge to zero, after which the banks recharge toward minimum firing power and eventually 100 percent. A negative value instead means that Damage Control must first repair the phaser back to zero before normal charging can begin.

The report consequently cannot distinguish:

  • an undamaged phaser that is empty and recharging; and
  • a damaged phaser that cannot begin recharging until its repair countdown reaches zero.

Attempting to fire does not clarify the distinction. Classic responds to both states with “There is insufficient phaser power to fire sir!” The player must remember the earlier damage message or wait for the phaser-repair message.

This is why adding an explicit “Phasers damaged” entry is a correction even though the existing phaser line already says that the system is inoperable.

Fire-control damage is invisible in the report

Fire-control damage is the clearest omission. A positive firecntl blocks lockon(), which prevents torpedoes and missiles from being fired at a selected ship. An attempted launch reports that Fire Control is not functioning and that Damage Control is working on it.

Unless the player attempts to use one of those weapons, however, REP SYS gives no indication that Fire Control remains damaged. The report does not display firecntl in any form.

This differs from helm, tactical, cloak, and shield damage only because the two lines needed to test and report it were omitted.

Warp damage is a separate case

Classic's warp engine damage does not use a signed repair counter from the random damage table. Every ship begins with topspeed equal to its class maximum. Sustained overspeed can reduce that value, or a severe containment breach can set it to zero.

The reduced value has real gameplay effects:

  • topspeed == 0 leaves the ship with impulse power only.
  • A nonzero value below the class maximum becomes the damaged engine's safe operating speed.
  • The WARP command warns about or rejects speeds according to the reduced value.
  • Planetary maintenance restores topspeed to the class maximum.

Those facts make the reduced value a form of persistent system damage, but classic reports it reactively: the player sees warnings when the damage occurs or when a later WARP command encounters the limit. It is not part of REP SYS.

Unlike phaser and fire-control damage, warp damage is not one of the states that classic's existing random-system list partially enumerates. Treating its absence as a bug is therefore debatable. It can instead be understood as a useful ge-next enhancement that exposes the engine state already enforced by the simulation.

Gameplay consequences

The omissions do not prevent the damage from taking effect or being repaired. They prevent the systems report from serving as a reliable Damage Control summary.

A player who misses or forgets the original combat message can see that helm, cloak, tactical scanners, or shields are damaged, but cannot obtain equivalent information about Fire Control. A damaged phaser is visibly unavailable, but looks the same as an ordinary discharged phaser. Warp limitations are visible only through earlier warnings or an attempted speed command.

This matters most during combat, when asynchronous messages can scroll past quickly and the player uses REP SYS specifically to reassess the ship's condition.

Correction in ge-next 0.1

ge-next added explicit tests to the damaged-system section:

if (warsptr->phasr < 0)
    prfmsg(REP21);
if (warsptr->firecntl > 0)
    prfmsg(REP22);

The resulting report names “Phasers damaged” and “Fire control damaged.” The phaser's normal status line can still show whether it is currently capable of firing, while the additional damage line explains why a negative system is unavailable. The phaser command was also changed to report that Damage Control is repairing the phasers, rather than treating damage as ordinary insufficient charge.

ge-next also added warp-state reporting. A zero current top speed is shown as “Warp engines inoperable.” A reduced top speed is identified as damage and the report gives the recommended maximum warp speed. This was included in the same 0.1 REP SYS cleanup, while remaining conceptually separate from the two clear omissions in the random-damage list.

Later ge-next releases expanded the damage-control presentation further, but the basic missing-system correction dates to 0.1. The 32-bit ge-next port retains the correction.