Double Helix Help File

Version 1.2

Written by uNsane and Lin

Make sure you have the latest version of Double Helix.


Basic


- The Basics -
Most people with any experience using Double Helix or ZeroFission at all should be fine skipping this part.

Double Helix uses, essentially, four layers of tiles. Three of these layers, the Background, Level Layer, and Foreground, are entirely graphical; they comprise what you see in-game, as well as in the Map window. The Background is drawn behind Samus and other sprites (enemies and other graphics samples that move a lot), whereas the Level Layer is in front of sprites and Foreground is in front of Level Layer. Foreground isn't necessarily available in every room, and should pretty much only be used for certain things, explained soon.

Clipdata is the fourth tile layer. Clipdata is invisible, but it's what the player interacts with; you might say it shapes the world. The most commonly used Clipdatas are 00 - Air and 10 - Block. Air is, obviously, air; empty tiles through which anything can move freely and normally. Blocks are just the opposite; nothing can move freely through them (except certain enemies). Samus can walk across the top of them, but she cannot walk through them. They are what you can walljump off of and grab with the Power Grip.

Clipdata isn't just limited to blocks and air, however; it also contains things like slopes, bomb blocks, energy tanks, and other similar and assorted things. Clipdata is what makes the Foreground layer especially useful; there are special Clipdatas to control its brightness and transparency, making hidden passages very easy to construct.


- The Interface -
DH's interface is relatively simple. The Map window shows what you see in-game, while the Tileset window allows you to select tiles to draw in a graphical layer. The main window, however, is where much of your time will be spent. The Area and Room dropdowns allow you to select which room you are editing. Tile information shows you the clipdata of the block under your cursor. View toggles which graphical layers are visible in the Map window; this does not affect anything in-game. Control, obviously, affects which layer you draw in, and Controls for Map Copy allow you to choose which layers are copied to the clipboard. Map Coordinates is your cursor's X and Y position in hexadecimal tiles. Window options are just what they suggest; unchecking Show Map or Show Tileset will close the respective windows until you re-check them, and View Clipdata highlights all tiles that use the Clipdata you have selected. Sprite set affects which sprite set you are viewing (these are changed during the game through certain events and through playing on hard difficulty). Edit Scrolls, Edit Doors, and Edit Sprites affect whether or not you can drag around, view (in the case of scrolls), and otherwise edit the respective things. The Clipdata dropdown is where you select what clipdata you place on the map when you draw Clipdata. The Edit Scenery button allows you to edit the very back layer in-game (known as BG3). Edit Level Palette lets you change the palettes used by the graphical layers for the room's tileset.


- The Clipboard -
DH has 16 clipboards available for use at once. These can be accessed from Tools in the main window's menu. Using the clipboards is quite simple; simply edit the tiles as you would the Map, then once you're ready to insert the tiles into the clipboard in, hold Ctrl and click. It might not seem too terribly useful at first, but it removes a great deal of tedium from editing.


- Right-Click -
DH has a special function to make drawing much faster. Right-clicking and dragging on the Map or Tileset will greatly increase the number of tiles you can simultaneously fill or select. This, once again, will remove a lot of tedium, since you can click-drag over multiple tiles to draw in them.
NOTE: This function is currently extremely buggy; refrain from using it until interdpth gets off his lazy ass. PWND!

Right clicking is also used for other things, such as: Editing doors, sprites, and scrolling. When you first add a sprite (Explained later), it is normally added in the top left corner. You can right click that sprite with "Edit Sprites" checked, and you'll be presented with a dialog, where you can choose the sprite. This works the same for doors, except the dialog is different. To edit scrolls, you can click and drag anywhere within the scroll to place the top-left corner on the tile your mouse is located at, or you can right-click and drag to change the scroll's dimensions. Make sure you leave Edit Scrolls unchecked until you're ready to edit them.


- Minimap -
The minimap editor can be accessed from the Tools menu. It is very similar to the Map editor, but there are a few key differences. The palette affects the visibility of the tile at different times; gray (palette 0) is visible at any time, blue (palette 1) and orange (palette 2) are visible when you enter the minimap square in-game or access a map station, and green (palette 3) is visible only when you enter the square. Higher palettes aren't intended to be used in-game, so it's quite possible that attempting to do so could cause errors.



Beginner


- Doors 1 -
Editing doors is a necessary aspect of most kinds of hacks. It can be quite easy, too; all you need to do is right-click on a door icon to bring up a list of options for the door. The Room Door is the number of the door in that room (only useful in any way if you want to debug in the RAM), while the Actual Door is the value of the door in the area. To connect two doors in one area together, simply find the Actual Door value of one of the doors you want to connect, then put that value into the "Connects too door" field on the other. DH will automatically hook them up together once you save. Exit Length is the distance from the door at which it puts you when you come through, in signed hexadecimal. Generally, for horizontal doors, you'll want 20 (for ones facing right) or E0 (ones facing left), or for vertical doors, 10 for doors facing down or F0 for doors facing up. Door Width and Height are just the dimensions of the door zone. To move a door, make sure Edit Doors is checked, then just click in the door field and drag.

