DOAEditor and Romhacking for Destiny of an Emperor

Use this forum to discuss hex-editing or otherwise altering any Three Kingdoms game, and to promote modded titles and patches.

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby MiDKnighT » Mon Aug 14, 2017 3:36 pm

Boneduke wrote:Hello,

I've been working on a DOAE mod for about the past 8 months and very excited that most of the storyline, map modification etc is getting finished (Destiny of an Editor is fantastic!).

But I ran into a problem last week that's had me stumped since - Have searched through the wiki, all the old threads here, gamefaqs, and the LYS forums and can't find a solution...

After the Sima Yi thunder event, the party wakes up in an Inn. Upon exiting the Inn, the group always appears in Jianye (0B1F0A14) and when leaving the city immediately afterwards, the group always appears at the original location of Jianye itself (09100D13).

I want to change both of these behaviors, but can't seem to find any reference in the ROM to either of them. I found, for instance, that when trying to edit the exits for caves I often needed to search for a truncated version of the "mailing address" because the orientation of the party's sprites (all clumped up and facing south, all clumped up and facing west, in a row and facing north) etc was controlled by a slight modification of the hex code... so in that regard I search in the ROM for variants of the Jianye address like A9100D13, but - nothing. Even just 100D13 and I dont find that either.

I also noticed that, when the party dies, you appear back at the current castle and when exiting the city immediately afterwards, you appear at the original location for that castle. I was able to find and adjust those locations in the ROM so that after dying you exit at a relocated castle's location. Confused why I can't figure out how to do the same thing in the case of this special event.

Tdlr; did anyone successfully move Jianye itself, and then after the Sima Yi thunder event was able to adjust the locations where the party appears after exiting the Inn? What I really want to achieve is to have the party appear in a different city (Chengdu) after the thunder event.

thanks!



It's been a while since I did DOAE debugging but if you have a ROM and a save state right before the event I can probably help. PM me.
User avatar
MiDKnighT
Sage
 
Posts: 260
Joined: Mon Oct 16, 2006 4:16 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby Boneduke » Mon Aug 14, 2017 10:41 pm

Thanks! Sent you a PM.
Boneduke
Apprentice
 
Posts: 22
Joined: Sun Aug 13, 2017 5:09 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby MiDKnighT » Tue Aug 15, 2017 6:06 pm

