Classic bug: NPC speed exceeds class limits
| Bug ID | GE-BUG-018 |
|---|---|
| Affected versions | Classic 3.2e and published classic source |
| Status | Verified in source |
| Fixed in | ge-next 0.2 |
| Primary source | GECYBS.C; GEDROIDS.C; GEFUNCS.C |
Summary
Classic NPC behavior routines sometimes choose an arbitrary floating-point speed without respecting the ship class's maximum warp or selecting a whole-number warp speed. This is separate from a Cybertron's deliberate high-speed travel toward a distant target.
Examples in classic
- The Murdonian Transport's configured maximum is warp 8, but its missile-evasion branch in
droid_act_class_12()setsspeed2btorndm(5900.0) + 5000.0. That requests roughly warp 5 through 10.9, including fractional speeds and speeds above the class maximum. A transport dodging missiles can therefore outrun its own specification. - When jammed, a Cybertron directly requests
d_topspeed + rndm(3000.0). The extra random amount can push its requested speed almost three warp units above its configured top speed, independently of any long-distance pursuit. - Ordinary Cybertron cruising selects
rndm(d_topspeed), and Droid initialization similarly selects a random floating-point speed up to the class maximum. When the result is in the warp range, it need not be an integer warp setting; a scan can show an unintended fractional warp speed even when the maximum is not exceeded.
Cause
These branches write directly to the requested-speed field, speed2b, using values in thousandths of a warp unit. The random-number routine returns floating-point values, and the classic AI does not consistently constrain or quantize the resulting warp request. Movement then accelerates toward that request.
Correction in ge-next 0.2
The NPC behavior rewrite replaced the affected cruising and maneuvering choices with class-aware, whole-number warp selections. Shared npc_cruise() chooses integer warp steps up to the class's configured maximum for normal cruising, while other AI branches use appropriate fixed or bounded speeds. A Cybertron's long-distance pursuit remains an intentional exception to its ordinary class maximum; it is not an example of this bug.
Porting guidance
Audit each NPC branch that assigns speed2b, not just the general cruising path. Apply the class's speed limit to ordinary movement choices and quantize warp-range requests to whole warp settings, while preserving any explicitly designed special movement modes.
Home · Play · Reference · Versions & history · Sysop · Development · Classic bugs