News: 11 March 2016 - Forum Rules

### Author Topic: Dragon Warrior 1  (Read 2874 times)

#### joe73ffdq

• Full Member
• Posts: 207
##### Dragon Warrior 1
« on: October 22, 2016, 07:16:58 am »
I have sifted through much of the data for this very simple game, and yet ran into more complications then I expected. FF1 and FF3 have too many statistical formulas, and I lost patience or ability to keep up with. DW1 is VERY simple, but I ran into one barrier. Most of what I am interested in has been found, except zoning.

3...3...2...2...3...5...4...5

3...2...1...2...3...3...4...5

4...1...0...0...1...3...4...5

5...1...1...12..9...6...6...6

5...5...4...12..12..7...7...7

10..9...8...12..12..12..8..7

10..10..11.12..13..13..9..8

11..11..12.13..13..12..9...9

This is each zone, as depicted by Ryan8bit on Gamefaqs. 8x8 grid, with 16x16 per block.

The 2 zero's on the 3rd row, are for Tantagel area, which are just Slime and Red Slime.

I can change each enemy per zone...

Zone 00 : F55F: 00 01 00 01 00 --- Slime, Red Slime, Slime, Red Slime, Slime

How do i manually redefine each zone # on the world map. This hasent been found. I cant get Townedit to work, but I am not interested in map editing. I want to define each zone as I wish, and leave the layout exactly as is. 8x8 = 3f, but I couldnt find a pattern in hex conclusive for this.

The only other things I havent conclusively found, are Heal/Herb/Hurt/Breath values.

If someone can help me figure out how to change the zone numbers, then I finally have a game that will be essentially easy to work through. I have played through DW1 100+ times in the 90's, and about 30 times post 2000. The math and variables are cake compared to FF1.

My goal would be to create Dragon Warrior rebalanced, while leaving the EXACT vanilla maps. There is just this 1 barrier of data with DW1, whereas FF1, FF3, And DW2 had too many hurdles for me. Once I can redefine each zone #, then I will have enough viable interest to seriously hack this game. First JRPG in late 89, and the first RPG to be completed. I didnt expect DW1 to have that many complications with the data, but it is much much simpler then the FF series. Once I can create my own zones, then I finally have a project I can wrap my head around. I know this game inside and out, and Im just a few data points away from working on it

Character stats/level up/exp - Check
Enemy attributes - Check
Weapon/Armor, strength and price - Check
Shop and Treasure - Check

I just need to change those zone #'s to my liking, and Im well on my way

#### Disch

• Hero Member
• Posts: 2814
• NES Junkie
##### Re: Dragon Warrior 1
« Reply #1 on: October 22, 2016, 12:16:10 pm »
I looked at this for about 10 minutes.

Your player's X position on the map is stored in RAM at 003A.  Y position is at 003B

If you set a breakpoint for address \$CE91  (ROM offset 0x0CEA1), it will trip when the game reads the X position from RAM just before entering a battle.  Presumably, the game is reading this value so it can determine what zone you're in.  You should be able to figure out where the zones are stored by tracing the code and finding out how it's using that value.

I traced this for about 2 minutes then lost interest, so I figured I'd just let you do it  =P

#### joe73ffdq

• Full Member
• Posts: 207
##### Re: Dragon Warrior 1
« Reply #2 on: October 23, 2016, 02:17:07 am »
Im a little confused. Set a breakpoint? Do you mean NOP with EA or a 00 to block the operation.

And for tracing. Do you mean with FCE ultra debugger?

Thanks Disch. I will try various things. I know it is at least narrowed down to C010-10010

#### SunGodPortal

• Hero Member
• Posts: 2938
• 2 + 2 = 5
##### Re: Dragon Warrior 1
« Reply #3 on: October 23, 2016, 02:38:17 am »
Im a little confused. Set a breakpoint?

I'm not an expert debugger but I think when you set a breakpoint the emu halts operations when certain conditions are met. Like, stopping when the game writes anything to a certain address in RAM so that you will have time to make observations on the details of certain activities.
Cigarettes, ice-cream, figurines of the Virgin Mary...

#### Disch

• Hero Member
• Posts: 2814
• NES Junkie
##### Re: Dragon Warrior 1
« Reply #4 on: October 23, 2016, 02:40:30 am »
Im a little confused. Set a breakpoint? Do you mean NOP with EA or a 00 to block the operation.

You don't know how to use a debugger??!  Egads!

The debugger let's you see the contents of RAM and all registers at runtime, and lets you step through line-by-line of the code as the game executes it.  I'm amazed you haven't been using one.

