<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://manicpop.org/gewiki/index.php?action=history&amp;feed=atom&amp;title=Classic_bug%3A_Damaged_warp_overrides_requested_speed</id>
	<title>Classic bug: Damaged warp overrides requested speed - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://manicpop.org/gewiki/index.php?action=history&amp;feed=atom&amp;title=Classic_bug%3A_Damaged_warp_overrides_requested_speed"/>
	<link rel="alternate" type="text/html" href="https://manicpop.org/gewiki/index.php?title=Classic_bug:_Damaged_warp_overrides_requested_speed&amp;action=history"/>
	<updated>2026-10-20T17:15:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://manicpop.org/gewiki/index.php?title=Classic_bug:_Damaged_warp_overrides_requested_speed&amp;diff=1556&amp;oldid=prev</id>
		<title>CodexBot: Link first command references to command pages</title>
		<link rel="alternate" type="text/html" href="https://manicpop.org/gewiki/index.php?title=Classic_bug:_Damaged_warp_overrides_requested_speed&amp;diff=1556&amp;oldid=prev"/>
		<updated>2026-10-12T02:14:39Z</updated>

		<summary type="html">&lt;p&gt;Link first command references to command pages&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Classic bug&lt;br /&gt;
|id=GE-BUG-026&lt;br /&gt;
|affected=Classic 3.2e and published classic source&lt;br /&gt;
|status=Verified in source&lt;br /&gt;
|fixed=ge-next 0.1&lt;br /&gt;
|source=Overspeed penalty in &amp;lt;code&amp;gt;moveship()&amp;lt;/code&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When classic GE applies engine damage after an overspeed warning sequence, it unconditionally changes the ship&amp;#039;s requested speed to the newly reduced maximum. This can override a lower speed the player just requested, including a request to stop.&lt;br /&gt;
&lt;br /&gt;
The bug was fixed in ge-next 0.1. It predates and is separate from the smooth overspeed system introduced in ge-next 0.3.&lt;br /&gt;
&lt;br /&gt;
== Overspeed state in classic ==&lt;br /&gt;
Each user ship has a current safe top speed in &amp;lt;code&amp;gt;topspeed&amp;lt;/code&amp;gt;, a current speed in &amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt;, and a requested destination speed in &amp;lt;code&amp;gt;speed2b&amp;lt;/code&amp;gt;. Traveling above &amp;lt;code&amp;gt;topspeed&amp;lt;/code&amp;gt; can increment &amp;lt;code&amp;gt;warncntr&amp;lt;/code&amp;gt; as progressively stronger engine warnings are issued.&lt;br /&gt;
&lt;br /&gt;
The accumulated penalty is not applied immediately. Once the ship is no longer continuing to accelerate at excessive speed, &amp;lt;code&amp;gt;moveship()&amp;lt;/code&amp;gt; divides &amp;lt;code&amp;gt;topspeed&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;warncntr&amp;lt;/code&amp;gt;. This represents the reduction in the engines&amp;#039; safe maximum after the overspeed incident.&lt;br /&gt;
&lt;br /&gt;
That general process is intentional. The error is what classic does to &amp;lt;code&amp;gt;speed2b&amp;lt;/code&amp;gt; at the same time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
ptr-&amp;gt;topspeed = ptr-&amp;gt;topspeed / ptr-&amp;gt;warncntr;&lt;br /&gt;
ptr-&amp;gt;speed2b = ptr-&amp;gt;topspeed * 1000.0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second assignment does not check what speed the player requested. It always replaces that request with the damaged engine maximum.&lt;br /&gt;
&lt;br /&gt;
== Gameplay consequences ==&lt;br /&gt;
Suppose a ship has a safe top speed of warp 10, is still traveling at warp 12, and has accumulated an overspeed warning count of 2. The player recognizes the danger and enters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
WARP 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command correctly sets the requested speed to zero. On the next movement update, however, classic applies the pending engine penalty:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
new top speed = 10 / 2 = warp 5&lt;br /&gt;
requested speed = warp 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ship decelerates only to warp 5 instead of stopping. A request for warp 3 would likewise be changed to warp 5. The player is warned that the recommended maximum has fallen, but the more immediate problem is that the helm no longer obeys the lower speed that was ordered.&lt;br /&gt;
&lt;br /&gt;
This is especially hazardous when the player is trying to stop near a planet, another ship, a wormhole, or the galactic perimeter. The corrective command can leave the ship moving at substantial warp speed and require another command after the penalty has been applied.&lt;br /&gt;
&lt;br /&gt;
Clamping a request above the new maximum is reasonable. Raising a request that is already at or below the new maximum is not.&lt;br /&gt;
&lt;br /&gt;
== Cause ==&lt;br /&gt;
Classic uses the same assignment both to enforce the damaged maximum and to set the target speed. It therefore treats all requested speeds as though they were above the new limit. The code never compares &amp;lt;code&amp;gt;speed2b&amp;lt;/code&amp;gt; with the reduced &amp;lt;code&amp;gt;topspeed&amp;lt;/code&amp;gt; before overwriting it.&lt;br /&gt;
&lt;br /&gt;
The behavior occurs in the movement update rather than directly in &amp;lt;code&amp;gt;cmd_warp()&amp;lt;/code&amp;gt;. The WARP command accepts the lower speed correctly; &amp;lt;code&amp;gt;moveship()&amp;lt;/code&amp;gt; replaces it when resolving the outstanding overspeed warnings.&lt;br /&gt;
&lt;br /&gt;
== Correction in ge-next ==&lt;br /&gt;
ge-next 0.1 made the assignment conditional:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
ptr-&amp;gt;topspeed = ptr-&amp;gt;topspeed / ptr-&amp;gt;warncntr;&lt;br /&gt;
if (ptr-&amp;gt;speed2b &amp;gt; ptr-&amp;gt;topspeed * 1000.0)&lt;br /&gt;
    ptr-&amp;gt;speed2b = ptr-&amp;gt;topspeed * 1000.0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The damaged maximum is still calculated exactly as before. A requested speed above that maximum is reduced to it, while a lower requested speed remains unchanged. In particular, [[Warp command|&amp;lt;code&amp;gt;WARP 0&amp;lt;/code&amp;gt;]] continues toward a dead stop.&lt;br /&gt;
&lt;br /&gt;
ge-next 0.3 later replaced the broader overspeed mechanics with a smoother system. That later feature should not be confused with this fix: the incorrect target-speed overwrite had already been corrected in the first public ge-next release.&lt;br /&gt;
&lt;br /&gt;
[[Category:Classic bugs: Navigation]]&lt;br /&gt;
[[Category:Classic bugs: Combat]]&lt;br /&gt;
&lt;br /&gt;
{{GE navigation}}&lt;/div&gt;</summary>
		<author><name>CodexBot</name></author>
	</entry>
</feed>