[M1] Enemy Placement, Slots, Spawning and how enemies work in general

Started by 8bit_Ecologist, October 29, 2014, 10:46:20 AM

Previous topic - Next topic

8bit_Ecologist

Hi all,

    I am currently working on a Metroid fan project using some analytical methods to compare how the game's "natural" phenomena match phenomena observed in the real world. So it is not a hack, but I have some questions on the mechanics of the game so I figured this was an appropriate place for it.

    I am trying to find out how the game engine utilizes enemies, how it spawns them, where they are spawned, how it deals with respawning them, etc. I have been trying to find a method of "counting" the enemies present in the game, and I have found that not understanding the games underlying mechanics are simply making me flounder in this effort. So far the only solid information I have found has been at snarfblam's website on a page about enemy slots in Editroid.  From this page I have gathered that the game has specific "slots" in the memory that enemies can be put into. Multiple enemies can be put into each slot, but only one enemy from each slot will be rendered on the screen at a time. If the enemy for a specific slot is destroyed, it frees the slot up for another enemy in this slot to be rendered. Enemies are rendered as soon as the screen reaches their position. By varying enemy position and slots, it can be made to look like enemies are spawning in "random" locations, but it is actually the interaction between enemies' positions, slots, and the enemies Samus has destroyed which produces this effect.

From here I have some questions: Are enemy placements and the slots they use independent of other rooms? Does destroying an enemy in one room effect the enemies rendered in the next room? Do the enemy placements reset every time you leave, and then re-enter a room (except for the bosses). Do enemies respawn, or is this an effect of a combination of enemy placement and slots? If they respawn, how does the game make enemies respawn? Does Samus need to move a certain distance, or is it based on an amount of time?

My current synthesis of all of this is that there is a fixed amount of enemy placements, no respawns, and they operate on a single room at a time. Enemies do not spawn randomly, but rather predictably if you understand the background mechanics. that spawn predictably if you understand the background mechanics. There is no random spawning with regard to enemy type, or position. If this is correct I could in theory find all of the enemy placements by going into each room and destroy each enemy as soon as it appears on screen, making sure to traverse the room in each direction. Or would it be easier to open the rom up in something like Editroid and count the enemy placements in each room?

If anyone can answer any of my questions, or tell me that my current understand is incorrect, I'd greatly appreciate it.

Grimlock

I'm not really understanding what you're  trying to figure out.  It kind of sounds like you're over complicating what is really fairly simple.  There are six sprite slots available for enemies.  If you have six enemies set up for six different slots (0 to 5) then when the game loads the screen you have six critters scurrying about.  If the next screen over also has six creatures then it will appear empty if the six creatures in your current screen are still active as the next screen is loaded.  Alternatively if you kill a few of the enemies before the next screen loads those sprite slots become open allowing the enemies with the same sprite number to become active.

You have the ability to toggle on respawn for individual enemies.  As long as the sprite slot is open the enemy with respawn activated will continue to fill the sprite slot.

I haven't experimented to see if multiple enemies set to respawn with the same sprite number will randomly spawn, I would guess it's just the first spawn location that gets used repeatedly, probably the first one appearing in the code, so it's always the same one.  If would be fairly simple for you to do some testing and observing in Editroid.

Really if you want to understand how it works you have to look at it differently.  Think in terms of sprite slots rather than enemies.  As long as a sprite slot is open the next entity that shares the slot number will load.

I don't know if that helps any.

8bit_Ecologist

Thanks Grimlock for taking the time to reply to this, and this:

QuoteIt kind of sounds like you're over complicating what is really fairly simple.

Is surprisingly helpful. Not ever having hacked a game, or made one, I really don't have an idea of how the mechanics work and I guess I thought that it is complicated. I will grab Editroid and poke around with it to see what you have told me in action.