Home › Forums › Destiny of an Emperor › DoaE Artificial Intelligence Enhancements + New Tactics
Tagged: Destiny of an Emperor, Destiny of an Emperor hack, Destiny of an Emperor hacking, Destiny of an Emperor Rom, DoaE artificial intelligence, NES AI, NES Artificial Intelligence, NES hacking, ROM Hacking, Yuan Shu
- This topic has 645 replies, 10 voices, and was last updated 4 years, 9 months ago by
MiDKnighT.
-
AuthorPosts
-
July 30, 2012 at 9:32 pm #44155
MiDKnighT
ModeratorOK my little math subroutine just went from one line to like 50 lines. 8O
I think damage for tactics is already INT based isn't it? Ie…Zhuge Liang would be able to do more tactic damage than Song Ren with the same tactic.
July 30, 2012 at 9:32 pm #44156MiDKnighT
ModeratorOK my little math subroutine just went from one line to like 50 lines. 8O
I think damage for tactics is already INT based isn't it? Ie…Zhuge Liang would be able to do more tactic damage than Song Ren with the same tactic.
July 30, 2012 at 9:42 pm #44157DragonAtma
ModeratorNot surprising, but I thought I'd mention it just to make sure. I'm not a programmer, though, and I can't use magic to will excellent code into existence yet…
July 30, 2012 at 10:00 pm #44158MiDKnighT
ModeratorI've got an idea… I found a formula that I think would work via a loop that shows some pretty steady "damage potential" growth. The formula is:
Damage Potential + ( Level * 1/2 Level )
Then if there is an overflow add to the "big number".
That shows a nice, predictable growth for each damage related tactic. For example here's the list for "Lian Huo":
Level Damage Potential
0 60
1 60
2 62
3 63
4 68
5 70
6 78
7 81
8 92
9 96
10 110
11 115
12 132
13 138
14 158
15 165
16 188
17 196
18 222
19 231
20 260
21 270
22 302
23 313
24 348
25 360
26 398
27 411
28 452
29 466
30 510
31 525
32 572
33 588
34 638
35 655
36 708
37 726
38 782
39 801
40 860
41 880
42 942
43 963
44 1028
45 1050
46 1118
47 1141
48 1212
49 1176
50 1250
51 1275
Maybe also add a bonus for "current soldiers".
Then I could have 3 lists for modders. In the lists you'd put tactic IDs for STR, AGI, and INT bonuses. Ie… if you put Lian Huo on the "AGI" list then there would be bonus damage for higher AGI officers.
Then I could make another list… A "this tactic always works" list so that some damage tactics could be used by officers with lower INT. The framework for that is already available via my other tactics (like "Charge").
July 31, 2012 at 12:51 am #44159MiDKnighT
ModeratorOK I think I've got a formula figured out…
Damage Potential + (Level * 1/2 Level)
+ Max of 15 bonus damage for soldier count for every other level.
+ Max of 15 bonus damage for STR (if on list) for every other level.
+ Max of 15 bonus damage for AGI (if on list) for every other level.
+ Max of 15 bonus damage for INT (if on list) for every other level.
That means Lian Huo with less than 255 soldiers and no STR, AGI, or INT bonuses at level 51 would do a max of 1275 damage.
But… Lian Huo with 65K soldiers and 255 STR, AGI, and INT with max bonuses at level 51 would do a max of 2775 damage.
Lian Huo with 65K soldiers with 220 INT (with INT bonus) at level 51 would do a max of 1975 damage.
July 31, 2012 at 5:40 pm #44160MiDKnighT
ModeratorI decided to change my formula to give more weight to current soldiers.
Current formula is:
Damage Potential + (1/2 * 1/2 Level)
+ Max of 31 bonus damage for soldier count for every other level.
+ Max of 15 bonus damage for STR (if on list) for every other level.
+ Max of 15 bonus damage for AGI (if on list) for every other level.
+ Max of 15 bonus damage for INT (if on list) for every other level.
I've put a calculator in a spreadsheet to help come up with the right base damage potential and bonuses:
https://www.box.com/s/4c16fbe302096085c757
If everybody's cool with this formula I'll start coding.
August 1, 2012 at 1:39 am #44161MiDKnighT
ModeratorIt's done.
– Tactic damage is level, soldier, and optionally STR, AGI, and INT based.
– To calculate damage, use this spreadsheet and fill in the yellow boxes. The final estimated damage potential is in the gray box for each level. –> https://www.box.com/s/c550a40e0c0d8adf5cd7
– There are 3 lists to control whether a tactic gets a STR, AGI, or INT damage bonus. Simply put the tactic ID on the list (ie…01 for Lian Huo)
– There is a list to control whether a damage/healing tactic always succeeds. For Lian Huo you would put "01" at 0x5720, Ye Huo at 0x5721, etc…
Lists are:
0x5720-0x572F: Tactic always succeed list. 01=always work (only for tactics 01-0F)
0x5730-0x573F: STR bonus list (put tactic ID in this list for STR bonus)
0x5740-0x574F: AGI bonus list (put tactic ID in this list for AGI bonus)
0x5750-0x575F: INT bonus list (put tactic ID in this list for INT bonus)
Hex Changes:
0x39790: 8511A9012082C4EA
0x3BA30: 11A91E2082C4EA
0x79860:
0000000000000000000000A9012082C4
4C21BA00000000000000000000000000
0x7BA30: 00A90E2082C44C5B98
0x4170:
C00F90034CB182A44DB90F97C901F003
4CB1824C908300000000000000000000
0x42B0:
A91E2082C4A44DC015D0034C348D4C60
81C01AD0034CB083A5AD65AE290FC5F3
0x5760:
AAA511C9FFF006A511690185118A6000
A678E005B00AAD73604A85B120B09760
BDB6604A4A4A85B120B0976000000000
0000A90E2082C4A90085128515206097
20E097202098EAEAEAEAEAEAEAEAEAEA
EAEAEAEA20F0874C8297000000000000
A54A0A0AAABD61614A4A4A85B2A67820
00884A4A4A4A85B6A6782020884A4A4A
4A85B7A6782040884A4A4A4A85B86000
A90085B385B485B5A00FB92097C54DD0
06A5B365B685B38810F0A00FB93097C5
4DD006A5B465B785B48810F0A00FB940
97C54DD006A5B565B885B58810F06000
A4B1A5101865B190032050971865B290
032050971865B390032050971865B490
032050971865B590032050978810D585
1060000000000000000000A91E2082C4
A9008512851520609720E097202098EA
20F0874C5B9800000000000000000000
Main Driver for damage:
00:9787:A9 00 LDA #$00
00:9789:85 12 STA $0012 = #$00
00:978B:85 15 STA $0015 = #$00
00:978D:20 60 97 JSR $9760 <– Record 1/2 Current Level
00:9790:20 E0 97 JSR $97E0
00:9793:20 20 98 JSR $9820
etc…
00:97A7:4C 82 97 JMP $9782
Record half of current level in $B1. For enemies the level is AC/4.
00:9760:A6 78 LDX $0078 = #$02
00:9762:E0 05 CPX #$05
00:9764:B0 0A BCS $9770
00:9766:AD 73 60 LDA $6073 = #$30
00:9769:4A LSR
00:976A:85 B1 STA $00B1 = #$18
00:976C:20 B0 97 JSR $97B0
00:976F:60 RTS
00:9770:BD B6 60 LDA $60B6,X @ $60B8 = #$C8
00:9773:4A LSR
00:9774:4A LSR
00:9775:4A LSR
00:9776:85 B1 STA $00B1 = #$18
00:9778:20 B0 97 JSR $97B0
00:977B:60 RTS
Find STR, AGI, and INT and LSR them 4 times:
00:97B0:A5 4A LDA $004A = #$03
00:97B2:0A ASL
00:97B3:0A ASL
00:97B4:AA TAX
00:97B5:BD 61 61 LDA $6161,X @ $6161 = #$8B
00:97B8:4A LSR
00:97B9:4A LSR
00:97BA:4A LSR
00:97BB:85 B2 STA $00B2 = #$10
00:97BD:A6 78 LDX $0078 = #$00
00:97BF:20 00 88 JSR $8800
00:97C2:4A LSR
00:97C3:4A LSR
00:97C4:4A LSR
00:97C5:4A LSR
00:97C6:85 B6 STA $00B6 = #$07
00:97C8:A6 78 LDX $0078 = #$00
00:97CA:20 20 88 JSR $8820
00:97CD:4A LSR
00:97CE:4A LSR
00:97CF:4A LSR
00:97D0:4A LSR
00:97D1:85 B7 STA $00B7 = #$07
00:97D3:A6 78 LDX $0078 = #$00
00:97D5:20 40 88 JSR $8840
00:97D8:4A LSR
00:97D9:4A LSR
00:97DA:4A LSR
00:97DB:4A LSR
00:97DC:85 B8 STA $00B8 = #$0F
00:97DE:60 RTS
Read the STR, AGI, and INT lists to find bonuses:
00:97E0:A9 00 LDA #$00
00:97E2:85 B3 STA $00B3 = #$00
00:97E4:85 B4 STA $00B4 = #$00
00:97E6:85 B5 STA $00B5 = #$10
00:97E8:A0 0F LDY #$0F
00:97EA:B9 20 97 LDA $9720,Y @ $9721 = #$00
00:97ED:C5 4D CMP $004D = #$01
00:97EF:D0 06 BNE $97F7
00:97F1:A5 B3 LDA $00B3 = #$00
00:97F3:65 B6 ADC $00B6 = #$07
00:97F5:85 B3 STA $00B3 = #$00
00:97F7:88 DEY
00:97F8:10 F0 BPL $97EA
00:97FA:A0 0F LDY #$0F
00:97FC:B9 30 97 LDA $9730,Y @ $9731 = #$00
00:97FF:C5 4D CMP $004D = #$01
00:9801:D0 06 BNE $9809
00:9803:A5 B4 LDA $00B4 = #$00
00:9805:65 B7 ADC $00B7 = #$07
00:9807:85 B4 STA $00B4 = #$00
00:9809:88 DEY
00:980A:10 F0 BPL $97FC
00:980C:A0 0F LDY #$0F
00:980E:B9 40 97 LDA $9740,Y @ $9741 = #$00
00:9811:C5 4D CMP $004D = #$01
00:9813:D0 06 BNE $981B
00:9815:A5 B5 LDA $00B5 = #$10
00:9817:65 B8 ADC $00B8 = #$0F
00:9819:85 B5 STA $00B5 = #$10
00:981B:88 DEY
00:981C:10 F0 BPL $980E
00:981E:60 RTS
Loops through half the number of level times to add level, soldier, STR, AGI, and INT bonuses. If we go over FF, add 01 to to the damage/healing "big number":
00:9820:A4 B1 LDY $00B1 = #$18
00:9822:A5 10 LDA $0010 = #$3C
00:9824:18 CLC
00:9825:65 B1 ADC $00B1 = #$18
00:9827:90 03 BCC $982C
00:9829:20 50 97 JSR $9750
00:982C:18 CLC
00:982D:65 B2 ADC $00B2 = #$10
00:982F:90 03 BCC $9834
00:9831:20 50 97 JSR $9750
00:9834:18 CLC
00:9835:65 B3 ADC $00B3 = #$00
00:9837:90 03 BCC $983C
00:9839:20 50 97 JSR $9750
00:983C:18 CLC
00:983D:65 B4 ADC $00B4 = #$00
00:983F:90 03 BCC $9844
00:9841:20 50 97 JSR $9750
00:9844:18 CLC
00:9845:65 B5 ADC $00B5 = #$00
00:9847:90 03 BCC $984C
00:9849:20 50 97 JSR $9750
00:984C:88 DEY
00:984D:10 D5 BPL $9824
00:984F:85 10 STA $0010 = #$3C
00:9851:60 RTS
Check to see if tactic always succeeds:
00:8160:C0 0F CPY #$0F
00:8162:90 03 BCC $8167
00:8164:4C B1 82 JMP $82B1
00:8167:A4 4D LDY $004D = #$02
00:8169:B9 1F 97 LDA $971F,Y @ $9721 = #$00
00:816C:C9 01 CMP #$01
00:816E:F0 03 BEQ $8173
00:8170:4C B1 82 JMP $82B1
00:8173:4C 90 93 JMP $9390
August 1, 2012 at 3:22 am #44162sonic.penguin
ModeratorSo, higher STR characters do more damage or something? or High agility? Not sure if I understand how it works…
August 1, 2012 at 3:27 am #44163sonic.penguin
ModeratorNevermind, just saw your list. It seems that High STR, High Soldier count guys will deal way more damage than low HP, slow, high INT guys
August 1, 2012 at 4:05 am #44164MiDKnighT
ModeratorQuote:Nevermind, just saw your list. It seems that High STR, High Soldier count guys will deal way more damage than low HP, slow, high INT guysThat's not the idea. The modder decides which tactics get which bonuses (if any). For example you might have a fire tactic that gets only an INT bonus (but no STR or AGI bonus). Then you might have a ninja tactic or something that only gets an AGI bonus. Or maybe one called "Smash" that only has a STR bonus. The modder controls the tactics, who does them well, and what type of damage they do.
August 1, 2012 at 12:59 pm #44165sonic.penguin
ModeratorCan you make the "No Fail" list for all tactics through 1E?
August 1, 2012 at 1:05 pm #44166MiDKnighT
ModeratorQuote:Can you make the "No Fail" list for all tactics through 1E?Sure…
August 1, 2012 at 1:24 pm #44167sonic.penguin
ModeratorI also figured out why the mod is so glitchy when I make changes to the duel text and it has nothing to do with the changes I make. I tried just deleting that 1 line of garbled mess and made no changes to the text at all and the game STILL froze and got all glitchy. Thus, I believe that the issues is a problem w/ how DOAEditor is compiling the text.
I could probably enter the text manually through the hex…
August 1, 2012 at 2:54 pm #44168MiDKnighT
ModeratorMy next project is:
– Make the "No Fail" list for all tactics through 1E (but Charge, An Sha, and Duel cannot be changed via this list).
– Look into the "Guard" thing further.
– Look into the soldier progressions bug further.
August 1, 2012 at 2:54 pm #44169MiDKnighT
ModeratorMy next project is:
– Make the "No Fail" list for all tactics through 1E (but Charge, An Sha, and Duel cannot be changed via this list).
– Look into the "Guard" thing further.
– Look into the soldier progressions bug further.
-
AuthorPosts
- You must be logged in to reply to this topic.

