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

Author Topic: Dragon Warrior 2 Disassembly  (Read 5684 times)

joe73ffdq

  • Full Member
  • ***
  • Posts: 195
    • View Profile
Dragon Warrior 2 Disassembly
« on: April 05, 2018, 06:38:32 pm »
Finally, after several weeks of plugging away at this, I got everything organized the right way. All the data is presented in disassembly form, which made it much easier then how I was doing it before.

There are 2 banks, 04 and 06, where almost all of the found data is. The full rom disassembly is left unmarked. Then there is an index, and one for detailed info.

Characters - Exp, Stats, Equip, Magic
Enemies - Stats, Skills, Formations, Zones, Palettes
Shop and Treasure
Text for - starting names, items, equipment, magic, enemies

Just about all I want to find has been found. The Item drops for Evil Clown and Saber Lion still havent been found yet. Power for all healing and fire spells have been found, except for the 3 fire breath attacks. The next things I would like to find is enemy drops, and see if I can find enemies assigned. I would like to create a blue and red dragon, among a few other ideas. Now with the ability to normalize all the equipment, there will be more varied options, also expanding what can be found in chests. I also want to remove sacrifice and surround, and add healall for poc, and hustle for pom. The last thing I would like to try and figure out, is HP past 256 for characters and enemies. There is a location in ram for this, and if I can find the zero page instruction, then writing new code to add this in, would really expand the options quite a bit.

In DW1 I, found a way to change the damage resistance for Erdricks and magic armor. I took the ASL and expanded it to 3 ASL's. Now every armor can have x16 resistance options, by choosing between ASL, LSR, and NOP, on those 3 bytes. That was my best accomplishment, with total new code of about 225 bytes. I need to find the bank switch in DW2, which I haveent looked for, but it should be similar to DW1 MMC1. There is roughly 80K free space, with the US release being expanded to 256, from the original 128. I am getting a little bit ahead of my self, but when I understand the code, I can branch upon it, even though I have no idea how to write a whole new instruction.

I will admit, that I struggle more with concentration, then I do understanding the code. Using a hex editor all these years, and now I found the mix of good methods. Organize the notes, scan through the disassembly, look for things in fceux, and then use HxD.


With all that said, here we finally have, a good foundation for further disassembly of DW2, now that I finally set it up in an organized manner.


Original thanks to AlexKC, who found the initial data back in 2011. Special thanks to gameboy9, who was finding code left and right 2 years ago, when he was helping me on my DW2 thread  :)  :beer:

Then there are the many people here that have helped me quite a bit. Disch and King Mike in particular, who always give a full scale analysis, and precise direction to find the code I am looking for  :) :beer:



One last thing here, that I was wondering if someone knew about. DragonWarriorX overworld editor sort of works. There is a full interface that edits everything perfectly fine, and even marks coords and location entrances as well. When you try to open the game, all the graphics and tiles are a garbled mess. So it partially works...


If anyone is interested in helping look for code, that would be awesome  :beer:

Now I am finally ready to start the writing process. Starting with Character stats, exp, and magic. Equipment and then enemy stats, abilities, formations, and zoning. Then shop and treasure last.


https://www.dropbox.com/s/dv539hthifv8mw4/DW%202%20Disassembly.zip?dl=0
« Last Edit: April 05, 2018, 06:56:12 pm by joe73ffdq »

DavidtheIdeaMan

  • Hero Member
  • *****
  • Posts: 655
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #1 on: April 05, 2018, 06:40:51 pm »
Nice!

Mari42

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #2 on: April 05, 2018, 06:43:57 pm »
Finally, after several weeks of plugging away at this, I got everything organized the right way. All the data is presented in disassembly form, which made it much easier then how I was doing it before.

There are 2 banks, 04 and 06, where almost all of the found data is. The full rom disassembly is left unmarked. Then there is an index, and one for detailed info.

Characters - Exp, Stats, Equip, Magic
Enemies - Stats, Skills, Formations, Zones, Palettes
Shop and Treasure
Text for - starting names, items, equipment, magic, enemies

