Enemy cloning is exactly as the name implies. Taking an enemy and making an exact copy of its DNA to free space in the ROM, which creates a new one. 32 or so new enemies can be added this way - more if you overwrite unused enemies and ones you know you'll never ever use in your hack otherwise – tons more if someone was badass enough to make enemy data load from any bank(s). Cloning is totally worth it, though. You can give 'em colors and new graphics, HP/damage and so on, which will be covered here along with some simple examples. Anyone who's used a hex editor before, can convert LoROM/PC values and knows their way around SMILE/TLP will breeze through this. Zero experiencers should hold off and learn the basics first, otherwise have extra patience when following this write-up. It shouldn't matter if our program versions are different. We're only using the most basic functions.
Tools you'll need:
What you'll be doing by following this guide:
You will first need to decide which enemy you would like to clone. Outside of bosses (which COULD be cloned by someone more experienced), just about any enemy is fair game. Cloning an enemy lets you give them their own colors and weapon vulnerabilities, which the original game has done itself with HACHI/ki fighters and space pirates. It's possible to clone a whole enemy AI so every possible aspect of the clone could be modified until it was no longer really a clone, but like boss cloning, that is outside of what I know and what can be covered here. Like I mentioned above, cloned enemies can also have new graphics and a different hurt sound for taking damage. However, there are a few small limits.
Ways that a cloned enemy CAN be varied
Ways that a cloned enemy CANNOT be varied
For this walkthrough, I am going to clone Zoomer (enemy ID: DCFF), then a larger enemy later on. You should do the same thing unless you're comfortable with deviating a little bit at certain points.
1. Right click on a Zoomer and select “Species.”
2. Look above where it says “Save Enemy DNA.” See that horizontal scroller? Click the right > arrow on it.
3. Click “Edit” next to where it says “Palette Pointer: E5B0” to bring up a new window.
4. In the little palette window that pops up, click “export palette” then close the window.
5. Right underneath the palette pointer, look where it says “Enemy Tiles: AE8000” - this is how you find their graphics in TLP
6. AE8000 is a LoROM address. Convert that to a PC address using Lunar Address or some other method. AE8000 = 170000.
7. Make a back-up copy of your ROM, then open the .SMC file in TLP.
8. Click Edit > Goto… > Offset: 170000 Radix: Hex Method: Absolute > click “Go!”
9. Look for the discolored Zoomer graphics in the top-left corner of your TLP graphics window now. See them? Good.
10. Click Palette > Load… > find “DCFF.tpl” that SMILE exported earlier and open that. Hooray, Zoomer colors look normal now.
11. Open another Super Metroid ROM in TLP. In this other ROM, go to 170000 and load DCFF.tpl also. The reason for loading a copy of the ROM (which we will not be editing) is so that graphics can be dragged and dropped from it to the ROM that we are editing. This is needed because you can't drag tiles up or down beyond what you can see in TLP's window. This means that yes, you will be dragging and dropping graphics from one ROM file to another. Like I said, this copy ROM will not be edited. It is strictly for taking graphics from because TLP doesn't allow you to scroll while dragging.
12. Here's where it gets a bit more tricky. Look at the Zoomer's graphics and observe how it breaks down into 8×8 blocks, which is the grid size that TLP uses. You should see that its body is 4 tiles wide, 2 tall (4×2) walking horizontally, and 2 tiles wide, 4 tall (2×4) when crawling walls. Its legs are half that size; they will cycle through a total of 5 animation frames, which are 2 tiles wide, 1 tall walking horizontally and 1 tile wide, 2 wall walking vertically. Learning how to determine an enemy size will make it easier to find suitable clone graphics in the future, which is what we're about to do.
13. With the Zoomer's palette loaded, you should be able to see some other enemy graphics, albeit with Zoomer's colors instead of their own. This should be enough to see what enemies are there, so start looking around for one that is about the same size as the Zoomer. Even though the Zoomer's body is 8 tiles in size, its graphics are heavily centered on the 4 middle tiles, so you could actually get away with using a 4×4 enemy graphic in place of the Zoomer's body, which there are a lot more of. After you decide on a replacement graphic(s), don't just drag them over the Zoomer's tiles. We're gonna put the new graphics in free space instead. The reason we're looking here is so you could get an idea of how enemy graphics are arranged, and sizing them up.
14. In TLP, free space will all look like a single color. If no palette is loaded, it will be neon green. With Zoomer's palette loaded and unchanged, free space will be orange. Seeing the free space in TLP and determining the PC address can be a little bothersome, but you'll have to do that later to get your new “Enemy Tiles” pointer. There's actually some free space directly over the Zoomer's graphics, so scroll up a little. See? All one color. Now, open up your hex editor of choice and load up the ROM that you're working.
15. Like you did in TLP, use your hex editor's “Goto” function and get to address 170000. Scroll up some. All those FF FF bytes are free space, yup. To make things easier, determine where the usable free space begins and ends, and which graphics are using it. You'll thank yourself later if you ever need to retrieve that info or move them around to consolidate space. By usable free space, let me make it clear that the order that the enemy's tiles are in will have to remain the same for the cloned enemy's new tiles. Because of this, most enemies will usually fit better into a '16×16 tile grid' instead of the 8×8 grid that we see in TLP. This means that we might have to neglect a row of 8×8 free space blocks to fit more enemies into a chunk of free space blocks. That will all make more sense later when you can place a visual to it.
16. So, determining usable free space. The easiest-to-explain way will require interpreting what you see in TLP with a hex editor as well, which really isn't as hard as it sounds because it's something that can be explained visually. In your hex editor, scroll up through the FF bytes until they stop, which is actually where the free space begins. 16F444 is the start of this free space, assuming you haven't edited this portion of your ROM already with a patch or something. See it? Okay. Go back to TLP. Fill in the 1 8×8-pixel block with a single color like I did in this picture (I used yellow; the color that you use doesn't matter):
17. After you've colored your square, save the ROM with TLP, then go back to your hex editor and look what's there now. Look down past 16F444 a little ways, specifically at the address 16F600. Notice those bytes have changed to something else? 16F600 is where exactly these changes started, and will be our new enemy's “Enemy Tiles” pointer, but let's not get too ahead of ourselves.
18. Next, drag-and-drop Zoomer's graphics over to this free space, using 16F600 as the very 'top left' or beginning portion of the enemy's tiles so that you've copied the whole Zoomer in the same graphical order that it was originally in, like in the picture below. Save the ROM with TLP after you do this.
Now, if you look back in your hex editor at 16F600, you'll see that there's a lot more data written there, with 'gaps' of free space here and there. This is normal. The free space gaps are there because the Zoomer's graphics didn't stretch all the way across TLP's grid (notice that there are 3, 3 and then 6 empty squares to the right of Zoomer). For an enemy with graphics that were 16 tiles across and had no empty spaces, this wouldn't happen. These parts of the free space will most likely not be used.
So what now? We've copied the enemy graphics to a new place in the ROM and know where they are. Next up is giving the enemy its own DNA, its own palette, then its own .GIF file that SMILE uses for placing them in a room, and a .TXT file with info about your new enemy. Enemy DNA is located in bank $A0 and is 64 bytes long. Enemy colors are in bank $A2 and use 32 bytes.
19. Look for 64+ bytes of space in bank $A0. I'm going to use 107800, which is the PC address. Its LoROM equivalent is A0F800. The last 4 digits of this LoROM value (F800) will be the new enemy ID, so remember it.
20. Since enemy colors are in bank $A2, we'll need 32+ bytes of free space in this bank also. I'm going to use PC address 1174C0, which is A2F4C0 in LoROM.
21. In your SMILE folder, navigate to “smile\files\Enemies” and make copies of DCFF.gif and DCFF.txt. Rename them to F800.gif and F800.txt.
22. In SMILE, if your enemy editor is still open from earlier, close it then open it back up. Now scroll to the very bottom of the enemy list. You should see that there is an enemy 1D F800 there now, which looks identical to Zoomer, and has the same description at the bottom in SMILE as a Zoomer does. These are F800.gif and F800.txt at work.
23. Scroll up to where the real Zoomer is in the enemy list and click on “DCFF.” After that, click on “Copy DNA.” Now just scroll back down to “F800” and click on it, then click “Paste DCFF DNA.” Once that's all done, click “Save Enemy DNA.” If you couldn't tell, this gives the fresh new clone we just made (F800) the Zoomer's data. No sense in testing this new enemy, it won't work just yet. We need to set up its other stuff first.
24. Look at the “Enemy Tiles” pointer in F800's enemy DNA again like you did earlier with DCFF. This pointer still says AE8000, which goes to Zoomer's old graphics. Change it to ADF600, which is the LoROM version of address 16F600 - if you remember from step 17 earlier, we determined this new tile pointer by where the duplicated graphics were placed. “Save Enemy DNA” after you do this.
25. Next up, right above Enemy Tiles is the “Palette Pointer” which also still says E5B0. Since we determined earlier the new palette will write to 1174C0 (PC), we change this palette pointer to F4C0, since 1174C0 = A2F4C0. Click “Save Enemy DNA” after you do this. Now click the “Edit” button to pull up the mini color editor window like you did in step 3. This time, click “Import Palette” and open the DCFF.tpl palette file that you exported earlier using this window. This loads the Zoomer's palette from a new location, so you can change the colors freely. After DCFF.tpl is loaded, click “Save ROM” and close this little window out.
If you followed all of the steps correctly, you should now have a perfectly cloned Zoomer with a new enemy ID. Test the enemy out if you want to now. It should behave exactly like any other Zoomer does, but the beauty is that its graphics, colors and other things aren't linked with the original Zoomer (DCFF). Your new Zoomer (F800) can now be changed into something hardly resembling what it used to be. You could call it a day right now and have yourself a cloned enemy that can have alternate colors and damage/HP, but why stop there? This is the fun part because now you can be creative.
Yuh. So we have a cloned enemy that we can do a bunch of stuff to. Just changing its palette is not enough - let's change the way it looks. Get back into TLP.
NOTE: TLP won't auto-update new data written to a file that it has open. This means that if you were to save the ROM in TLP right now, the changes you made in SMILE to the enemy's DNA and colors would be undone. Before you continue, CLOSE AND RE-OPEN THE ROM IN TLP. You always want to do this if you're editing any part of the ROM in TLP and some other program at the same time: close and re-open the ROM in TLP if you just finished saving it with another program.
Remember what I said earlier about Zoomer being 8 tiles in size, but its graphics centered heavily in the middle. You have the option of completely re-painting the Zoomer clone's graphics from scratch, and that's fine if you're a good pixel artist. Have fun with that. If you're not so motivated, there's a way of changing them that's also very effective. You guessed it: stealing parts from another enemy or enemies to make up your new one. This has a few advanges:
26. Because of Zoomer's graphics being centered towards the middle 2×2 blocks instead of the full 4×4, I'll look around for a 4×4 enemy part that would be a suitable replacement for the Zoomer's body. Once you see something that might work, drag-and-drop its tiles over the Zoomer clone's tiles. You might need to erase the extra bits of the Zoomer's sides in the outer 4 tiles by filling the whole things in with transparency/background color (shown as blue for Zoomer's colors), which is the very first/left color in TLP's palette window, or replace them with extra bits of the replacement enemy's tiles if needed. The image below should explain the rest well enough. At any point you could save and be done, but taking it further gets more and more rewarding…
Easy as that. Approximating sizes for smaller enemies like the Zoomer is one of the simplest ways of giving new graphics to a clone. All I did is copy over 8 tiles and erase 8 more. Find some new graphics for Zoomer's moving legs and change the colors if you want, or find better graphics to use for the Zoomer's body than I did.
27. Our clone doesn't look bad with Zoomer's colors, but it could look better with new ones. Click the “Edit” button next to “Palette Pointer” in F800's enemy DNA window, which you changed from E5B0 to F4C0 earlier. Instead of importing or exporting, change the colors this time around. Change them to whatever you want. Save and test your enemy until you've settled on a good new set of colors for it. Alternatively, you can edit the enemy's colors in TLP instead, which might be easier for some since TLP lets you preview the colors right in the program as you're changing them. If you choose to do that, save/overwrite your DCFF.tpl file with TLP after you're done and import it into SMILE the same way you did when you imported DCFF.tpl as this clone's palette the first time.
28. Don't forget that you're cloning an enemy's DNA, which is different from its AI.
Enemy DNA = Everything you see that can be changed in SMILE, underneath “Enemy DNA” Enemy AI = 'Hard-coded' artificial intelligence that isn't editable within SMILE and will affect all clones the same way
Still, consider other ways that your clone may differ from the Zoomer it was made from that fall into the limits of enemy DNA. In SMILE's enemy DNA window, Zoomer's “sound” is 0023 by default. Find another enemy that makes a more appealing sound when you shoot it and give your clone that sound. An example would be changing 0023 to 0066 to make them bark like a space pirate when you shoot them. Damage, HP, item drops and weapon vulnerabilities can also be changed without affecting the original Zoomer.
Technically, you've learned all you need to know by completing step 28 - cloning an enemy and changing this clone in certain ways. Everything below this point is just a second, slightly more abridged walkthrough for creating a larger and more elaborate clone than the Zoomer (using most of the same steps), with a few extra notes and examples. Continuing is optional, but it wouldn't hurt to go for it if you're still a bit shakey on how the process is done.
Understanding the Zoomer was easy enough, but some enemies are a little harder to pick apart. That is, determining what tiles are used for that particular enemy, and which ones are used by another enemy nearby. This isn't much of a problem when you remember that the arrangement of duplicate enemy 8×8 tiles has to stay the same. For the next example, I'm going to clone a large sidehopper (enemy ID: D9BF).
29. D9BF's Enemy Tiles pointer = AEAA00, so “Goto…” address 172A00 in TLP. As you can see, this dude has more parts to him and they're not as easy to make out. There also isn't a convenient chunk of free space right next to these tiles like there was on top of the Zoomer. Optional: In SMILE, export D9BF.tpl using the “Edit” window next to “Palette Pointer” like you did with Zoomer's colors. Now load D9BF.tpl into TLP so you can see the sidehopper's real colors.
30. Time to find free space for the sidehopper clone's tiles. Press the “Page Up” or “Page Down” keys to quickly go up or down a whole page in TLP. I'm gonna go up since that's where the closest free space is that will fit the large sidehopper's tiles. 6 or 7 pages up and you'll see a big free space area under the spikey sea turtle from Maridia.
31. In your hex editor, goto 172A00 and start scrolling up (or pressing “Page Up” again). You'll pass some other free space along the way, which is actually the same free space above Zoomer that we used earlier. Keep going up until you hit another vast area of free space, which will be after 15 pages or so. This free space begins at 166E00, making ACEE00 the Enemy Tiles pointer for this new clone. We're at the same place in both TLP and the hex editor right now, just below the Maridian sea turtle.
32. Do you still have a second copy of the ROM open in TLP? If not, do it so you've got two ROMs open. You'll need this extra copy open to drag new graphics from. Copy the sidehopper's graphics over to the free space that we just noted in the appropriate order, save the ROM, and here's what we're looking at so far:
33. Easy stuff. Remember that an enemy's DNA takes 64 bytes each and must be in bank $A0. Enemy colors take 32 bytes and must be in bank $A2. For the Zoomer clone, I used 107800/A0F800 for its DNA and 1174C0/A2F4C0 for its colors. Assuming you haven't started on another ROM since you made the Zoomer, you should only need to add 64 and 32 to the previous DNA/color addresses to figure out the ones you need for your new clone (or just have a glance in your hex editor). Either way, I'll be using 107840/A0F840 for the sidehopper clone's DNA and 1174E0/A2F4E0 for its colors.
34. Go to the “smile\files\Enemies” folder again and make copies of D9BF.gif and D9BF.txt. Rename them to F840.gif and F840.txt. Note it again that I get these filenames from where the enemy DNA will be copied to, in the case of (A0)F840. Now in SMILE, close and reopen the enemy editor to refresh the enemy list, allowing the new enemy ID F840 to be seen at the bottom.
35. See F840 down there? Good. Scroll up the enemy list, then click on “D9BF” and “Copy DNA” in that order. After that, scroll back down and click on “F840” and “Paste D9BF DNA” in that order. Click “Save Enemy DNA.”
36. Now change the “Enemy Tiles” pointer from AEAA00 to ACEE00, then change the “Palette Pointer” from B085 to F4E0. Click “Save Enemy DNA” again.
37. Click “Edit” next to “Palette Pointer” then click on “Import Palette” and load the “D9BF.tpl” file. Click “Save ROM” and close the edit window.
This marks the end of the cloning process again. Enemy F840 is now a fully functioning large sidehopper variant. Because of its unique shape and size, this enemy will be harder to find suitable replacement graphics for, but it can be done. Visualize. Look at the enemy you're trying to change, then see what body parts from other enemies could work. Things like faces are very easy to replace, but more specific areas like legs can be harder to do. Be patient, and keep trying different things out between testing until you settle on something that you're satisfied with. As appealing as the idea is, you don't need to replace every single graphic with something new. Most of the time, a new face and some kind of obvious body edit is enough.
Here's what I came up with after giving the large sidehopper clone new graphics, new colors and a few small pixel edits which consisted of little more than adding pink to other parts of the enemy besides the claws on its feet.
There are actually pieces from 5 different enemies in that sidehopper clone's graphics, not the 3 or 4 that I guessed at while I was making the image. 2 different enemies were used for just its head. That sidehopper clone took me about 15 minutes to make, and most of that time went into choosing which graphics to carry over to it. Don't be discouraged if you don't make something awesome right away. Keep doing it until you learn how to mesh enemy graphics together, or until you can edit the pixel art and force them to mesh. The main goal here is a new enemy that at first glance looks different from its original, so I'll consider the graphics for the sidehopper clone complete. Here's a little breakdown of all the other enemy parts that I used.
Just give this guy a new sound and some other new attributes and we're finished. There are hundreds of possibilities I could have ended up with, so don't think you're all that limited. If you can make the leap and incorporate pixel editing into your enemy graphic splicing, you'll give yourself so many more options. I believe that I've explained enemy cloning as best I can; two walkthroughs should have been enough to get you all going. Now make some badass enemies and put them in your hacks.
Okay, sweet. So you can make (mostly) new enemies on command. This is enough to get by if you're just making a hack, but you might as well go all the way by giving the clone its own .GIF file so it shows up in SMILE the way it looks like ingame. Right now, the clones we made in this walkthrough still use the original graphics in SMILE (remember, you copied DCFF.gif and D9BF.gif, which still look like the Zoomer/sidehopper). You could go the easy route and just recolor the F800.gif and F840.gif files and overwrite them so you can tell the enemies apart in your SMILE room, but why not just include the new graphics/colors too? Here's the general process I use for making .GIF files, but do your own research if this confuses you. Just Google around for “saving transparent GIF images.”
Tools you'll need to make a new .GIF file for your clone:
1. Run your emulator and enter a room that has your cloned enemy in it somewhere.
2. Turn off layers 1 and 2 in your emulator. In Snes9X, I believe this is done by pressing the 1 and 2 keys, but surely there's an option for it somewhere else. After you've turned off layers 1 and 2, you should only see Samus and the enemy(s) over a pitch black background.
3. Press the “Print Screen” key to take a screenshot of what's happening on your screen. If you need to, press Print Screen several times until your enemy clone is in a good animation frame. Remember that you'll be seeing this graphic everywhere in SMILE that the clone is used, so make sure it looks decent.
4. Open your image editing program of choice, then open up a blank new file. Press Ctrl+V (or right click > click on “Paste…”) to paste the screenshot you took. You should see Samus and the enemy(s) over a black background in your image editing program now.
5. Use your program's “crop” tool to cut away all of the extra space. Do this by making a square around the clone, as close to its edges as possible (zoom in if you need to) and telling your program to crop. Doing this will leave only a tiny image of your clone behind with a black background.
6. Color the background from black to neon green (this will make sense later). Specifically, color code #00FF00. If your program has an area for entering a 6-digit hex value to select a color, enter 00FF00 and change the whole background to that shade of green. I'm only stressing a particular shade of green for consistency. You should have something looking like this so far:
Notice how closely I cropped the image around the hopper clone. The 'border' of the image touches the highest, lowest, and furthest left/right of the clone's graphics. You should crop your images in this way too, so SMILE can more accurately display their size when you're putting them in a room.
6a. Optional: If the program you're using right now can't save pictures as transparent a .GIF file, copy the cropped clone graphic to your clipboard, open a program that can save transparency, create a new file, paste your clone in that progam and re-crop if necessary.
7. Transparency can be implemented in various ways depending on the program. You'll be setting aside one color (in this case, neon green) that gets 'deleted' and replaced with a see-through color. If there were any other parts of the hopper clone's graphics that also used neon green, they too would become clear. This is why the background absolutely cannot share its color with anything else in the picture that isn't intended to be transparent also.
8. I don't know what program you're using, so I can't tell you exactly how to save the image transparently. Look around for anything mentioning 'transparency.' There might be options for it in the “Save As…” menu. If all else fails, Google “[your program] saving transparent GIF” and I'm sure you'll find a page telling you exactly how to do that.
9. After you figure out how transparency works, overwrite the .GIF file with your new one in “smile\files\Enemies” - F800.gif for the Zoomer clone and F840.gif for the hopper clone. If you had SMILE open during all of this, save your room and re-open it if the clone is still in the room you're viewing. Oh, lookie here…
I just replaced the large sidehopper (D9BF) in this room with the new clone (F840) to demonstrate what they look like in SMILE among other enemies and room graphics. Pretty good I'd say. I don't know if I'm entirely correct, but I believe that 32 new enemies can be added this way without replacing any existing ones, based on how much free space is left in bank $A0 for placing copied enemy DNA. If more space in $A0 could be freed up, then surely more than 32 could be added.
With the .GIF file taken care of, what about the .TXT? This is optional. DCFF.txt and F800.txt are exactly the same for the Zoomer and its clone, only they've got different filenames. Same with D9BF.txt and F840.txt for the large sidehopper and its clone. The information in the clones' TXT documents (F800.txt and F840.txt) are already relevant to how to use the cloned enemy in SMILE because their AI is still the same as the enemy they were cloned from. Make sense?
There's no reason to not consider enemy cloning for any serious hacks. There's more to be done than just having a clone - it's all about the context in which they are presented. Got an ice area? Make some enemy clones that have icey looking graphics and colors. Do the same with some other enemies if you have another area that's heavily volcanic. Sky's the limit. Clone a large enemy and make it into a miniboss. Make several different types of miniboss. Make 3 different clones of a single type of enemy and put all 4 of them in the same room. See what I'm getting at? Just because they're clones doesn't mean that they can't be used for great effect in lots of different ways.
Here are a few random ideas that I pulled out of my ass:
Consider the different enemy types. Know those blue blocks with the glowing red faces near Morph Ball at the beginning? Those are “KOMA” enemies. You could make a few Koma clones and have different types of creepy faces (or any other type of animation) that trigger when you pass by them. Unfortunately, the glowing red/orange colors used for Koma's face aren't linked with its palette pointer, but the blue colors for the block itself are. Combined with Black Falcon's “Falling Koma” and “Crumble Blocks” ASM files, you could have themed blocks to use for puzzle elements in different area types. Ice blocks for frozen areas, stones for jungle areas, etc.
I went through a lot of trouble to write this, so you guys better be out there making cool enemies now.
Original document by Grime