Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,481,643
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-25-24 12:06 PM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests | 1 bot

Main - ROM Hacking - To all Megaman 1 hackers (Video + Patch) New thread | New reply


Jimmy52905
Posted on 04-25-10 03:27 AM (rev. 2 of 04-28-10 05:59 AM) Link | Quote | ID: 130491


Paratroopa
Level: 29

Posts: 145/152
EXP: 144373
Next: 3512

Since: 01-25-08

Last post: 5103 days
Last view: 4159 days
So today I decided to work on my Megaman 1 hack again. While I was working on my hack, I realized that Megaman doesn't jump higher when he's in water like he does in the other Megaman games. I decided to make an ASM hack that would fix the problem, so I opened up the FCEU Debugger's Hex Editor to see if I could find anything. To my surprise, I managed to find 2 RAM addresses: $002C and $0094.

But what is so significant about these two addresses? Well...they both contain the tile properties of the objects Megaman is interacting with. The values for these addresses are the same as the values for the tile properties in Rock And Roll: $00 = Air, $01 = Solid, $02 = Ladder, $03 = Spike, $04 = Ice, and $05 = Water. $002C is used to determine what tile Megaman is standing on, and $0094 is used to determine what tile Megaman is standing in. So, if Megaman is standing on a solid tile, but is also standing in water, $002C would hold value $01 (Solid), and $0094 would hold value $05 (Water).

So, to solve the problem of making Megaman jump higher in water, I basically hijacked the jump routine, checked RAM $0094 to see if it was equal to $05 (Water), and increased his jump height if so.

However, there is another thing that is significant about these RAM addresses. What if we could use the unused tile properties (values $06-$FF) for our own custom use? I may have possibly found the first step in creating Megaman Custom Blocks! We could use the unused tile properties for making, say for example, a block that will hurt Megaman on contact, or maybe a block that can only be passed on a certain condition, or something as simple as a tile that just plays a certain sound effect. Imagine the possibilities...


Also, if anyone's interested in using my code for making Megaman jump higher in water, I made a quick IPS patch for it. You can download it here.

EDIT: Allright. Here is a list of all the custom blocks I have created for Mega Man 1 so far:

Custom Blocks List

Name: Bounce Block
IPS Patch
ASM Code
Video
Tile Properties: $07
Description: This block will launch Mega Man into the air when he jumps on it. Holding down A will make him jump higher, do not place the block too high in the level unless there is some sort of ceiling above him, or else he will go too high off the screen and die.

____________________
Come join my IRC channel, #Megahax for Mega Man hacking related discussions.

Insectduel
Posted on 04-25-10 05:56 PM Link | Quote | ID: 130522


Hammer Brother
Level: 68

Posts: 533/1069
EXP: 2687552
Next: 41248

Since: 02-16-08
From: Insectduel's office

Last post: 1256 days
Last view: 1255 days
Cool! Thanks for the code. I should use it on my existing Megaman 1 hack but I will change everything in my hack now.

Sprites and Everything. Since I am planning to move it with Multimedia fusion 2.

NetSplit
Posted on 04-25-10 06:15 PM Link | Quote | ID: 130523


Level: 32

Posts: 151/178
EXP: 188017
Next: 18425

Since: 02-26-07

