Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: gameboy9 on February 07, 2016, 08:13:35 am

Title: Dragon Warrior 3
Post by: gameboy9 on February 07, 2016, 08:13:35 am
As I am nearing completion of version 1.0 of the Dragon Warrior 2 randomizer, I'm going to start pecking at the ROM for Dragon Warrior 3 so I can program a randomizer for that game.  I'm well aware that the mechanics of the game are very clear; there are numerous places to look around to figure those out.  What I don't have a ton of is where all of these mechanics are in the ROM.  So I'll be listing things I will be looking for as this post progresses.  If you know of ROM addresses via a place I haven't found yet via searches, please let me know.  As always, feel free to contribute if you wish.

Here's what I have found or what I've discovered via forums so far, as well as GGGuy with codes I've run into, and what I'm looking for:

ENCOUNTER RATES: $934-$945 <----------- Might want to adjust this for randomizer racing purposes...
WORLD MAP ENCOUNTER TILES: $946-$A45 <--------- Don't think is is relevant to randomizer...
ALEFGARD ENCOUTNER TILES: $A46-$A85 <----------- Don't think this is relevant to randomizer...
Boss fights:  0x8ee-0x918
Boss quantities:  0x919-0x944 (+/-)
Monster Zones: 0xaeb-0x107a

Who equips weapons/etc:  0x1147-0x11b2(latter +/-, Hr = byte 0, Wz = byte 1, Pg = byte 2, Sg = byte 3, Sr = byte 4, Mr = byte 5, Gf = byte 6, Fi = byte 7)
Equipment/item prices:  0x11b3-0x123a (MOD 4 = 0, x1, 1, x10, 2, x100, 3, x1000) AND 0x123b-0x12c2 (multiplier to the first address range) (far more complicated than DW2... that was VERY clever, Enix... VERY clever...)

