Home › Forums › Destiny of an Emperor › Destiny of an Editor (permanent beta test mode active)
Tagged: Destiny of an Editor, Destiny of an Emperor, Huo Hu, Niahak, ROM Hacking, Xian Zhu Xuande, Zhuge Liang
- This topic has 1,129 replies, 26 voices, and was last updated 10 years, 12 months ago by
MiDKnighT.
-
AuthorPosts
-
October 25, 2007 at 4:13 pm #26740
Xian Zhu Xuande
ParticipantNiahak said:
This sounds like something my program should be able to do with a bit of work. Complicated, but it may be a project for the weekend.
I guess all the program would have to do is know how much free space it has to work with (the empty space after all the officer entries). The user would be allowed to use that free space for officers. Officer names should be limited by what can be displayed on the screen. When the program exports the officer data it would, I suppose, overwrite that entire section with the new values.
It would be pretty tough to catch small bugs, though.
Would have to be very careful with handling the position values!
I wonder how they continually describe them with only a single hexadecimal value for each…
October 26, 2007 at 2:48 am #26741Niahak
ModeratorWell, I’ve more or less figured it out…
It took some number crunching in Excel-equivalent (too cheap to buy Office), though.
It has a starting point (206881 dec, don’t have the hex on hand), stored by 11 hex. The next officer location is the in the byte difference between that, added to that point. I’ll do all my math in decimal to keep it simple.
51 – 17 = 34, so our next officer is expected to start at 206881+34 = 206915.
For our next, do the same:
84 – 51 = 33, so our next officer is expected at 206915+33 = 206948. When the diff is negative, we take the complement (add 256 to it).
The one thing I don’t get is why the duplicates are there (the 3 extra 74s at the beginning, for example). I did this in Excel-equiv to figure out what they did; turns out they are just junk (i.e. everything matches up without them).
So I think what I’ll be doing is storing the pointer values with each officer, then generating that section afterward. Take the diff between "original name length" and "current name length", add that to the value, make sure we aren’t going to spill over into anything important, then write the officers and their pointers.
October 28, 2007 at 4:08 am #26742Xian Zhu Xuande
ParticipantNiahak! A request, if you’d consider indulging it. I don’t know how the text reference table works so I’m not sure how to expand it. Would you explain to me how I might do that efficiently, or would you mind expanding it yourself? There is a lot of content that I’d love to change, but I don’t understand enough to even begin doing it just yet…’);
October 28, 2007 at 5:57 am #26743Niahak
ModeratorI’ve taken a look at auto-generating it and I’m not sure there’s an easy way to go about doing it. I thought it was integer-indexed (i.e. if "Bob" is right after "Fred", Fred’s index is Bob’s + 1), but I tried generating it like that and it was off by quite a bit. When I worked on mine (the one in the table), I mostly looked for words I knew – I went off of the first speeches in the game for many of them.
Also, since I’ve been working on it lately, an update on pointers and such!
I believe I am updating the pointer refs properly… but apparently NPC sprite refs are right after officers are!
I tried changing "Cheng Yuan Zhi" to "Cheng Yuanzhi", then updating everything. I essentially shifted everything back one value, updated the pointers… the generals seem to have mostly come out okay but…

Whoa!

The mysterious ghost Song brothers…
Somewhat bizarrely, nearly everyone in Xuzhou has changed into one of three sprites:
1) Blue Pirates
2) Blue Zhang Bao (like on the icon for DoaEd)
3) Blue Liu Bei-lord-sprite
I’m looking into what might’ve caused this now.
October 28, 2007 at 6:01 am #26744Niahak
ModeratorWell, that was fast. Turns out the pointers after the officers all point to townspeople, and I had forgotten to update them! Whoops.
By the way: as far as I can tell there are 70 spaces we can fit officer names in. If we fix all the Si Mas and Zhu Ges, that gives us a goodly amount of stuff to fill in with other things. This should make pretty much any officer mod no problem when I finish it :)
October 28, 2007 at 6:39 am #26745Xian Zhu Xuande
ParticipantNiahak said:
By the way: as far as I can tell there are 70 spaces we can fit officer names in. If we fix all the Si Mas and Zhu Ges, that gives us a goodly amount of stuff to fill in with other things. This should make pretty much any officer mod no problem when I finish it :)
I’m thrilled that you are making progress on this! That will make a number of new things possible. I wonder how hard it would be to actually add new officers and create references to them. I suppose if you were adding officers to castle battles that would require program-updating more limited references, but that should solve problems like references. It would be really awesome, in the end, if we could make it possible to actually move officers around and add people to castle battles where possible. Are references to officers in the database (e.g. Han Zhong being both an officer and a state) easy to update and calculate?’);
October 28, 2007 at 6:41 am #26746Niahak
Moderatorand… victory!