Door Type gets its own paragraph because it is especially interesting. There are only 5 valid values for it: 12, 14, 51, 52, and 54. 12 means that the transition... transitions without any sounds, 14 means there will be a "door closing" sound, 51 will use an elevator sound, 52 has a room popup with no sound, and 54 has a room popup with a door closing sound.

- Sprites 1 -
Changing sprites is a simple task. Simply right-click on the sprite image to bring up a dialog containing the sprite, where you can choose it. When you first add a sprite, it will be added to the top left of the map. It won't be visible, but you have to pretend it is. But before you choose your sprite, you have to choose the sprite group. This can be done in the "Header Editor", under the "Sprites" group box ... Here you can also change the number of sprites the current room has. If for some reason when you add your sprite, it doesn't take get added at the top left, just add another.
STAY AWAY FROM THE STUFF AT THE TOP OF THE HEADER EDITOR UNTIL YOU READ THE SECTION ON IT LATER.

- Room Options and Text Editor -
In Room Tools-Room Options, you can clear out entire layers with a single click. The Height and Width fields are the dimensions of the current layer, in tiles. Click Save after changing these dimensions.

Combined to make these sections not seem ridiculously small and worthless, because they're not, the Text Editor is accessible from General Tools. In the Text Editor, you can select, view, edit, and preview the strings in the game, both English and Japanese. Make sure, however, that you don't make your new string any longer than the original, as you'll overwrite new strings. Operators wrapped in brackets, such as [NEWLINE], [RAW 0x4E0F], and similar things count as only one character. [NEWLINE] and [END] are fairly self-explanatory as to their function; [NEWLINE] creates a new line in the text. In strings like the opening text, this moves the text down a line, while in things like item pickup text, it creates a point where the player must press A to continue.

- Stat Editor -
The Stat Editor is a powerful tool for editing enemy statistics. In Zero Mission, it allows you to change enemies' health, damage, resistances (what damages it), and drop percentages. In the resistances, a checked box indicates that the enemy is vulnerable to that weapon type. All values in here are in decimal (what is used by normal people every day), so you can just type in the values you want straight away. Drop Percentages do not need to add up to any particular number. Please note that scrolling too far down the list of enemies will crash DH.

- TSA Editor -
The TSA Editor allows you to edit the construction of graphical tiles in the game. To use it, open up the editor in the General Tools menu, then click on a tile in the Tileset window. This tile is the one that you will save over. Once you have the image of a tile in the TSA Editor, you can replace the four parts of the tile with 8x8s from the left of the editor. You can flip the tiles and change their palette using the controls at the right. Once you're satisfied, hit Save Block to put your changes into the tileset.

- Importing BG3 Images -
Using the Edit Scenery button, you can import custom images into the BG3 (the background of the room). First, you need to get yourself an image, which must be exactly 256x256, 256x512, or 512x256 pixels. Next, make sure you have ZMBGi.ips and FreeImage.dll in your Double Helix directory. With the room you want your picture in open, click Edit Scenery, then click on the Edit Background button. Click Import Background Picture, then select the image size on the right with the correct radio button. Choose your file, click OK, then click Save to ROM if the file works correctly.

- Level Palettes -
To use the level palette editor, simply click the obvious button in the main window. Doing so will bring up a window with a series of swatches and scrollers. Each row of swatches is a palette, and each swatch is a color in the palette. An 8x8 tile (four of which make up the standard graphical tiles you can use for the Level Layer and such) references a palette, and a pixel in the 8x8 references a color in the 8x8's palette. Click on a swatch to select it. Two sets of numbers then appear by the scrollers. RGB is the 24-bit color component, used in most computers for things like .jpg pictures, and GBA is the 15-bit color value the game will actually use. Once you've changed some colors, click Apply New Colors to see the changes in the Map and Tileset windows. If you like what you see there, click Save Colors.



Intermediate


You may need a hex editor for things in this section. XVI-32 is a good freeware editor, but Hex Workshop is the best there is, according to many sources. Unfortunately, HW isn't free, so you'll have to buy it.

- Doors 2 -
Area connections are a lie.

- Sprites 2 -
Spritesets are groups of sprites that can be used in the current room. They contain the enemy, its graphics, its palette info, everything you need.

Editing spritesets is usually pretty easy to do, but at times, it can get a bit out of hand. To start, open the Header Editor and find the current sprite set number, then open the Spriteset Editor in Tools. Select your current set from the list at the left to get a graphical preview of the sprites within the set. The sprite's slot in the set only really matters for sprites taller than 16 px, in which case you'll need to make sure you leave space after it. Once you pick your sprites for the set, just save the set and go.

