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

Author Topic: Zelda II Redux  (Read 35546 times)

Trax

  • Sr. Member
  • ****
  • Posts: 444
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #80 on: April 17, 2018, 05:58:13 pm »
I tried to make the text boxes wider some time ago, and I failed. I had the tiles set correctly, but not the palette mappings, so I could say it was 50% failure. The calculations needed to remap the palettes are quite complex. Also, a few years ago, I made a small sub-hack that made the box taller, almost twice as tall. However, I think it was not really functional with very long text strings. Or maybe it required some ASM, I can't remember exactly.

The other thing you have to consider is whether you foresee the use of accented characters. If you do, you have to leave an empty line between each line of text. If you don't, you can effectively double the available lines by canceling the line skip.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 960
    • View Profile
Re: Zelda II Redux
« Reply #81 on: April 18, 2018, 10:17:15 am »
I tried to make the text boxes wider some time ago, and I failed. I had the tiles set correctly, but not the palette mappings, so I could say it was 50% failure. The calculations needed to remap the palettes are quite complex. Also, a few years ago, I made a small sub-hack that made the box taller, almost twice as tall. However, I think it was not really functional with very long text strings. Or maybe it required some ASM, I can't remember exactly.

The other thing you have to consider is whether you foresee the use of accented characters. If you do, you have to leave an empty line between each line of text. If you don't, you can effectively double the available lines by canceling the line skip.
Thanks for stopping by my humble thread, Trax! hahah :P
So you have attempted expanding the text boxes before, but you say the palettes are what made it difficult?
Interesting.

As for what you mention in the second paragraph, by accented characters you mean like Á, É, etc, or special characters like ', ?, !, etc?
I did notice that the game tends to jump one whole row of tiles to print the next line of text, so perhaps we could somehow bypass this to effectively have around 8 lines of text per textbox instead of the 4 we have at the moment.

I believe Bisquit did the same thing for Castlevania II's textboxes, where he made it so that each text box has 8 lines now instead of 4. Both CV2 and Zelda 2 seem to use a very similar textbox setup.

I'll try to attempt the 8 lines thing and see if I can make something out of it.

Thank you so much, Trax!

--------------------------------------------------------------------------------------------

@Trax:
I searched a little bit around the disassembly and found this in particular:

Code: [Select]
bank3_End_of_Line_Routine                                                      ;
ldy      #$0B                          ; 0xf666 $B656 A0 0B                    ; 0B = delay after dialog line with FD
cmp      #$FD                          ; 0xf668 $B658 C9 FD                    ;
beq      LB65E                         ; 0xf66a $B65A F0 02                    ;
ldy      #$2D                          ; 0xf66c $B65C A0 2D                    ; 2D = delay after dialog line with FE
LB65E                                                                          ;
sty      $0566                         ; 0xf66e $B65E 8C 66 05                 ; Delay between letters
lda      #$00                          ; 0xf671 $B661 A9 00                    ; A = 00
sta      $0489                         ; 0xf673 $B663 8D 89 04                 ; New Letter X Position (offset)
lda      $048A                         ; 0xf676 $B666 AD 8A 04                 ; Next Letter Y Position
clc                                    ; 0xf679 $B669 18                       ;
adc      #$40                          ; 0xf67a $B66A 69 40                    ; Go down 2 tiles (0x10 pixels)
sta      $048A                         ; 0xf67c $B66C 8D 8A 04                 ; New Letter Y Position
jmp      LB752                         ; 0xf67f $B66F 4C 52 B7                 ;

This seems to be related to the FD/FE commands that the text uses to make a new line.
The portion I focused on was the [69 40] in particular.
I tried to change it to [69 20] to try to make the game print to the tile below instead of skipping one.
It DOES print to the tile below, but not without deleting the one above as it prints new letters.
I also tried [69 60] just to try and see what it does when skipping 2 tiles and printing to the third one, and this one effectively makes it so that I can only have 3 lines of text in a textbox (just as a simple test).
But 69 20 keeps removing the line above as it prints letters sadly.

