News:

11 March 2016 - Forum Rules

Main Menu

zelda 2 ASM hacking and improvements

Started by njosro, February 05, 2018, 10:20:28 PM

Previous topic - Next topic

ultimaweapon

That would be a interesting dynamic for non palace locations. If certain strong enemies like Dairas, Blue Goriyas, Scorpions, Lizaflos, or Basilisks did have that ability, it does create some new things that could be done for the Overworld locations.
Trust in the Heart of the Cards

Trax

The idea of dropping other items is certainly feasible. You can code specific conditions to your liking and make sure the items drop at specific locations and keep such items in limited quantity. I thought about something similar some time ago, and that should be a feature of my next hack. My original idea was to have special enemies in a special place give you special keys (or other unique item) that can only open special doors. That's quite special.

By the way, I just completed another of my sub-hacks: ice tiles in the Overworld. You can get a demo with a little puzzle here:

www.bwass.org/romhack/zelda2/icetile.zip

I used tile type D for the demo, so it sacrifices walkable water. I could also use type F since it's so rare and you can go without it in an entire region. However, it means that if you want different tiles in different regions, you need to have provisions for different tile mapping tables. And new graphics.

ShadowOne333

Quote from: Trax on March 20, 2018, 08:35:54 PM
The idea of dropping other items is certainly feasible. You can code specific conditions to your liking and make sure the items drop at specific locations and keep such items in limited quantity. I thought about something similar some time ago, and that should be a feature of my next hack. My original idea was to have special enemies in a special place give you special keys (or other unique item) that can only open special doors. That's quite special.

By the way, I just completed another of my sub-hacks: ice tiles in the Overworld. You can get a demo with a little puzzle here:

www.bwass.org/romhack/zelda2/icetile.zip

I used tile type D for the demo, so it sacrifices walkable water. I could also use type F since it's so rare and you can go without it in an entire region. However, it means that if you want different tiles in different regions, you need to have provisions for different tile mapping tables. And new graphics.

Hey Trax, sorry to bother you, but do you happen to know how I would go about restoring the animated water tiles in the overworld for the NES release?

GTM604

#63
Quote from: Trax on March 20, 2018, 08:35:54 PM

By the way, I just completed another of my sub-hacks: ice tiles in the Overworld. You can get a demo with a little puzzle here:

www.bwass.org/romhack/zelda2/icetile.zip

I used tile type D for the demo, so it sacrifices walkable water. I could also use type F since it's so rare and you can go without it in an entire region. However, it means that if you want different tiles in different regions, you need to have provisions for different tile mapping tables. And new graphics.

Now that was cool. It's hard to make the overworld interesting beyond what is already present in the original game imo that was simple yet adds a new layer to the overworld. only thing is you'd probably have to limit it to a few area. there's only so many cave systems in the game. other then death mountain and then your kind of limited to the size of the map and death mountain already works as a puzzle. I guess it could be a double layed puzzle but that could really try someones patience. I did really enjoy that in its small sample size.

edit - come to think of it you could have something like this a small puzzle leading into death mountain or leading into new cave areas would take a bit of work though cause of how the map uses its memory but it could be great

ultimaweapon

This is awesome Trax. It reminds me of Tales Of Symphonia. I also like the blue color tunic for Link as well. There are a lot of overworld design possibilities with the ice tiles.
Trust in the Heart of the Cards

Trax

ShadowOne, you are not bothering me :thumbsup:. I don't know exactly how to do it, but such a thing was done in the hack "Shadow of Night", by Ice Penguin. A guy named JaSp did the coding for the animation of the water in the Overworld. If I find the time, I will check the hack and peek in the code to see how it was done, but it would be better to ask JaSp directly.

ItemDrop. Keep in mind that the original game uses fewer areas than the game engine permits, a that both for West and East Hyrule. Palaces are tightly packed, however. Technically, the game allows 3E pointers, 62 in decimal. Because some areas are reused (for example, bridges), there is even less used pointers for Area Data than there are for Key Areas in OW. Also, Key Areas are used for maps that are not "local", like the Dock, both entrances to Death Mountain, Towns, Palaces, etc. With all that compiled, West Hyrule uses 45 Key Areas out of 62, leaving 17 unused areas. One of these unused areas is a Red Jar in Desert, one screen wide, like the spot east of Nabooru.