Just about all I want to find has been found. The Item drops for Evil Clown and Saber Lion still havent been found yet. Power for all healing and fire spells have been found, except for the 3 fire breath attacks. The next things I would like to find is enemy drops, and see if I can find enemies assigned. I would like to create a blue and red dragon, among a few other ideas. Now with the ability to normalize all the equipment, there will be more varied options, also expanding what can be found in chests. I also want to remove sacrifice and surround, and add healall for poc, and hustle for pom. The last thing I would like to try and figure out, is HP past 256 for characters and enemies. There is a location in ram for this, and if I can find the zero page instruction, then writing new code to add this in, would really expand the options quite a bit.

In DW1 I, found a way to change the damage resistance for Erdricks and magic armor. I took the ASL and expanded it to 3 ASL's. Now every armor can have x16 resistance options, by choosing between ASL, LSR, and NOP, on those 3 bytes. That was my best accomplishment, with total new code of about 225 bytes. I need to find the bank switch in DW2, which I haveent looked for, but it should be similar to DW1 MMC1. There is roughly 80K free space, with the US release being expanded to 256, from the original 128. I am getting a little bit ahead of my self, but when I understand the code, I can branch upon it, even though I have no idea how to write a whole new instruction.

I will admit, that I struggle more with concentration, then I do understanding the code. Using a hex editor all these years, and now I found the mix of good methods. Organize the notes, scan through the disassembly, look for things in fceux, and then use HxD.


With all that said, here we finally have, a good foundation for further disassembly of DW2, now that I finally set it up in an organized manner.


Original thanks to AlexKC, who found the initial data back in 2011. Special thanks to gameboy9, who was finding code left and right 2 years ago, when he was helping me on my DW2 thread  :)  :beer:

Then there are the many people here that have helped me quite a bit. Disch and King Mike in particular, who always give a full scale analysis, and precise direction to find the code I am looking for  :) :beer:



One last thing here, that I was wondering if someone knew about. DragonWarriorX overworld editor sort of works. There is a full interface that edits everything perfectly fine, and even marks coords and location entrances as well. When you try to open the game, all the graphics and tiles are a garbled mess. So it partially works...


If anyone is interested in helping look for code, that would be awesome  :beer:

Now I am finally ready to start the writing process. Starting with Character stats, exp, and magic. Equipment and then enemy stats, abilities, formations, and zoning. Then shop and treasure last.


https://www.dropbox.com/preview/Public/DW%202%20Disassembly.zip?role=personal

It said that it doesn't exist. :<

joe73ffdq

  • Full Member
  • ***
  • Posts: 195
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #3 on: April 05, 2018, 06:46:59 pm »


https://www.dropbox.com/s/dv539hthifv8mw4/DW%202%20Disassembly.zip?dl=0



I copied the new link above. Let me know if it still isnt working.



Character development is almost done, and then enemies next. My goal for the end of April still looks possible. Hopefully there are others interested in this great under rated game as well  :beer:
« Last Edit: April 09, 2018, 11:01:03 pm by joe73ffdq »

joe73ffdq

  • Full Member
  • ***
  • Posts: 195
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #4 on: April 20, 2018, 04:04:59 am »
Check this out. I discovered how to change the enemies, and this is what I have decided on.


Here are screen shots of all the enemies in each family. The following have been removed...

Ghost Mouse
Ghost Rat
Enchanter
Poison Lily
Evil Tree
Hork

https://imageshack.com/a/img922/6112/hfOuqg.png ... Slimes

https://imageshack.com/a/img924/9723/zDifxZ.png ... Drakees

https://imageshack.com/a/img923/4494/hQZGVX.png ... Snakes

https://imageshack.com/a/img922/2162/gIhkTm.png ... Cats

https://imageshack.com/a/img923/5017/zSRkzQ.png ... Dragons

https://imageshack.com/a/img922/9895/DSRB1b.png ... Name changes



Aside of that, I have all the character, magic, and equipment stuff done



Str-Agi-HP-MP

Lv-10/09/08 : -48/037/023 ... -40/-43/-48 .... -73/-62/-51 .... -54/-60
Lv-24/23/20 : 104/085/063 ... -92/102/114 ... 141/123/101 ... 121/136
Lv-32/31/28 : 132/113/082 ... 120/133/151 ... 186/173/158 ... 158/192
Lv-50/45/35 : 160/140/110 ... 150/160/180 ... 250/225/200 ... 200/240