I'll try to see what I can do in the meanwhile with this.
Hopefully that's what you meant by the line skip, if not then I am screwing around somewhere else lol
« Last Edit: April 18, 2018, 12:01:27 pm by ShadowOne333 »

Midna

  • Hero Member
  • *****
  • Posts: 688
  • Resident Panel de Pon Nut
    • View Profile
Re: Zelda II Redux
« Reply #82 on: April 19, 2018, 12:32:55 am »
All you have to do to get an acceptable amount of space out of Zelda 2's message boxes is redo the text drawing code so it doesn't skip the spaces where the dakuten would go in the Japanese version.

njosro

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Zelda II Redux
« Reply #83 on: April 19, 2018, 10:26:27 pm »
There are two things I remember that complicated things.

1. The space above each letter is printed because in the japanese there was a possibility for some characters having those lines (") above them. If you print any character in a certain range it will print (") (but actually comes out as garbage text in the US version since the tileset is different). Otherwise it prints a space character above the letter. So if you find the spot where it does that and get rid of that bit of code then you should probably be able to do the no skipping lines thing without a problem.

2. After printing 4 lines of text the counter wraps around to zero and starts printing from the top again. If I recall correctly, it was because the line number was actually stored as the y position that directly corresponds to the y position on screen, so you can't go down past the last line of text without requiring 2 bytes (which is why the text box is at the height you see in the game). You'd need to make things more complicated and do your own math routine to get past this.


So if you find the code that prints the extra character above the letters and remove it, and then make it increase the y counter by 0x08 instead of 0x10 you should be able to do it. But I'm just going by memory here...

EDIT:
I didn't read Midna's post fully! The dakuten is the symbol I'm talking about when I write this: (")

Trax

  • Sr. Member
  • ****
  • Posts: 444
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #84 on: April 20, 2018, 01:12:50 am »
I have just retrieved the solution in my documents. If you want to go on and find the answer for yourself, I encourage you to do so. But if you prefer for me to provide the answer, I'll do it.

What you have to consider is that everytime a letter is drawn on screen, there's actually 2 tiles that are drawn. The letter itself, and the tile above. The top tile is set to empty (F4), or an accent tile, used initially in the Japanese version, and never happens in the US version, so the tile is always empty. If you want to see what happens visually, go to F416, and replace all F4 values by FE (or whatever tile you want). You will end up with a dialog box with a different background, and the drawn tiles will be visually distinguishable.