Ultima. The next step would be to code Ice Tiles in the side scrolling mode. I think it would be quite a challenge. I'm not sure if I'll do it, right now I have other priorities for my hack.

ultimaweapon

Trax
     I'm guessing there might be a way to code the breakable blocks for ice tiles, but that's beyond my level of programming. How did you change the color Link's tunic to blue? I really like that blue color.
Also, I wanted to try my hand at creating a double jump for Link when casting JUMP spell, but I don't know where to start. Where in the hex editor is the command for jump and the one that tells Link to jump higher with JUMP spell. Any update on when you will launch your nw editor Sword II?

ShadowOne
      I know you are about to go on vacation, but when you return, if you can solve the mystery of the Boss Enemy Life Bar, that would be awesome. I'll need to re-patch my hack once you solve it, cause I can't figure out how you were able to change it.

Njosro
      Do you think you will try your had at creating that GHOST spell again? It was a great concept, and I'd love to see you recreate and perfect it.
Trust in the Heart of the Cards

ShadowOne333

Quote from: Trax on March 23, 2018, 09:53:24 PM
ShadowOne, you are not bothering me :thumbsup:. I don't know exactly how to do it, but such a thing was done in the hack "Shadow of Night", by Ice Penguin. A guy named JaSp did the coding for the animation of the water in the Overworld. If I find the time, I will check the hack and peek in the code to see how it was done, but it would be better to ask JaSp directly.
If you have the spare time to do so, it'd amazing :)
I'll ry to take a peek at it as well and see if I can find something once I'm back from vacations.
That's if you don't find it beforehand :P
Thanks!
Quote from: ultimaweapon on March 23, 2018, 10:45:01 PM
ShadowOne
      I know you are about to go on vacation, but when you return, if you can solve the mystery of the Boss Enemy Life Bar, that would be awesome. I'll need to re-patch my hack once you solve it, cause I can't figure out how you were able to change it.
Sure thing!
I'm sure it's an easy enough thing to fix, I just gotta sit back, play a while and debug it properly to do so. Shouldn't take long, but rest assured I will post the fix once I find it in the Redux thread :)

Trax

#68
Ultima. If you want to learn about the jumping mechanics, you can start at 14C5, bank 0. It's not the exact start of everything related to Link's movement, but it's the main part for jumping. You may have to go back and forth between Bank 0 and Bank 7 a few times. I reuploaded all my disassemblies to my website (8 Banks + RAM Map), so that you can have the newest comments. You will need at least one variable of your own. You can store it in Cartridge RAM. That variable would indicate which jump Link is performing. You have to reset that variable when Link touches the ground. I figure the second jump would reset Link's negative Y velocity.

As for the Ice Tile shenanigans, the collision checks in Zelda II are quite limited. Either the tile is transparent (background tile, no collision), or the tile is solid. Every frame, the engine checks to the four sides of Link (and most enemies) whether the tile he touches is solid or not, and sets the variable at RAM A7 (A8,X for enemies) accordingly, one bit per side. This information is used to calculate jumps, falling, walking, etc.

Other than that, there are special tiles that have their own processes, like the surface of lava and breakable blocks, among others. Each region has a list of such tile codes, and the engine goes through them. For example, for West Hyrule, at 451A, there is a table of 9 bytes like this :

451A: Tile Codes for Specific Interactions (9 bytes)

00 00 00 00 61 60 80 87 91


Tile Code 61 is Breakable Block, 60 is Breaking Bridge, 80 and 87 are Lava Surface (maybe one is Water Surface, but the graphics are the same), and 91 is Swamp. Same table for East Hyrule, in Bank 2. Other banks have their own list. We can safely assume 00 does nothing, and therefore we can set whatever value we want there and code whatever we want.

For an Ice Tile to work, we would have to slow down acceleration and deceleration in some way. As far as I know, there is no "subunits" for velocity/acceleration in Zelda II, so we have to work with integers. On the other hand, table at 13B3 says that 18 is Link's max X Velocity, which can't be pixels/frame, that would be way too fast.

EDIT