Cannock Spells :

Heal     
Antidote
Healmore
Return   
Healall 
Stepguard
Revive   

Firebal 
Heal     
Stopspell
Healmore
Firebane
Increase
Defeat   
Healall 


Moonbrooke Spells :

Antidote
Healmore
Outside 
Return   
Repel   
Stepguard
Open     

Infernos
Sleep   
Firebane
Healmore
Explodet
Defense
Confuse
Hustle 


Equipment

-3 : Bamboo Stick
-5 : Falcon Sword
10 : Club
14 : Magic Knife
18 : Copper Sword
25 : Chain Sickle
27 : Wizard's Wand
32 : Iron Spear
40 : Broad Sword
45 : Staff of Thunder
50 : Erdrick's Sword
60 : Giant Hammer
63 : Staff of Destruction
70 : Light Sword
80 : Dragon Killer
90 : Thunder Sword

-4 : Clothes
12 : Leather Armor
20 : Chain Mail
25 : Cloak of Evasion
30 : Bronze Armor
40 : Silver Armor
40 : Mink Coat
50 : Gold Armor
60 : Water Flying
60 : Diamond Armor
70 : Erdrick's Armor

-5 : Leather Shield
12 : Scale Shield
20 : Iron Shield
30 : Power Shield
40 : Erdrick's Shield

-8 : Mysterious Hat
15 : Iron Helmet
25 : Erdrick's Helmet



Enemy set up

#01 : Slime
#02 : Field Slug
#09 : Army Ant
#04 : Drakee
#14 : Red Slime
#05 : Wild Mouse..........Spring/Lake
#1f : Pit Viper
#03 : Iron Ant

#0a : Magician............Hamlin
#08 : Babble
#15 : Baboon
#13 : Smoke
#06 : Healer
#0e : Magidrakee
#0b : Giant Rat...........Tower
#0f : Centipod
#0d : Magic Ant
#11 : Lizard Fly
#12 : Zombie
#16 : Carnivog............West of Moonbrooke
#17 : Megapede
#20 : Mummy Man
#07 : Saber Leopard
#30 : Metal Slime
   
#18 : Sea Slug............Ocean
#10 : Man O’ War
#19 : Medusa
#1a : Drakeema
#1d : Demighost
#21 : Gorgon
#2e : Hawk Man


#1b : Mud Man.............Tantegel
#1c : Magic Baboon
#1e : Gremlin.............Lighthouse
#25 : Undead
#0c : King Cobra
#27 : Goopi
#22 : Saber Tiger.........Beran/Well/Oster
#24 : Titan Tree
#23 : Dragon Fly
#28 : Orc
#2a : Mummy
#2c : Gas
#2f : Sorcerer

#31 : Hunter..............Tuhn
#33 : Hibabango
#34 : Graboopi
#35 : Gold Orc............Moon/Sea Cave
#29 : Puppet Man
#32 : Evil Eye
#48 : Flame
#37 : Ghoul
#36 : Evil Clown
#39 : Mega Knight
#38 : Vampirus
#3a : Saber Lion
#46 : Green Dragon
#42 : Metal Babble

#3c : Ozwarg..............CTR
#3d : Dark Eye
#3e : Gargoyle
#3b : Metal Hunter
#3f : Orc King
#41 : Berserker
#26 : Basilisk
#49 : Silver Batboon
#40 : Magic Vampirus

#4a : Blizzard............Rhone
#44 : Cyclops
#43 : Hargon’s Knight
#2b : Blue Dragon
#47 : Mace Master
#4b : Giant
#4c : Gold Batboon
#45 : Attack Bot
#4d : Bullwong
#2d : Red Dragon
   
#4e : Atlas
#4f : Bazuzu
#50 : Zarlox
#51 : Hargon
#52 : Malroth




Now I can set up the enemies, and test the level ups.

This is moving along much better then I expected. I found the way to change enemies, by checking pointers to each palette set, and sure enough it was right before palettes. Enemy drops havent been found yet, but there is a GG code which narrows down the search area. Aside of that, there are just 2 things that will make this complete, and that is the Evil Clown/Saber Lion drops, which is still elusive.


