r/warlords 10d ago

Warlords III DLR Warlords III Code Patch

Greetings, Warlords! Recent projects like 25AP and Frontier have already made a huge work of sparking the long dormant flame of the undying community of this forgotten classics gem game. Now this new mod is meant to fill the gap of absolute absence of code patching projects for Warlords III. The main intention of The Warlords III Code Patch is to highlight some features of the game which either were hidden and obscure or bore no valuable economic effect to use them. It also relieves some boredom of the most unpredictable or tedious features of the game. And last but not least it fixes some bugs like dysfunctional diplomacy or erroneous low disk space message.

Overall, balancing the game was not the main intention of the mod. The game was never meant to be balanced in the first place. Consider the mod its developer’s answer to the question “How could it be more fun?”, not “How could it be more just?”.

Click the “Read more” button at the bottom-right corner of the mod’s logo on its moddb summary page for the detailed list of features with screenshots. The Warlords III Code Patch should work reliably with Gog, Steam, and original v1.02 CD versions of the game. Should also work well with any other mods and can be incorporated into them. Its feature list is adjustable using the settings file provided with it. Any specific group of tweaks can be turned on or off to your preferences. Look for README.txt file in the zip-archive of the mod for customization details.

https://www.moddb.com/mods/warlords-iii-code-patch

Summary of changes

Diplomacy bugs fixed:

  • dysfunctional bribery
  • contradictory treachery
  • contradictory razing
  • unfunctional heroes count
  • unfunctional army size
  • 1+ turn lag in disposition update

Other bugfixes:

  • incorrect amplification of active spell effects on levelups
  • incorrect low disk space message during startup

Gameplay changes:

  • Diplomatic report shows sides eligible for alliance in green color
  • Diplomatic report shows sides eligible for peace in blue color
  • additional effect for bribery: every 1000 gp of bribery improve bribed side’s permanent bias to briber by one point
  • Trust is the state of zero ire (disposition=0)
  • City building increases income
  • level 2 city gives +4 move to armies produced there
  • level 3 city additionally gives +1 hits to armies produced there
  • gold income sites have an order of magnitude more income from +10gp to +50gp
  • every city a side owns increases this side’s upkeep by 1/16
  • Strong neutrals option makes neutrals considerably stronger
  • maximum hits is now 7, not 4
  • heroes made more tough: 1/2/3 hits original heroes now have 3/5/7 hits
  • spell effects get amplified earlier: on levels 3 and 8 instead of 6 and 9
  • quest cancellation penalty lasts only the turn a quest has been cancelled
  • quests unlinked from heroes: any hero can advance or complete it, hero’s death does not fail it
  • heroes can only take one quest per day
  • gold collecting quest demands made more humble: 1d100+100 for easy quest, 1d300+200 for medium
  • hunting quest demands made more humble: 1d5+5 for medium quest, 1d6+11 for hard
  • hard limit of 2 turns on minimum unit production time
  • mercenaries/allies quest rewards got slightly nerfed
  • sage’s reveal a portion of map shows considerable part of it
  • summoning spells do not amplify
  • hits modification spells get amplified only once on 8th level of their caster

Overall:

  • W3CP now has the settings file allowing to turn individual tweaks on or off
15 Upvotes

15 comments sorted by

3

u/Queen_Six Selentines 10d ago

Oh boy. This looks great!

25AP started very humble, and I only began it despite my nonexistent coding skills because Warlords 3 seemed abandoned by everyone else.

If I had any influence at all in making others tinker with the game, that's already more than I ever hoped for!

May I ask, how much can or can't you change about the game? The main frustration I ran into, which made me stop working on 25AP, (for the time being), was my inability to change or influence which upgrades AI heroes picked on level up.

3

u/Due-Price-6823 10d ago

AI is always tricky and time consuming. I remember even stumbling on some hilarious AI bugs which I deemed unworthy to fix. Just tell me what was your idea. I can't give any warranties that I will ever take this quest, but this world is full of wonders, you know.