Boneduke wrote:However the ROM seems to force the party to wake up in the Inn at Jianye (city we haven't conquered yet!) and then to make matters worse when exiting the city, they appear at the original location for Jianye, way down in Wu.


Here we go, I traced it and found where it is setting the location:

Place location inside the Inn:

0D:A5CB:A9 05 LDA #$05
0D:A5CD:85 60 STA $0060 = #$0C
0D:A5CF:A9 01 LDA #$01
0D:A5D1:85 61 STA $0061 = #$0C
0D:A5D3:A9 04 LDA #$04
0D:A5D5:85 62 STA $0062 = #$06
0D:A5D7:A9 03 LDA #$03
0D:A5D9:85 63 STA $0063 = #$07

Change location ID to Jian Ye:

0D:B3F0:A9 57 LDA #$57
0D:B3F2:8D 13 60 STA $6013 = #$5F

So for the fun of it, let's put them in Luosang village:

0x37400: A957 --> A97F
0x365DB: A9058560A9018561A9048562A9038563 --> A9028560A9018561A9068562A91C8563

Image

Oops they are still laying down and the color palette is still set to town. :P

So there's more to figure out as well. At least at this point putting them laying down in some other inn should be easy. If you want to stick them somewhere more exotic that might be more challenging. I'll try the easy version and just change the town to XuZhuo:

0x37400: A957 --> A97F

Image

This looks better but when I step outside I end up in a weird location (which might be correct if you re-designed XuZhuo...)

EDIT: OK I see where you wanted them to end up. Let me check on that...

Here's where you end up when you walk out of the Inn:

A:13 X:03 Y:01 S:2C P:nvUbdIzC $B40E:A9 0B LDA #$0B
A:0B X:03 Y:01 S:2C P:nvUbdIzC $B410:8D 1E 60 STA $601E = #$03
A:0B X:03 Y:01 S:2C P:nvUbdIzC $B413:A9 1F LDA #$1F
A:1F X:03 Y:01 S:2C P:nvUbdIzC $B415:8D 1F 60 STA $601F = #$1D
A:1F X:03 Y:01 S:2C P:nvUbdIzC $B418:A9 0A LDA #$0A
A:0A X:03 Y:01 S:2C P:nvUbdIzC $B41A:8D 20 60 STA $6020 = #$03
A:0A X:03 Y:01 S:2C P:nvUbdIzC $B41D:A9 14 LDA #$14
A:14 X:03 Y:01 S:2C P:nvUbdIzC $B41F:8D 21 60 STA $6021 = #$18

So if we change those coordinates we can change where we end up after we walk out.

I think it's easiest if you have them wake up in an Inn somewhere. Otherwise you'd have to change color palettes, change that they are lying down, etc... Much easier that way. I'm sure it's possible to have them wake up somewhere else but waking up at an Inn (in any town) is the lowest hanging fruit.

That said, I think this will give you what you want:

0x37400:
A95F8D1360A9278D1460A9098D1A60A9
108D1B60A90D8D1C60A9138D1D60A909
8D1E60A91E8D1F60A90C8D2060A9188D
User avatar
MiDKnighT
Sage
 
Posts: 260
Joined: Mon Oct 16, 2006 4:16 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby Boneduke » Tue Aug 15, 2017 8:44 pm

AWESOME!! Yes waking up in the inn in Luo is exactly what I was hoping for. Although there is some comedic value I suppose to waking up in a ditch somewhere too lol

However, I was surprised, even though we exit the Inn into Luo, when we leave Luo it still warps to the original location of Jianye (09100D13) on the world map, rather than the current location of Luo (0D100D05). Was hoping that by changing what inn we warped to, it would take care of that subsequent location, guess not.

I'll take a look at the source you posted and see if I can make sense of it - so far only been using DOAEditor and the Hex editor - no debugger, will have to figure out how thats working. But I think probably the same investigation you were able to do for the inn location, is needed to adjust for where it dumps you on the world map

thanks so much - thats a huge help. Such a relief to know the problem isn't insurmountable!
Boneduke
Apprentice
 
Posts: 22
Joined: Sun Aug 13, 2017 5:09 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby MiDKnighT » Tue Aug 15, 2017 8:58 pm

Boneduke wrote:AWESOME!! Yes waking up in the inn in Luo is exactly what I was hoping for. Although there is some comedic value I suppose to waking up in a ditch somewhere too lol

However, I was surprised, even though we exit the Inn into Luo, when we leave Luo it still warps to the original location of Jianye (09100D13) on the world map, rather than the current location of Luo (0D100D05).


Oh, I guess that's what this is:

0D:B3FA:A9 09 LDA #$09
0D:B3FC:8D 1A 60 STA $601A = #$09 <--------------
0D:B3FF:A9 10 LDA #$10
0D:B401:8D 1B 60 STA $601B = #$10 <--------------
0D:B404:A9 0D LDA #$0D
0D:B406:8D 1C 60 STA $601C = #$0D <--------------
0D:B409:A9 13 LDA #$13
0D:B40B:8D 1D 60 STA $601D = #$13 <--------------
0D:B40E:A9 0B LDA #$0B
>0D:B410:8D 1E 60 STA $601E = #$03
0D:B413:A9 1F LDA #$1F
0D:B415:8D 1F 60 STA $601F = #$1D
0D:B418:A9 0A LDA #$0A
0D:B41A:8D 20 60 STA $6020 = #$03
0D:B41D:A9 14 LDA #$14
0D:B41F:8D 21 60 STA $6021 = #$18

So the full fix for what you're looking for would be:

0x37400:
A95F8D1360A9278D1460A90D8D1A60A9
108D1B60A90D8D1C60A9058D1D60A909
8D1E60A91E8D1F60A90C8D2060A9188D

Boneduke wrote:I'll take a look at the source you posted and see if I can make sense of it - so far only been using DOAEditor and the Hex editor - no debugger, will have to figure out how thats working. But I think probably the same investigation you were able to do for the inn location, is needed to adjust for where it dumps you on the world map

thanks so much - thats a huge help. Such a relief to know the problem isn't insurmountable!


The debugger is looking at 6502 assembly code which is not easy to figure out but once you do and with the DoaE ROM Hacking guide you can figure a lot of things out. So far no problem in the game has been insurmountable although we have accidentally created some very difficult bugs to figure out.

Events like this one are some of the areas we hadn't really uncovered yet. At least parts of this event (locations) have been uncovered now.
User avatar
MiDKnighT
Sage
 
Posts: 260
Joined: Mon Oct 16, 2006 4:16 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby Boneduke » Tue Aug 15, 2017 9:25 pm

Sweet - will give that snippet a try later tonight, thanks again!

I am sure will be back a little later with a few more issues if you dont mind :D
Boneduke
Apprentice
 
Posts: 22
Joined: Sun Aug 13, 2017 5:09 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby Boneduke » Tue Aug 15, 2017 11:51 pm

Yes!! Works perfectly. Thanks again, so much!
Boneduke
Apprentice
 
Posts: 22
Joined: Sun Aug 13, 2017 5:09 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby MiDKnighT » Wed Aug 16, 2017 2:31 pm

Boneduke wrote:I am sure will be back a little later with a few more issues if you dont mind :D


Sure. Just make sure to provide ROM + save state right before the issue so I can trace/test the issue.
User avatar
MiDKnighT
Sage
 
Posts: 260
Joined: Mon Oct 16, 2006 4:16 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby Boneduke » Wed Aug 16, 2017 11:55 pm

Ok this one isn't very critical, have lots to work on in the meantime - but something I'd love to get resolved eventually.

For some reason in my ROM, two cities, when you enter them, the incorrect graphics load (or more accurately, the World Map graphics continue to be used, rather than switching to town graphics). Villagers etc are visible so you clearly enter the town... I've copy & pasted the relevant sections in the Warps part of the ROM (i.e. 01Cxxx) from a fresh copy of DOAE and moved the warps back to their original locations etc, but nothing seems to work.

The cities are Yangzhou and Fushui. In my ROM Fushui has been renamed to Xuzhou (needed a pointer for that one to save on text bank space, since Xuzhou is mentioned a lot in my script - but problem has been occuring for long before I did the renaming)

I've managed to pretty much complete my ROM without needing to use those cities, but it would be a nice bonus if they got fixed. I'm sure could find a use for them somewhere.

I'll PM you a link to ROM and save state as before!
Boneduke
Apprentice
 
Posts: 22
Joined: Sun Aug 13, 2017 5:09 pm

Re: DOAEditor and Romhacking for Destiny of an Emperor

Unread postby MiDKnighT » Thu Aug 17, 2017 2:57 pm

Problem is here:

0E:BF38:A5 47 LDA $0047 = #$70
0E:BF3A:4A LSR
0E:BF3B:A8 TAY
0E:BF3C:B9 86 BF LDA $BF86,Y @ $BFBE = #$06
0E:BF3F:B0 04 BCS $BF45
0E:BF41:4A LSR
0E:BF42:4A LSR
0E:BF43:4A LSR
0E:BF44:4A LSR
0E:BF45:29 0F AND #$0F
>0E:BF47:85 49 STA $0049 = #$00

On the last line it is storing 00 in $49 instead of 05 which is the town graphics.

I see it has a bad value in $BFB6 and $BFBE. DoaEditor is not picking that up for some reason.

Fixes:

0x3BFC6: 04 --> 54
0x3BFCE: 06 --> 56

Next time I crack open the DoaEditor code I'll try to figure out why it is reading those towns wrong.

Oh and if you'd like to advertise your ROM that is coming soon post some screenshots and I'll put it on the DoaE Mods Facebook page :)
User avatar
MiDKnighT
Sage
 
Posts: 260
Joined: Mon Oct 16, 2006 4:16 pm

PreviousNext

Return to Three Kingdoms Game Editing & Mods

Who is online

Users browsing this forum: No registered users and 1 guest

Copyright © 2002–2008 Kongming’s Archives. All Rights Reserved