With all that said, tell me what you guys think. There is now some vast options for DW2, similar to what DW3 has, maybe even more. I wanted FF1 hacking abilities for this game, and now it comes close, except for sprites and dialogue.

Im actually around 50% done now, depending on how long enemy set up takes.


This rocks  :beer:
« Last Edit: April 20, 2018, 04:20:46 am by joe73ffdq »

releasethedogs

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #5 on: April 30, 2018, 11:03:04 pm »
this has me excited.
thanks for doing it.
can you tell how the battle system work?

joe73ffdq

  • Full Member
  • ***
  • Posts: 195
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #6 on: May 03, 2018, 06:38:08 pm »
The battle system is the same as all classic RPG's, turn based. Specifically though, each formation can have up to 6 possible enemies, with each slot having a different % rate. Aside of that there are special battles, which have a 25% chance to occur instead of the normal formation. There is a 75% chance for the normal formation, and 25% for the special battle to occur.

#1 : 1-6 enemies - very high chance
#2 : 1-6 enemies - high chance
#3 : 1-6 enemies - Medium chance
#4 : 1-1 enemies - low chance
#5 : 3-6 enemies - low medium chance
#6 : 1-1 enemies - low chance

Depending on the formation #, there will be 1-3, 1-4, 1-6, 3-3, 3-4, or 3-6 enemies.

Here is the likely occurrence rate.

#1
#2
#3
#5
Special battle
#4
#6

#1-4 can appear in the same battle
#5-6 will appear alone
Special battles can have up to 4 enemies

There are 64 regular formations, and 13 special battles. 64 total special battles, but only 13 are changeable.


This is where I am at right now. Setting up all the formations and zones. Most of it is similar to the usual formations, but here are the new ones.

Saber Leopards west of Moonbrooke
Slime, Red Slime, Metal Slime, Drakee, Magidrakee, and Drakeema in Tantegal region
Green Dragon rare chance in the lower levels of Charlock Castle
Iron Ant and King Cobra in the Lighthouse
Demighost now in the ocean, and Gorgon being the most powerful
Green Dragons in Tuhn region, Moon Tower, Sea Cave, and CTR
Cyclops, Blue Dragon, and Magic Vampirus, rare chance in Tuhn region
Blue Dragon rare chance in Sea Cave, regular chance in the upper levels of CTR and Rhone
Red Dragon rare chance in Rhone, and regular chance in Hargons Castle


I am currently deciding on formations for Hamlin, Moonbrooke, and Wind Tower. Once I get further, I will have to see how well all these ideas will work. I already know that dragons will appear as singles, until deep into CTR and Rhone itself. Aside of that, many formations will be based on my favorite enemies.


Thank you for taking interest in this project  :beer:

This enemy set up is proving to be a little difficult, and what looks good on paper plays out differently in battle. I have the first 10 enemies pretty much all set, and equipment power/prices decided through Hamlin. Right now I am finalizing what enemies will appear where, and then I will create enemy stats/abilities from Hamlin and beyond.

I started to stall on this in the past week, but hopefully I can plow through this zoning thing, and actually complete a project for the first time.

releasethedogs

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #7 on: June 19, 2018, 02:07:48 am »
Sorry, I had forgotten i posted here and then got busy IRL.
What I meant was, can you understand how the game determines if you hit the monsters and how much damage you do? Can you tell how the game decides if you get a "tremendous blow" power attack? stuff like that, the mechanics behind the game.

abw

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #8 on: July 07, 2019, 04:04:59 pm »
Hmm, this is a bit of a necro-post, but it does seem like the most relevant thread around...

Following some recent text-based work on Dragon Warrior II including a complete translation and helping out with two separate script update projects, I created a full disassembly of Dragon Warrior II and have been puttering away at documenting it in my free time for the past couple of months. I've made a fair bit of progress, but there is still a long way to go, and since I know there are a few other people interested in looking at this (and maybe contributing to it?), I decided that rather than sitting on this until it's "done" (whatever that means :P), I ought to post what I've got on the wiki (https://datacrystal.romhacking.net/wiki/Dragon_Warrior_II::ROM_map/ASM), so this is simply an announcement to say that I've done so!