Important note. Because of that 2-tile setup, you may lose one line either at the top (original game's setup), or at the bottom. The reason why you can't start at the very top of the interior of the dialog box is that it would overwrite the top border with empty tiles. So, without skipping lines, you can have a clean 7 lines of text instead of 4. Not a bad improvement.

The more advanced alternative would be to remake the drawing macro code so that it uses only one tile and remove the accent tile completely. This is fine until you want to use languages with accented characters.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 960
    • View Profile
Re: Zelda II Redux
« Reply #85 on: April 20, 2018, 02:14:29 pm »
That's some helpful insight from all of you!

So I have to look at the dialogue printing routines and see what they do.
@Trax, if I'm correct you are referring to these:

Code: [Select]
; ---------------------------------------------------------------------------- ;
bank3_Pointer_table_for_rows_of_dialog_box                                     ;
.word    bank3_Tables_for_dialog_box_rows_tile_mappings; 0xf403 $B3F3 07 B4    ;
.word    LB415                         ; 0xf405 $B3F5 15 B4                    ;
.word    LB415                         ; 0xf407 $B3F7 15 B4                    ;
.word    LB415                         ; 0xf409 $B3F9 15 B4                    ;
.word    LB415                         ; 0xf40b $B3FB 15 B4                    ;
.word    LB415                         ; 0xf40d $B3FD 15 B4                    ;
.word    LB415                         ; 0xf40f $B3FF 15 B4                    ;
.word    LB415                         ; 0xf411 $B401 15 B4                    ;
.word    LB415                         ; 0xf413 $B403 15 B4                    ;
.word    bank3_Tables_for_dialog_box_rows_tile_mappings; 0xf415 $B405 07 B4    ;
; ---------------------------------------------------------------------------- ;
bank3_Tables_for_dialog_box_rows_tile_mappings                                 ;
.byt    $CA,$CB,$CB,$CB,$CB,$CB,$CB,$CB; 0xf417 $B407 CA CB CB CB CB CB CB CB  ;
.byt    $CB,$CB,$CB,$CB,$CB,$CA        ; 0xf41f $B40F CB CB CB CB CB CA        ;
LB415                                                                          ;
.byt    $CC,$F4,$F4,$F4,$F4,$F4,$F4,$F4; 0xf425 $B415 CC F4 F4 F4 F4 F4 F4 F4  ;
.byt    $F4,$F4,$F4,$F4                ; 0xf42d $B41D F4 F4 F4 F4              ;
LB421                                                                          ;
.byt    $F4                            ; 0xf431 $B421 F4                       ;
LB422                                                                          ;
.byt    $CC                            ; 0xf432 $B422 CC                       ;
; ---------------------------------------------------------------------------- ;

The part which prints the empty spaces is found at label LB415, and it seems the pointer table right above it uses this very same tilemapping.

Diving a little bit into the disassembly I found this portion of code which seems to control the drawing of the dialogue boxes, and it also utilizes this very same pointers and tilemaps for the empty F4s.

Code: [Select]
; ---------------------------------------------------------------------------- ;
bank3_Dialog_Routines_load_tiles_to_draw_the_dialog_box_lines_and_more__R1     ;
lda      $0525                         ; 0xf0e2 $B0D2 AD 25 05                 ; Routine Delay
asl                                    ; 0xf0e5 $B0D5 0A                       ;
tay                                    ; 0xf0e6 $B0D6 A8                       ;
lda      bank3_Pointer_table_for_rows_of_dialog_box,y; 0xf0e7 $B0D7 B9 F3 B3   ;
sta      L0002                         ; 0xf0ea $B0DA 85 02                    ;
lda      bank3_Pointer_table_for_rows_of_dialog_box+$01,y; 0xf0ec $B0DC B9 F4 B3;
sta      $03                           ; 0xf0ef $B0DF 85 03                    ;
lda      bank3_Pointer_table_for_rows_of_dialog_box+$01+$09,y; 0xf0f1 $B0E1 B9 FD B3;
sta      $04                           ; 0xf0f4 $B0E4 85 04                    ;
lda      bank3_Pointer_table_for_rows_of_dialog_box+$01+$09+$01,y; 0xf0f6 $B0E6 B9 FE B3;
sta      $05                           ; 0xf0f9 $B0E9 85 05                    ;
ldy      #$0D                          ; 0xf0fb $B0EB A0 0D                    ; Y = 0D
LB0ED                                                                          ;
lda      (L0002),y                     ; 0xf0fd $B0ED B1 02                    ;
sta      $053E,y                       ; 0xf0ff $B0EF 99 3E 05                 ;;temp area used to copy from to generate the ppu macro for the spell menu
lda      ($04),y                       ; 0xf102 $B0F2 B1 04                    ;
sta      $054C,y                       ; 0xf104 $B0F4 99 4C 05                 ;
dey                                    ; 0xf107 $B0F7 88                       ;
bpl      LB0ED                         ; 0xf108 $B0F8 10 F3                    ;
jsr      bank3_Palette_modification_routine; 0xf10a $B0FA 20 0B B1             ; Palette modification routine
inc      $0525                         ; 0xf10d $B0FD EE 25 05                 ; Routine Delay
lda      $0525                         ; 0xf110 $B100 AD 25 05                 ;; Routine Delay
cmp      #$05                          ; 0xf113 $B103 C9 05                    ;
bcc      LB10A                         ; 0xf115 $B105 90 03                    ; if A < 05, return
bank3_Dialog_Routines_advance_to_next_routine_in_this_table__R2                ;
inc      $0524                         ; 0xf117 $B107 EE 24 05                 ; advance to next routine...
LB10A                                                                          ;
rts                                    ; 0xf11a $B10A 60                       ;
                                                                               ;
; ---------------------------------------------------------------------------- ;

I'm a little busy at work today, and since weekend is at hand, I won't work on Redux until next Monday (I gotta get myself a PC damnit).
I will try to make out some sense out of it in the weekend though, I'll give it a good read and try to understand how it works :)

Thanks for the help, guys!
It is really appreciated!

Shade Aurion

  • Jr. Member
  • **
  • Posts: 92
  • Shadow Keeper
    • View Profile
    • DudeGoBack
Re: Zelda II Redux
« Reply #86 on: April 22, 2018, 12:28:34 am »
Aside from the above hacks I mention above to incorporate, you should also change Bagu's name to Bug so the Error and Bug reference makes sense. Maybe add a line of dialog on one of them about being brothers or something to tie them together a bit more. I'd def try an incorporate the more accurate title screen and updated link sprites. Also, since you have hearts for health, maybe you could change the magic meter to green using Link's palette?

I had a lot of ideas for Revility. I could copy and paste them here if it helps.
Your work so far looks awesome :3

Rodimus Primal

  • Hero Member
  • *****
  • Posts: 834
    • View Profile
Re: Zelda II Redux
« Reply #87 on: April 22, 2018, 09:02:24 am »
I'm loving most of the improvements done here. I was just thinking though. The Giant Bubble is kind of KNOWN for having a ludicrous amount of HP and reducing it relieves a major issue, but maybe make it take a little bit more than just 5 (maybe 10?) just so that it is still drastically reduced but still retains some of the original feel. Just a suggestion.

As for Bagu's name, maybe Buggu or Buggo might sound better, but Bagu is simply Bug as far as his name. Though, one might think that they are referring to an insect and not a person.

itemdrop

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Zelda II Redux
« Reply #88 on: April 22, 2018, 07:07:08 pm »
the skull bubbles like the lazors that come from the heads are more meant to be something to annoy you not to kill esp in the early game. there something to chase you out of a room and something to take magic away from you. just my opinion but reducing there hits to kill them defeats there purpose.
« Last Edit: April 22, 2018, 08:59:15 pm by itemdrop »

ShadowOne333

  • Hero Member
  • *****
  • Posts: 960
    • View Profile
Re: Zelda II Redux
« Reply #89 on: April 23, 2018, 04:22:17 pm »
Regarding the Skull Bubbles health, yeah I think I will make them have a bit more health than 5 hits.
I will make it 10 so that at least they're not AS easy.

What I did was take one other enemy as a base, in this case one of the Red Stalfos that appear in the first Palace, and then I saw how many hits they took and how much experience they gave in comparison.
The Red Stalfos take 3 hits and give 30 Exp, so I thought having the bubbles take 5 hits and give 50 Exp would be good enough, besides they move somewhat fast and tend to appear alongside other enemies, which means that you have to avoid getting hit or the Bubble will continue its path.
I will NOT restore the Bubble's original health, that's an absurd amount of health to just get 50 Exp back, I think something between 5-10 hits is okay. I am still open to suggestions to the correct amount. I might leave it at 10.

As for Bagu, I think I settled on naming him Bug, plain and simple. :P
Bagu's literal translation to English is Bug, so I will keep the running joke between Error and Bug as the original localization team attempted to do. Besides how could I remove such an iconic phrase of gaming history? lol
So Error and Bug will be their names :)