1 -  Get FCEUX
3 -  Go in the "Debug" menu, open the "Trace Logger" & the "Debugger"
4 -  Get to a point in the game just before where you're just about to enter a battle
5 -  Savestate
6 -  Click "Start Tracing" in the trace logger  (game will start to move sluggish)
7 -  In the debugger window, click "Add" in the breakpoints section in the upper-right corner
8 -  Address:  \$CE91.  Check the "Execute" box.  Don't worry about the rest.  Hit "OK"
9 -  Walk around in the game to trigger the breakpoint
10-  The debugger will "snap", pausing the game
11-  Debugger will show you current executing code
12-  Tracelogger will show you the code that has already run

Breakpoints stop game execution ("snap the debugger") under certain conditions.  Read breakpoints will snap when the game reads from a certain address, write breakpoints when they write to an address, and execute breakpoints will snap when the game executes code from the given address.

Once the debugger is snapped, you can click "Run" to have the game resume normally (until another breakpoint is hit) -- or you can use the "Step" functions to run line-by-line
- "Step Into" = let the game do exactly 1 instruction
- "Step Over" = let the game do 1 instruction, but if that instruction is a JSR, let it do the entire subroutine
- "Step Out" = let the game resume until it exits the current subroutine (until an RTS or RTI is hit)

In this case, I'm having you set a breakpoint on \$CE91 because that's the 003A read that occurs just before a battle starts.  You can walk through the code from there to see what it's doing.

#### joe73ffdq

• Full Member
• Posts: 207
##### Re: Dragon Warrior 1
« Reply #5 on: October 23, 2016, 05:36:42 am »
Thank you for the help Disch

Looking at everything with FCEUX is a little confusing. Two things I encountered here. One, the option in the tracer gives me a logging option, not a tracer option. Second, I dont see CE91 pulled up at 3A, it stays the same, which is coordinates. I scrolled through the hex editor part in RAM, and couldnt find anything conclusive as I entered battle.

If the zone around Tantegel is for #00 enemy encounter, then shouldnt I be able to find an A9 00, or even A0,A2, or A5 00. There are also 64 zones, which would lead me believe that I am looking for 00-3F as well.

Here is a link to to Ryan8bits formula guide on Gamefaqs. There is plenty of mechanic info, but no info to change the zone numbers. I also have no luck with TOWNEDIT, where as DW1MDE works fine.

http://www.gamefaqs.com/nes/563408-dragon-warrior/faqs/61640

EDIT

Found it by luck. There are 19 battle sets, 3 specific to dungeons. It runs from F532-F551. Tantegel domain grid is at F53B. This is done per nybble, so only battle sets 1-16 are available on the overworld. Changing which enemies appear in each group is already known, so now I got it made

Now the only thing I dont know for certain, is holding capacity past 6, and then I have all I need.

I will keep tinkering with FCEUX, and hopefully find the locations. Thank you for your detailed effort
« Last Edit: October 23, 2016, 07:41:08 am by joe73ffdq »

#### Disch

• Hero Member
• Posts: 2814
• NES Junkie
##### Re: Dragon Warrior 1
« Reply #6 on: October 23, 2016, 11:46:31 am »

One, the option in the tracer gives me a logging option, not a tracer option.

Well... it's both.  It's tracing the code, and making a log of it.  Hence "trace logger"

Quote
Second, I dont see CE91 pulled up at 3A, it stays the same, which is coordinates.

CE91 read from address 3A in RAM, which is the player's coordinates.  From there it would do some math to turn the coordinate into an index in some lookup table.

Quote
If the zone around Tantegel is for #00 enemy encounter, then shouldnt I be able to find an A9 00, or even A0,A2, or A5 00

Not likely.  Tantegel being zone 0 just means 0 will exist in the lookup table somewhere, but it's very unlikely the code actually uses the value '0' directly.

#### joe73ffdq

• Full Member
• Posts: 207
##### Re: Dragon Warrior 1
« Reply #7 on: October 25, 2016, 05:51:31 am »
Thanks for all the help

My concentration isnt what it used to be, so going through code, and or deciding on formulas, can be a little daunting. Both FF1 and DW2 had too many variables to keep up with, so I decided to give DW1 a try. This ends up being within range of comfortable ability.

I never really used FCEUX, but I kind of know how to use it now. The few things I havent found yet, might be found if I knew what to look for in FCEUX. Changing the 6 limit of Herbs and Keys, and the 8 limit holding capacity. Once I find those, and then organize my notes, I can attempt to map out a plan. I cant seem to get Townedit to work. I open it in Dosbox74, but cant figure out to work it. I dont have any map editing plans, but the option to do some things would be helpful.
« Last Edit: October 25, 2016, 06:24:17 am by joe73ffdq »

#### joe73ffdq

• Full Member
• Posts: 207
##### Re: Dragon Warrior 1
« Reply #8 on: November 04, 2016, 12:50:02 am »
d70a : # of Herbs Max
d81e : # of Keys Max
647d : 02 for double digits, for Keys and Herbs in the menu screen