Dominions 5

Dominions 5

Loggy 4 Mar, 2022 @ 7:00pm
3
4
3
2
2
Illwinter, Executable modification and Bless Modding
After some digging around, it seems that the current bless system is set up in a way that can be modded, albeit not in the usual sense: it is simply a data table sitting around in the executable, which, usefully, is identical in all the builds of dom5 for the different platforms.

As such, it's fairly simple to locate and edit this table in an automated fashion to create a large array of new bless effects, and this can be done relatively easily for all platforms due to the fact the table looks the same in all of them. Additionally, doing this does not require messing with any instructions of executed code, only the data table.

Thus, my question: does Illwinter object to the sharing of programs/source code that produce a modified copy of dom5 executables? Distributing any derived executables in their own right should obviously be a big fat no on IP/copyright grounds, but modding the bless data table can be done in a way that requires each user to have a working dominions 5 executable to modify, rather than shipping out the whole thing every time.

I would also point out the the open source scripts used to scrape the data for the mod inspector already could be used in reverse to learn how to mod the other data structures of the base game in ways that the usual .dm files cannot. For example, applying the same principle to the unit data table should allow the creation of this guy[cdn.discordapp.com]. which traditional modding cannot do due to lack of mod commands for many of the abilities shown there.

I'm well aware that implementing this "properly" in the form of official .dm mod commands takes time and effort, which is why I looked into whether I could use what I know about the game to easily implement some kind of bless modding, which seems to be quite highly desired. While needing to edit data tables in the executable is an unfortunate hoop to jump through, I suspect there are people out there who would greatly enjoy being able to play with this...

This image[cdn.discordapp.com] shows an example of fire blesses from an alternate universe. I didn't put a huge amount of thought into power/pricing here, but did take the time to test to ensure all these effects worked when added in this way.

I wrote a parser for "mod" files of this format[media.discordapp.net]. Here is some of that which I used for the image above.

For the curious, details about what is possible regarding bless modding:

There is room in the current executable for 100 bless effects, of which one is reserved for the morale +1 that all non-independents get when blessing sacreds. I haven't looked into this one specifically but it is very likely that it too can be edited.

By editing this table:

A bless can be given any primary and secondary path mix. The ingame UI orders them correctly as shown above. Incarnate blesses are hardcoded to those with primary path levels of 5+, but this can be worked around by splitting the bless point cost into the secondary path. For example, N7 regeneration can be made non-incarnate by making it have a primary cost of N4 and a secondary cost of N3.

A bless can be given up to four scales requirements. Either I misunderstand how to write the format, or Order cannot be used as a scale requirement for some reason (or the UI refuses to accept that your pretender has the necessary scales). The UI otherwise enforces these correctly, but multiple scale requirement icons are rendered nearly on top of each other[cdn.discordapp.com] which is a little unfortunate.

A bless can be given a "buffs type 1" (or effect 10 for modders who know such things) damage bitmask to apply, which is how the vanilla quickness and fortitude blesses operate amongst other things. The flaming arrows bless above uses this.

A bless can also be given up to 7 effects to apply. These are in internal ID form[docs.google.com], and not all on this list will work when added this way.

A bless can be allowed to be picked multiple times like Undying, but this uses up one of the seven effect slots.

A bless can be flagged as always active (on all sacred units without requiring blessing), but this also uses up one of the seven effect slots.

The shortcomings include: custom blesses are not included in the bless effect lists from clicking the lit candelabra icon or the temple button on the map. Fixing this would require code changes, which is unfortunate, but the effects still work...

I have not tried to understand the tooltip system for blesses, meaning that they all currently have none, hence the need to try to stuff as much detail as possible in the 32 character bless names.

Oh Steam, I wish you had a preview post option, it would save so many headaches posting something then waiting a minute for it to be reviewed, only to need to go and edit it again.
Last edited by Loggy; 4 Mar, 2022 @ 7:03pm
< >
Showing 1-15 of 45 comments
freek_o_nature 4 Mar, 2022 @ 7:43pm 
Holy. Pretty amazing work! I really hope this gets picked up! Wow, dude.
No One 4 Mar, 2022 @ 7:56pm 
I thought originally modding was modifying the executable, (specifically of Wolfenstein 3D). Doing it the easy way was added because it was popular. Though in DOOM all they did was essentially separate the engine and the engine's data so when you hacked the binaries you couldn't accidentally make it crash, from what I understand.

If you really wanted to make the distinction you could call it an unofficial patch.
Smiling Spectre 4 Mar, 2022 @ 8:58pm 
Originally posted by Loggy:
A bless can be given any primary and secondary path mix. The ingame UI orders them correctly as shown above. Incarnate blesses are hardcoded to those with primary path levels of 5+, but this can be worked around by splitting the bless point cost into the secondary path. For example, N7 regeneration can be made non-incarnate by making it have a primary cost of N4 and a secondary cost of N3.
I believe, you are wrong in this part. N4+N3 will equal "N4 checked twice". Can be wrong though. Otherwise - good work!
Last edited by Smiling Spectre; 4 Mar, 2022 @ 8:58pm
Loggy 5 Mar, 2022 @ 5:21am 
Originally posted by freek_o_nature:
Holy. Pretty amazing work! I really hope this gets picked up! Wow, dude.