I had quite a busy weekend and sadly couldn't take a look at the dialogue box routines. :/
I will try to do so this week, hopefully I get a break or two at work to be able to dive into it properly.

itemdrop

  • Jr. Member
  • **
  • Posts: 42
    • View Profile
Re: Zelda II Redux
« Reply #90 on: April 23, 2018, 10:01:13 pm »
of course do what you want its your hack but if your going to make them that easy of a kill people will just grind them at 50 xp so I would suggest moving there xp way down considerably.

Shade Aurion

  • Jr. Member
  • **
  • Posts: 92
  • Shadow Keeper
    • View Profile
    • DudeGoBack
Re: Zelda II Redux
« Reply #91 on: April 24, 2018, 12:56:41 am »
Speaking of rebalancing, I think the Great Palace is one to consider. I know it's meant to be difficult, but its difficult even for seasoned veterans. I know a heap of people who owned the game back in the day, got to the final dungeon and never finished it. The Fokka are just a bit OP. I feel like this could be offset with health or more magic items being strewn about but slightly less health might help those less seasoned. Those Blue Fokka.. well, they're mother fokkas that's for sure.

As for changes to the game, how far are you willing to go. I know you're open to incorporating parts of other hacks but would you be open to added in content, such as maybe an Impa sprite standing by Princess Zelda who tells you the story that the intro doesn't? Maybe put the Prince at King's Tomb. Actually, the FDS version of King's Tomb was better IMHO then just a single screen with a woman stating the obvious.

