Difference between revisions of "Ikari Warriors/Game Mechanics"

From SDA Knowledge Base

Jump to: navigation, search
(Items)
(Airstrike target plates)
(30 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
==Items==
 
==Items==
 
'''Pink soldier drops'''<br />
 
'''Pink soldier drops'''<br />
* F - Your bullets will be able to pass through walls and multiple enemies.
+
* [[File:F_ik1.png]] F - Your bullets will be able to pass through walls and multiple enemies. The bullets can now destroy buildings (but not tanks).
* L - Longer bullet range.
+
* [[File:L_ik1.png]] L - Longer bullet range.
* S - Faster firing rate (bullets).
+
* [[File:S_ik1.png]] S - Shots will travel faster (bullets and projectiles when in tank or helicopter). Grenades are not affected.
* B - Grenades will finish with a huge blast upon impact.
+
* [[File:B_ik1.png]] B - Grenades will finish with a huge blast upon impact.
 
These drops are always fixed. There are a few fake pink soldiers throughout the game that don't drop anything.<br /><br />
 
These drops are always fixed. There are a few fake pink soldiers throughout the game that don't drop anything.<br /><br />
  
 
'''Green soldier drops'''<br />
 
'''Green soldier drops'''<br />
* K - Smart bomb, kill all the enemies on screen
+
* [[File:K_ik1.png]] K - Smart bomb, kill all the enemies on screen
 
Green soldiers always drop K.<br /><br />
 
Green soldiers always drop K.<br /><br />
  
'''Tank and destroyable environment (gates, parked trucks, ...) drops'''<br />
+
'''Tank drops'''<br />
* Gas can - Bullets are restored to 99, +50 grenades, gas is restored to 99
+
* [[File:Gas_can_ik1.png]] Gas can - Bullets are restored to 99, +50 grenades, gas is restored to 99
Tanks can drop gas cans, a tank or nothing. However, some tanks will never drop a tank. The drop is determined some time before the tank appears on screen. Once the drop has been determined, there is no (known) way to change it. Before the drop has been determined, it can be changed based on typical rng-factors such as firing or moving around a bit.<br />
+
Tanks can drop gas cans, a tank or nothing. The type of drop is determined by the RAM-address the tank is allocated to. If the tank gets the first object address, $500, it will drop a tank. If it's in the third object address, $502, it will drop a fuel. For more information about the address allocation of objects and some special cases of drop manipulation, see [[Ikari Warriors (NES)/Fuel drop manipulation|fuel drop manipulation]].<br /><br />
The drops from the destroyable environment are always predictable (with the exception of the garbage sprites around the helicopter in level 4).<br /><br />
+
  
'''Tank and destroyable environment (gates, parked trucks, ...) drops'''<br />
+
'''Destroyable environment (gates, parked trucks, ...) drops'''<br />
* Gun - Bullets are restored to 99.
+
* [[File:Gas_can_ik1.png]] Gas can - (explained above)
* Grenade - +50 grenades
+
* [[File:Gun_ik1.png]] Gun - Bullets are restored to 99.
The drops from the destroyable environment are always predictable (with the exception of the garbage sprites around the helicopter in level 4).<br /><br />
+
* [[File:Grenades_ik1.png]] Grenades - +50 grenades
 +
The drops from the destroyable environment are always predictable (with the exception of the garbage sprites around the helicopter in area 4).<br /><br />
  
 
'''Hidden items'''<br />
 
'''Hidden items'''<br />
* SS - Your speed on foot is increased.* H - Bullets and grenades are restored to 99 and gas is restored to 199
+
* [[File:SS_ik1.png]] SS - Your speed on foot is increased.
* Knife - Touching an enemy inflicts damage corresponding to a bullet. Enemies that are immune to bullets will either be rendered harmless (for example the "big men") or will still kill you (helicopters and tanks). The knife also allows you to run through gates destroyable buildings.
+
* [[File:H_ik1.png]] H - Bullets and grenades are restored to 99 and gas is restored to 199.
* Heart - Allows you to keep all collected items if you die or clear the level. Without a heart, you'll start from scratch. Once used, you need to collect another heart.
+
* [[File:Knife_ik1.png]] Knife - Touching an enemy inflicts damage corresponding to a bullet. Enemies that are immune to bullets will either be rendered harmless (for example the "big men") or will still kill you (helicopters and tanks). The knife also allows you to run through gates and destroyable environment.
* Golden heart - Same as the heart, but gives you all upgrades and replenishes your inventory to the max.
+
* [[File:Heart_ik1.png]] Heart - Allows you to keep all collected items if you die or clear the area. Without a heart, you'll start from scratch. Once used, you need to collect another heart.
* Triple shot - Replaces L, S and F with a triple shot (similar to the helicopter gun). If you pick up L, S or F again, you'll lose the triple shot and go back to the normal gun with only the power-up you just collected. This power-up must be avoided at absolutely all cost.
+
* [[File:Golden_heart_ik1.png]] Golden heart - Same as the heart, but gives you all upgrades and replenishes your inventory to the max.
* Various other items (girl, clock, gold box etc) - Points (useless)
+
* [[File:Triple_shot_ik1.png]] Triple shot - Replaces L, S and F with a triple shot (similar to the helicopter gun). If you pick up L, S or F again, you'll lose the triple shot and go back to the normal gun with only the power-up you just collected. This power-up must be avoided at absolutely all cost.
These items are always in the same spot and can only be reveled with the gun or a tank shot.<br /><br />
+
* Various other items (girl, clock, gold box etc) - Points and extra life (girl). These items have no use in a speedrun.
 +
These items are always in the same spot and can only be revealed with the gun or a tank shot.<br /><br />
  
 
Collecting several upgrades of the same kind does nothing more than add points to the total.<br /><br />
 
Collecting several upgrades of the same kind does nothing more than add points to the total.<br /><br />
  
 
==Movement speed==
 
==Movement speed==
Diagonal movement in this game is done at a 45o angle on a flat surface. Slopes change this angle (more about this below). All levels go from bottom to top of the screen so it's important to keep the vertical movement speed up as much as possible. Below ratios are with respect to the foot speed with the SS power for the vertical speed (unless stated otherwise).<br />
+
The speeds below refer to the change in y-position per update cycle (every 4 frames). When moving in water or diagonally, the y-subpixel value will change every cycle. Otherwise it doesn't change. Depending on the type of movement, the subpixel either increases or decreases. If it increases, it will decrease the y-movement by 1 every time the y-subpixel loops. The opposite is true if it decreases. For simplicity, the speeds below approximate after how many cycles the y-subpixel loops and then lists a resulting speed that alternates. For the relevant addresses, see the memory address section on this page.<br />
Diagonal/Straight speed ~70% (on a flat surface, regardless of in the water, in a tank etc)<br />
+
Foot (SS) - 3y/4f<br />
Foot ~67%<br />
+
Foot (SS) diagonal - alternating 8x 2y/4f and 1x 3y/4f<br />
Tank ~83%<br />
+
Foot water (SS) - alternating 3x 2y/4f and 1x 3y/4f<br />
Heli 100%<br />
+
Foot water diagonal (SS) - alternating 3x 2y/4f and 2x 1y/4f (in average)<br />
Foot (SS) water ~74%<br />
+
Foot (SS) uphill - 2y/4f<br />
Foot (SS) uphill slope ~70%<br />
+
Foot - 1y/4f slower than with SS in all vertical scenarios. The y-speed during diagonal movement is however better preserved than with SS.<br />
Foot (SS) uphill diagonally ~55%<br />
+
Tank - alternating 1x 2y/4f and 1x 3y/4f<br />
Foot (SS) downhill (horizontal speed)^ ~121%<br />
+
Tank diagonal - alternating 3x 2y/4f and 1x 1y/4f<br />
Foot (SS) uphill (horizontal speed)^^ ~61%<br />
+
Heli - vertical speed same as foot (SS), while diagonal speed is slightly better in heli<br /><br />
Foot (SS) diagonally uphill (horizontal speed)^^^ ~45%<br />
+
Foot (SS) diagonally downhill (horizontal speed)^^^^ ~100%<br /><br />
+
  
^ It's not possible to move in a straight horizontal line on a sideways slope. You will lose 4 units of height for every 10 horizontal units.<br />
+
Some additional comments:
^^ The opposite of ^.<br />
+
* It's faster to save the diagonal movement for when the diagonal speed is higher. For example, it's better to wait until you get out of the water before starting to move diagonally.
^^^ You will gain 12 units of height for every 10 horizontal units.<br />
+
* The first cycle of diagonal movement changes the y-subpixel less than when continuously moving diagonally (constant change when in the helicopter). By alternating between vertical and diagonal movement, it's therefore possible to move sideways with less loss of vertical movement (the horizontal movement is also impacted, but the overall result is still that this is a more efficient type of movement). There is no downside in trying this, since you'll just revert to normal diagonal movement for the cycles you don't succeed. In real-time, you can expect to save roughly a frame per horizontal block (a bush etc) of diagonal movement.
^^^^ You will gain 6 units of height for every 10 horizontal units.<br /><br />
+
* In the water areas, it's slightly faster to walk uphill and then on flat ground instead of staying in the water the whole time. This is very marginal though, but still useful in areas 3 and 4.
 
+
* Again in the water areas, you can sometimes walk over corners of slopes. It's slightly faster to walk over the corner (uphill and then downhill) instead of staying in the water.
Some comments on how to use the above for speed considerations:
+
* As a rule of thumb, moving diagonally "one block" (so the width of a bush or an item token) at SS speed costs 8 frames of vertical movement.<br /><br />
* Helicopter and foot (with the SS power) speed are equal and the fastest modes of movement.
+
* Diagonal speed is "geometrically correct". Since the diagonal movement is done at 45o, the speed ratio of ~70% corresponds to the inverted square of two as it should be. This also means that diagonal movement should be done when traveling at the fastest movement speed. For example, it's better to wait until you get out of the water to start moving diagonally.
+
* In water areas, it's slightly faster to walk uphill and then downhill again instead of staying in the water the whole time. This is very marginal though and only useful in level 4 (could possibly be used in the water section of level 3 with a new route).<br /><br />
+
  
 
==Glitches==
 
==Glitches==
=Flying glitch=
+
===Flying glitch===
 
https://www.youtube.com/watch?v=kQF-OpUh99o<br />
 
https://www.youtube.com/watch?v=kQF-OpUh99o<br />
If you hold A, B and up at the same time while in the helicopter (they don't need to start to be pressed down simultaneously, you just need to hold them down at the same time), Paul/Vince will exit the helicopter and continue traveling vertically at helicopter speed as long as A and/or B is kept held down (the glitch doesn't work with the tank). In this state, you're invincible, can't interact with anything in the game (such as collecting items or the terrain) and can't use your weapons. If you let go of A and B, you will either be teleported back to the helicopter (if it's still on screen) or land in a glitched state. Your movement speed will be back to walking speed, but the movement doesn't correspond to the graphical terrain (you'll appear to walk in water while on land, there will be invisible walls etc). You'll still be in the invincible state, you're still unable to collect items or use your weapons. The only way to revert back to normal is to exit the level. This glitch has the potential to completely break the game, but is of limited use with the current knowledge due to some unlucky circumstances:
+
If you hold A, B and up at the same time while in the helicopter (they don't need to start to be pressed down simultaneously, you just need to hold them down at the same time), Paul/Vince will exit the helicopter and continue traveling vertically at helicopter speed as long as A and/or B is kept held down (the glitch doesn't work with the tank). In this state, you're invincible, can't interact with anything in the game (such as collecting items or the terrain) and can't use your weapons. If you let go of A and B, you will either be teleported back to the helicopter (if it's still on screen) or land in a glitched state. Your movement speed will be back to walking speed, but the movement doesn't correspond to the graphical terrain (you'll appear to walk in water while on land, there will be invisible walls etc). You'll still be in the invincible state, you're still unable to collect items or use your weapons. The only way to revert back to normal is to exit the area. This glitch has the potential to completely break the game, but is of limited use with the current knowledge due to some unlucky circumstances:
- In level 1 you still need to collect 3 items (SS, the knife and the heart) after the helicopter section. If you activate the flying glitch and fly through the whole level and exit, you will start level 2 without any power-ups. This saves 30-40 seconds (obviously depending a lot on what the alternative route was). As a strike of luck, the two most important power-ups, SS and B, are available very early in level 2, making it possible to start building up the character again and making this a nice time-saver after all.<br />
+
: - In area 1 you still need to collect 3 items (SS, the knife and the heart) after the helicopter section. If you activate the flying glitch and fly through the whole area and exit, you will start area 2 without any power-ups. This saves 30-40 seconds (obviously depending a lot on what the alternative route was). As a strike of luck, the two most important power-ups, SS and B, are available very early in area 2, making it possible to start building up the character again and making this a nice time-saver after all.<br />
- There is unfortunately no helicopter in level 2.<br />
+
: - There is unfortunately no helicopter in area 2.<br />
- Since you need to "fight" a boss at the end of level 3 and 4, activating the flying glitch here is essentially the same as soft-locking the game.<br />
+
: - Since you need to "fight" a boss at the end of areas 3 and 4, activating the flying glitch here is essentially the same as soft-locking the game.<br /><br />
  
