K-Mod: Far Beyond the Sword

Is this the right place for feature requests? I'm sorry if there's a better place for this, but would it be possible to add the ability to build monasteries after the invention of Scientific method? It's really annoying not being able to make missionaries after the industrial age unless I switch to Organized Religion. Is there a reason you have kept it the way it is for so long?

Also I'd like to say love your mod. I've played it pretty much every day for many years. Keep up the good work!
 
Do you have any logs of OOS game? On what actoin of you or your friend OOS has appeared? Or on AI turn?
P.S. I'm against of any KMOD xml changes. If you want to play with more various resource system, i recommend to play CCV - it has absolutely different multi-resource system with terrible AI management)
What is CCV?
 
Of course it's mined most where it's cheapest, but we're talking about iron for tanks here. The idea that an economy could first industrialize, build forges and factories, and then not be able to find enough of the fourth most common element in the Earth's crust to build weapons is absurd.



Perhaps, but with iron in the modern age it's not a question of if you can get your hands on it, but a question of how much. And that's not what the resource tiles are about.



And that's what aluminum represents. At least I feel such a resource does a better job of representing those minerals than one discovered around the time that writing is invented.



Simple perhaps, but also silly, if that same hill that was used in anicient times to make swords still determines the fates of nations thousands of years later. Anyway, I'm not saying you don't have a point, but as long as the way the game works can be rationalized, that's enough. Let the players worry about oil, uranium and aluminum. Requireing an iron resource to build tanks because there's iron in them would not enriching the game experience, but it would make it harder for small civilizations to defend themselves. Whatever. You asked for opinions.

I appreciate the discussion. I guess this is one of the things I like about Civ V and HoI IV. I think HoI IV does it best with a production penalty if you lack enough of the strategic resource. Maybe there could be a healing penalty if you lack that unit's resource.

The idea that an economy could first industrialize, build forges and factories, and then not be able to find enough of the fourth most common element in the Earth's crust to build weapons is absurd.
Ask Japan about that. I did a count on a few fractal maps and there was consistently more iron than players. So acquiring it through trade or colonizing is easy after astronomy.

Another QoL feature for karadoc: Make it so that you can queue up buildings with a pre-req building above it in the queue. Example: you can queue up a factory and a coal plant at the same time as long as the factory get built first.
 
Last edited:
Ask Japan about that.

I stand by what I said. Japan industrialized and then DID have enough iron to build weapons. Of course they needed more iron to build more weapons, but that, again, is a matter of quantity, which is not what resource tiles are about. If you disagree on this point, answer this: what do mines on non-resource tiles produce?
 
After playing a few more games I have some more observations and suggestions:

The AI seems very raze happy. I've seem them raze enemy cities that are right on their border.

The AI doesn't also seem to understand the importance of levees and industrialization. Or at least, I'm always the first player to industrialize even if the AI has tech parity with me.

This might be the Fractal map script I started playing with when I got into K-Mod, but strategic resources are a bit too abundant.

A neat button for unit selection could be a "split" button which evenly divides the selection in half, like what Paradox games have. I find myself doing this manually a lot.

A way to save city selections as hotkeys.

Have the actual number of units listed on the stack flag rather than dots.

What I love about this mod though, is that I was able to win a conquest victory on a Huge map and Epic game speed in under 8 hours.
 
The AI in this mod often seems to be fighting wars just for the sake of fighting them. No matter how many stacks you slaughter, they just come right back at you. Is there any easy way (say editing some XML files) of toning down their aggressiveness a bit? Or perhaps to stop them from being so persistent and attacking the same target every ten turns just so that they can have their stacks slaughtered like the last five times?


What I love about this mod though, is that I was able to win a conquest victory on a Huge map and Epic game speed in under 8 hours.

How do you play so quick?
 
The AI in this mod often seems to be fighting wars just for the sake of fighting them. No matter how many stacks you slaughter, they just come right back at you. Is there any easy way (say editing some XML files) of toning down their aggressiveness a bit? Or perhaps to stop them from being so persistent and attacking the same target every ten turns just so that they can have their stacks slaughtered like the last five times?

The AI doesn't remember getting its nose bloodied this way, so it can't learn from its mistake. That mistake lies in how it evaluates what's a good target to attack. The principal factor it uses in that evaluation is the power ratio, which is a good indicator of an AI civ's actual power, but not so much of human-controlled civs because of skill differences. An experienced player's civ will consistently be underestimated and thus attacked over and over again.

You could tone down the AI aggressiveness in the Leaderheads XML file, but that would also affect how they interact with each other. Alternatively, you could reduce the power values of buildings like barracks, thus reducing the power ratio bias against civs with more specialized cities. Or you could just deter attacks by building a stronger military. "If you want peace, prepare for war." It works in K-Mod.
 
The AI in this mod often seems to be fighting wars just for the sake of fighting them. No matter how many stacks you slaughter, they just come right back at you. Is there any easy way (say editing some XML files) of toning down their aggressiveness a bit? Or perhaps to stop them from being so persistent and attacking the same target every ten turns just so that they can have their stacks slaughtered like the last five times?