Chicken Knife

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #9 on: July 08, 2019, 03:32:59 pm »
Thanks for posting this abw and for all the work that went into it. I'm sure it will be of some help when I eventually strive to restore the cross shaped background tiles in Hargon's Castle--eventually meaning when I shift my brain out of script writing and back into hacking.

abw

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #10 on: July 08, 2019, 09:20:15 pm »
Thanks for posting this abw and for all the work that went into it. I'm sure it will be of some help when I eventually strive to restore the cross shaped background tiles in Hargon's Castle--eventually meaning when I shift my brain out of script writing and back into hacking.
Ohh, the maps... those were not stored anything like the way I was expecting, which explains why it was hard to find the map data by searching for hex values in the ROM.

Instead of storing the map itself, the game stores instructions for building the map. For instance, when entering Leftwyne, it starts by filling the map with grass tiles, then adds a rectangular blob of sand from ($12, $10) to ($16, $16), adds a blob of trees from ($09, $0F) to ($0C, $16), and goes on a tree-drawing spree (and by "drawing" I mean taking its tree-planting pen, touching it to the map in one spot, dragging it around for a while to make shapes, picking it up and moving it to a new spot, and then touching down again to continue drawing more shapes), part of which overwrites the bottom-right corner of the sand blob it drew earlier. After that it switches to whatever that dark green grass is supposed to be (bushes? clover? long grass? I dunno), and repeats the process for each of the different map tile types. Of the 35 sand tiles from that first blob, only 15 survive not being overwritten by other tiles :P. Once it's done with the background and base layer, it proceeds to add in the roofed sections and switch the tile IDs for vertically adjacent horizontal wall tiles to the vertical wall tile. All of this is done in bits, not bytes, with the width of a map co-ordinate calculated based on the map size, the width of a tile ID set by #$02 + the high 2 bits of the 3rd byte of map data, and map control codes being 1 or 2 bits wide. Oh, and the map drawing system maintains its own separate stack in cartridge RAM. The action all starts at $02:$AB89 if you want to take a look for yourself; I only got partway through documenting the code before walking away in disgust calling it quits for the day.

Or in other words, map editing is going to be so much more complicated than it needed to be :'(.

Chicken Knife

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #11 on: July 08, 2019, 09:37:00 pm »
Ohh, the maps... those were not stored anything like the way I was expecting, which explains why it was hard to find the map data by searching for hex values in the ROM.

Instead of storing the map itself, the game stores instructions for building the map. For instance, when entering Leftwyne, it starts by filling the map with grass tiles, then adds a rectangular blob of sand from ($12, $10) to ($16, $16), adds a blob of trees from ($09, $0F) to ($0C, $16), and goes on a tree-drawing spree (and by "drawing" I mean taking its tree-planting pen, touching it to the map in one spot, dragging it around for a while to make shapes, picking it up and moving it to a new spot, and then touching down again to continue drawing more shapes), part of which overwrites the bottom-right corner of the sand blob it drew earlier. After that it switches to whatever that dark green grass is supposed to be (bushes? clover? long grass? I dunno), and repeats the process for each of the different map tile types. Of the 35 sand tiles from that first blob, only 15 survive not being overwritten by other tiles :P. Once it's done with the background and base layer, it proceeds to add in the roofed sections and switch the tile IDs for vertically adjacent horizontal wall tiles to the vertical wall tile. All of this is done in bits, not bytes, with the width of a map co-ordinate calculated based on the map size, the width of a tile ID set by #$02 + the high 2 bits of the 3rd byte of map data, and map control codes being 1 or 2 bits wide. Oh, and the map drawing system maintains its own separate stack in cartridge RAM. The action all starts at $02:$AB89 if you want to take a look for yourself; I only got partway through documenting the code before walking away in disgust calling it quits for the day.

Or in other words, map editing is going to be so much more complicated than it needed to be :'(.
This all sounds frightfully difficult to manipulate.

But how difficult would it be to locate the section of code that controls that castle layout and essentially replace it with the related code from the Japanese version?

Cyneprepou4uk

  • Full Member
  • ***
  • Posts: 186
  • Самый лысый ромхакер
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #12 on: July 09, 2019, 11:59:17 am »
and by "drawing" I mean taking its tree-planting pen, touching it to the map in one spot, dragging it around for a while to make shapes, picking it up and moving it to a new spot, and then touching down again to continue drawing more shapes
I like that explanation of yours :)
I am the baldest romhacker
NES Romhacking Guide