Revility made a lot of great dialog changes. With his game as a base and your changes, I think that would be the definitive Zelda 2 experience. And RetroAchievements for good measure. Pretty sure that'd draw more people to play your hack too

ultimaweapon

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: Zelda II Redux
« Reply #92 on: April 24, 2018, 05:55:36 am »
What would be even better for the Great Palace is the inclusion of the bosses from the 1st 6 palaces. If someone can find a way to do that, That would be awesome.
Trust in the Heart of the Cards

ShadowOne333

  • Hero Member
  • *****
  • Posts: 960
    • View Profile
Re: Zelda II Redux
« Reply #93 on: April 24, 2018, 10:21:51 am »
Speaking of rebalancing, I think the Great Palace is one to consider. I know it's meant to be difficult, but its difficult even for seasoned veterans. I know a heap of people who owned the game back in the day, got to the final dungeon and never finished it. The Fokka are just a bit OP. I feel like this could be offset with health or more magic items being strewn about but slightly less health might help those less seasoned. Those Blue Fokka.. well, they're mother fokkas that's for sure.

Are those by any chance these little assholes?


Man this was the first enemy I thought of when I mentioned rebalancing some enemies, it's a nightmare going through these guys.
I remember I once got stuck in one of those block structures with a Blue Mofokka jumping in the other side and I was like:
"Goddamnit just de-spawn or something, I wanna get through!"
I freaking despise those guys lol.
It seems Red Fokkas have 48 HP and the Blue ones have double, 96 HP.

If someone has suggestions for rebalancing enemies on the Great Palace, I'm all up for suggestions on those.
You can get an idea of how much HP, damage and other stuff each enemy has in this page:
https://strategywiki.org/wiki/Zelda_II:_The_Adventure_of_Link/Palace_Enemies#Great_Palace

I might have some spare time today, I'll try to focus on changing the health of the Bubbles in the meantime.

Shadic

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Zelda II Redux
« Reply #94 on: April 24, 2018, 11:00:39 am »
I wish it was easy to increase Link's maximum level. Even 8/8/8 can feel fragile in The Great Palace.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 960
    • View Profile
Re: Zelda II Redux
« Reply #95 on: April 24, 2018, 01:11:39 pm »
Okay I found the MoFokkas HP address in the ROM.
I changed the Red Fokka's HP from 48 to 40 and the Blue ones from 96 to 80.
This should at least alleviate a little bit the issues with those two in the Great Palace.

I also changed the Degu Bubble HP from 255 to 60, and the Bubbles in the Great Palace to 30 HP (from the usual 255).
For other Palaces, I made them have double the amount they had.
I think the Bubbles in normal palaces had 0A, I doubled it to 14 in hex.

That should do it right now for the most annoying enemies so far.
I might still edit some more enemies down the road.

Here's the patch with the latest changes:
https://www.dropbox.com/s/9nvida92kyh5svj/Zelda2Redux.ips?dl=0

