News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Locating sprite and AI data for minor enemies in Rockman 2  (Read 1377 times)

cschifani

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Locating sprite and AI data for minor enemies in Rockman 2
« on: March 16, 2020, 11:10:00 am »
I'm trying to find the sprite and AI data for the Goblin, Petit Goblin, and Kaminari Goro enemies in Airman's stage in Rockman 2, but I'm not sure where to look in the ROM (especially for sprites). Any advice about what to look for or do using FCEUX would be very helpful and appreciated. Thank you!

FAST6191

  • Hero Member
  • *****
  • Posts: 2759
    • View Profile
Re: Locating sprite and AI data for minor enemies in Rockman 2
« Reply #1 on: March 16, 2020, 12:22:17 pm »
Sprites and AI? OK. For the record sprites are usually considered one of the more entry level things to be doing where messing with AI tends to be rather more tricky (as in possibly one of the later things you will be learning). If you are having trouble finding sprites then chances of accomplishing that much in AI fiddling any time soon is not so great. If it is what you want to do though and will get you to learn then so be it, and you could do some damage in both in reasonably short order.

Is this not the sort of game to be well documented already? It has a whole category on the wiki here
https://datacrystal.romhacking.net/wiki/Mega_Man_2:ROM_map
Even without that though it should be fairly basic tracing (watch to see when it lands in memory, then load an earlier savestate, set an appropriate breakpoint and wait to see what put it there). The game will either load them when you load the level, or maybe when you are loading the "screen" they are on.
You might also have some fun with a level editor.

AI gets more fun. That said AI for NES stuff often is not, and even if it is then you can still start the same way. That being the AI will make it move or make it load another sprite onto the screen (which is to say change the locations between two different sprites representing the various steps of the animation). Watch what happens in the OAM, then go backwards from there. Bonus if they are related to your position relative to them as that can make things a lot easier.

cschifani

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Locating sprite and AI data for minor enemies in Rockman 2
« Reply #2 on: March 16, 2020, 01:11:28 pm »
This is very helpful. Thank you! I fixed the AI problem (I'm just trying to make a weapons patch for the vanilla game from an unfinished ROM hack), but not the sprites. I'll try what you suggest and see what I find.

EDIT: I found the data I think I'd need. I just don't know what the file containing said data means when it has two-number groups For example, it says:

01 %u30AF%u30C3%u30AF%u30FB%u53F3%u8DB3%u524D
02 %u30AF%u30C3%u30AF%u30FB%u4E2D%u9593
03 %u30AF%u30C3%u30AF%u30FB%u5DE6%u8DB3%u524D
04 %u30C6%u30EA%u30FC%u30FB%u6B63%u9762
05 %u30C6%u30EA%u30FC%u30FB%u5DE6%u3092%u5411%u304F
06 %u30C6%u30EA%u30FC%u30FB%u5B8C%u5168%u306B%u5DE6
07 %u30C6%u30EA%u30FC%u30FB%u5F8C%u308D%u5411%u304D

08 %u30C6%u30EA%u30FC%u30FB%u5B8C%u5168%u306B%u53F3
09 %u30C6%u30EA%u30FC%u30FB%u53F3%u3092%u5411%u304F
0A %u30D7%u30C1%u30B4%u30D6%u30EA%u30F3%u30FB%u53E3%u9589%u3058
0B %u30D7%u30C1%u30B4%u30D6%u30EA%u30F3%u30FB%u53E3%u3059%u307C%u3081%u308B
0C %u30D7%u30C1%u30B4%u30D6%u30EA%u30F3%u30FB%u53E3%u958B%u3051
0D %u30D5%u30E9%u30A4%u30DC%u30FC%u30A4%u30FB%u30A2%u30A4%u30C9%u30EB1(%u8155%u81EA%u7136%u4F53)
0E %u30D5%u30E9%u30A4%u30DC%u30FC%u30A4%u30FB%u30A2%u30A4%u30C9%u30EB2(%u8155%u7E2E%u3081%u308B)
0F %u30D5%u30E9%u30A4%u30DC%u30FC%u30A4%u30FB%u8155%u4F38%u3070%u3057(%u30D7%u30ED%u30DA%u30E9%u5DE6)

I can read the Japanese, but I don't know what the numbers refer to. Can anyone enlighten me?

March 20, 2020, 04:23:15 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
More specifically, I now just need help finding where in the Rockman 2 ROM data for 2 sprites are located:

1) Goblin's horns (the rising and lowering horns on the big "Air Tiki" enemy that is the first thing you encounter in Air Man's stage).
2) Kaminari Goro's Lightning Bolts (just the bolts from the cloud rider enemy who throws them).

Any help in locating this data, or showing me a reliable way to find it, would be very much appreciated.
« Last Edit: March 20, 2020, 04:23:15 pm by cschifani »

FAST6191

  • Hero Member
  • *****
  • Posts: 2759
    • View Profile
Re: Locating sprite and AI data for minor enemies in Rockman 2
« Reply #3 on: March 20, 2020, 09:37:25 pm »
What have you tried for finding the sprites?

Opening the ROM in a tile editor, setting to the appropriate console mode and pressing down/page down a lot might well get you what you want.

If you know where something else (if this is a rare enemy then probably with other enemies rather than megaman and the robot masters, though it can be all in one) is then chances are other things will be nearby somewhere.

If you can make it appear in the game then you can try things.

Simple one is find it in VRAM and then search the game for that data (or a fraction of it). Compression will get in the way of this but such things are not the most common on such devices (though if it was going to be one then megaman would be up on the list).
Typically such things will be loaded either at the time a new "screen" is loaded or when the level is loaded.

Tracing is probably the next step. As mentioned above then most consoles won't tend to stream things directly to video from the cart and will instead copy something and go from there. The NES is a potential exception here as it does feature something called CHR ROM and CHR RAM, though that actually makes it even easier
https://wiki.nesdev.com/w/index.php/CHR_ROM_vs._CHR_RAM
https://wiki.nesdev.com/w/index.php/PPU_memory_map

Get a debugging emulator and set a break on write (called different things in different emulators but probably bpw here in short) just before it is loaded in. Whatever gets used to shuffle data around (can vary by system, though usually limited to something the CPU does, DMA or something more specialist for the system in question) then should have a read type (might be important), source and destination.

cschifani

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Locating sprite and AI data for minor enemies in Rockman 2
« Reply #4 on: March 29, 2020, 12:14:25 pm »
I've made some adjustments, and managed to fix (mostly) the sprites for those enemies. They're better, but not perfect. Now the Goblin horns work, but have a weird "furry" look, and the Kaminari Goro throws Petit Goblins instead of Lightning Bolts. I'd be happy to share the IPS of what I'm working on with anyone willing to look at the differences between that and vanilla Rockman 2 and provide some specific guidance on how I can fix these two sprites. I'm hoping that someone can walk me through the process of restoring at least one of those sprites. I've tried the methods suggested by FAST6191, but I don't know enough about using the FCEUX debugger to pinpoint where the horns appear and where the lightning bolts get thrown.