abw

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #13 on: July 09, 2019, 08:43:41 pm »
But how difficult would it be to locate the section of code that controls that castle layout and essentially replace it with the related code from the Japanese version?
Good idea, but in this case it looks like it won't work. After spending a few minutes comparing against the Japanese ROM, both the way the map data is stored and the code for drawing maps appear to be completely different than in the English ROM despite generating basically the same thing on screen. At this point I'll refrain from guessing as to why the map system was changed between versions.

I like that explanation of yours :)
Thanks! :)

Chicken Knife

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #14 on: July 09, 2019, 10:38:51 pm »
Good idea, but in this case it looks like it won't work. After spending a few minutes comparing against the Japanese ROM, both the way the map data is stored and the code for drawing maps appear to be completely different than in the English ROM despite generating basically the same thing on screen. At this point I'll refrain from guessing as to why the map system was changed between versions.
Thanks! :)
How could you not realize why it was changed? Clearly the Japanese system wasn't convoluted enough so they had to remedy the matter.

abw

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #15 on: July 11, 2019, 10:50:36 pm »
How could you not realize why it was changed? Clearly the Japanese system wasn't convoluted enough so they had to remedy the matter.
Clearly :P. I didn't dig in to the Japanese routines enough to see what they were doing, just that they weren't doing the same things as the English routines, but without the cartridge RAM to store the final map in, the Japanese won't be able to spend too much time on loading map data as you walk around, so I imagine it would be simpler.

I'm sure it will be of some help when I eventually strive to restore the cross shaped background tiles in Hargon's Castle
I put some more time into documenting the map code and updated bank 2 on the wiki with the results. I also dumped the map for Hargon's Castle 1F, rewrote the instructions for drawing that part of the map, and inserted the new instructions. The end result seemed to work out pretty well!

Esco

  • Full Member
  • ***
  • Posts: 130
  • Esco.... nuff said!
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #16 on: July 12, 2019, 03:50:10 am »
I will never understand why someone hasn't just created a nes or snes level DW engine by now. It's simple enough and this game is very easy to reproduce on something like Unity.

Also, and I'm pretty sure I'm alone here, this game is my absolute favorite in the series! So difficult and relentless, yet you can still get to Rhone without dying once if you know what you are doing and without grinding to insane levels. Now getting thru Rhone without a single death while getting hit by defeats, explodets, enemies with criticals and the occasional sacrifice thrown at you from a gold batboons? Different story.... but still doable.
Esco.... the original Nuyorican Latin Lover! And creator of the Castlevania: Symphony of the Night engine!

My Patreon page for the Castlevania: SOTN HACKED Engine: http://sotnhacked.wordpress.com/

Chicken Knife

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #17 on: July 12, 2019, 12:41:24 pm »
I put some more time into documenting the map code and updated bank 2 on the wiki with the results. I also dumped the map for Hargon's Castle 1F, rewrote the instructions for drawing that part of the map, and inserted the new instructions. The end result seemed to work out pretty well!
I'm..... so excited to see this that I'm about to call my boss and tell him I have a family emergency and need to leave work immediately.

I will never understand why someone hasn't just created a nes or snes level DW engine by now. It's simple enough and this game is very easy to reproduce on something like Unity.

Also, and I'm pretty sure I'm alone here, this game is my absolute favorite in the series! So difficult and relentless, yet you can still get to Rhone without dying once if you know what you are doing and without grinding to insane levels. Now getting thru Rhone without a single death while getting hit by defeats, explodets, enemies with criticals and the occasional sacrifice thrown at you from a gold batboons? Different story.... but still doable.
While there are numerous games in the DQ series that I absolutely adore for various reasons, I agree that 2 stands out proudly. It puts off new players like no other game in the series but there is something incredibly satisfying in replaying it for someone like me who goes through the same rpgs 20 times or more. (while totally ignoring an ever growing pile of ones I need to play)

Choppasmith

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #18 on: July 15, 2019, 12:37:06 pm »
Hmm, this is a bit of a necro-post, but it does seem like the most relevant thread around...