Also, I found out that some addresses were wrong in the Data Crystal entry for Zelda II.
I took the liberty to fix them up, mostly in the enemy data.

Please be sure to give the newest patch a try and let me know how the Bubbles feel with the new HP, also try out the Great Palace to test the Fokkas and Bubbles HP, same for the Bit/Bot creatures.



As for the dialogue boxes, I will check them during the week, hopefully it's not that hard to remove that line that gets printed above to get at least 7 lines of text per box.

Shade Aurion

  • Jr. Member
  • **
  • Posts: 92
  • Shadow Keeper
    • View Profile
    • DudeGoBack
Re: Zelda II Redux
« Reply #96 on: April 24, 2018, 02:05:35 pm »
Yeah, those mother fuckers.. Literally the worst. You gotta have your shit down or get lucky. There's no in between.
I think there are just too many of the TBH. Especially when you're looking for magic bottles and you accidentally awaken a Fokka out of no where. Desperation for health becomes desperation for survival so quickly lol

Trax

  • Sr. Member
  • ****
  • Posts: 444
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #97 on: April 24, 2018, 05:58:17 pm »
Come on, it's the last palace, it's supposed to be hard as hell. Great Palace = Great Difficulty.

I pretty much agree with ItemDrop about the Bubbles. It's obvious that the 250 HP value was meant to make them look invincible. It's only because you level up your sword power that they become killable with a reasonable amount of hits later in the game. I see two ways to balance the thing:

- Reduce the hit points, but as a tradeoff, also reduce the experience points. Plus, don't make them regenerate between screens (there's a flag for that in Enemy Attributes tables), to avoid obvious grinding.

Or...

- Make them truly invulnerable, as in, your sword goes through. There's a flag for that in the third Attributes Table. This way, they keep their function as annoying enemy that you have to avoid, and you don't have to worry about hit points or experience points.

As for the Fokkas. Yes, they are hard, but it's not like you hack your sword in all directions until they (or you) die. Like any other enemy, they have a pattern and you study the pattern to beat them. The only thing that annoys me is when they throw a flying blade at an odd height while mid-jump, and you're not sure whether you need to duck or not. Both Red and Blue Fokkas have the same movement AI, the only difference is that the Blue one shoots a lot more flying blades. You can't fight them like Iron Knuckles, so you basically have three options:

- Head hit while at the peak of the jump.
- Leg hit just before landing.
- Up thrust anytime while in mid-air. Note that this attack is more likely to hurt you at the same time.

ultimaweapon

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: Zelda II Redux
« Reply #98 on: April 24, 2018, 11:18:48 pm »
Most of the areas where the Blue Fokkas appear, you can use the landscape to your advantage to defeat them. Stay high and when they jump, hit them in the head and repeat the process.

ShadowOne - I figured out how to create a midair jump, but it is always on, so it renders jump magic useless. I haven't figured out how to get it working only when using the Jump spell yet.
Trust in the Heart of the Cards

Shade Aurion

  • Jr. Member
  • **
  • Posts: 92
  • Shadow Keeper
    • View Profile
    • DudeGoBack
Re: Zelda II Redux
« Reply #99 on: April 25, 2018, 04:03:40 am »
Its not like I haven't finished Zelda 2 a number of times :p I can imagine if it were a boss that were really difficult that would make sense but a regular enemy.. its a cop out. Less skilled players hit a brick wall and stop playing and is it really worth keeping the original difficulty just because difficult? I don't think so. If you want the original unbalanced version, that's what the official release is for. I mean the logic for arguing for keeping Fokkas at their original difficulty would be the same if you were arguing against the 'start at the entrance of palace' hack also as that makes things easier too.

I imagine this version of the game would be better if it appealed to more players. Maybe a compromise would be best. Maybe make the Up stab take like a third/quarter of their health? Either way, a regular enemy shouldn't impede a player THAT much that the only way past is precision shots to the head. Also you can't really use the landscape to your advantage when they can launch a volley of penetrating blades through anything. Maybe making their blades stop on blocks would balance things more also.