Cite as
Ryan8bit, DW Formulas
Original
https://gamefaqs.gamespot.com/nes/563408-dragon-warrior/faqs/61640
sha256
0c0d73f2c13f4502fff5539d97b7abba618dbeead3cce1882fd7df37c24e7244
Version
v1.0
Archived
https://web.archive.org/web/20250717012136/https://gamefaqs.gamespot.com/nes/563408-dragon-warrior/faqs/61640
Accessed
2026-10-20
Licence
all rights reserved by the author (GameFAQs guide)
Credit
Ryan8bit, who learned NES assembly to read the game's formulas; section III quotes the code behind each one.
Notes
GameFAQs refuses automated reads, so the text was read in a verbatim repost (https://pastebin.com/pKkihMcv, 27 April 2017). GameFAQs' Dragon Warrior guide list, archived by the Wayback Machine on 2018-12-07, lists it as "Formula Guide", 01/10/11, Ryan8bit, 1.0, 98K. Used as a cross-check on dw1 claims; nothing is copied beyond the short quotes.

Cited on

Claims (12)

UpdateRandNum steps a 16-bit state as s←771s+129(mod65536), and battle code reads its high byte, RandNumUB.III.A, Common algorithmsCode
GetJoypadStatus steps the generator each time it reads the controller.IV, Frequently Asked QuestionsCode
Computed from the generator's update, its 65,536 states form two cycles of 32,768, and over each cycle the high byte takes every value exactly 128 times.III.A, Common algorithmsCode
PlyrCalcHitDmg takes X=A−⌊D/2⌋, the hero's attack power less half the monster's defense byte; if X≥2, damage is ⌊(X+⌊r(X+1)/256⌋)/4⌋ for a random byte r, so from ⌊X/4⌋ to ⌊X/2⌋.II.B, Hero attack formulasCode
Before the normal formula, a 1-in-32 roll gives the hero an "excellent move", except against either form of the Dragonlord; it deals A−⌊r⌊A/2⌋/256⌋ for a random byte r, from ⌈A/2⌉+1 to A (more than half to all of the attack power), and ignores defense.II.B, Hero attack formulasCode
After the damage is set, an awake monster dodges when a roll of 0–63 falls below d, the low nibble of its resistance byte, a chance of d/64; a sleeping monster never dodges, and spells skip the check.III.C, CombatCode
EnCalcHitDmg takes X=A−⌊D/2⌋, the monster's attack less half the hero's defense power; if X≥⌊A/2⌋+1, it uses the hero's normal formula, and otherwise the monster deals ⌊(⌊r(⌊A/2⌋+1)/256⌋+2)/3⌋, from 0 to about A/6.III.C, CombatCode
TryRun lets the hero escape when Agility × a random byte is at least the monster's defense byte × a roll whose range grows with the monster: 0–63 from Slime to Druinlord, 0–94 from Drollmagi to Werewolf, 0–127 from Green Dragon to Blue Dragon, and 0–255 from Stoneman on. Running from a sleeping monster always works.II.B, RunningCode
On the overworld's zone 0, the slime-only region around Tantegel Castle, a second byte lets only half of those fights through, and a quarter on hills.II.A, EncountersCode
The dodge nibble d of the 40 monsters (each dodges d/64 of the hero's attacks, dodge) is 1 or 2 for 27 of them; the Demon Knight's is 15, the Werewolf's 7, the Poltergeist's and Drakeema's 6, six monsters' 4, and the Golem's and both Dragonlord forms' 0.II.B, Combat, monster list (#28 Demon Knight)Code
The high nibble h of the same byte blocks Hurt and Hurtmore h/16 of the time (hero-spells); it is 0 for 26 of the 40 monsters and 15 for seven, the Metal Slime, Golem, Demon Knight, Wizard, Red Dragon, and both Dragonlord forms.II.B, Combat, monster listCode
Each fight picks one of its zone's five monster slots with equal chance; zone 0, around Tantegel Castle, holds three Slime slots and two Red Slime slots, and zone 1 adds a Drakee, all with dodge 1.II.A, EncountersCode