Home › Forums › Destiny of an Emperor › Destiny of an Emperor RH Guide ( MOVED! to http://doaerhguide.wikidot.com )
Tagged: Battles, Destiny of an Editor, Destiny of an Emperor, Destiny of an Emperor hacking, Destiny of an Emperor Mods, Destiny of an Emperor Rom, DoaE rom, DoaE Rom hacking, FCEUX, Feidian, Graphics, hacking DoaE, Map, NES ROM hacking, nes8 template, Portraits, ROM Hacking, ROM hacking information
- This topic has 985 replies, 17 voices, and was last updated 2 years, 9 months ago by
MiDKnighT.
-
AuthorPosts
-
November 6, 2011 at 9:30 pm #39745
ludmeister
ParticipantProgress:

Changes:
0x3ea45: "f8" -> "f9" Y-Position of Attribute list, moved up 2 spaces
0x3ea75: "00" -> "ff" Y-Position of Tactic Box, moved up 2 spaces
Problems: Need to move the "red filter" for the bar graph up 2 spaces. Co-ordinates of this, if I count correctly, should be Y= FA (-6), X= 2.
When all else fails... manipulate the source code.
November 6, 2011 at 9:33 pm #39746MiDKnighT
ModeratorSweet, I was playing with that idea as well but stopped because of the color issue.
November 6, 2011 at 9:40 pm #39747MiDKnighT
ModeratorUpdated the guide with the new DoaEditor changes.
November 6, 2011 at 10:10 pm #39748DragonAtma
ModeratorWhy let the box run off the bottom of the screen? I recommend something like this mockup:
November 6, 2011 at 10:25 pm #39749sonic.penguin
ModeratorI like it Atma :finger:
Lol, he's got ALL the uber tactics now! Just replace Gui Han with Ji Mian :P
November 6, 2011 at 10:34 pm #39750MiDKnighT
ModeratorThat would be awesome Atma… It's just figuring out how to do that… That's the problem…
November 6, 2011 at 10:39 pm #39751sonic.penguin
ModeratorFound a bug in the guan yu/zhang fei leave in party code… here is what happens
The game unequips them upon the "leaving party" script, BUT if you look in the menu, Guan yu/Zhang Fei have 255 AC with nothing equipped. This changes once you equip them but who would want to? muahahaha!
November 6, 2011 at 11:59 pm #39752MiDKnighT
ModeratorQuote:Also, did you check to see if the enemy AI could use tactics #7/8? I was going to see about that as well.Well this part, of course, is way more complicated than it needed to be. It's storing a value in $00F4 with a value (0-6) which contains the tactic slot that the enemy will use. First it's looking up one of 4 values here:
A897: 00 02 03 04
Then figuring out what to do with the value and storing in $00F4.
00:A8F6:BD 97 A8 LDA $A897,X @ $A899 = #$03 <– Going to use tactic in slot 03
00:A8F9:85 F4 STA $00F4 = #$03
00:A8FB:D0 07 BNE $A904
00:A8FD:AE 20 62 LDX $6220 = #$00
00:A900:F0 02 BEQ $A904
00:A902:E6 F4 INC $00F4 = #$03
00:A904:C9 04 CMP #$04 <– If it is 04 it decides if it wants to increment to 05
00:A906:D0 0C BNE $A914
00:A908:A5 AD LDA $00AD = #$30
00:A90A:65 AE ADC $00AE = #$0C
00:A90C:E5 AC SBC $00AC = #$34
00:A90E:29 01 AND #$01
00:A910:F0 02 BEQ $A914
00:A912:E6 F4 INC $00F4 = #$03 <– Can increment $00F4 if it is 0 or 4
00:A914:20 0C DF JSR $DF0C
Then it cycles through the enemy guy's tactics until it hits the slot for $00F4 and uses that one.
So I have to look at the code I posted in particular and figure out how to make it work with 8 values instead of 6.
November 7, 2011 at 12:51 am #39753MiDKnighT
ModeratorThis would work but it might change the randomness of enemy tactics a bit:
A897: 00 02 04 06
00:A8F6:BD 97 A8 LDA $A897,X @ $A89A = #$06
00:A8F9:85 F4 STA $00F4 = #$7F
00:A8FB:D0 07 BNE $A904
00:A8FD:AE 20 62 LDX $6220 = #$00
00:A900:F0 02 BEQ $A904
00:A902:E6 F4 INC $00F4 = #$7F
00:A904:C9 00 CMP #$00
00:A906:F0 0C BEQ $A914
00:A908:A5 AD LDA $00AD = #$F8
00:A90A:65 AE ADC $00AE = #$49
00:A90C:E5 AC SBC $00AC = #$F5
00:A90E:29 01 AND #$01
00:A910:F0 02 BEQ $A914
00:A912:E6 F4 INC $00F4 = #$7F
00:A914:20 0C DF JSR $DF0C
So that it *may* decide to bump it up by 1 whether it's 00, 02, 04, or 06.
Changes:
0x3A8A9: 0406
0x3A914: C900F00C
0x3A928: 08
Seems to be able to use all tactics but I'm not totally sure about the distribution vs what it had before. Fire/Water tactic distribution should be exactly the same as before. But the others might be distributed a bit. One thing to consider is that the 2nd group (slots 02 and 03) might only get called when a bad guy is low on health since that's the slot where heal tactics are. That means that we should put something defensive/recover related in slot 03. Another heal tactic or life would be perfect there.
I'll add these changes to the guide.
I think the meat of the "8 tactics" enhancement is done. Now it's mostly about having a decent looking status page. :)
November 7, 2011 at 1:18 am #39754MiDKnighT
ModeratorQuote:Found a bug in the guan yu/zhang fei leave in party code… here is what happensThe game unequips them upon the "leaving party" script, BUT if you look in the menu, Guan yu/Zhang Fei have 255 AC with nothing equipped. This changes once you equip them but who would want to? muahahaha!
I'll check this out next.
November 7, 2011 at 1:32 am #39755ludmeister
ParticipantQuote:I think the meat of the "8 tactics" enhancement is done. Now it's mostly about having a decent looking status page. :)I'm poring through PPU tables looking for color information as my little one grants me license. Hoping there's a clue in there for what I'm looking for.
When all else fails... manipulate the source code.
November 7, 2011 at 2:38 am #39756sonic.penguin
ModeratorYou guys are certainly on a roll with this stuff, it's nice to be inspired :)
November 7, 2011 at 3:06 am #39757ludmeister
ParticipantEureka! Found the color coding:
In PPU memory, between :23c0 and :23ff, we find the information that tells the NES drawing engine to use certain "color quatrains" (for lack of a better description) at various places on the string.
Well, @ 0x385e3, we find the string to format our status screen:
0x385e3: 23 cd13 aaaa aa0f 0f00 0000 aaaa aa00 0000 0000 0a0a 0aff
To format it correctly when we shift the Stats info and Tactic box up, change the above to the following:
0x385e3: 23 c513 a0a0 a000 0000 0000 aaaa aa0f 0f00 0000 aaaa aaff
And then we have this screen:

Again, not exactly optimal… but functional, and at least passingly aesthetic.
When all else fails... manipulate the source code.
November 7, 2011 at 3:56 am #39758ludmeister
ParticipantAh… MiDKnighT–
I figured out I could move my code for my gradual stair-stepping damage function to a different location! So, don't worry about moving around your stuff with 8 tactics.
Since you all were wondering (maybe), here is the code for implementing a more DoaE2-like damage function, and then I'll discuss what it changes:
@ 0x397f2… to 0x3982d (0x3b bytes)
Old:
B9D0 6085 03B9 D160 8504 B9D2 6085 0520
88D6 A000 B904 01D0 07C8 C008 D0F6 F01B
84F2 A907 38E5 F285 F2A8 A900 8515 A5F2
1865 1585 1588 D0F6 205B C1
New:
B9D0 6085 04B9 D160 8503 A8C0 00F0 1F30
08C0 0830 12C0 2030 07A2 27A0 0A4C 1498
A20F A008 4C14 98A2 07A0 074C 1498 A201
A005 8600 4CE0 BFEA 205B C1
@ 0x3bff0… to 0x3c003 (0x14 bytes)
Old:
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
New:
4603 6604 88C0 00D0 F7A5 0418 6500 8515 4C17 9800
To illustrate what the calculation does, here's a before and after.
Before:
*************************************
Army size (soldiers) Strength multiplier (x = army size)
1 to 9 –> 1
10 to 99 –> 4
100 to 999 –> 9
1000 to 9999 –> 16
10000+ –> 25
Meteorstrike's discussion of the damage function helped me in this as he provided clues as to what to look for, so I would know that damage was being calculated.
Quite literally, the game calculated the number of digits in your current soldier total (like it might calculate the length of a string), and then squared that result. That number was multiplied by your strength, your weapon damage rating (not what you see in the status screen), and finally a number from the random table.
After
*************************************
With my edits to the damage algorithm, your current soldiers modify the damage in this way:
Army size (soldiers) Strength multiplier (x = army size)
1 to 255 –> (x / 32) + 1
256 to 2047 –> (x / 128) + 7
2048 to 8191 –> (x / 256) + 15
8192+ –> (x / 1024) + 37
Hence, until you reach 256, you gain +1 to your strength multiplier every 32 soldiers. Then, from 384 to 2048, you gain +1 every 128 soldiers. At 2304 and every 256 soliders until 8192, you gain +1. Once you hit 8192 soldiers, you need another 1024 soldiers to gain a +1. Let's compare damage ratings with real figures.
Soldiers – Previous – Modified
10 soldiers – 4x – 1x
75 soldiers – 4x – 3x
550 soliders – 9x – 11x
1896 soldiers – 16x – 21x
5000 soldiers – 16x – 34x
40000 soldiers – 25x – 76x
Don't mess with overwhelming forces… or get overwhelmed! Mwa-hahaha
When all else fails... manipulate the source code.
November 7, 2011 at 4:07 am #39759ludmeister
ParticipantQuote:I had an idea, after playing DoaE II. Not sure how feasible this is. You know what's cool about DoaE II though? We can use tactics OUT of battle. Mostly just so that we can heal up before a fight.LYS, I had this idea too; I also often let it ride trying to find a Rebel Force battle to heal my poor ailing officers before many a gate battle.
I know this for sure… it would take skills greater than mine, because it would entail adding another menu option to the command menu, which would launch a custom-made menu to select the tactic (only Healing tactic… maybe a custom Life tactic as well) which would require a tactics user (could skimp here and call the tactician the user), a target officer, and then apply effect. It would definitely require the use of a separate code bank, just for starters. You might be able to reuse the menu for selecting officers (such a menu is already made for the General Stat screen menu). But this would be an awful lot of work for someone really talented at hex code development who has a lot of time on their hands.
When all else fails... manipulate the source code.
-
AuthorPosts
- You must be logged in to reply to this topic.

