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
-
May 15, 2013 at 9:32 pm #40310
ludmeister
ParticipantMiDKnighT–
Good afternoon!
I noticed in my ROM that there is about 0x300 bytes of space free in ROM page 0B (at about 0x2f380 to 0x2f67f). This is the ROM page that contains names for Tactics and Items. Do you know if this space is used Destiny of an Editor for Text editing? I'm planning out expanding the number of weapons and armor available for use.
I've got Base AC working, and will do a write up of this in a little bit. It was a bit hairier than I was hoping… I had to actually move the Status Screen weapon power display values to the ROM page 1E as well :evil: The defense for officers is actually only calculated when equipping/unequipping items. So, I had to figure Base AC separately, at the time of display or use in battle, and not save this to memory, so I needed two functions: one for Status screen display, and one for Battle functionality. The awesome part of this, though, is that Base AC is viewable from the Billeting status function! :P
The plan for the Items changes (I've done quite a bit of code research :study: , and I do believe my plan is workable) is to make use of the dummied item IDs that DoaE has for weapons/armor/helmets. However, if I did this, we'd have 25 potential weapons (up from 19), 13 armors (up from 7), and 10 helmets (up from 8). I'm actually being more ambitious than this, and want to realign the way items are handled by the game, allowing
30 weapons
10 armors
8 helmets
!! :lsd: !!
So, this is a nasty edit, and doesn't easily lend itself to the IPS patch. It would require a realigning of the existing item structure (Weapons begin at ID #40, Armor begins at ID #5e *not 59* and Helmets begin at ID #68 *not 66*. It would require string pointer manipulation for item names (and finding space for the item names!), shop realignment so that the shops don't sell unintended stuff), treasure and hidden item replacement, as well editing code to open up the space for the weapon strength, and the defense power for armor.
:smoke:
How would you like this attacked, so that this could be put into IPS format? It will absolutely require 1MB expansion. The Item Expansion change would also most likely require the Base AC change, as it takes advantage of moving the Status Weapon power display values off of page 0E. I almost think that this should be a separate IPS patch, as I can't imagine many would want to do all that realigning work with items in general. I do think that this has the capacity for making the game much more interesting, and giving modders tools to give officers more unique weaponry and defensive capabilities… The problem is, and I'm not sure I see any way around it, the item expansion would still require a bit of a learning curve for modders to take advantage of.
The bonus of having this in a separate IPS patch is that the item realignment (with shops, treasure and hidden items, as well as names) could be packaged with it. The downside with this is, of course, that modders would lose their custom items. Blargh. My head is spinning.
When all else fails... manipulate the source code.
May 15, 2013 at 9:42 pm #40311ludmeister
ParticipantHmmm… the way to go about Item Names may just be, and I hate to say it because it adds a layer of complexity implementation-wise, would be to use another ROM page. Then, I imagine that we'd have all the space we need for names, and that could make for easier visualization for modders when working with the hex (not to mention the item costs). That may actually be the best solution. What do you all think?
When all else fails... manipulate the source code.
May 15, 2013 at 11:23 pm #40312sonic.penguin
ModeratorUsing a new page would probably be best as running out of space via the middle of making changes would just make things harrier. I was actually wondering if somehow either AC or INT could be used to actually boost defense vs. tactics. Leveling AC and such is cool, but only works against physical damage in the current structure. Too bad you can't have dual AC eh? Like M.Def in Final Fantasy. Currently its just like M.Block, it either misses for no damage or hits for full damage.
I would agree also that a seperate IPS patch for this would be a must as, from experience, I know that editing shops and such can be a real pain, especially making it balanced, but I do think that new weapons would be awesome, but make sure they have at least 10 slots for letters, even if less are used if possible. IE: War Hammer or Sky Spear etc.
May 16, 2013 at 1:46 am #40313Niahak
ModeratorQuote:Do you know if this space is used Destiny of an Editor for Text editing?Straight from the DoaEditor code:
Code:private static class TextBank1Constants
{
public const int pointerStart = 0x28010;
public const int pointerBank2Start = 0x28210;
public const int textStartPoint = 0x283f8;
public const int textAdjustedStartPoint = 0x20010;
public const int BankLength = 487;
public const int BaseBankNumber = 0;
public const int EndPoint = 0x2bfdf;
}private static class TextBank2Constants
{
public const int AdjustedStartPoint = 0x24010;
public const int PointerStart = 0x2c010;
public const int PointerBank2Start = 0x2c210;
public const int StartPoint = 0x2c390;
public const int EndPoint = 0x2fa0f;
public const int BankLength = 384;
public const int BaseBankNumber = 3;
}private static class TextBank3Constants
{
public const int AdjustedStartPoint = 0x34010;
public const int PointerStart = 0x3c010;
public const int PointerBank2Start = 0x3c210;
public const int StartPoint = 0x3c390;
public const int EndPoint = 0x3EB9A;
public const int BankLength = 47;
public const int BaseBankNumber = 0xa;
}"PointerStart" and "Endpoint" are probably what you're looking for. DoaEditor does use that little section for Text Bank 2 since there isn't much other space to work with in that area.
I have SVN set up for DoaEditor and would be glad to make you an account in case you'd like to tinker with it.
May 16, 2013 at 12:11 pm #40315MiDKnighT
ModeratorYa, I agree with sonic and Niahak. I wouldn't touch the pages where text banks live because the text banks can grow. I know sonic fills the text banks up to the brim. Page 1E or a new page (I recommend 3C, 3D, or 3E) would be best.
The increase in the number of weapons sounds great but if we do that, it makes the menu change I talked about long ago a little more important. One of the most annoying things about the original DoaE engine is equipping a new set of equipment. Ideally if you equip or unequip a weapon, it shouldn't make the menu disappear. It should allow you to do more things in one shot (like equip 3 items) where only the B button takes you out of the menu.
As for the IPS patch. Maybe include optional enhancements as separate IPS patches. Maybe we should designate a page or two for optional enhancements that the main IPS patch doesn't touch? Perhaps 3E and maybe 3D? I still need to get the IPS patch updated to 1M too – hopefully I can get that done this week.
May 16, 2013 at 2:24 pm #40316ludmeister
ParticipantNiahak:
That would be really cool if you would set up an SVN for me. No rush on it, but thank you very much for the offer! :P
Sonic:
An M.Def type effect would be neat. That sounds like something that might be worthwhile tackling, though I'm scared of attempting to add a new character attribute… that would likely be beyond what I can do at this time, at any rate.
MiDKnighT and all:
As far as the new place for item text, I coded like a madman last night and placed it on page 3E (0xfb010 – 0xfb810). With the item expansion hack, item costs are always in bytes ending in 0 and 1 (i.e. 0xfb110, 0xfb111) and obviously, the name follows. So, if your hex editor shows lines 0x10 in length, the item names and costs will line up for you. For me, this is invaluable for modding on the quick.
Quote:The increase in the number of weapons sounds great but if we do that, it makes the menu change I talked about long ago a little more important. One of the most annoying things about the original DoaE engine is equipping a new set of equipment. Ideally if you equip or unequip a weapon, it shouldn't make the menu disappear. It should allow you to do more things in one shot (like equip 3 items) where only the B button takes you out of the menu.Ah! I had forgotten about that. That sounds good, I'll see what I can do on that. My feeling is that equipping, trading, or dropping an item should, after execution of the command, re-open the current officer's pack (like it had just been selected again). This would be important if they traded away or dropped their last item.
Quote:As for the IPS patch. Maybe include optional enhancements as separate IPS patches. Maybe we should designate a page or two for optional enhancements that the main IPS patch doesn't touch? Perhaps 3E and maybe 3D? I still need to get the IPS patch updated to 1M too – hopefully I can get that done this week.I've actually got an IPS patch together that does the Base AC and Item Expansion edits– just click on the link below to download it. You can only apply it (safely) to a 1MB ROM. If you're using Firefox… right clicky -> Save as.
Download Base AC and Item Expansion patch
Patch details
***************************************************************************************************************
Here's the nitty gritty of the stuff that has it's location changed:
Weapon Power- Status display: 0x78640 (none), 0x78641 to 0x7865f (ID #40 – #5e)
Weapon Damage- least significant byte: 0xfe710 to 0xfe72f (0x20 bytes), also 0x7e710 to 0x7e72f
Weapon Damage- most significant byte: 0xfe730 to 0xfe74f (0x20 bytes), also 0x7e730 to 0x7e74f
Armor Defense: 0xfe750 to 0xfe758 (0x09 bytes), also 0x7e750 to 0x7e758
Helm Defense: 0xfe759 to 0xfe760 (0x28 bytes), also 0x7e759 to 0x7e760
Defense values for opposing generals: 0xfe750 to 0xfe777 (0x28 bytes), also 0x7e750 to 0x7e777
Item Name Pointers: 0xfb010 to 0xfb0ef (0xe0 bytes)
Item Names: 0xfb110 to 0xfb80f (0x700 bytes)
That may look like a lot, but most of the stuff above is encapsulated in the 0xfe710 to 0xfe777 and 0x7e710 to 0x7e777 ranges.
So, Item IDs #40-#5e are used for weapons, #5f-#67 are for Armor, and #68-6f are for Helmets.
The patch creates the dummy names for the expansion items, and makes sure that all items are still in the same place (whether given at the start, sold in stores, or found in chests on hidden on the ground). Armor defense is not re-aligned for use with Base AC enhancement; it uses stock DoaE defense values.
The Base AC enhancement works as advertised (at least, as far as my meager testing as gone). The equation used is:
let x = STR/2 + INT/4 + AGI/4
Base AC = x * 3 * level / 256, capped at 100
New Hacking Ideas
***************************************************************************************************************
First, I intend to add a few characters to the DoaE font. Have you noticed how characters 0x40-5f are lonely and unused? I am going to add several characters to delineate differing types of items (swords, axes, mail shirts, potions, horse heads, etc.) This would be very cool for making neat looking item names, like in DoaE 2.
Second, what do you all think about implementing a moddable item drop list for after battle spoils? :unibrow:
When all else fails... manipulate the source code.
May 16, 2013 at 6:11 pm #40317MiDKnighT
ModeratorAll I have to say is…
Saweet! I'll get your new IPS patch added to the guide soon.
Quote:That would be really cool if you would set up an SVN for me. No rush on it, but thank you very much for the offer!Wow – another coder for DoaEditor perhaps? That would be fantastic. It seems that these days we have trouble keeping DoaEditor up with all these enhancements and findings. Hopefully someday DoaEditor can be so updated and efficient that mods like "Flames of Wu" will be possible for other modders as well. Right now a mod like "Flames of Wu" takes sooooo much time to make with a ton of hex editing. Right sonic? 8)
May 16, 2013 at 8:26 pm #40318ludmeister
ParticipantHey MiDKnighT,
I noticed a typo in the Section 12, under Starting Lineup. The guide says to modify this:
Code:0x375D0: A90A8DF861A9018DC0608DC160A9028DC260A9148DB4608DB5604C3C94That code is actually found @ 0x357d0. FYI :wink:
When all else fails... manipulate the source code.
May 16, 2013 at 8:30 pm #40319MiDKnighT
ModeratorQuote:That code is actually found @ 0x357d0. FYIFixed.
I also added your new enhancement to the guide. Working on 1MB IPS patch now.
May 16, 2013 at 8:55 pm #40320MiDKnighT
Moderator1MB IPS Patch 1.2 is updated!
May 16, 2013 at 8:59 pm #40321ludmeister
ParticipantAwesome! Thanks, MiDKnighT.
I also have some code to insert if people want to make use of my Item Icons.
Place @ 0x27c10 (0xb0 bytes)
Code:004060703C181606C0E0713A1C0F1727
E0F0FA7A3A043B0340406030391E070B
D0E0609008040201402098FCFEE7713C
70D8B8E87C0E0703384442212162E4C2
002E94E8F4622100804F31324C485060
1048249E5B331F0E42E7FF7E7E5A3C3C
28D6AA546C54AA44DBBD7E66183C5ADB
097AFFDF8D0D18107C027CFE1E7C1E00
3C182442FFFFFF7E031E2F7F7FFFF160
0F304758233C77F13C1E396DD6EE7C38
3E427E4A7E527E00000006FDF9AD0600Here's a rundown of the icons that you will receive. Open up the PPU Viewer in FCE Ultra to check them out.
40- Dagger
41- Sword
42- Broadsword
43- Curved Sword
44- Spear
45- Large Polearm Head
46- Mace
47- Whip
48- Axe
49- Bow
4a- Claw
4b- Robe
4c- Mail
4d- Armor
4e- Bandana
4f- Helm
50- Potion
51- Horse Head
52- Wing
53- Generic Pouch
54- Letter
55- Key
56- Staff
Here's a screenshot with some of the new enhancements in action:

If someone wants a few tactic icons, I might be able to cook those up in the next couple of days. :ninja:
When all else fails... manipulate the source code.
May 16, 2013 at 9:07 pm #40322MiDKnighT
ModeratorWow, that is uber cool. Thanks lud – that will be a new guide addition and that belongs in the main IPS patch.
May 16, 2013 at 9:20 pm #40323ludmeister
ParticipantAh. I should probably note that I edited the box borders, as well. Instead of giving the code, I'll tell you how to make your own:
Each font character is 8×8, and so each is 8 bytes in size. Row 1 is first bit, Row 2 is second, etc.
So, a DoaE 1 "zero" looks like this:
Code:-*** **– 7c
**– -**- c6
**– -**- c6
**– -**- c6
**– -**- c6
**– -**- c6
-*** **– 7c
—- —- 00This is found @ 0x27a10, where the first character in the font set is stored in the ROM (zero is char ID #00).
Here's where the box borders are:
Bottom-Left: 0b (0x27a68)
Top: 0c (0x27a70)
Bottom: 0d (0x27a78)
Top-Left: 6d (0x27d78)
Top-Right: 6e (0x2d80)
Bottom-Right: 6f (0x27d88)
Left: 7d (0x27df8)
Right: 7e (0x27e08)
I suggest firing up a graphics program (Paint will work fine), create an 8×8 bitmap. Magnify it so you can see all the pixels, and start playing around to see what looks good. When you like it, hex-edit the character, using the graphic you created.
When all else fails... manipulate the source code.
May 17, 2013 at 2:25 am #40324DragonAtma
Moderator…better yet, open it up in TLP and edit it in.
May 17, 2013 at 2:40 am #40325Niahak
ModeratorQuote:That would be really cool if you would set up an SVN for me. No rush on it, but thank you very much for the offer! :PIt's set up. Sent you an email via the contact system on your site. Feel free to make any edits you like, as I'm not sure how often I can make updates to the tool now. Let me know of any questions you have.
-
AuthorPosts
- You must be logged in to reply to this topic.