Last post: 2216 days
Last view: 2141 days
Nice to see someone else figuring this out. The MM1 water really bugged me, particularly considering the behavior in later Mega Man games, so it was definitely on my list of things to update when I was working on my Mega Man hack (video of my water here: http://www.youtube.com/watch?v=z4bIxaIkH3M). Unfortunately, it's been a long time since I worked on my hack, so I don't really know the specifics of how I made it work (though a quick glance confirms that $94 is definitely the way to go for Mega Man). This is also the way you'd handle custom block types, yes. That was something I intended to work on, but I never got to making the levels in my hack that would've benefited from the new block types, so it was never worth pursuing.

The real problem comes when you want to make enemies interact with specific block types. Your solution is nice, but it doesn't make enemies have lower gravity when underwater. Mega Man 2 solved this by making gravity lower universally depending on Mega Man's water status, which is a simple change. You'll want to approach this by changing the gravity that affects things rather than changing Mega Man's jump height. That'll achieve a more water-like feel and mean you only have to change the gravity routine rather than jumping velocities for everything.

Water got a lot more complex with later games, where each sprite was checked for water status rather than just doing it all based on Mega Man. I know little about how general collision works for MM1, so my solution was to make another #32 byte array for sprites to check what block they're currently in. Regarding free space to hold such a huge array, I used the top of the stack space, since if your stack is ever getting that high, you can realistically expect a crash, anyway. Then, the gravity routine can be modified so that it uses either the normal or underwater gravity values depending on the sprite's array value. Further benefits of this method are that you can then easily make any sprite react to any block type. If you watch my video, you'll see I made sprites with the bg collision flag explode if they touch spikes, which is just a matter of checking if that array is set to the spike value or not. You can further generalize this and make more unique block types for different levels that affect enemy sprites in addition to Mega Man. Just be conscious of free space for the additional code, as well as the additional overhead (read: more cycles used).

Oh, and if you do all that, you'll also want to further improve the water by fixing the occasional delay that occurs in water. MM1's version of water was slowing down Mega Man a bit when underwater, so it turns it into a play control hazard. It's a pain in the ass and feels much better with that feature disabled. If I recall correctly, the game does it by using a counter that all sprites have that says for how many more frames that sprite is frozen in place. This is located at $06A0 and is used for when you freeze enemies in place with the Ice weapon. I think the game sets Mega Man's to 1 every few frames when underwater, or something like that. Definitely worth disabling, in my opinion.

Anyway, it's great to see MM1 developments. I hope to see more coming in the future.

Jimmy52905
Posted on 04-25-10 07:12 PM Link | Quote | ID: 130525


Paratroopa
Level: 29

Posts: 146/152
EXP: 144373
Next: 3512

Since: 01-25-08

Last post: 5103 days
Last view: 4159 days
Ah of course. I had completely forgotten to take sprite interaction into consideration. Oh well, hopefully with the way that I intend to do this, I won't need to set up sprite interaction for the custom blocks. Well...thanks for your info. I'll take a look at $06A0 and see if I can disable Megaman walking slower through water. Also, it turns out that setting up custom block types is a bit more complicated than I initially thought. Eh, well I should be able to figure it out eventually. Once I've completely figured this out, I'll probably release a few of my custom block codes so that other Megaman hackers can use them.

Also, nice to see you again, NetSplit. I doubt you remember who I am but I used to always bug you with Megaman hacking questions back when I was rather n00bish...heh.

____________________
Come join my IRC channel, #Megahax for Mega Man hacking related discussions.

NetSplit
Posted on 04-25-10 07:23 PM Link | Quote | ID: 130529


Level: 32

Posts: 152/178
EXP: 188017
Next: 18425

Since: 02-26-07

Last post: 2216 days
Last view: 2141 days
You seem to have learned a lot. Always nice to see people go from knowing little to knowing much.

I seem to recall bg collision being a bit irritating to mess around with in MM1, but I imagine adding custom blocks shouldn't be too bad. You're doing a check for water right now. You could just do a check for another value and have code somewhere that will see that and decrement MM's health every now and then, or something like that. You get the idea.

I think my implementation of the 32 byte array was actually fairly intelligent in trying to decide what is and isn't important information. Basically, sprites are big, so they can be touching a lot of different kinds of blocks. I decided to give blocks priorities, so my implementation says that spikes (#$03, I think?) are the most important value, so if it's #$03, then don't update the value anymore, and water is the second more important, so if it's #$05, don't update it anymore unless it's #$03. This lets you get the most significant information for a given sprite. It won't do any good if you want 2 special effects at the same time, but so it goes. You could make it use both nybbles to try to get multiple effects at a time, so one nybble is air-like blocks (like water and 'poison' air), while the other is special wall blocks, or something like that. There are lots of ways of achieving this sort of thing.

At some point, I intend to sit down and make an MM1 editor. I have so much information about this game lying around in notes, but there aren't any really good editors for the game; they're all so limited. We'll see if I ever get around to this, but hopefully it'll happen!

Insectduel
Posted on 04-27-10 12:55 AM (rev. 3 of 04-27-10 12:58 AM) Link | Quote | ID: 130580


Hammer Brother
Level: 68

Posts: 535/1069
EXP: 2687552
Next: 41248

Since: 02-16-08
From: Insectduel's office

Last post: 1256 days
Last view: 1255 days
You know, last summer I tried to create a block in Megaman 4 where your main character creates an air meter when going underwater, then starts losing health meter when the air runs out. The code is still buggy and I still cannot fix it properly and it costs me at least over 100 bytes of free space.

Maybe you can create something like that in MM1. If you want a code creating challenge. I took the idea off Magical Doropie.

Jimmy52905
Posted on 04-27-10 07:53 AM (rev. 2 of 04-28-10 06:08 AM) Link | Quote | ID: 130596


Paratroopa
Level: 29

Posts: 148/152
EXP: 144373
Next: 3512

Since: 01-25-08

Last post: 5103 days
Last view: 4159 days
Well...I am excited to say that I have coded my first actual custom block, that uses new tile properties and everything.
It turns out though, that $94 doesn't work quite the same way as I thought it did. I expected it to always update the current tile that Mega Man is standing in, but it actually only updates when Mega Man is standing in water, so using custom Tile properties doesn't affect it at all. However, I was able to use $2C instead, as that RAM seems to be updated no matter what. I'll post the code and the video of it as soon as I can figure out how to record videos using FCE Ultra.

While I'm posting this, I'd like to mention that I decided to create an IRC channel for Mega Man hacking, since it seems that the majority of the people here seem to be hacking some sort of Mega Man game. The channel can be reached with this information:

Server: irc.caffie.net
Channel: #Megahax

Look forward to seeing you guys there.

EDIT:
Well...here is a video of the new custom block that I made:



I have released an IPS Patch which will insert the block into your Mega Man hack if you want to use it. To get it to work properly, you just need to modify the Solidity Settings in Rock And Roll (In the Level Properties) and change one of the Tile Settings to $07.

Here's the patch:
BounceBlock.ips

And here is the ASM code so that you guys can modify it and create your own custom block codes with it:
BounceBlock.txt

I have also updated the first post with a list of all the custom blocks I've made so far, including download links to the patches and ASM code. I will update this thread with new custom block codes every once in a while, so be on the lookout for updates.

____________________
Come join my IRC channel, #Megahax for Mega Man hacking related discussions.

zkip
Posted on 04-30-10 04:42 AM (rev. 2 of 01-30-11 08:47 PM) Link | Quote | ID: 130749


Level: 15

Posts: 11/34
EXP: 14276
Next: 2108

Since: 02-13-10

Last post: 4178 days
Last view: 3052 days


~zkip:
Well, after getting Jimmy's patch and looking at the ASM, I figured it would be a little easier if this where in a tool form. So, here:

MegaBlock v.01 Beta
A Mega Man 1 custom blocktool.

Features:
* Inserts .bin block(s) into the ROM.
* Installs the ASM hack needed to get the blocks working.
* Features an assembler to create your own .BIN blocks. (TRASM, not made by me)

Beta limitations:
* Only 1 block can be inserted.

DL

Oh yeah, it was created in C#, so you'll need the .NET framework 3.5. Also, check the readme for help/etc.

____________________



PU206C
Posted on 05-01-10 10:06 AM Link | Quote | ID: 130785


Red Goomba
Level: 16

Posts: 13/41
EXP: 18914
Next: 1342

Since: 02-07-10

Last post: 4805 days
Last view: 3411 days
Posted by DarkBoyHacker
Well, after getting Jimmy's patch and looking at the ASM, I figured it would be a little easier if this where in a tool form. So, here:

MegaBlock v.01 Beta
A Mega Man 1 custom blocktool.

Features:
* Inserts .bin block(s) into the ROM.
* Installs the ASM hack needed to get the blocks working.
* Features an assembler to create your own .BIN blocks. (TRASM, not made by me)

Beta limitations:
* Only 1 block can be inserted.

http://bin.smwcentral.net/17480/MegaBlockv.01[0].rar
(The link isn't clickable cause it has []'s in the url, and I suck at html )

Oh yeah, it was created in C#, so you'll need the .NET framework 3.5. Also, check the readme for help/etc.

html ftw

Zycor
Posted on 05-01-10 10:47 AM Link | Quote | ID: 130786


Ninji
Level: 36

Posts: 226/237
EXP: 286786
Next: 21324

Since: 05-27-07

Last post: 4827 days
Last view: 4772 days
I'd be impressed to see a hack where the spikes wont always instant kill you, like when you get hit and land on them, like in Megaman's 2-10.

____________________
Why are you reading this? My post is up there^

kuja killer
Posted on 05-01-10 12:43 PM (rev. 2 of 05-01-10 01:17 PM) Link | Quote | ID: 130787


Level: 55

Posts: 189/628
EXP: 1243780
Next: 70409

Since: 03-20-07
From: Lake Havasu City, Arizona

Last post: 281 days
Last view: 6 days
probably because the spike code doesn't ever check for megaman's invisiblity time register.
(which is what the rest of the NES game's do)
-------------------
edit:
easy no problem. did it in less than 10 minutes.

copy-paste this into the hex editor. Will allow ya to not instantly die even if your hit by an enemy. but apparently these spikes do not act as wall/ground. I aint going to bother looking into it.

1D7EE = 4C E0 FC
1D82B = 4C F0 FC
----------------
1FCF0 = 48 A5 55 F0 04 68 4C C2 D7 68 4C 19 C2
1FD00 = A4 55 F0 03 4C 01 D8 4C 19 C2

Jimmy52905
Posted on 05-01-10 07:28 PM Link | Quote | ID: 130794


Paratroopa
Level: 29

Posts: 150/152
EXP: 144373
Next: 3512

Since: 01-25-08

Last post: 5103 days
Last view: 4159 days
Nice find there, Kuja. You should make that into a patch for more convenience. I'd love to see that feature in other Mega Man hacks; I'll probably even use it in mine as well.

Posted by kuja killer
but apparently these spikes do not act as wall/ground. I aint going to bother looking into it.


Hmm...maybe I could do a check with $2C to see if Mega Man is standing on spikes and have the block act solid if it is. Only problem though is that I have no idea what routine I could use that would make it act solid.

Eh, does anyone else here happen to know?

____________________
Come join my IRC channel, #Megahax for Mega Man hacking related discussions.

Main - ROM Hacking - To all Megaman 1 hackers (Video + Patch) New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.024 seconds. (339KB of memory used)
MySQL - queries: 72, rows: 104/104, time: 0.017 seconds.