I'd have to agree with that, it's more of a problem AI vs. AI. I once saw Japan and Boudica locked into an eternal war, constantly producing archers all the way up to the 1600s or so when I conquered them both. God forbid you play on Aggressive AI, you'll get archer rushed for days.

How do you play so quick?
Heavy use of issuing build orders to multiple cities, hot-keyed build queues, way-points, and automated workers.
 
Last edited:
The AI doesn't remember getting its nose bloodied this way, so it can't learn from its mistake. That mistake lies in how it evaluates what's a good target to attack. The principal factor it uses in that evaluation is the power ratio, which is a good indicator of an AI civ's actual power, but not so much of human-controlled civs because of skill differences. An experienced player's civ will consistently be underestimated and thus attacked over and over again.

You could tone down the AI aggressiveness in the Leaderheads XML file, but that would also affect how they interact with each other. Alternatively, you could reduce the power values of buildings like barracks, thus reducing the power ratio bias against civs with more specialized cities. Or you could just deter attacks by building a stronger military. "If you want peace, prepare for war." It works in K-Mod.


That is part of the issue, the AI DoWs every ten turns even when your power is roughly equal to theirs (I'm assuming here that vassal power is not considered when the AI is choosing a target). And significantly outstripping the AI power-wise seems borderline impossible given the K-Mod AI's penchant for spamming units. Even if you manage that, there's usually a financial civ on another continent who ends up beating you to Alpha Centauri :lol:

Guess I'm just going to have to learn to get better at diplomacy, somehow every late game I manage to get everyone pissed off at me. Any tips for earning steadfast allies that I can use for help during wars?
 
That is part of the issue, the AI DoWs every ten turns even when your power is roughly equal to theirs (I'm assuming here that vassal power is not considered when the AI is choosing a target). And significantly outstripping the AI power-wise seems borderline impossible given the K-Mod AI's penchant for spamming units. Even if you manage that, there's usually a financial civ on another continent who ends up beating you to Alpha Centauri :lol:

Guess I'm just going to have to learn to get better at diplomacy, somehow every late game I manage to get everyone pissed off at me. Any tips for earning steadfast allies that I can use for help during wars?

Most of my wins are diplomatic victories, so I may not be the worst person to give some bits of advice. Here goes: The AI warring amongst each other is good for you. Don't try to please everyone. Pick sides and be a good friend. When your chosen buddy asks for something, your default answer should be yes. Starting or joining pile-on wars is a great way to make friends. Especially if the target gets wiped out.

Does the AI evaluation for going to war mentioned here hold in K-Mod?

No, it doesn't. For one, the K-Mod AI is happy to attack you even with only archers.
 
Does the AI evaluation for going to war mentioned here hold in K-Mod?
Here's a quote by karadoc (from page 132) on the changes to AI_doWar:
[...] Actually, most of the war-declaration stuff is unchanged. It's still mostly random, and mostly based on the war rand xml values.

K-Mod has heaps of major changes to CvTeamAI::AI_startWarVal, which plays a large role in determining who to declare war on, once the decision to go to war has been made; but not a big role in determining whether to go to war at all. CvTeamAI::AI_doWar is where AI's decide when to go to war; and although it's a long function, the key numbers are mostly calculated in CvTeamAI::AI_getWarThresholds... which has only had minor changes in K-Mod. However, one of the changes is in how "high unit spending" is determined; and if there was something strange happening there, then it could have a major effect the probability of war. So perhaps you should look at CvPlayerAI::AI_unitCostPerMil to see if it makes sense; and look at CvTeamAI::AI_getWarThresholds to see how those cost calculations can affect the probability of war.
You could also read through the comments in the code (GitHub link), although only some of the changes are marked. Apart from the get-better-units change (dagger can overrule it), another unmarked change that comes to mind is that canDeclareWar is replaced with canEventuallyDeclareWar, i.e. the AI can plan war despite a peace treaty. The two bugs that DanF5771 mentions toward the end are fixed in K-Mod (and BBAI) as far as I can tell.

--
On an unrelated note, this post by @Fippy in Civ 4 General has lead me to this K-Mod Deity report in Strategy & Tips from last year. Perhaps I'm not the only one here who had missed that at the time.
 
On an unrelated note, this post by @Fippy in Civ 4 General has lead me to this K-Mod Deity report in Strategy & Tips from last year. Perhaps I'm not the only one here who had missed that at the time.


A nice read. It reminded me of another issue I had faced earlier as well; that of peace-vassals often breaking free without good reason. Especially when towards the end of a domination/conquest game, it can be seriously annoying to plow through another dozen cities and gazillion cities. What factors does the AI (in K-Mod at least) consider when breaking a peace-vassal agreement? They seem to do it even when their power is significantly lesser than their masters', and this is something I haven't noticed in vanilla btS.
 
A nice read. It reminded me of another issue I had faced earlier as well; that of peace-vassals often breaking free without good reason. Especially when towards the end of a domination/conquest game, it can be seriously annoying to plow through another dozen cities and gazillion cities. What factors does the AI (in K-Mod at least) consider when breaking a peace-vassal agreement? They seem to do it even when their power is significantly lesser than their masters', and this is something I haven't noticed in vanilla btS.


Arghh. Just had another case of this happen to me. Ragnar delayed my domination by 20-30 turns by cancelling a peace-vassal agreement, despite being friendly and his power being much less than mine. Domination victories become quite the drag towards the end, as @Fippy discovered in his playthrough.
 
[...] What factors does the AI (in K-Mod at least) consider when breaking a peace-vassal agreement? They seem to do it even when their power is significantly lesser than their masters', and this is something I haven't noticed in vanilla btS.
It's probably this condition: if (5*iVassalPower > 4*iAveragePower) (GitHub link)
In BtS it says iVassalPower > iAveragePower, which means that the vassal needs a bit more power to break free than in K-Mod, but K-Mod sets iPowerMultiplier=75 (code location) when considering cancelation, meaning that the vassal's power gets multiplied by 75%, so it's pretty much the same as in BtS. Though it could be that there is some oddity in the BtS code that prevents vassal agreements from being canceled, or perhaps K-Mod vassals just train more units. (Or it's something else entirely. :lol:)
 
It's probably this condition: if (5*iVassalPower > 4*iAveragePower) (GitHub link)
In BtS it says iVassalPower > iAveragePower, which means that the vassal needs a bit more power to break free than in K-Mod, but K-Mod sets iPowerMultiplier=75 (code location) when considering cancelation, meaning that the vassal's power gets multiplied by 75%, so it's pretty much the same as in BtS. Though it could be that there is some oddity in the BtS code that prevents vassal agreements from being canceled, or perhaps K-Mod vassals just train more units. (Or it's something else entirely. :lol:)

Yes, probably something else altogether. I'm guessing there must be another condition or two besides this one.

Even this condition doesn't quite make sense now, does it? When a peacevassal breaks free they are essentially daring the master into declaring war on them. Which is why some element of the power differential between the master and the vassal should be considered, not just the average power (which can easily be skewed by one city capitulated vassals on larger maps).
 
A couple of other (slightly radical) suggestions I had for balance, would appreciate some discussion on these:

1. Gold/Silver/Gems should only give +2 or +3 :commerce: at the start, and later give another +4 or +5 :commerce: (or even more) with currency (or any other late classical/medieval tech). Atm the main reason some starts end up laughably unbalanced is one of these three resources. Mansa or Huayna with a corn/pig and 2 gems start runs away with tech very easily.

2. Make enemy naval units use up all their Movement points when they get into enemy territory. This makes having a defensive navy far more useful as you have a chance of stopping an invasion fleet before they make a landing. This is implemented in some mod I've played, I can't really recall which (was it DoC? SoI? or Civ5/6?)
 
Yes, probably something else altogether. I'm guessing there must be another condition or two besides this one.
Perhaps "You've grown too powerful for us" (DENIAL_POWER_YOU). That would also explain why I'm not really encountering these problems with breakaway vassals – I've disabled that condition long ago. I did so actually because it bothered me that civs refused to become my vassal when I was close to Domination (why prolong the inevitable?), but it seems that "grown too powerful" can also cause vassals to cancel the agreement. Though that should also be the case in unmodded BtS. Of course, if I had a K-Mod savegame where a vassal is about to break free, I could check in the debugger what the cause is. Come to think of it, it would really be nice if the AI told the player, at least in vague terms, why it's canceling the vassal agreement. Displaying the denial message in the AI's diplo comment is easy enough to implement (see attached screenshot).
Even this condition doesn't quite make sense now, does it? When a peacevassal breaks free they are essentially daring the master into declaring war on them. Which is why some element of the power differential between the master and the vassal should be considered, not just the average power (which can easily be skewed by one city capitulated vassals on larger maps).
Actually, BBAI (and thus K-Mod) doesn't count capitulated vassals in this context (comment in the code: "Count capitulated vassals as a fractional add to their master's power"). I don't think the vassal should take it as given that the master will (eventually) attack if the vassal breaks free, but I agree that it's a possibility that the vassal should consider. Perhaps simply let the "grown too powerful" condition (master close to Domination) block vassals from breaking away.

Regarding suggestion 2, I've just implemented that, as @Cruiser76 had suggested something similar a while ago. So if anyone wants to experiment with that, this Git commit of mine could be helpful. As for the Gold/Gem starts, I've partly addressed that by adding a BONUSCLASS_PRECIOUS for Gold, Silver and Gems and changing to the map generator so that these precious resources aren't placed close together (or only very rarely). Tying the commerce to a tech also sounds good; though Currency is already very powerful. Perhaps the Market building? Though a building that increases resource commerce would be a novel thing. Either way, it is, as you say, a slightly radical change, which I also don't like so much about my own spent-movement change; though, in that case, I see no satisfactory low-key solution.
 

Attachments

  • cancel-vva.jpg
    cancel-vva.jpg
    107.2 KB · Views: 217
Top Bottom