STAT FORMULAS: $28D6-$29C5
MONSTER STATS: $32D3-$3F38 <------ The data crystal and a forum post on another site has all the specifics I need to get messy...
Monster treasure drop chances:  INCLUDED with the monster stats, above
Seed effects:  0x31ed-0x320a (+/-)
Spell Costs:  0x13462-0x1349F
SPELL POWER: $134A1-$134C4
Item effects (links to a spell in DW3):  0x13280-0x13293 (+/-)
Who spells affect:  ???????????????????
When spells are learned:  0x29D6 for Hero, 0x2A15 for Pilgrim, 0x2A54 for Wizard, 0x2A93 for Sage
What spells are learned:  0x22E7 for Hero, 0x2307 for Pilgrim, 0x2327 for Wizard
PREVIOUS 2 LINES:  Please see http://www.angelfire.com/comics2/fatboy9175/DW3Spell.txt for more details
BASE STATS: $1F23E-$1F28A
WEAPON POWER: $27990-$279D6
Inn prices:  0x367c1-0x367da
House of healing cost:  ????????????????
What is available in stores:  0x36838-0x368b3 (weapons stores), 0x368b4-3692f (item stores) - each store ending with a byte 80 higher than usual... TRICKY!  TEN item maximum!
Battle speeds:  ?????????????????? (in order to get battles to move just as fast or even faster as mashing the A button)
Reduced spell flashing, monster flashing, damage shaking:  ????????????????? (will have to debug to figure this out)
Treasure locations:  0x29238 (Wayfarer's @ Promontory Cave), ??????????????????
Starting gold:  0x2914F (could give a bunch possibly with 0x29162...)
Starting equipment:  ??????????????? (probably want to start all characters the same way as in DW2R... Bamboo stick and clothes)

Experience to gain for the next level... or the formula to such:  ???????????????????? (will need to debug to determine this I think)
Experience multiplier:  0x282FD (increase/decrease to adjust the multiplier - might not need the above since EXP maxes at 9,999,999 and monster EXP maxes at 65,535 this time)

Text: $AA28-$BA48 (labels for towns, items, weapons, enemies etc.) <------ Might use this... I doubt it

Default names for Lucia's Eatery:  0x1ed52-0x1edb1
Title: Re: Dragon Warrior 3
Post by: joe73ffdq on February 07, 2016, 11:50:57 pm
This is from 1who

ENCOUNTER RATES: $934-$945
WORLD MAP ENCOUNTER TILES: $946-$A45
ALEFGARD ENCOUTNER TILES: $A46-$A85
MONSTER LISTS: $ADB-$106A
STAT FORMULAS: $28D6-$29C5
MONSTER STATS: $32D3-$3F38
SPELL POWER: $134A1-$134C4
WORLD MAP: $14018-???
ALEFGARD MAP: $15A95-???
BASE STATS: $1F23E-$1F284
WEAPON POWER: $27990-$279D6

Graphics: $20000-$27FFF (Bank 6-7) Sprites, Map tiles
$5C000-$6BFFF (Bank 24-27) Title Screen, Credits (code interspersed everywhere, hack at your own peril)

Text: $AA28-$BA48 (labels for towns, items, weapons, enemies etc.)
$1F767-$1FDB6 (credits)
$29527-$2970F (ending)
$39139-$39D97 (menus)
$3ADEB-$3AE8F (misc. pronouns, numbers)
$40000-$56187 (game script)


There is a couple repeats with what you already have.
Title: Re: Dragon Warrior 3
Post by: gameboy9 on February 08, 2016, 07:30:33 pm
Wow... this is astounding... all of the EXP programmed in the ROM is increased by 33%... that's why all of the EXP is reduced by 33% in the GBC version.

What I'm saying is that a slime, for example, is programmed in the ROM to score 4 EXP, but the program increases that by 33% to 5 EXP, then it divides it by 4 points for the number of characters in the game.

The way they do it is really weird... say you beat four slimes for 16 points.  It doubles the score 24 times... but when you go over the 3 byte limit three times, you add one point and reset the points earned to 1 point and continue doubling, but you add an additional point for each time after that... and apparently that's how you add 33% to all experience earned!  Amazing!

Dividing by 3 is hard when you have to divide in binary...

Anyway, to add or reduce XP greatly, you can change byte 0x282FD from 18 (the 24 doubles)... if you change it to 0, then you get millions of XP!  (and a bazillion level ups...)
Title: Re: Dragon Warrior 3
Post by: Reiska on February 08, 2016, 09:56:18 pm
Wow... this is astounding... all of the EXP programmed in the ROM is increased by 33%... that's why all of the EXP is reduced by 33% in the GBC version.

What I'm saying is that a slime, for example, is programmed in the ROM to score 4 EXP, but the program increases that by 33% to 5 EXP, then it divides it by 4 points for the number of characters in the game.

The way they do it is really weird... say you beat four slimes for 16 points.  It doubles the score 24 times... but when you go over the 3 byte limit three times, you add one point and reset the points earned to 1 point and continue doubling, but you add an additional point for each time after that... and apparently that's how you add 33% to all experience earned!  Amazing!

Dividing by 3 is hard when you have to divide in binary...

This was a change for the US localization on NES, I believe.  Gold is also changed in this version (increased by 20%).
Title: Re: Dragon Warrior 3
Post by: tvtoon on February 09, 2016, 09:47:07 am
Dividing by 3 is hard when you have to divide in binary...

Anyway, to add or reduce XP greatly, you can change byte 0x282FD from 18 (the 24 doubles)... if you change it to 0, then you get millions of XP!  (and a bazillion level ups...)
They are probably avoiding overflow.

You must take into consideration the Dharma Shrine location in a randomizer, I mean, it is better to make it as close as possible. ;)
Title: Re: Dragon Warrior 3
Post by: gameboy9 on February 10, 2016, 08:54:05 am
You must take into consideration the Dharma Shrine location in a randomizer, I mean, it is better to make it as close as possible. ;)