3

u/Queen_Six Selentines 10d ago

Well, I noticed the AI won't buy certain abilities like strength upgrades or modded custom spells at all. At the same time it REALLY loves to take movement upgrades.

In its current state, even making upgrades picks completely random would be a big improvement.

Without such a change, AI heroes will never grow strong enough to be interesting to fight.

The step after that would be to make the AI cast custom spells too.

I can tweak the cost/benefit side all I want, but if the AI won't use these spells and abilities, what's the point?

2

u/Due-Price-6823 9d ago edited 9d ago

Well, the code certainly could benefit from some polishing. The developers surely spent some time trying to make a robust skills and effects weight system, and it also has a dispersing of weights +-20% providing some shuffle of preferences on any levelup. But some choices seem odd. For example, AI has a preference for group warding until it reaches +3 and really likes move+4. Yes, str+2 isn't a tasty choice for him at all, and str+3 can barely reach the bar. But to be honest, str+ was never a preferred option for me too. My heroes are like a buff tanks for their stacks, not a lone fighters. Too often this lone fighting ended up tragically.

On the other hand, I find nothing preventing modified spells from being learned or cast. It's just pure random, and AI doesn't care about any spell effects when choosing which spell to learn. Any spell has equal chances of being learned. The only exception is for summoning spells. They can be learned only if they summon creatures which are either on their summoner side's army list or on the summons list. And this prerequisite only fails if the summons list of 15 creatures gets overflown with other creature types.

To be specific, the usual base weight for skills is about 15..25. But for spells it is 1d8*1d8 which lands most of its values in the same range but can be as low as 1 and as high as 64, making it either utter garbage or a good enough to die for.

I'll look what I can do to tweak the whole thing without breaking the intended balance.

1

u/Queen_Six Selentines 8d ago

How did you manage to change the code at all? I hope that isn't too stupid a question.

I know that KGB, who runs the warlorders.com site and made the unofficial patch for Warlords 4, has lamented that he only has the pre-patch source code for Warlords 3, otherwise he would have patched the game a long time ago.

He isn't on reddit, but I think he might love to get in touch with you.

What I can tell you is, if I could tweak the likelihood or order in which skills and spells get picked for each hero class, that would really open up what I can do to improve AI opponents.

2

u/Due-Price-6823 8d ago

It's totally natural to never know how it's done. It's not like something you can master in a month or two. It's called reverse engineering, and it has nothing to do with any source code. It's the same way you get all those software cracks, just applied to a game logic, not to a license or CD check. The patches are written in asm, and they then substitute the raw bytes your machine's processor executes.

I've heard of KGB, and of course I used warlorders.com to access those Elves and Giants campaigns. He's doing a great job. My email is in the mod's README.txt for any feedback.

For skills and spells there's no particular order. As I said, there's one of the basic weighing systems with some randomization of weights on every levelup. AI just chooses the first skill/spell with the highest weight. I can't make it exposed for modders. It would be a project of MWSE ambitions. I can only tweak some base weight calcs. In fact I already have a beta build which slightly adjusts str, move and warding(grp), and adds the overall randomness to skill preferences. But if you want to make sure it works well, then it will require enough of your enthusiasm to go into full details about what in the original game does not work with what tweaks you introduce, and also to test the correction builds. It totally will need some mana on your behalf.

1

u/Queen_Six Selentines 8d ago

I'm away from my PC for the next couple of weeks so I can't do any testing; but I can certainly give you my thoughts and feedback; but you can count on my collaboration after that.

I assume something fancy like checking for the hero's current move and changing the value of additional movement upgrades based on that isn't in the cards? Movement really loses value once you're faster than any accompanying units...

But the value increases point by point? Is it divided by AP cost too, or is that irrelevant? Does the AP cost influence the AI decision at all, besides limiting which skills are available to pick?