=Visual glitches=
+
===Visual glitches===
The game often gets confused when trying to represent the sprites for the item drops if there are several possible drops on the screen available. For example, if you kill a pink guy when there is an item hidden nearby, the pink guy's drop will look like the hidden drop. However, if you pick it up, you will still only get the normal drop from the pink guy and not the hidden drop. You can even have item drops appear as parts of enemies in certain situations. Again, it's only a visual glitch.<br />
+
The game often gets confused when trying to represent the sprites for the item drops if there are several possible drops on the screen available. For example, if you kill a pink guy when there is an item hidden nearby, the pink guy's drop will look like the hidden drop. However, if you pick it up, you will still only get the normal drop from the pink guy and not the hidden drop. You can even have item drops appear as parts of enemies in certain situations. Again, it's only a visual glitch.<br /><br />
  
=Memory corruption (level 4)=
+
===Garbage sprites in area 4===
Even when playing normally, the game will create garbage sprites in the area where you find the helicopter in level 4. These sprites can be destroyed and the items they leave behind can be collected (including the much wanted fuel drop that allows you to cruise to the end of the level in the helicopter). It hasn't been properly attempted to understand how this works. However, the more you move around (especially backwards) will further increase memory corruption. With enough corruption, the whole rest of the level will be transformed into a graphical mess (but it's still playable until the end). When playing normally, this is very uncommon (and it's even hard to get to that point when trying for it).<br /><br />
+
Even when playing normally, the game will create garbage sprites in the area where you find the helicopter in area 4. These sprites can be destroyed and the items they leave behind can be collected (including the much wanted fuel drop that allows you to cruise to the end of the area in the helicopter). They are spawned just like other random enemy soldiers. A plausible, but unconfirmed, explanation is that the game was intended to spawn a different type of enemy (different memory values) in this section. Instead, the corresponding calculation was set up incorrectly and now produces the values for these sprites. Why the memory values correspond to these sprites has not been looked into.<br /><br />
 +
 
 +
==Cheats==
 +
===Area select cheat===
 +
When the game starts, Paul and Vince will walk into the screen from below. Press start (or just wait) and you will see the title screen with the selection of 1 or 2 players. During this screen, press Up, Down, A, A, B, Left, Right, A, B, Up, A, Down, Right, Right, Left, B, Up, Left, A, Right, B, Left, Right, A, Left, Up, A, Down, A, Right, Left, B, and finally press Start. This has to be done before the demo starts playing. Getting the code to work is a small feat in itself. If done correctly, after the cutscene with the crash landing, you will get a black screen with the text "Area 1" (instead of the few seconds of normal black screen before the game starts). By pressing A and B, you can select the area to start at (A increases, B decreases, but it loops so it doesn't matter). Needless to say, you'll start without any upgrades.<br /><br />
 +
 
 +
===Continue code===
 +
One of the most well known continue codes throughout the NES library, A B B A. Just press the button combination after having lost the last life and before the game reverts back to the title screen.<br />
 +
For unknown reasons, the code doesn't work when you've scrolled until the very end of a level.<br />
 +
Sometimes, the game continues to scroll the screen after a game over (unknown reasons), which also prevents you from continuing. This is quite uncommon though.<br /><br />
  
 
==Some comments about various aspects of the game mechanics==
 
==Some comments about various aspects of the game mechanics==
=Airstrike target plates=
+
===Airstrike target plates===
Not dangerous themselves, they will trigger an airstrike when you get close to them. Sometimes the airstrikes come so quickly that it's literally not possible to avoid it. Sometimes it will take a while. The angle of attack is also different from time to time. The best way to understand this is to think of a steady stream of (invisible) bombers passing by from left to right. Their position when the target plate is activated determines the angle of attack and the speed. Once they cycled through from left to right (roughly 1000 frames), their distance will also be different. It hasn't been investigated how long time before the distance from the target plate is cycled back. While this information provides some understanding for what at first seems to be a random game mechanics, there is no known way to manipulate the airstrikes to not be undodgeable. The only way to mitigate the risk is to try and minimize the critical places where you have to travel next to or through these target plates.
+
[[File:Target_plate_ik1.png]]<br />
=Arrow shooting rocks=
+
Not dangerous themselves, they will trigger an airstrike when you get close to them. The incoming angle and the vertical position from where it arrives differ from time to time. The best way to understand this is to think of a steady stream of (invisible) bombers passing by from left to right. Their position when the target plate is activated determines the angle of attack. Once they have passed by to the right, they will reappear from the left and so on (one cycle is roughly 1000 frames). Cycling through from left to right will also change their vertical position on the screen. Roughly speaking, the bomb planes appear to run on a sort of global timer that is set when the game starts. The result of testing seems to indicate that the global timer starts from the same value. This appears to be true for a given route, but it seems like player input can also have an impact.<br />
These shoot arrows horizontally through a small hole in the side. The interval between arrows is not understood, but arriving at different time windows (very roughly 100 frames) will result in different arrow patterns. There is lots of randomness with these enemies, but also some individual behavior that can be taken advantage of.
+
There are two important special cases to be aware of:
=Vehicles=
+
* The airstrike can come so quickly that it's impossible to avoid it.
- Entering a vehicle creates an immobility of around 1 second.<br />
+
* The airstrike comes from such a far off position that it won't reach the target plate before it has scrolled off screen. The airstrike will then lock on to a different position on screen, while keeping the horizontal value. This can be dealt with by moving to the side out of the way, but obviously at the cost of lost time.
- Leaving a vehicle creates an immobility of only a few frames (seems to vary a bit, but less than 10).<br />
+
Everything written in this section has been concluded from observations during gameplay, but the actual mechanics that determine the air strikes are unknown.
- If you approach a vehicle while holding down the A-button (the grenade button), you will enter the vehicle on the first possible frame.
+
 
=Sprite limit=
+
===Arrow-shooting rocks===
The game has a sprite limit that frequently comes into play. Enemies that are supposed to spawn in a certain area, but are prevented from doing so because of the sprite limit, will appear out of nowhere when one of the other sprites has disappeared off-screen. It hasn't been investigated in detail the exact rules for the sprite limit, but for the individual sections where it makes a difference, it's often easy enough to understand the triggers. The sprite limit (and the generally slow speed of the game - 15 fps!) means that lag is almost non-existant.
+
[[File:Arrow_shooting_rock_ik1.png]]<br />
=RNG=
+
These shoot arrows horizontally through a small hole in the side. The interval between arrows is not understood, but arriving at different time windows (very roughly 100 frames) will result in different arrow patterns. There is lots of randomness with these enemies, but also some individual behavior that can be taken advantage of.<br /><br />
The game appears to use a fairly simple rng-algorithm. Some enemy types appearances seem to be fixed (although they can sometimes be missing) and some appear to spawn more randomly (but still restricted to certain areas). One of the random enemy types, the blue soldiers equipped with normal guns, move about in what at first seems to be a random pattern. However, even if it hasn't been investigated exactly how it works, it's quite evident by observations that some enemy movements repeat themselves too often for it to be random. It would take a lot of dedication to map out all those possible enemy patterns in all areas of the game and then what to respond in each case. Still, it's worth keep this in mind if there is a particular section, where the enemy movements come into play.
+
 
 +
===Vehicles===
 +
: - Entering a vehicle creates an immobility of around 1 second.<br />
 +
: - Leaving a vehicle creates an immobility of only a few frames (seems to vary a bit, but less than 10).<br />
 +
: - If you approach a vehicle while holding down the A-button (the grenade button), you will enter the vehicle on the first possible frame.<br />
 +
: - Changing direction of the tank cannon costs a minimum of 4 frames (because of the game running at 15 fps), but in practice costs more like 8 frames.<br /><br />
 +
 
 +
===Sprite limit===
 +
The game has a sprite limit that frequently comes into play. Enemies that are supposed to spawn in a certain area, but are prevented from doing so because of the sprite limit, will appear out of nowhere when one of the other sprites has disappeared off-screen. This can readily be studied for a section by looking how the object address values are attributed (see memory address $0500 and onwards). The sprite limit (and the generally slow speed of the game - 15 fps!) means that lag is not an issue in the game.<br /><br />
 +
 
 +
==='Half-diagonal' shots===
 +
Other than the 8 standard directions (4 straight and 4 diagonal), the game allows you, when on foot, to shoot in the 8 directions in-between, here called 'half-diagonals'. Getting these additional directions allows for time savers in several areas. To get a 'half-diagonal' shot, you need to shoot (press B) and change movement direction between straight and diagonal between two consecutive frame updates in the game. Since the game runs at 15 fps, this is therefore a 1-4 frame trick (depending on which of the "in-between" frames you initiate the trick).<br /><br />
 +
 
 +
===Enemy AI===
 +
The game appears to use a fairly simple rng-algorithm. Some enemy types appearances seem to be fixed (although they can sometimes be missing) and some appear to spawn more randomly (but still restricted to certain areas). One of the random enemy types, the blue soldiers equipped with normal guns, move about in what at first seems to be a random pattern. However, even if it hasn't been investigated exactly how it works, it's quite evident by observations that some enemy movements repeat themselves too often for it to be random. It would take a lot of dedication to map out all those possible enemy patterns in all areas of the game and then what to respond in each case. Still, it's worth keeping this in mind if there is a particular section, where the enemy movements come into play. The following clip demonstrates this effect: https://www.youtube.com/watch?v=gIFoTTkVTRM<br /><br />
 +
 
 +
==Memory addresses==
 +
The below analysis of the memory addresses was made by TaoTao in http://tasvideos.org/forum/posting.php?mode=quote&p=450038.<br />
 +
<u>RAM</u><br />
 +
$3D    U8      $2000 mirror<br />
 +
$3E    U8      $2001 mirror<br />
 +
$3F    U8      $2005 x mirror<br />
 +
$40    U8      $2005 y mirror<br />
 +
$41    U8      tmp variable for input reading<br />
 +
$42    U8      tmp variable for input reading<br />
 +
$43    U8      P1 input        # ABSTUDLR<br />
 +
$44    U8      P1 input modified      # suppress continuous A<br />
 +
$45    U8      P2 input<br />
 +
$46    U8      P2 input modified<br />
 +
$6A    U8      current sprite buffer page      # 2..3<br />
 +
$E4    U8      P1 life<br />
 +
$E5    U8      P2 life<br /><br />
 +
 
 +
$0200-$02FF    Sprite[64]      sprite buffer 1<br />
 +
$0300-$03FF    Sprite[64]      sprite buffer 2<br /><br />
 +
 
 +
- In object list, index 0 means player1, index 1 means player2.<br />
 +
- Object position seems to be signed 24-bit (lower 8-bit is subpixel).<br />
 +
- Calculation of y-position is weird a bit (see $DD02).<br /><br />
 +
 
 +
$04FE-  U8[]    object type etc?        # 0:not-exist<br />
 +
$0576-  U8[]    object position x mid<br />
 +
$0594-  U8[]    object position y lo    # subpx<br />
 +
$05B0-  U8[]    object position y mid<br />
 +
$05CC-  U8[]    object position y hi<br />
 +
$05E8-  U8[]    object position x lo    # subpx<br />
 +
$0604-  U8[]    object position x hi<br />
 +
$063C-  U8[]    object direction        # 0..15<br />
 +
$0674-  U8[]    object drop-related value<br />
 +
$067F  U8      P1 ammo of gun<br />
 +
$0680  U8      P2 ammo of gun<br />
 +
$0681  U8      P1 ammo of grenade<br />
 +
$0682  U8      P2 ammo of grenade<br /><br />
 +
 
 +
<u>ROM</u><br />
 +
$C271  code    read inputs<br />
 +
$D97E  code    check if object list is full?<br />
 +
$DC9E  code    calculate object velocity?<br />
 +
$DD02  code    move object<br />
 +
$DDF9  code    multiplication (S24 * U8 -> S24)

Revision as of 10:18, 25 September 2017

Ikari_Warriors_(NES)

Items

Pink soldier drops

  • F ik1.png F - Your bullets will be able to pass through walls and multiple enemies. The bullets can now destroy buildings (but not tanks).
  • L ik1.png L - Longer bullet range.
  • S ik1.png S - Shots will travel faster (bullets and projectiles when in tank or helicopter). Grenades are not affected.
  • B ik1.png B - Grenades will finish with a huge blast upon impact.

These drops are always fixed. There are a few fake pink soldiers throughout the game that don't drop anything.

Green soldier drops

  • K ik1.png K - Smart bomb, kill all the enemies on screen

Green soldiers always drop K.

Tank drops

  • Gas can ik1.png Gas can - Bullets are restored to 99, +50 grenades, gas is restored to 99

Tanks can drop gas cans, a tank or nothing. The type of drop is determined by the RAM-address the tank is allocated to. If the tank gets the first object address, $500, it will drop a tank. If it's in the third object address, $502, it will drop a fuel. For more information about the address allocation of objects and some special cases of drop manipulation, see fuel drop manipulation.

Destroyable environment (gates, parked trucks, ...) drops

  • Gas can ik1.png Gas can - (explained above)
  • Gun ik1.png Gun - Bullets are restored to 99.
  • Grenades ik1.png Grenades - +50 grenades

The drops from the destroyable environment are always predictable (with the exception of the garbage sprites around the helicopter in area 4).

Hidden items

  • SS ik1.png SS - Your speed on foot is increased.
  • H ik1.png H - Bullets and grenades are restored to 99 and gas is restored to 199.
  • Knife ik1.png Knife - Touching an enemy inflicts damage corresponding to a bullet. Enemies that are immune to bullets will either be rendered harmless (for example the "big men") or will still kill you (helicopters and tanks). The knife also allows you to run through gates and destroyable environment.
  • Heart ik1.png Heart - Allows you to keep all collected items if you die or clear the area. Without a heart, you'll start from scratch. Once used, you need to collect another heart.
  • Golden heart ik1.png Golden heart - Same as the heart, but gives you all upgrades and replenishes your inventory to the max.
  • Triple shot ik1.png Triple shot - Replaces L, S and F with a triple shot (similar to the helicopter gun). If you pick up L, S or F again, you'll lose the triple shot and go back to the normal gun with only the power-up you just collected. This power-up must be avoided at absolutely all cost.
  • Various other items (girl, clock, gold box etc) - Points and extra life (girl). These items have no use in a speedrun.

These items are always in the same spot and can only be revealed with the gun or a tank shot.

Collecting several upgrades of the same kind does nothing more than add points to the total.

Movement speed

The speeds below refer to the change in y-position per update cycle (every 4 frames). When moving in water or diagonally, the y-subpixel value will change every cycle. Otherwise it doesn't change. Depending on the type of movement, the subpixel either increases or decreases. If it increases, it will decrease the y-movement by 1 every time the y-subpixel loops. The opposite is true if it decreases. For simplicity, the speeds below approximate after how many cycles the y-subpixel loops and then lists a resulting speed that alternates. For the relevant addresses, see the memory address section on this page.
Foot (SS) - 3y/4f
Foot (SS) diagonal - alternating 8x 2y/4f and 1x 3y/4f
Foot water (SS) - alternating 3x 2y/4f and 1x 3y/4f
Foot water diagonal (SS) - alternating 3x 2y/4f and 2x 1y/4f (in average)
Foot (SS) uphill - 2y/4f
Foot - 1y/4f slower than with SS in all vertical scenarios. The y-speed during diagonal movement is however better preserved than with SS.
Tank - alternating 1x 2y/4f and 1x 3y/4f
Tank diagonal - alternating 3x 2y/4f and 1x 1y/4f
Heli - vertical speed same as foot (SS), while diagonal speed is slightly better in heli

Some additional comments:

  • It's faster to save the diagonal movement for when the diagonal speed is higher. For example, it's better to wait until you get out of the water before starting to move diagonally.
  • The first cycle of diagonal movement changes the y-subpixel less than when continuously moving diagonally (constant change when in the helicopter). By alternating between vertical and diagonal movement, it's therefore possible to move sideways with less loss of vertical movement (the horizontal movement is also impacted, but the overall result is still that this is a more efficient type of movement). There is no downside in trying this, since you'll just revert to normal diagonal movement for the cycles you don't succeed. In real-time, you can expect to save roughly a frame per horizontal block (a bush etc) of diagonal movement.
  • In the water areas, it's slightly faster to walk uphill and then on flat ground instead of staying in the water the whole time. This is very marginal though, but still useful in areas 3 and 4.
  • Again in the water areas, you can sometimes walk over corners of slopes. It's slightly faster to walk over the corner (uphill and then downhill) instead of staying in the water.
  • As a rule of thumb, moving diagonally "one block" (so the width of a bush or an item token) at SS speed costs 8 frames of vertical movement.

Glitches

Flying glitch

https://www.youtube.com/watch?v=kQF-OpUh99o
If you hold A, B and up at the same time while in the helicopter (they don't need to start to be pressed down simultaneously, you just need to hold them down at the same time), Paul/Vince will exit the helicopter and continue traveling vertically at helicopter speed as long as A and/or B is kept held down (the glitch doesn't work with the tank). In this state, you're invincible, can't interact with anything in the game (such as collecting items or the terrain) and can't use your weapons. If you let go of A and B, you will either be teleported back to the helicopter (if it's still on screen) or land in a glitched state. Your movement speed will be back to walking speed, but the movement doesn't correspond to the graphical terrain (you'll appear to walk in water while on land, there will be invisible walls etc). You'll still be in the invincible state, you're still unable to collect items or use your weapons. The only way to revert back to normal is to exit the area. This glitch has the potential to completely break the game, but is of limited use with the current knowledge due to some unlucky circumstances:

- In area 1 you still need to collect 3 items (SS, the knife and the heart) after the helicopter section. If you activate the flying glitch and fly through the whole area and exit, you will start area 2 without any power-ups. This saves 30-40 seconds (obviously depending a lot on what the alternative route was). As a strike of luck, the two most important power-ups, SS and B, are available very early in area 2, making it possible to start building up the character again and making this a nice time-saver after all.
- There is unfortunately no helicopter in area 2.
- Since you need to "fight" a boss at the end of areas 3 and 4, activating the flying glitch here is essentially the same as soft-locking the game.

Visual glitches

The game often gets confused when trying to represent the sprites for the item drops if there are several possible drops on the screen available. For example, if you kill a pink guy when there is an item hidden nearby, the pink guy's drop will look like the hidden drop. However, if you pick it up, you will still only get the normal drop from the pink guy and not the hidden drop. You can even have item drops appear as parts of enemies in certain situations. Again, it's only a visual glitch.

Garbage sprites in area 4

Even when playing normally, the game will create garbage sprites in the area where you find the helicopter in area 4. These sprites can be destroyed and the items they leave behind can be collected (including the much wanted fuel drop that allows you to cruise to the end of the area in the helicopter). They are spawned just like other random enemy soldiers. A plausible, but unconfirmed, explanation is that the game was intended to spawn a different type of enemy (different memory values) in this section. Instead, the corresponding calculation was set up incorrectly and now produces the values for these sprites. Why the memory values correspond to these sprites has not been looked into.