LOL!  You mean move it next to Aliahan?  Well, I like the idea... but I'm terrible at map manipulation.  :(  But... perhaps I can throw out that level 20 requirement.  Hmmmm...
Title: Re: Dragon Warrior 3
Post by: gameboy9 on February 20, 2016, 02:23:22 pm
And now the massive treasure hunting post!  There are 200(!) treasures you can get in DW3.  This counts items that are found on the ground, or items that are given to you via NPCs. (for example, the Thief's Key, or the Magic Ball)

Also, anything that might be marked 0x80+ is 8G / 1 over 0x80.  7F = 1016G, FC = Meteorite Armband with Skeleton, FD = Maneater Chest, FE = Mimic, and FF = Empty

0x29237-0x29239 - Promontory Cave
0x2927B-0x2927D - Najimi Tower Basement
0x292C4-0x292C6 - Najimi Tower
0x37DF1 = Thief's Key NPC
0x375A9 = Magic Ball NPC
0x2927E-0x2927F - Invitation Cave/Enticement Cave
0x29234-0x29235 - Kanave
0x29252, 0x292D2, 0x292E6 - Champange Tower (the last is the Golden Crown)
0x2925C - Meteorite Armband with Skeleton (change to 4B to be awarded the Meteorite Armband WITHOUT the skeleton... it'd make a great joke to have a skeleton appear in a treasure chest somewhere else though!  :) )
0x2925D-0x29264, 0x31B9C - Isis Castle (rest of treasures) and Wizard's Ring
0x317F4 - Golden Claw (Pyramid Basement)
0x29249-0x2924F - Pyramid, 1st floor
0x292B4-0x292C2 - Pyramid, 3rd, 4th, and 5th floors
0x2923A, 0x2923B, 0x29280-0x29287 - Dream Cave
0x3B785 - Wake Up Powder NPC
0x29255-0x29259 - Aliahan
0x29269-0x2926B, 0x37CB9 - Portuga (with Royal Scroll)
0x2923C, 0x2923D - Dwarf Cave
0x2923E-0x29243, 0x2928B-0x2928E - Kidnapper's Cave
0x377D4 - Black Pepper NPC
0x31B94, 0x29270, 0x37828 - Tedan, Green Orb
0x29251, 0x292C7-0x292CA - Garuna Tower
0x292E4, 0x292E7 - Noh Mask, Purple Orb (Jipang)
0x377FE - Water Blaster NPC
0x29271-0x29273 - Pirate Cove
0x2925B - Eginbear (Vase Of Drought)
0x2922B - Final Key
0x292CB-0x292D1 - Arp Tower
0x31B8C - Soo (Staff Of Thunder)
0x29291-0x292A7 - Samanao Cave
0x292E5 - Samanao Castle (Staff Of Change)
0x29244-0x29248, 0x2928F, 0x29290 - Lancel Cave
0x31B97 - Luzami (Intelligence Seed)
0x2926C, 0x2926D, 0x31B80 - New Town (Yellow Orb)
0x378A9 - Sailor's Thigh Bone NPC
0x29275-0x2927A - Ghost Ship
0x31B84 - Sword Of Gaia
0x29288-0x2928A - Necrogund Cave
0x37907 - Purple Orb NPC
0x31B9F - Leaf Of The World Tree
0x37929 - Sphere Of Light NPC
0x29228-0x2922A - Baramos Castle
0x37a25 - Portuga post-Baramos NPC (Sword Of Illusion)
0x29265-0x29268 - Tantegel Castle
0x292A8-0x292AC - "Erdrick's Cave"
0x29274 - Silver Harp
0x292DF-0x292E3 - Rocky Mountain Cave
0x31B90 - Oricon
0x31B88 - Fairy Flute
0x29253, 0x29254, 0x292D5-0x292DE - Kol Tower
0x37D5A - Sacred Amulet NPC
0x37D9D - Staff Of Rain NPC
0x37D80 - Rainbow Drop NPC
0x29233 - Rimuldar (Life Ring)
0x292AD-0x292B3 - Zoma Castle

Geez... lots of randomization here!  (Yes, I plan on randomizing even most of the NPCs!)
Title: Re: Dragon Warrior 3
Post by: zonk47 on February 20, 2016, 04:56:21 pm
Might as well add the experience tables to the list... they take up a good chunk of ROM. (hint: they aren't well disguised)

Title: Re: Dragon Warrior 3
Post by: gameboy9 on February 26, 2016, 10:25:53 pm
I'm afraid not... from reading forum posts on GameFAQs, I think it's a formula instead, due to the large amount of ROM space it would take.  (3 bytes * 98 levels * 8 classes = 2,376 bytes, 0.5% of the ROM file)

Here are the ways this game is going to be sped up in the randomizer. (very similar to the DW2 randomizer)

0x00852 - Animation of transition from field to battle.  Change from 10 -> 02 to remove said animation, saving 14 frames / start of battle
0x008ce - Flashing before the start of a battle.  0C -> 01 = 11 frames saved / start of battle
0x0980D - Flashing of magic spells.  08 -> 01 = 7 (14?) frames / spell casted
0x09827-0x09829 - Change this to EA to kill all flashing of magic spells altogether.
0x09957 - Enemy flashing when they get hit.  Change from 04 -> 01 (4 flashes to 1 flash) to save at least 6 frames / hit... probably more like 12 frames / hit.
0x09882 - Shaking of screen when you get hit.  Change from 0C -> 02 to save 10 frames / hit. (any odd number screws up the screen)
0x13A65-0x13A6B - The big one.  Delay between battle statements.  The fastest speed is "18", meaning a 24 frame delay!  Small wonder all the speed runners choose speed 8 and turn it into a button mashing game!  Yes, the randomizer will make it 01, saving 23 frames / statement.  Yikes, that in and of itself will speed up battle a ton!

Oh, and if you thought the new DW2 Randomizer battles were super quick... I feel like the DW3 Randomizer battles will be substantially faster than that!
Title: Re: Dragon Warrior 3
Post by: zonk47 on February 28, 2016, 03:04:41 pm
You're right. I was thinking of Maken Densetsu.
Title: Re: Dragon Warrior 3
Post by: gameboy9 on March 03, 2016, 09:12:02 am
I've got a repository started here:  https://github.com/gameboy9/dw3randomizer

It is VERY alpha and probably isn't going to work well for you right now.  But when the time comes, you can see the updates at that site.  When it becomes a full release, I will, of course, release it on romhacking.net.