Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Error Details:
Share Link
New factions without replacing vanilla ones, .exe patch
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 has been patched in about 60 places, the town type and race IDs have been expanded so that now you can add up to 24 new factions on top. But that's only half the framework. The project is still in development, but I can't help sharing the progress.
It seemed that a video review format is more convenient for this, but if anyone prefers text, I'll duplicate the key points in text below the video.
Important: this is a demonstration that all this is possible, it's not a finished faction mod. I'm 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, for now the expansion is made for +24 factions.
This allows you to fully add:
Faction selection in the lobby (on any maps where faction selection is possible)
Binding new heroes to factions and selecting them in the lobby
Selection of new factions in the built-in map generator, and their generation on the map
Your own icon, your own town
Music in the town
Editable building window, including new unique buildings
Native terrain (used in the map generator)
Your own arenas, including during sieges (and that includes towers, walls, and tower icons)
Tavern functionality, starting hero armies with faction creatures
If a random faction is selected in the lobby, new factions will also appear
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)
Of course, your own creatures, and they are tied to the new faction
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 in my opinion, this only works 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'm 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. And why should Heroes be any different?
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 enormous 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 created a huge table for myself, collected a ton of material from forums about what ideas for mechanics people have come up with (since my own 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 enemy'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 maximize internal compatibility. That is, different people can work on different factions, and it will be possible to freely use combinations of these mods. For this purpose, an automatic conflict resolution algorithm was implemented.
This algorithm automatically distributes IDs. There's no need to manually assign numbers to factions, creatures, spells, etc. Only string IDs - the framework will take care of the numerical representation in the game itself. 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 somewhere the IDs are still the same 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 made packaging for 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 the 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's 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 tests.
There's no documentation, so even if someone were given access, it would 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, understandable interface, validation, and not digging through XML. The editor will also package into .h5u (currently I do this with Python scripts)
More and more of those building blocks for mechanics
Editing the game's UI, so that even completely new faction mechanics look fully fleshed out
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 don't understand it. 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 don't do that myself anymore. If necessary, I can try to figure it out or package the pipeline into documentation through a neural network, and knowledgeable people will then be able to analyze 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.
Is it possible to upload these materials to VK Video and YouTube?
I didn't quite understand the YouTube part, the post has a video from YouTube attached - a video version of roughly the same thing written in the post. I most likely won't publish it on other platforms myself (maybe I'll start a Telegram channel if there's demand for slightly more frequent updates, but for now the forum and YouTube are enough), but if anyone wants to - you have my permission to reupload it, but with a link to this post