Cheats

Area select cheat

When the game starts, Paul and Vince will walk into the screen from below. Press start (or just wait) and you will see the title screen with the selection of 1 or 2 players. During this screen, press Up, Down, A, A, B, Left, Right, A, B, Up, A, Down, Right, Right, Left, B, Up, Left, A, Right, B, Left, Right, A, Left, Up, A, Down, A, Right, Left, B, and finally press Start. This has to be done before the demo starts playing. Getting the code to work is a small feat in itself. If done correctly, after the cutscene with the crash landing, you will get a black screen with the text "Area 1" (instead of the few seconds of normal black screen before the game starts). By pressing A and B, you can select the area to start at (A increases, B decreases, but it loops so it doesn't matter). Needless to say, you'll start without any upgrades.

Continue code

One of the most well known continue codes throughout the NES library, A B B A. Just press the button combination after having lost the last life and before the game reverts back to the title screen.
For unknown reasons, the code doesn't work when you've scrolled until the very end of a level.
Sometimes, the game continues to scroll the screen after a game over (unknown reasons), which also prevents you from continuing. This is quite uncommon though.

Some comments about various aspects of the game mechanics

Airstrike target plates

Target plate ik1.png
Not dangerous themselves, they will trigger an airstrike when you get close to them. The incoming angle and the vertical position from where it arrives differ from time to time. The best way to understand this is to think of a steady stream of (invisible) bombers passing by from left to right. Their position when the target plate is activated determines the angle of attack. Once they have passed by to the right, they will reappear from the left and so on (one cycle is roughly 1000 frames). Cycling through from left to right will also change their vertical position on the screen. Roughly speaking, the bomb planes appear to run on a sort of global timer that is set when the game starts. The result of testing seems to indicate that the global timer starts from the same value. This appears to be true for a given route, but it seems like player input can also have an impact.
There are two important special cases to be aware of:

  • The airstrike can come so quickly that it's impossible to avoid it.
  • The airstrike comes from such a far off position that it won't reach the target plate before it has scrolled off screen. The airstrike will then lock on to a different position on screen, while keeping the horizontal value. This can be dealt with by moving to the side out of the way, but obviously at the cost of lost time.

Everything written in this section has been concluded from observations during gameplay, but the actual mechanics that determine the air strikes are unknown.

Arrow-shooting rocks

Arrow shooting rock ik1.png
These shoot arrows horizontally through a small hole in the side. The interval between arrows is not understood, but arriving at different time windows (very roughly 100 frames) will result in different arrow patterns. There is lots of randomness with these enemies, but also some individual behavior that can be taken advantage of.

Vehicles

- Entering a vehicle creates an immobility of around 1 second.
- Leaving a vehicle creates an immobility of only a few frames (seems to vary a bit, but less than 10).
- If you approach a vehicle while holding down the A-button (the grenade button), you will enter the vehicle on the first possible frame.
- Changing direction of the tank cannon costs a minimum of 4 frames (because of the game running at 15 fps), but in practice costs more like 8 frames.

Sprite limit

The game has a sprite limit that frequently comes into play. Enemies that are supposed to spawn in a certain area, but are prevented from doing so because of the sprite limit, will appear out of nowhere when one of the other sprites has disappeared off-screen. This can readily be studied for a section by looking how the object address values are attributed (see memory address $0500 and onwards). The sprite limit (and the generally slow speed of the game - 15 fps!) means that lag is not an issue in the game.

'Half-diagonal' shots

Other than the 8 standard directions (4 straight and 4 diagonal), the game allows you, when on foot, to shoot in the 8 directions in-between, here called 'half-diagonals'. Getting these additional directions allows for time savers in several areas. To get a 'half-diagonal' shot, you need to shoot (press B) and change movement direction between straight and diagonal between two consecutive frame updates in the game. Since the game runs at 15 fps, this is therefore a 1-4 frame trick (depending on which of the "in-between" frames you initiate the trick).

Enemy AI

The game appears to use a fairly simple rng-algorithm. Some enemy types appearances seem to be fixed (although they can sometimes be missing) and some appear to spawn more randomly (but still restricted to certain areas). One of the random enemy types, the blue soldiers equipped with normal guns, move about in what at first seems to be a random pattern. However, even if it hasn't been investigated exactly how it works, it's quite evident by observations that some enemy movements repeat themselves too often for it to be random. It would take a lot of dedication to map out all those possible enemy patterns in all areas of the game and then what to respond in each case. Still, it's worth keeping this in mind if there is a particular section, where the enemy movements come into play. The following clip demonstrates this effect: https://www.youtube.com/watch?v=gIFoTTkVTRM

Memory addresses

The below analysis of the memory addresses was made by TaoTao in http://tasvideos.org/forum/posting.php?mode=quote&p=450038.
RAM
$3D U8 $2000 mirror
$3E U8 $2001 mirror
$3F U8 $2005 x mirror
$40 U8 $2005 y mirror
$41 U8 tmp variable for input reading
$42 U8 tmp variable for input reading
$43 U8 P1 input # ABSTUDLR
$44 U8 P1 input modified # suppress continuous A
$45 U8 P2 input
$46 U8 P2 input modified
$6A U8 current sprite buffer page # 2..3
$E4 U8 P1 life
$E5 U8 P2 life

$0200-$02FF Sprite[64] sprite buffer 1
$0300-$03FF Sprite[64] sprite buffer 2

- In object list, index 0 means player1, index 1 means player2.
- Object position seems to be signed 24-bit (lower 8-bit is subpixel).
- Calculation of y-position is weird a bit (see $DD02).

$04FE- U8[] object type etc? # 0:not-exist
$0576- U8[] object position x mid
$0594- U8[] object position y lo # subpx
$05B0- U8[] object position y mid
$05CC- U8[] object position y hi
$05E8- U8[] object position x lo # subpx
$0604- U8[] object position x hi
$063C- U8[] object direction # 0..15
$0674- U8[] object drop-related value
$067F U8 P1 ammo of gun
$0680 U8 P2 ammo of gun
$0681 U8 P1 ammo of grenade
$0682 U8 P2 ammo of grenade

ROM
$C271 code read inputs
$D97E code check if object list is full?
$DC9E code calculate object velocity?
$DD02 code move object
$DDF9 code multiplication (S24 * U8 -> S24)

Personal tools