Difference between revisions of "Ikari Warriors (NES)/Fuel drop manipulation"

From SDA Knowledge Base

Jump to: navigation, search
(Some background about object allocation in the RAM)
Line 62: Line 62:
  
 
==Area 3 fuel drop==
 
==Area 3 fuel drop==
This section will explain how to increase the chances of getting a fuel drop from the first tank in the helicopter section. The tank drops in this game are determined by the RAM-address the tank object is allocated to.
+
This section will explain how to increase the chances of getting a fuel drop from the first tank in the helicopter section.<br /><br />
  
 +
The tank drops in this game are determined by the index the tank is allocated to. If the tank is in index 0 (= $500), it will drop a tank and if it's in index 2 (= $502), it will drop a fuel. All other index will result in no drop. The goal of this manipulation is therefore to maximize the chances of the tank spawning in index 2. This can be broken down in two parts. One part leading up to fuel drop itself and one part ensuring the helicopter itself isn't blocking the relevant certain index. It's easiest to understand the route by starting with the fuel drop itself and then retracing the steps as far backwards as possible to try and fulfill the drop conditions.<br /><br />
 +
 +
===Part 2 - getting the tank in index 2===
 +
[[File:Ikari Warriors (U)-3 fuel manip.JPG]]<br /><br />
 +
 +
With reference to the numbering in the screenshot above, we can see that the tank will be allocated to index 2 if, and only if, index 0 and 1 are unoccupied when #1 and #2 appear on screen. This is only true if #3-#5 get index >2 and the objects occupying index 0-2 at that point disappear before the mines appear. There are 4 enemies (the three in #6 + one underwater enemy not shown in the screenshot) and #7 that are always present and can help achieve this condition. If index 0-2 are occupied among these 5 objects and they despawn between the gates and the mines, the tank will get index 2. #7 will disappear after #3-#5 have spawned, but before #1 and #2, so that's never an issue. Fortunately, the four enemies can also be taken out so they despawn according to this condition.<br /><br />
 +
 +
[[File:Ikari Warriors (U)-3 fuel manip.zip]]<br />
 +
The fm2-movie in the file above shows a successful fuel drop. The lua script and the wch-file both contain the object addresses to make it easier to follow the address allocations. Other than illustrating the description above, it's also worth mentioning the role of #8. If the knife gets an index in the range 0 to 2 (which is not feasible to know in real-time) and is not collected, the leftmost gate (#3) will inherit its index, which means the fuel drop will not be possible. If it's collected, one of the enemy soldiers will inherit its index. #8 should therefore always be collected, no matter what.<br /><br />
 +
 +
===Part 1 - index of the helicopter===
  
 
==Area 4 fuel drop==
 
==Area 4 fuel drop==

Revision as of 14:55, 26 March 2017

Ikari_Warriors_(NES)
This page goes more in depth on how to manipulate fuel drops for the helicopters in areas 3 and 4. The RAM-addresses used here are listed in the memory address section.

Some background about object allocation in the RAM

All objects that aren't part of the background are allocated to RAM-address $500 and onwards (player 1 is always in $4FE and player 2 is always in $4FF, but they can be disregarded here since they don't interfere with the foreign objects). This includes enemies, destroyable structures, hidden items, mines etc and even bullets). These addresses are referred to as "object addresses". The object address with index 0 corresponds to $500, index 1 corresponds to $501 etc. A new object entering the screen will be allocated to the lowest available index and when an object leaves the screen (regardless of how), the corresponding index will be restored to null. Dropped objects will retain the address of the initial object though. Bullets are also an exception as they will be allocated to an index further down (without interest for the topics of this page).

Different objects provide different values to the object addresses. Some objects share the same value, so there must be additional addresses that determine the exact type of object. However, these values aren't overly important to know, but are helpful when analyzing emulator movie files. Below are some common values (but the list is nowhere near complete):

Object address value Description
(128) Player moving forward
(120) Player in tank/heli
(64) Rail turret, drops, mine
(63) Exploding rail turret
(62) Soldier, heli, blinking object
(61) Dying soldier, exploding barrel
(58) Returning soldier, missile target plate
(54) Guardian soldier
(53) Dying soldier (alternating with 75)
(50) Missile target plate with incoming airstrike
(45) Dying kamikaze (alternating with 83)
2 Helicopter/tank in use
64 Unrevealed mine
66 Object not on screen (includes unrevealed hidden items and destroyable structures with drops)
75 Dying soldier (alternating with -53)
83 Dying kamikaze (alternating with -53)

The type of drop is determined by the value of the object's "drop address". The drop addresses start with $0676. When the object leaves the screen, the drop address isn't reset to null, like the object address. When an object is allocated to an object address, its "drop address" can be overwritten with the object's corresponding drop value. This drop value is overwritten for most objects (including many objects that don't drop anything), but for example blue soldiers don't overwrite the drop values. The only drop value of interest is 20, which means fuel will be dropped.

Area 3 fuel drop

This section will explain how to increase the chances of getting a fuel drop from the first tank in the helicopter section.

The tank drops in this game are determined by the index the tank is allocated to. If the tank is in index 0 (= $500), it will drop a tank and if it's in index 2 (= $502), it will drop a fuel. All other index will result in no drop. The goal of this manipulation is therefore to maximize the chances of the tank spawning in index 2. This can be broken down in two parts. One part leading up to fuel drop itself and one part ensuring the helicopter itself isn't blocking the relevant certain index. It's easiest to understand the route by starting with the fuel drop itself and then retracing the steps as far backwards as possible to try and fulfill the drop conditions.

Part 2 - getting the tank in index 2

Ikari Warriors (U)-3 fuel manip.JPG

With reference to the numbering in the screenshot above, we can see that the tank will be allocated to index 2 if, and only if, index 0 and 1 are unoccupied when #1 and #2 appear on screen. This is only true if #3-#5 get index >2 and the objects occupying index 0-2 at that point disappear before the mines appear. There are 4 enemies (the three in #6 + one underwater enemy not shown in the screenshot) and #7 that are always present and can help achieve this condition. If index 0-2 are occupied among these 5 objects and they despawn between the gates and the mines, the tank will get index 2. #7 will disappear after #3-#5 have spawned, but before #1 and #2, so that's never an issue. Fortunately, the four enemies can also be taken out so they despawn according to this condition.

File:Ikari Warriors (U)-3 fuel manip.zip
The fm2-movie in the file above shows a successful fuel drop. The lua script and the wch-file both contain the object addresses to make it easier to follow the address allocations. Other than illustrating the description above, it's also worth mentioning the role of #8. If the knife gets an index in the range 0 to 2 (which is not feasible to know in real-time) and is not collected, the leftmost gate (#3) will inherit its index, which means the fuel drop will not be possible. If it's collected, one of the enemy soldiers will inherit its index. #8 should therefore always be collected, no matter what.

Part 1 - index of the helicopter

Area 4 fuel drop

Personal tools