As an example in Metroid Zero Mission, let's try replacing the Zoomers in the first room with Metroids. Open the spriteset editor and go to set 1, then change the Zoomers to Metroids by replacing the 12 for the first sprite with 64 (these numbers are the global enemy IDs). Set the sprite, save the set, then open up the ROM in VBA (or your emulator of choice) and test it. The Metroids are all a bunch of glitchy messes! They function just like normal, but their graphics are all wrong. Why? The answer is simple: there isn't enough room in the set for them. To fix this, we need to open up the ROM in your hex editor. Where do we need to go? We'll use the formula SetNumber x 4 + 0x75F31C, where SetNumber is the number of the Spriteset in the list at the left of the editor, to find out. We need to go to the address we get, in this case 0x75F320. We should be seeing the values 56 21 2B 08 here. This is a pointer to the actual sprite set values. To use it, we first have to convert it to 32-bit, which is essentially done by flipping the numbers around, to get 082B2156. The 08 is only used for the GBA to recognize its location in the memory, so we can forget it. We are left with 2B2156, which is the address in the actual .gba file the game reads from to determine what enemies are in the spriteset. We should see something along the lines of 64 00 21 02 50 03 here. The first byte in each pair is the global enemy ID (once again) and the second number is the slot in the set. If we change the 21 02 to 00 00, then we basically tell the game to stop reading enemies for the set, which has two effects in this case: one, the only enemies in the set will be Metroids, which causes two, the Metroids will be entirely glitch-free, whether graphical or otherwise.


Advanced


- Header Editor -
The Header Editor is one of the most dangerous things to use in DH; always, always back up before even opening it. It contains controls for the locations of the layers in the game and how they're compressed, the spriteset and number of sprites used in the room, information on different room states, minimap location of the room, the tileset and music, and the BG3 effect. The Header Editor is very versatile and powerful, but it is also very easy to crash your ROM with it by changing the wrong field to the wrong address. As a general rule, you should only use it if you absolutely need to.

The only times you should really need to use this are when you want to change the tileset or music, or if the room gets filled with garbage. In the cases of the former, there shouldn't be much problem any time, but for the latter, you have to be very careful.

- Editing Graphics -
To edit graphics, you will need specialized programs, depending upon the type of graphics you want to change. For uncompressed graphics, such as Samus, beams, and some tilesets, you'll need Tile Layer Pro. For most other graphics, you'll want the program NLZ-GBA Advance. Both programs can be found on www.romhacking.net for free. To use TLP, you need to find the graphics by hand and edit the individual pixels. NLZ-GBA Advance searches for compressed graphics and allows you to export the graphics for editing in another program, then allows you to re-import them, warning you if the new graphics are larger.

- DH Hex Help -
The creator of Double Helix, interpdth, compiled a help file for DH for use with a hex editor. It contains various file addresses for both MZM and MF, written by uNsane and PJBoy, as well as information on editing spritesets and door connections. It should only really be used in combination with a debugger, or at the very least, a THUMB reference sheet, since the values will be straight code in most cases, not necessarily defined values. For example, in the MZM section, it says that Ice Beam projectile speed can be found at 050D64. The value at this address is 211A, which is a command that moves the hexadecimal value 0x1A to the processor's register 1.



Errors, Bugs, Et Cetera


- My Game Froze! -
Sometimes, you will start up your ROM and it will just be a blank screen (For Visual Boy Advance users). Now, the fix for this is VERY simple. The first 8 or so bytes got messed up, so take your latest backup (Or a clean ROM if you have none) and the broken ROM and open them in a hex editor. If the first 8- bytes aren't the same as the working ROM's, match them. After they're the same, it should work.

- My Room is Filled with Garbage! -
To fix this bug, you should open your latest working backup or a pure ROM, go to the Header Editor, and change the layer addresses and compressions in your hack to a working one. Unfortunately, this will erase any work you've done on the room since you last saved where you're pulling the addresses from, as well as having a fair chance of not working. Another safer but more costly method is to link doors around the room, then change the minimap positions of rooms to account for it. This method virtually eliminates any possibility of more damage to the ROM, and it works in more cases, but cutting out an entire room can be damaging to your hack.


Additional Help


If you have a problem that isn't answered in this file or DH Hex Help, join #jzd on the server irc.esper.net with an IRC client. You can also go to forum.metroid2002.com and head towards the Double Helix thread in the Hacks and Fangames forum after registering.



Credits:
interdpth - making Double Helix, Zero Fission, and various other helpful informations.
PJBoy - introducing me to the wonderful world of ROM hacking, as well as helping me with so much stuff I can't even remember it all.
Lin - helping to write this file.
uNsane (me) - writing almost all of this 5-page document.
Nintendo - for creating the Metroid Series.
Everyone on #jzd and m2k2

All rights to Metroid, Metroid Fusion, and Metroid Zero Mission are owned by Nintendo.