Following some recent text-based work on Dragon Warrior II including a complete translation and helping out with two separate script update projects, I created a full disassembly of Dragon Warrior II and have been puttering away at documenting it in my free time for the past couple of months. I've made a fair bit of progress, but there is still a long way to go, and since I know there are a few other people interested in looking at this (and maybe contributing to it?), I decided that rather than sitting on this until it's "done" (whatever that means :P), I ought to post what I've got on the wiki (https://datacrystal.romhacking.net/wiki/Dragon_Warrior_II::ROM_map/ASM), so this is simply an announcement to say that I've done so!

Well done with all of this! I was a little curious about monster counts in battle.

Code: [Select]
0x011523|$04:$9513:8D 61 01 STA $0161  ; current monster ID
0x011526|$04:$9516:A2 00    LDX #$00   
0x011528|$04:$9518:20 D6 9C JSR $9CD6  ; write monster name in A (+ monster number within its group in X, if > 0) to $6119
0x01152B|$04:$951B:CE D8 60 DEC $60D8 
0x01152E|$04:$951E:D0 0D    BNE $952D 
0x011530|$04:$9520:A6 A8    LDX $A8   
0x011532|$04:$9522:CA      DEX       
0x011533|$04:$9523:D0 04    BNE $9529 
0x011535|$04:$9525:A9 54    LDA #$54    ; String ID #$0054: [cardinal #] [monster(s)][line]appeared.[end-FC]
0x011537|$04:$9527:D0 06    BNE $952F 
; control flow target (from $9523)
0x011539|$04:$9529:A9 53    LDA #$53    ; String ID #$0053: And [cardinal #] [monster(s)][line]appeared.[end-FC]
0x01153B|$04:$952B:D0 02    BNE $952F 
; control flow target (from $951E)
0x01153D|$04:$952D:A9 01    LDA #$01    ; String ID #$0001: [cardinal #] [monster(s)],[end-FC]
; control flow target (from $9527, $952B)
0x01153F|$04:$952F:20 CA 9C JSR $9CCA  ; for A < #$60, display string ID specified by A; for A >= #$60, display string ID specified by A + #$A0

I'm assuming it works like this:

One Enemy/group= Just String 54 is used
Two Groups= String 54 and 53 is used together
Three (or more) groups: Start with String 1, then 54, then 53

Is that right? 3 Group battles are kind of hard and uncommon to pull up in game so it's hard to test.

abw

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: Dragon Warrior 2 Disassembly
« Reply #19 on: July 15, 2019, 11:14:43 pm »
I'm..... so excited to see this that I'm about to call my boss and tell him I have a family emergency and need to leave work immediately.
That's maybe going just a wee bit overboard, but I appreciate the enthusiasm nonetheless :laugh:.

While there are numerous games in the DQ series that I absolutely adore for various reasons, I agree that 2 stands out proudly. It puts off new players like no other game in the series but there is something incredibly satisfying in replaying it for someone like me who goes through the same rpgs 20 times or more. (while totally ignoring an ever growing pile of ones I need to play)
Working on the same game for months or even years can sometimes leave you sick and tired of the game, and 2 was never my favourite to begin with, but working on its disassembly has been an oddly captivating experience. I actually put together a little script for tracing through the map building process and displaying the map as it gets built up step by step, and there's a certain kind of beauty to watching it in action, something that you never get to see as a player, something that maybe nobody except the original dev team ever saw.

I was a little curious about monster counts in battle.
[...]
I'm assuming it works like this:

One Enemy/group= Just String 54 is used
Two Groups= String 54 and 53 is used together
Three (or more) groups: Start with String 1, then 54, then 53

Is that right? 3 Group battles are kind of hard and uncommon to pull up in game so it's hard to test.
Bank 4 would be a good place to start if you want to take a stab at figuring out what the code is doing - there's plenty of identified data scattered about (with the caveat that some of the notes might not be completely accurate), and once you know what a section of code is generally about, filling in the missing parts usually isn't too hard. Here, it's more like this:
One Group = Just String 54 is used
Two or More Groups = Use String 1 until only 1 group is left then use 53

For groups of 3, try hanging out around Leftwyne/Cannock. It shouldn't take too many tries to run into some combination of Big Slugs, Iron Ants, and Drakees.