Unfortunately it only worked the first time around. I was reading townsperson pointers wrong, but writing them correctly… so loading what I changed then re-saving caused…

Attack of the clones!
Fixed that problem, so now we have…

Even more thorough victory!
Guan Yu’s name is actually "reallylongnamenosrslythistime". Unfortunately, the game only displays 14 characters in-battle (curiously, 15 in general-screen).
James: I’m not sure how feasible it would be to add officers or to change which ones are in which battle. I’m really hoping that the pointers there are done by number of officer (i.e. officer number 160 is Pang De, or some such, so "officer 160" is in set battles). If they are, that shouldn’t be too bad.
I have no idea what the best remedy for Han Zhong is. I would guess finding where he’s being referenced, then fixing up a dictionary reference for the region would be the best solution… but then we’d have to do more dictionary stuff.
I will look over and do more thorough testing tomorrow morning (re: afternoon as I like sleep). Then it may be beta-release time :)
October 28, 2007 at 10:44 pm #26747Xian Zhu Xuande
ParticipantNiahak said:
I will look over and do more thorough testing tomorrow morning (re: afternoon as I like sleep). Then it may be beta-release time :)
Awesome news!
One more solution for Han Zhong would be to take that unused Xun You reference and turn him into Han Zhong. The pointer could then be set in his direction, and the problem would be solved. Just being able to do this stuff would be grand!
Two more questions:
1) Do you know how rebel soldiers work? There appears to be a 00 soldier value which bases soldiers off region. That value must be modified by a multiplier or value tables somewhere
October 28, 2007 at 11:56 pm #26748Niahak
ModeratorOkay, looks like said beta-release may be delayed a bit.
When I posted about how pointers were calculated, I figured they just used a simple diff +256 if it was negative. Turns out there’s another set of values indicating what page they refer to… but thankfully they’re easy to find.
I’ll figure out how these work, then hopefully have something good to show. Probably won’t be till tomorrow, though – feeling rather fuzzy tonight and fuzziness + pointers = bad.
1) I’m not sure how rebel soldiers work. I haven’t had a chance to look into it – I only know they’re mysteeeeerious :P
2) I’m not aware how the experience-per-level is determined, either, I’m afraid – too busy with the officer editing stuff to look into much of anything else.
October 29, 2007 at 12:48 am #26749Xian Zhu Xuande
ParticipantThanks for what you’re working on so far! If you don’t mind, would you consider taking a moment to look into the level-ups? I’ve found that they make the progression in the beta we’re testing now extremely off-balance in many areas, and if I could make adjustments to the level-up system that would work absolute wonders. It would save me days of careful adjustment, too! If you’re able to look! FLEXX’);
October 29, 2007 at 2:53 am #26750Niahak
ModeratorOkay, got a final burst of energy for the night :)
I’ve updated the program somewhat and now it changes both kinds of pointers as needed.
I had a brief issue with townspeople again (this time, only Song Yong, Song Ren, and the guy who complains about Cui Zhouping, in testing)… but it has been resolved (I update their pointers too).
As a test, I converted DoaE 2.0 beta (or the version I have anyway) into the new pointer system. After some initial hurdles (which thankfully helped fix some tricky pointer-bugs), I have ported the old system (using FFs to fill empty values) to the new system (updating pointers instead). The new version loads fine in the editor (which displays that now there are 108 extra characters of space left! The original had 70)… and I tested it as well; no issues that I saw.
So… this is still a test build, but it’s far beyond what it was before. It’s a bit rough around the edges, and it may still have some bugs – but that’s what beta testing is for. Please take a look and let me know what I can/should work on.
Operating instructions:
1) Load the ROM.
2) Click on an officer’s name.
3) Change stuff about that officer.
4) Click "Save" to save changes to that officer.
5) Repeat 2-4 as desired. There is no error accounting for using *too much* space – generally I would say it would lead to very bad things. However, it does tell you how much space is left.
6) When you’re ready to save the new ROM, click file->Export to ROM. I recommend saving it in a new file and testing, just in case it still isn’t all working.
Porting older changes:
The extra FF values show up as underscores "_" in the editor. To get rid of them, simply delete, save the officers as you go, then export.
–I’ll look into the level-ups tomorrow if I get a chance. Not sure where to begin looking, but I may be able to ask someone more knowledgeable for advice.
October 30, 2007 at 12:45 am #26751Niahak
ModeratorI haven’t found the level-ups yet, but I *have* found where regular soldier values are stored.
Look in 33EE0 (just past all the Officer stuff).
You’ll see a mysterious sequence
0000640068006E
…
If you convert 0064 to decimal, you get 100. 0068 is 104. These are encoded as 01 and 02 in the table we made…
These continue up to A000 which is 40960 :)
Unfortunately, there it looks like it gets more messy. I don’t know if I could decipher the level-up amounts. I’ll look into it a bit more.
Any idea how much EXP it takes to go up each level for, say, even the first 5 levels? It would help a lot to figure this out, if it’s stored in anything near normal formatting.
October 30, 2007 at 1:21 am #26752Niahak
ModeratorI came to realize today what I should have looked for a long time ago.
You know how every time you get hit, you’re forced to press a button?
9 of Liu Bei’s
soldiers
were
(press button)
defeated.
What if you didn’t have to press it anymore?
Change the value at:
28731 from FD to FB to make this into a simple line break, and you won’t have to do this when you get hit ever again.
October 31, 2007 at 2:33 am #26753Xian Zhu Xuande
ParticipantFirst, I’m thrilled that you have found the soldier values!
Here are some other goodies to keep an eye out for:
– Weapon APs
– Armor ACs
– Level Progression
– Rebel Stats/Soldiers
– An Sha Immunity Flag *
– Name Wrap Flag **
* Some officers are immune to An Sha. There must be a flag!
** The game normally separates the first and last name. There is some sort of flag that tells the game to word-wrap the name (Zhuge Liang, Cheng Yuanzhi, Xiahou Anyone) that prevents normal use of two-part names. I wonder how to disable it?
(E.g. Xia Hou/ Yuan, named ‘Cao Xie’, presents as Cao Xie on one line).
I’ve been using the tool. It has done a good job, so far, of adding characters to a few names. I haven’t encountered problems stemming from that yet, and I have altered a few names both up and down (and in Zhuge Liang’s case, down then up again).
I have noticed but one thing that I would like to request!
You can add an apostrophe to names (e.g. Chang’an) and I wanted to add one to my little character, Cao Ghost — I wanted him to be Cao’s Ghost). When I try to export that name the program gives an unexpected exception error. :)
October 31, 2007 at 3:26 am #26754Niahak
ModeratorOn name-wrapping:
I noticed when looking through some of the characters, some people had values other than FF right before their names! (this was one of the first problems I ran into when parsing – there’s an exception to every rule, including this one :D ) I have no idea what the numbers there actually mean, though, so while I don’t think there will be side-effects… there may well be.
Such people were the tri-name people (Cheng Yuan Zhi, Zhu Ge Liang).
I don’t have support for this in the tool (as it’s not confirmed to work yet), but you could try changing the 10 right before Zhuge’s name to FF and see if that fixes it. If it works as I suspect it does, this will also fix Cheng Yuanzhi, although Pei Yuanshao will never be displayable properly (as Yuanshao is 8 characters).
To add apostrophes, you should be able to just add the ‘ to the list of characters in both the alpha-tables: doaetable.tbl and revdoaetable.tbl, just as with a normal table file. As long as you keep the formatting (in the first, 2 characters = 1 char, in the second the reverse) it should load them fine and have no problems.
The APs, ACs, and Level progression I’m not sure about. They’ve got to be stored somewhere and are probably in an order…
I did notice, though, that prices are stored with the weapon names. Ex. Dagger has 32 right before it -> 50, Flail has 64 before it -> 100. All item names are stored starting at 2FAF0.
The An Sha flag…
I don’t see anything Zhou Yu, Sun Quan, Cao Pi and Sima Yi have in common aside from a white portrait background, sadly. Any idea if Yuan Shu and Yuan Shao are also immune to An Sha? Who else is known to be immune?
Have you tried setting Sima Yi’s int to 0 and An Sha-ing him?
-
AuthorPosts
- You must be logged in to reply to this topic.