Ultima. Banks 1 to 5 have palettes at [bank offset + 0x0E], so 400E, 800E, and so on. First the background palettes (8 groups of 0x10, plus one for grotto without candle), then at 0x40AE, sprites palettes, with the first byte of each group set to FF. Palette 0 is the one used for Link, so you can change them to whatever you want. If you want Link to always have the same color, you have to change the 5 sprite palette groups. The values I used in the Ice Tile hack are: FF 08 36 11. Use this chart for approximate reference:



EDIT 2

Links for the disassemblies:

http://www.bwass.org/romhack/zelda2/zelda2bank0.txt
http://www.bwass.org/romhack/zelda2/zelda2bank1.txt
http://www.bwass.org/romhack/zelda2/zelda2bank2.txt
http://www.bwass.org/romhack/zelda2/zelda2bank3.txt
http://www.bwass.org/romhack/zelda2/zelda2bank4.txt
http://www.bwass.org/romhack/zelda2/zelda2bank5.txt
http://www.bwass.org/romhack/zelda2/zelda2bank6.txt
http://www.bwass.org/romhack/zelda2/zelda2bank7.txt
http://www.bwass.org/romhack/zelda2/zelda2rammap.txt

njosro

Hey Ultima, I recreated the ghost spell.

Get it here

It changes the shield spell. Nothing else is changed.

ultimaweapon

NJOSRO, That spell is awesome! I like it a lot!
Trust in the Heart of the Cards

njosro

Thanks!

I made a gif of it in action (Link flickers much more quickly in the game)


GTM604

that my friend is awesome. Invincible link GG. now if the spell allowed him to walk through walls that would be something else XD

ultimaweapon

I figured out how to do a midair jump, but it's something that would always be on rendering the JUMP spell useless. I'm still looking for a way to use it ONLY by casting the jump magic, but it's proving even harder than expected.
Trust in the Heart of the Cards

GTM604

Quote from: ultimaweapon on April 25, 2018, 08:11:02 AM
I figured out how to do a midair jump, but it's something that would always be on rendering the JUMP spell useless. I'm still looking for a way to use it ONLY by casting the jump magic, but it's proving even harder than expected.

that's not totally a bad thing you could then use jump as a new spell replace it with like dash but a double jump in z2 might be weird thing it could be cool asf but you'd have to build the entire game around that mechanic.

ultimaweapon

Quote from: itemdrop on April 25, 2018, 11:40:35 AM
that's not totally a bad thing you could then use jump as a new spell replace it with like dash but a double jump in z2 might be weird thing it could be cool asf but you'd have to build the entire game around that mechanic.

That would be cool but pointless right now unless I can limit the midair jump to just 1 jump. Right now, I have it to where you can midair jump continuously. Continuous midair jump does open new platform options, but I think it's a bit much. I need to figure a way to reduce it to just 1 maybe 2 at most.
Trust in the Heart of the Cards

IcePenguin

That ghost spell is really cool, njosro!  For a brief moment in the gif you posted, it seemed like Link was stopped when his shield collided with the moblin.  Only an observation, and it's still quite cool to see! 

ultimaweapon, nice work on the double jump!  An infinite jump could work if the setting was the moon!  :P

Seems like stuff is brewing behind the scenes of Zelda II hacking.  Can't wait to see what new hacks are created for this game.   :happy:

ultimaweapon

Good to see you post here Ice Penguin.

If I can tweak it down to just 1 or 2 jumps, then I can look to having the JUMP spell replaced with something else. This is still proving to be challenging.
Trust in the Heart of the Cards

njosro

Thanks icepenguin! Link DOES stop when his shield hits the moblin. Nothing's different when he's a ghost except he can't be harmed. The ghost spell just forces the flicker counter to stay constant instead of counting down to zero. Very basic, but it's something! And the best part is that there are 3 bytes that I NOP'ed so you could replace that with a JSR and add whatever you want!

Ultimaweapon, that's very cool! Did you change the rom or did you freeze a ram address to accomplish midair jumping? I never looked much into the jumping routine.

ultimaweapon

Njosro, I found a way to change the rom for the midair jump. I didn't want to do ram since that's simple enough with a game genie code. I wanted to make sure it was built into the game. I'm just still having a hard time limiting how many jumps it does.
Trust in the Heart of the Cards