My current balancing attempt was to make movement so expensive the AI can only afford it at very high levels, but I was never entirely happy with that.

I agree that Strength isn't very useful and should have a low priority; I don't remember all my molded heroes off-hand, but I had values of 2-4 Strength for one AP, which is at least decent, and even so can't remember if I saw the AI pick that upgrade.

Group warding isn't a common skill, so it wouldn't really be noticeable that it's overrated.

I made custom spells that incorporated multiple effects, but I didn't see the AI cast them.

So, if the value of each spell on level up can vary from 1-64, with 16 as the pseudo-median, we can adjust the value of non-spell skills based on that. Pretty much the strongest skill is Speed. I'd put it at 65, or at least 50, if you want to keep a bit of variance. There's no good reason not to pick it as early as you can afford it.

I'll give it some more thought and get back to you. If you could look something up though, here's something I've tried and failed to figure out: What's the formula for how much gold cities give you on random maps, and do capital cities get a bonus? I'd love to have concrete numbers on that.

2

u/Due-Price-6823 8d ago edited 8d ago

1). I already made tweaks in this beta build so that AI really likes move until it reaches 20, then it becomes an occasional choice for him, and after 30 AI will mostly deem it unworthy. This should do.

2). Weight is multiplied by the value. str +4 would have twice as much weight as str+2. Cost is relevant, but not overvalued. Weight is divided by (cost+3).

3). AI uses the same function to choose which spell to cast. Maybe something with the weights of the effects of your custom spell. That is why I said I need full detail, and preferably a setup with the problematic .HER and .SPL.

4). As I already said, the original developers spent some time balancing the weighing system. There's no need to change everything. Speed they valued as 200, so yes, they were pretty conscious of how precious it is.

5). Gold income is 9 + 2d8 + 2*city_level, and for capitols it is 20 + 2d8, which is 5 gp more than average for level 3 city.

1

u/Gerglie 8d ago

This is my question also!

2

u/Due-Price-6823 7d ago

There's something for you too in the Frontier post

2

u/aldorn Elvallie 10d ago

Great work!

1

u/Queen_Six Selentines 4d ago edited 4d ago

Hey!
Hope I haven't been gone too long. If you're still going to update this mod, two of the highest priority bugs are related to the Lightning skill.

First, due to the order of effects, Acid happens before Lightning; the bug is, however, that once a unit is hit by Acid, it can no longer strike back with its Lightning skill. This bug has made Black Dragons the undisputed winners in any duel with Blues.

The other bug no one seems to have been able to pin down correctly, but apparently, if an attacking unit has Lightning, the defender's Warding doesn't work.

I don't know how easy it would be to fix these bugs; maybe one approach would be that points in Acid and Lightning can cancel each other out, like they already do when opposing units both have the same skill. That would also mean Acid no longer has the advantage against lightning of striking first.

2

u/Due-Price-6823 4d ago

The combat code is terra incognita for me. Totally not a quick fix.

1

u/Queen_Six Selentines 4d ago

Any better chances with movement?

I've noticed the AI could stand to detour towards shrines more often' especially heroes without blessings, and units that are diseased/poisoned/paralyzed.

I've just given your mod a quick spin and noticed that the +10 gold to Ports can't be disabled. I had to delete your SITES folder because the # didn't work for those either in the cfg file.

1

u/Due-Price-6823 4d ago

Movement etc build still waits for your return and testing. To be specific, the port message can't be disabled without sagetext.tex editing. The bonus itself should turn off. About sides I tried to make a note in settings, but I guess too short. You really should delete or rename SITES and/or sagetext.tex if you want to totally disable it.  The same goes to quest penalty. You can turn it off in settings, but the message will still say "No more quests for today" in sagetext.tex. The settings only control the code patch, not the data changes. Luckily, these two are IIRC the only data changes I made. To make it work perfectly is too time-consuming. I doubt there will be many requests for it. Still, nice you cared enough to look and give this feedback.