Skip to content

New factions without replacing vanilla ones, .exe patch Auto-translated

No ratings yet — be the first to rate!
#1
Auto-translated

Greetings everyone. I've only been reading the forums before, and this is my first time posting something here.

For me, this is like a childhood dream coming true. I've tried all the faction-replacement mods in my time and dreamed — if only they could be added without replacing anything. And now this is possible.

In short — the .exe is patched in about 60 places, the town type and race IDs have been expanded so that now up to 24 new factions can be added on top. But that's only half of the framework. The project is still in development, but I can't help sharing the progress.

It seemed that a video overview format is more convenient for this, but if anyone prefers text, I'll duplicate the key points below the video.

Important: this is a demonstration that all this is possible, it is not a ready-made faction mod. I am developing a toolkit that I will later hand over to the community.

New Factions

The framework patches the game's .exe so that it replaces about 60 hardcoded faction IDs with its own expandable faction table. Technically, the expansion is currently made for +24 factions.

This allows you to fully add:

  1. Faction selection in the lobby (on any maps where faction selection is possible)

  2. Binding new heroes to factions and selecting them in the lobby

  3. Selection of new factions in the built-in map generator, their generation on the map

  4. Custom icon, custom town

  5. Music in the town

  6. Editable building window, including new unique buildings

  7. Native terrain (used in the map generator)

  8. Custom arenas, including during sieges (and that includes towers, walls, and tower icons)

  9. Tavern functionality, starting hero armies with faction creatures

  10. If a random faction is selected in the lobby, new factions are also included

  11. Dwellings on the map (again, if the map has random dwellings of certain levels tied to a faction, then when selecting factions, the dwellings of new factions are correctly substituted)

  12. Of course, custom creatures, tied to the new faction

  13. New creatures are correctly generated in stacks of random creatures

The AI works with new factions — it fully manages the town, buys creatures, and uses creature abilities in battle.

New Modding Toolkit - Constructor

Initially, adding factions was just for fun, but in the end it turned out much better than I expected, and I decided not to stop there. The problem with mod factions that replace vanilla ones has always been that they usually don't bring new mechanics. At best, there could be a recombination of creature and hero abilities, but usually it's just renaming and reskinning. The abilities are the same, just described differently in text and with different icons. This isn't bad, I enjoyed playing such mods, but it only works, in my opinion, as long as the factions are actually replacing vanilla ones. But as soon as we add factions, a conditional swamp faction based on the Horde with the same Barbarians already seems like a strange duplication of mechanics, especially since Blood Rage won't work with swamp creatures either.

Then I realized that simply adding factions is not enough. We need a toolkit that allows adding new mechanics: effects, statuses, abilities, skills, spells, etc. And combine all of this together.

I am a game developer myself, and I've written modular ability systems in games more than once, which are then configured in a data-driven style. So why not Heroes?

Accordingly, it was decided to make every aspect of the framework modular and divide it into declarative building blocks, from which you can then assemble whatever you want, name it however you like, and give it to whoever you want. For example, triggers (start of day, start of week, start of battle, end of battle, taking damage, etc.), effects (just one-time actions, e.g., apply a status), statuses (here the analogy is with vanilla statuses, but they are also composite — stack policy, removal policy). And all this is combined and built into various logic chains, providing huge scope for new mechanics. Then this is attached to creatures, heroes, skills, towns — and there you have faction features.

The base for the above is already done. All this can be attached to skills, spells (new ones can also be added), passives, new faction skills, even towns. Even custom progression (your own wheel with new skills) can already be done, meaning your own hero class. There aren't very many of these building blocks themselves yet. I've started a huge table, collected a ton of material from forums about what ideas for mechanics people have come up with (since my imagination alone isn't enough), I'm looking at how this could be expressed through these blocks, and I'm adding them little by little. So the end result should be a truly massive constructor.

Among the directly unique things already done — custom creature summoning (I summoned unicorns this way, for example). Moreover, you can even summon creatures on the opponent's side (who knows, someone might find a use for that too).

Compatibility

Another important aspect of the framework is potential compatibility. I'm trying to ensure internal compatibility as much as possible. That is, different people can work on different factions, and it will be possible to freely use combinations of these mods. For this, an automatic conflict resolution algorithm was implemented.

This algorithm automatically distributes IDs. There is no need to manually assign numbers to factions, creatures, spells, etc. Only string IDs — the framework itself will take care of the numerical representation in the game. There is also a save migration system — saves will most likely not break when adding new mods.

There is also a mod merging algorithm, if IDs are still the same somewhere or the same parts of the game are affected (and here there is potential compatibility with other mods in general, my framework patches the .exe on top of what's already there, without replacing anything, and this should supposedly be compatible with something like Armageddon's Blade), but I haven't tested it much. At the very least, in case of conflicts when starting the game, there is a window with a conflict notification followed by detailed logging of the conflict itself.

The mods themselves will ultimately be packaged into .h5u faction files. One faction — one file. I haven't done packaging of mods without factions (a hero class separately, or creatures separately) yet, everything is within the framework of factions. If there's demand, I'll do it. Accordingly, you can simply add/remove these .h5u files without fear of breaking anything (except that saves might break upon removal). Added a file — the faction exists. Removed it — the faction is gone, and it doesn't affect other factions.

What's Not There Yet (YET)

I haven't touched the network code at all. Multiplayer doesn't work.

I haven't touched or patched the map editor at all yet. It also doesn't work.

The framework is installed on top of vanilla 3.1 TOTE, it doesn't fully work on others yet, although the mechanism is practically there.

There is no installer — I can't share it for hands-on testing yet, except if I personally assemble a build with the patched .exe and give it out for testing.

There is no documentation, so even if I give someone access, it will be completely unclear what to do.

Plans

Multiplayer.

Integration with the map editor.

Compatibility with popular mods. There is compatibility with NCF, it should supposedly be compatible with Armageddon's Blade, but I haven't tested it yet. I'll try to make compatibility with Heroes 5.5.

An installer, so you just point to the Heroes folder and that's it.

Ideally, a full-fledged editor, so that all this data-driven fun has a normal, clear interface, validation, instead of digging through XML. The editor would also package into .h5u (currently I have Python scripts doing this).

More and more of those building blocks for mechanics.

Editing the game's UI, so that even new faction mechanics look completely polished.

Documentation on working with the framework.

How It's Made

The patch is made in the form of .dll libraries written in C++. The problem is that I can't explain how it works myself, since I'm not an expert. I actively use LLMs in development. This isn't some crappy vibe coding — I control the process to a sufficient degree at a higher level. But the actual process of reverse engineering and implementing the patch — I'm not doing that myself anymore. If necessary, I can try to figure it out or package the pipeline into documentation via a neural network, and knowledgeable people will then be able to parse it and understand how it works.

That's about it. For those interested in this topic — share what factions you would like to fully add to the game as new ones and, most importantly, what unique mechanics (abilities, statuses, skills, classes, buildings, etc.) you would like to see for such factions. I'll try to add as many elements as possible to the constructor so that these mechanics can actually be assembled.

I'll probably check in on the forum periodically with progress updates.

User Avatar
#2
Auto-translated

We're waiting!

I've had a "plan" gathering dust here for a couple of years 😎

image.webp

Attachments 1
1 file attached • Total size: 8.5 KB
Ссылка на мой мод Heroes 5 Armageddons Blade

Ссылка на мои уроки по модостроению в Героях 5

Ссылка на мой Artstation