Thanks!

Originally posted by No One:
I thought originally modding was modifying the executable, (specifically of Wolfenstein 3D). Doing it the easy way was added because it was popular. Though in DOOM all they did was essentially separate the engine and the engine's data so when you hacked the binaries you couldn't accidentally make it crash, from what I understand.

If you really wanted to make the distinction you could call it an unofficial patch.

I agree, and given that there is a reasonable probability that Illwinter might read this, I thought I would take the time to ask. I don't want to step on any toes here and put something out that can't be taken back.

For what it's worth, you can absolutely crash the game with this. The easiest way I've found to do this is to make a bless require an invalid scale. The names of scales are stored in a simple array of pointers to their names elsewhere in the executable. There's no runtime checking against this, which, if nothing else goes wrong first, is likely to cause an access violation the moment the game tries to fetch the name of the nonexistent scale. The dm-like parser can trap things like this, though.



Originally posted by Smiling Spectre:
I believe, you are wrong in this part. N4+N3 will equal "N4 checked twice". Can be wrong though. Otherwise - good work!

If a picture says a thousand words, how many does an animation say?[cdn.discordapp.com] If this were a spell though, you'd be absolutely right; it's only because bless path levels turn into path point costs that this seems to work.
Last edited by Loggy; 5 Mar, 2022 @ 5:25am
Hasefrexx 5 Mar, 2022 @ 5:52am 
This is worthy of my Booli of the year award.
GrooveCrusader 5 Mar, 2022 @ 6:50am 
Such an excellent post OP! my question though is that would it be possible to mod in nation exclusive blesses? Similar to how all other nations have their own exclusive spells?
Loggy 5 Mar, 2022 @ 6:52am 
As far as I can see, that is not possible with the current setup Illwinter have provided.

The way I look at these things is, if the functionality already exists in the executable and is just inaccessible with modding commands, it's a lot more reasonable to make requests for than asking them to write/add new stuff.
Last edited by Loggy; 5 Mar, 2022 @ 6:54am
Legowarrior 7 Mar, 2022 @ 5:43pm 
Keep us posted on this.
Subak 10 Mar, 2022 @ 9:40am 
can be done in a way that requires each user to have a working dominions 5 executable to modify

I think dom does not use the typical steam DRM.

However, if it does, you would HAVE to do it this way because the rest of the exe has bits explicitly tied to a specific steam user account.

Also, custom blesses are cool, but I'm not running anything from someone who already demonstrated they can hack an exe like that.

Granted, a data table is a bit different than inserting your own instructions, but it's just not terribly far off, lol. Cool stuff, and good luck though!
Loggy 13 Mar, 2022 @ 1:53pm 
Not sure how I missed this reply, alas.

Originally posted by Jo Daddy:
I think dom does not use the typical steam DRM.

I don't know what Steam's typical DRM looks like, but given that there aren't any extra steps needed to start looking inside the game executable I'm going to assume not.

However, if it does, you would HAVE to do it this way because the rest of the exe has bits explicitly tied to a specific steam user account.

Originally posted by Jo Daddy:
Also, custom blesses are cool, but I'm not running anything from someone who already demonstrated they can hack an exe like that.

As mentioned above, doing things this way doesn't require modifying actual instructions which is the scary part. Someone with a bit of experience looking at binary data files and a decent amount of dominions modding experience could also have done this, it's as difficult as ctrl-f for the name of an existing bless, making sure that you are actually looking at the bless data table (which is pretty obvious with a little experience reading/writing files packed like this), then taking the time to look at the data table and figuring out what does what. Considering that people bruteforced the internal effect IDs using 5xx and 6xx effects, it'd be entirely feasible for someone to reach this point without having to worry about reverse engineering actual instructions.

Originally posted by Jo Daddy:
Granted, a data table is a bit different than inserting your own instructions, but it's just not terribly far off, lol. Cool stuff, and good luck though!

If I ever release anything to do this, I'd open source it for the reasons you've pointed out. Granted, I don't expect that to stop people being afraid of the nature of the messing around, but... what can a guy do?
mekamoari 18 Mar, 2022 @ 2:14pm 
Big support for this, would enable both light rebalancing of currently suboptimal blesses as well as major overhauls, bless draft games and various other options.

Compared to the relative ease of modding it, it should definitely be supported.
+1
Legowarrior 1 Apr, 2022 @ 7:41am 
So, are we getting anywhere on this front?
Nebulosa 1 Apr, 2022 @ 1:34pm 
This would be amazing for the game -- both for balance and for variety.

Also, I don't think this legally requires Illwinter's permission -- the best example is randomizers for old SNES games in the speedrunning community. It is a violation of copyright law to send someone a copy of Link to the Past, but just fine to say "hey, if you have a copy, twiddle these bits in your copy and let's race"
Last edited by Nebulosa; 1 Apr, 2022 @ 1:53pm
Loggy 1 Apr, 2022 @ 2:11pm 
It isn't so much the legal side I'm concerned with as you've pointed out, I'm wanting to ask mostly out of respect to Illwinter and what they do. I don't want to undermine them or make them unhappy by going and doing something that can't really be undone.
< >
Showing 1-15 of 45 comments
Per page: 1530 50