|
Wing Commander II
Reconstructed Win32 source (1996)
|
Bugs of the original game and its data. This source keeps them, since it rebuilds WC2.EXE byte for byte; the SDL2 port fixes the ones listed here. Unless an entry says otherwise, Wing Commander II and both Special Operations have the bug, in the DOS release and the Kilrathi Saga alike.
draw_sorted_objects_to_buffer() draws each planet as it draws stars and dust, with a frame of the star field's shape instead of the planet's own, so space has no planets. The Kilrathi Saga has this bug.
How to reproduce: fly to a nav point with a planet. Space shows stars but no planet.
How it was fixed: by drawing planets with their own shapes, scaled like ships.
Origin: wcdx
transform_objects_to_your_view() scales each object by a ratio that DivideFixed() cuts to eight fraction bits, so a distant ship keeps its size while it approaches, then jumps: the Concordia grows by a third at 11 km and by a quarter at 9 km. Only the Kilrathi Saga has this bug; the DOS release scales smoothly (#62).
How to reproduce: fly towards a capital ship from far away and watch its size.
How it was fixed: by taking the same scale without cutting the ratio.
Origin: wc2-re
The Kilrathi Saga steers from key events: each press, and each repeat the system sends, turns one step harder, and nine steps make a full turn. A held key turns one step, waits out the keyboard's repeat delay, then reaches a full turn within a few frames. Releasing any key levels every axis. The DOS release reads the held keys every frame (#67).
How to reproduce: hold an arrow key: the turn starts slowly, then jumps to full speed. Hold Down and Right, then let go of Down: the ship stops turning.
How it was fixed: by reading the held keys every frame in player_input(), as Wing Commander I's Kilrathi Saga build does: a held key turns one step harder each frame, and a released one levels only its own axis.
Origin: wc2-re
A cloaked ship decloaks only when it fires (fire()). One that stops attacking, or never gets a shot at an evading player, stays invisible for the rest of the mission, and report_kilrathi_rout() still counts it as near, so autopilot is refused (#9).
How to reproduce: in a mission with Strakhas, evade them until they stop attacking. They stay cloaked, and autopilot stays refused.
How it was fixed: by ending a cloak after a minute without firing, as a shot ends it; the ship then waits half a minute before it can cloak again.
Origin: wc2-re
flag_reached() marks every objective within 1,500 m of the player as visited, current or not, and set_next_destination() skips visited ones. A flight path that comes back to a nav point loses its return when the player first passes it (#9).
How to reproduce: in Special Operations 1, series 1 mission 4, fly to Nav 1. The nav computer then points at the other system instead of back to Rigel's jump point, and autopilot answers "Jump Point".
How it was fixed: an objective still ahead on the flight path, with another nav point between it and an earlier objective at the same place, is not visited by passing it.
Origin: wc2-re
ProcessMissionWaveCommands() can queue a scene for when a nav point's fight is over, but the scene stays queued after the player leaves, and ProcessEnemyWaveCompletion() plays it when the next nav point is cleared of Kilrathi (#9).
How to reproduce: in Special Operations 2, series 2 mission 3, heed the warning and leave Nav 3, then clear Nav 1. The bomb at Nav 3 kills the player there.
How it was fixed: by playing a queued scene only when its own nav point is cleared; it stays queued until then.
Origin: wc2-re
Only CompleteStarSystemJump() ends a star-system jump, so a player killed during one leaves the jump running for the rest of the session. Every later flight then skips HandleSpaceFlightControls(): no key works, the ship drifts to a stop and the wingman flies off. The capital-ship AI also flies the player's Broadsword and reads past its gun table.
How to reproduce: die during a jump, as in Wing Commander II's series 4 mission 4, jumping back from Nav 2 with a Kilrathi capital ship near, then start another flight.
How it was fixed: by clearing the jump in init_mission().
Origin: wc2-re
warp() takes an object for the jump's flash. With all of them in use, it turns the jumping ship itself into the flash. The player's jump then never ends: the ship vanishes and the controls stay off. A wingman jumping along becomes the flash in turn and is lost.
How to reproduce: hard to see in play: it needs every object in use when a jump starts, as in a large fight.
How it was fixed: by removing dust, debris, a shot or an explosion to make room for the flash.
Origin: wc2-re
A jump's arrival point is a jump point too, and the new system's jump drive is unused, so TryBeginStarSystemJump() starts another jump there. With no active nav point left in another system, CompleteStarSystemJump() takes nav point 10, past the ten: the mission ships' records.
How to reproduce: in Wing Commander II's series 7 mission 1, jump to Nav 3, then press J again once the jump point behind has been switched off.
How it was fixed: by answering "No jump point" when there is nowhere to jump to.
Origin: wc2-re
During a jump the AI flies the player's ship, which cannot turn. regulate_turn() still avoids collisions first, at full throttle, and returns before prepare_for_jump() for as long as something stays in the way. With the wingman close ahead, the player rams it until it blows up.
How to reproduce: start a jump with the wingman a little ahead.
How it was fixed: by not avoiding collisions with the player's ship during its jump.
Origin: wc2-re
cruise_home() turns a ship near its home's position to head home, and coming_home() looks home up with find_ship_index(). When home is at another nav point, that gives -1, and the ship steers by the position, speed and orientation read from before the tables.
How to reproduce: in Wing Commander II's series 4 mission 3, make the return jump to Nav 6: a Confed capital ship arriving there heads for the Concordia, which is at Nav 0.
How it was fixed: a fighter lands, as it does at home, and a capital ship stops.
Origin: wc2-re
new_sphere_shapes() frees the resource slots of ship types the next nav point does not preload and loads that nav's types into the lowest free slot, while ships on a freed slot can still be there: explode() spares a Confed capital ship with an ejection scene, and ships travelling with the player stay. A ship reaches its type only through its slot, so it takes the new type's records, and get_right_shape() loads a capital ship's views from a fighter's file.
How to reproduce: in Special Operations 1's first mission, fly to Nav 1 without autopilot with the Concordia in the rear view. The game stops with "Sorry, an error has occurred while allocating memory".
How it was fixed: by removing the ships explode() leaves behind, and loading a new type into a free slot that no ship uses.
Origin: wc2-re
load_ship() never marks a capital ship's slot as loaded, so load_all_slots() fetches its 41 packets again at every nav point and loses the previous set, and init_intelligence_data() never frees a small buffer. Their handles fill the table of 4,096 until the game exits with "qq mem push overflow".
How to reproduce: fly about 50 missions with capital ships without restarting the game.
How it was fixed: by keeping a slot that still holds the ship, and freeing the buffer.
Origin: wc2-re
A routed ship that cruise_home() removes far from the player, or that lands at home, is not recorded as gone, so the next set-up of its first nav point brings it back; if the player's wingman is gone by then, it becomes the wingman. Special Operations 1's aces with portrait 21 have no INTEL.021 in any release, so the game exits with a disk error.
How to reproduce: in Special Operations 1's series 4 mission 1, return to the Olympus after Hobbes has died and Landis has fled or been sent home.
How it was fixed: by recording a routed ship as gone when it leaves, and flying an ace without an intelligence file on its ship type's.
Origin: wc2-re
Navs 6 and 7 of Wing Commander II's series 8 mission 4, the two "Minefield" nav points, preload SHIP.V32, which no release includes; every other minefield uses hazards instead. The game exits with a disk error if the player comes within 10,000 of either. Neither is on the flight path. Special Operations 1 likewise preloads the missing SHIP.V37 at one Mines nav point.
How to reproduce: fly off course to Nav 6 or 7. Starting the DOS release at Nav 6 (WC2 Origin s8 m3 l as6) stops with "ship.v32, packet 38".
How it was fixed: by leaving those preloads and ships out of the missions as they load.
Origin: wc2-re
RunCutsceneScript() skips the drawing of an animation that starts while a key press skips the scene, so it never reaches its last frame, and a scene waiting for it loops without reading input.
How to reproduce: in Special Operations 1's series 4 mission 2, press a key at Nav 2 before the rescue scene's pickup animation starts.
How it was fixed: during a skip, an animation the script reaches ends as if its last frame played.
Origin: wc2-re
fire_weapon() gives a torpedo the player's saved lock whenever the player is in the torpedo view, whoever launches it. An enemy torpedo then flies at the player's target, or at object -1 when no lock was saved.
How to reproduce: stay in the torpedo view while a Kilrathi ship launches a torpedo.
How it was fixed: by giving the lock only to the player's own torpedo.
Origin: wc2-re
LoadShapeSet() stops at the first missing shape in a cockpit's list. Some ships' cockpits have no weapon display, and the target display's shield indicator comes after it, so it is never loaded (#30).
How to reproduce: lock a target in such a ship. The target display shows the ship but no shields around it.
How it was fixed: by loading the indicator on its own when the list stopped before it.
Origin: wc2-re
When new_sphere_shapes() frees a slot under a ship that stays, the ship's engine exhaust still points into the freed packet, and when it explodes, Create_explosion_debris() takes its wing shape from past the slot table. remove_object(), ShipExplosion() and the loops that release a nav point's ships free a capital ship's view even when its slot preloaded it for every ship of that type; the loops can free one twice.
How to reproduce: hard to see in play: the freed memory often still holds the same shapes.
How it was fixed: by freeing only the packets a ship loaded itself, and clearing what pointed into a freed slot.
Origin: wc2-re
With more sounds than voices, stopping a playing sound hands its voice to a waiting one. ix_system_delete_all_sounds() walks the playing sounds first, so that one survives, still playing a sample that stop_all_sounds() frees next. ix_dspv_clear_active() also stops a voice without the mixer's lock, so the mixer may still read a sample being freed.
How to reproduce: hard to see in play: fire the guns, then engage autopilot, with many sounds playing.
How it was fixed: by deleting the waiting sounds first, and taking the mixer's lock.
Origin: wc2-re
Many routines reach just outside their tables, most often for object -1 when a ship has no target: fire() reads the shields before its table, a shot is aimed at the position before the position table, and the cockpit reads the weapon slots at -1 when none is selected. The line-up and veer-away maneuvers, Mkill_missile() and imperial_formation() steer by object -1; push_mode() writes a fifth display mode past its four-deep stack; init_intelligence_data() reads a raider's strike target past the nav table; sprites at the screen's edge read past the row table; a turret's firing chance reads the side of the previous turret's shot; PollSceneHotspotInput() reads an event type it never set; and PlayRawSpeechBuffer() releases a sound its stop already freed. In the original each finds harmless data, or none that shows.
How to reproduce: nothing shows in play.
How it was fixed: by keeping each result without reaching outside the table.
Origin: wc2-re