Home › Forums › Destiny of an Emperor › DoaE game-editing question!
- This topic has 47 replies, 7 voices, and was last updated 14 years, 5 months ago by
Jiang Wei.
-
AuthorPosts
-
February 13, 2011 at 8:14 pm #5140
DragonAtma
ModeratorQuestion!
Is there a way to replace all of the fixed soldier amounts with level-based soldiers? Right now we only have 25 spaces (hex values 80~98) for level-based soldiers, whereas converting hex values 0~7F would let us add a whopping 25 new soldier progressions.
February 13, 2011 at 8:36 pm #38581Niahak
ModeratorI'm not sure where/how the leveling schemes are defined, so I couldn't say whether we could add new progressions or not :/
February 13, 2011 at 9:07 pm #38582DragonAtma
ModeratorThat's too bad; it could solve the "nontigers gain soldiers, but slowly enough to gradually become obsolete" problem.
February 14, 2011 at 1:14 pm #38583MiDKnighT
ModeratorI changed the way that my tigers gained soldiers in the Gongsun Zan mod I was working on. Details on how to do it are in:
http://www.gamefaqs.com/boards/563402-destiny-of-an-emperor/47999342?page=11
There are 5 slots for 'level gain' generals although multiple generals can share the same level gain pattern. I don't know how to add more than 5. You can use an Excel spreadsheet to plot out how the different numbers would affect future level gains.
February 15, 2011 at 2:05 pm #38584DragonAtma
ModeratorYes, yes, I know about editing the soldier increases; thing is, my goal is to have EVERYONE gaining soldiers, which would require more slots.
Ah, well…
To clarify:

Blue is you (assume that the graph is logarithmic or something); green, red, and purple are shu, wu, and wei; thick lines are the levels you're most likely to fight them.
And no, this is not an exact match for my plans; it does give you an idea what I'm planning (well, one of the ideas, anyway :twisted: )
February 15, 2011 at 9:33 pm #38585MiDKnighT
ModeratorYou have 4 lines in your graph so that is definitely doable. Assign every Wei general to the 'purple' level gain pattern, etc…
Right now you can assign every general in the game to 1 of 5 level gain schedules. Having more than 5 different 'schedules' is the part I don't know how to do.
February 16, 2011 at 12:59 am #38586DragonAtma
ModeratorThose are examples; the details would vary a bit.
And if I assigned everyone to the same line, everyone would be the same number of soldiers.
There's also the fact that there's Jingzhou, Yuan Shao, Yuan Shu, and Dong Zhuo.
So no, we don't have enough room unless there are changes. All we need is to find an "if soldier value is 80h or higher" command and change that 80 to 00, but…
June 19, 2011 at 6:47 pm #38587Jiang Wei
Participantyeah that would be nice some one plz find away
October 18, 2011 at 5:28 pm #38588MiDKnighT
ModeratorI decided to look into this further. The "new" level up progressions start at "80". See:
7E=39062
7F=40972
80=Huang Zhong leveling
85=Ma Chao leveling
8A=Guan Yu leveling
8F=Zhao Yun leveling
94=Zhang Fei leveling
Notice that each new one skips 5. That's because the level up algorithm has 5 values. See 0x3B51B. Each value represents 10 levels of solider gains:
Huang Zhong: 24 24 1F 1F 1A
Ma Chao: 22 22 22 22 1A
Guan Yu: 24 24 24 1F 1A
Zhao Yun: 1F 22 26 26 1A
Zhang Fei: 26 26 24 1F 1A
The problem is that after these values, there is other game code. If we change it, it will likely break something. However, if we want to we can still READ the data…meaning that there are likely some more level up gains available but I took a look at them and they have values that are too high. Meaning your soliders will eventually grow too fast…
However…there is an alternative… You can add some assembly code to branch off at 80 and read the level up codes from somewhere else where there *is* space. I can probably figure this out. If it works we would have 25 level up progressions instead of 5.
October 18, 2011 at 5:58 pm #38589DragonAtma
ModeratorAll we need to do is to find the "progressions start at 80" and change it to "progressions start at 00"…
October 18, 2011 at 6:10 pm #38590MiDKnighT
ModeratorQuote:All we need to do is to find the "progressions start at 80" and change it to "progressions start at 00"…But you'd still have to fit the progressions somewhere on the ROM page and there's no space on this particular ROM page. We'd need 8 lines of 0's to fit 25 level up progressions.
Anyway, I made further progress…
Here's the assembly where it's loading "24" – (Guan Yu's multiplier) into memory.
00:B4BE:BD 24 B5 LDA $B524,X @ $B623 = #$D0
00:B4C1:C5 F1 CMP $00F1 = #$01
00:B4C3:F0 05 BEQ $B4CA
00:B4C5:CA DEX
00:B4C6:10 F6 BPL $B4BE
00:B4C8:30 01 BMI $B4CB
00:B4CA:C8 INY
00:B4CB:A5 F1 LDA $00F1 = #$01
00:B4CD:CD 73 60 CMP $6073 = #$02
00:B4D0:F0 25 BEQ $B4F7
00:B4D2:C9 32 CMP #$32
00:B4D4:B0 0B BCS $B4E1
00:B4D6:B9 0B B5 LDA $B50B,Y @ $B515 = #$24
00:B4D9:85 14 STA $0014 = #$2A
00:B4DB:20 5F C1 JSR $C15F
00:B4DE:4C BA B4 JMP $B4BA
00:B4E1:A5 10 LDA $0010 = #$64
Notice that it has B50B hardcoded. That's where the level up gains start. If we change the B50B to some other spot where there is more space we'd have room for more level gains. However…this ROM page looks pretty full. There's no space on this page for a bunch of new level up multipliers… Remember we'd need 8 lines of 0's to fit 25 level up progressions. There's probably room on another ROM page but this is gonna require more assembly code to load from a different page.
It likely can be done…I did it before with the portrait stuff…
October 18, 2011 at 7:52 pm #38591MiDKnighT
ModeratorApparently loading from another page is not as easy as the portrait case because it's not actually designed to do that (in the portrait code it was designed to pull slices 80 or above from another ROM page).
Back to the drawing board… If we would have had 8 free lines on this page this change would have been easy.
October 18, 2011 at 9:54 pm #38592MiDKnighT
ModeratorI got it! I found the DoaE function to switch pages and found some space on another page. Now can support 25 soldier growth progressions! Here's what you do:
Put this hex in these spots:
0x3B4E6: 4C0BB5
0x3B51B: A90D2082C400000000000000000000008AA6254CD9B400000000
0x37520: 8625B920B5AAA90E2082C4
Now put all your level growths at 0x37530. Example:
0x37530: 24241F1F1A222222221A2424241F1A1F2226261A2626241F1A0A…continued…
You can put up to 5*25 entries there (125). And now in the general's "Soldiers (Ally)" slot you can put any of the following values for different soldier progressions:
80=Huang Zhong leveling (0x37530-0x37534)
85=Ma Chao leveling (0x37535-0x37539)
8A=Guan Yu leveling
8F=Zhao Yun leveling
94=Zhang Fei leveling
99
9E
A3
A8
AD
B2
B7
BC
C1
C6
CB
D0
D5
DA
DF
E4
E9
EE
F3
F8
Here's the code that was added:
00:B4D6:4C 0B B5 JMP $B50B
00:B50B:A9 0D LDA #$0D
00:B50D:20 82 C4 JSR $C482
…function to switch page to 0D…
00:B510:86 25 STX $0025 = #$FF
00:B512:B9 20 B5 LDA $B520,Y @ $B52A = #$24
00:B515:AA TAX
00:B516:A9 0E LDA #$0E
00:B518:20 82 C4 JSR $C482
…function to switch page to 0E…
00:B51B:8A TXA
00:B51C:A6 25 LDX $0025 = #$00
00:B51E:4C D9 B4 JMP $B4D9
I tested it and it works fine. Will add this to the DoaE ROM hacking guide.
October 21, 2011 at 8:55 pm #38593DragonAtma
ModeratorGood! Good, good, good.
One last, somewhat-related question: is it possible to change a growth progression officer's base of 100 HP? If we make Jin Xuan (or whoever our Liu Bei replacement is) gain level-based soldiers (presumably because they'd stay in the party), there's no meat shield at the start. It'd also look odd early on if you intend on using this sort of progression for most or all enemy officers…
October 21, 2011 at 9:22 pm #38594MiDKnighT
ModeratorQuote:One last, somewhat-related question: is it possible to change a growth progression officer's base of 100 HP?I wanted to do the same thing in the Gongsun Zan mod. There's some good news and some bad news.
Good News: Yes you can change the value.
Bad News: It's hardcoded so you'd have to change it for everybody, not just one character.
To change the value change the "64" at 0x3B4BC to some other number.
So my advice would be to raise that value a bit but not too much and make Jin Xuan's level growth very aggressive at the beginning (ie…his first level up growth value).
-
AuthorPosts
- You must be logged in to reply to this topic.

