K-Mod: Far Beyond the Sword

I strongly disagree Zacar. Early chops are a no-brainer and aggressive chopping would consistently improve the AI. Saving trees for later chops is a niche strategy far above what the AI can plan for. Early chopping is like slavery, its so strong its hard to fail.

So, which improvements or roads should not have been built to give the workers time to chop? How long has the AI had bronze working? Should there have been more workers and if so, at the expense of which pop growth or commerce tile/specialist or building or unit (or city)?

The reason why Istanbul is only size 5 is probably partly due to barbs, but also because the AIs haven't chopped a single tile. This leaves the AI working weak plainshills in an already somewhat food-poor capital.

What if the city has 5 happiness? Would you still grow it?

What if the AI doesn't have bronze working?

etc.. it would be more useful to capture a story of an AI at some simple (isolated one-city?) start instead of one screenshot from somewhere.

---

edit: A small bug to karadoc: A starving city with one rebel (total -1 food) building a settler gains +1 to both shown and actual settler production from food (hanging gardens caused the extra rebel, if it matters)
 
For the AI it's even simpler because it's too dumb to time chops with techs. For any given forest it has only the option of randomly chopping it verses letting it stay, and the cases in which chopping is the vastly superior move over not chopping are abundant, whereas the cases in which keeping forests is the better move are rare and even in such cases the benefits of not chopping are negligible, unless by "all trees" you meant even those on tiles other than those named by Windsor.

For the AI, chopping forests on those tiles is a no-brainer, and yes, plains hills are weak tiles, at least until Railroad. Before that, they may be strong enough to bother working, but just barely.

The AI is actually a bit smarter than that (or at least it tries to be a bit smarter than that). There are special situations that make the AI more likely to chop for instant productivity; such as when they're building a wonder, or when their preparing for total war. And even when they aren't chopping for productivity, the AI still doesn't "randomly chop vs let it stay". Instead, the AI weighs up the yield rates of all possible plot improvements, and picks the one that it wants the most. It also takes into account the health bonus from the forests. In fact, there is nothing explicitly random in the way the AI chooses it's improvements.

However, the AI does have some serious flaws in its worker management. In particular, when there is an improvement that isn't connected, the AI currently just rushes to it with whichever worker it happens to cycle to first - regardless of how far away that worker is, or how close other workers are, or how important the worker's other jobs might be... This can cause some significant inefficiencies in how workers are used.

As I mentioned in a recent post, the worker AI is something that I'd like to improve soon.

In the mean time, I'm pretty much ready to release a minor update. I'm mostly just waiting until I've actually play tested it first. (I'm still pretty busy at the moment).
 
The AI is actually a bit smarter than that (or at least it tries to be a bit smarter than that). There are special situations that make the AI more likely to chop for instant productivity; such as when they're building a wonder, or when their preparing for total war. And even when they aren't chopping for productivity, the AI still doesn't "randomly chop vs let it stay". Instead, the AI weighs up the yield rates of all possible plot improvements, and picks the one that it wants the most. It also takes into account the health bonus from the forests. In fact, there is nothing explicitly random in the way the AI chooses it's improvements.

However, the AI does have some serious flaws in its worker management. In particular, when there is an improvement that isn't connected, the AI currently just rushes to it with whichever worker it happens to cycle to first - regardless of how far away that worker is, or how close other workers are, or how important the worker's other jobs might be... This can cause some significant inefficiencies in how workers are used.

As I mentioned in a recent post, the worker AI is something that I'd like to improve soon.

In the mean time, I'm pretty much ready to release a minor update. I'm mostly just waiting until I've actually play tested it first. (I'm still pretty busy at the moment).

Okay, so AI chopping is seemingly random instead of totally random, but the issue remains that it's bad decision-making.

As for the worker management, I don't really see the problem. You want to make the game more fun, don't you? And you have. In K-Mod, I'm willing to automate my workers much earlier than in stock BtS, because they're a lot smarter, but there's still a cost in efficiency. And that's fine. Nobody wants a game that plays itself. It just needs to take tedious micromanagement of our hands.

For that same reason I was so disappointed with the last change to the citizen management. You made it smarter in the sense that it produced better results when left completely alone, but that's not what I need. I need the ability to make my cities do what I want them to do without having to micro each citizen.

An example: I have a six city empire with a big, cottaged-up, bureaucracy capital with Oxford University and Globe Theater, and I'm in a teching phase of the game with my science slider way up. I look at one of my secondary cities. It has some food, some mines, some coast, a library and a university. I understand that in this situation a piece of gold is worth way more than a beaker, but the citizen manager doesn't. I want that city to produce gold to finance the research in my capital, where the multipliers are more favorable, so I have it "build wealth". And what does it do? It switches citizens away from mines and onto coast and scientist spots because it sees the +50% beaker modifier, leaving me to micro everything by hand or accept that building Oxford that early was a waste of hammers.

Another example of essentially the same problem: I have all the techs I need and am engaged in or preparing for a major war. I have my slider down because I'll need the money to finance and recover from the war I'm about to start. I look at my cities and what do I see? They're working scientists instead of commerce tiles, because those don't benefit form my libraries at the moment.

Even more potential for improvement I see in the build automation, which currently I never use. Correct me if I'm wrong, but automated cities currently can't whip more than one pop, right? And they can't accumulate whip anger either? If that were to change for both the AI and automated cities, I think that would be a pretty big deal.
 
I'm getting the impression that the AI builds too few workers during the first two eras. I usually count about one worker per city. I'm not a very good player, but that can't be enough(?). Among other benefits, I'd expect an increase in AI workers to lead to more chopping.

CvCityAI::AI_updateWorkersNeededHere doesn't seem to (explicitly) account for chopping opportunities and the removal of jungle; other than that, the function looks good. I'd tend to just multiply the result of CvPlayerAI::AI_neededWorkers by 1.6 to ensure that the AI has a worker or two available when new tasks arrive, e.g. when founding a new city or unlocking improvements through research.
(K-Mod did add a block of code that increases the number of workers needed based on available city sites, but that's only for the 25% of AI leaders that have a "growth flavor".)
 
@Zholef, You're mistaken about automated cities. They can and do whip multiple population, and they don't always wait for whip anger to run out before whipping again. The governor doesn't do fancy things like deliberately hold back on productivity to maximise whip overflow, but I think its decision making for when to whip is good enough. So if you think that would be a big deal, then perhaps you should try it. (Keep in mind though, if you automate every city then you're going to want to add some things to the build queue manually. The governor never builds settlers or wonders, and it tends to under-produce military units. The governor assumes that you'll handle the big-picture stuff.)

About the scientists and commerce of automated citizens: the most recent changes wouldn't have much effect on that. The evaluation of individual jobs is roughly the same as before. The recent changes were mostly about making sure automated cities didn't get stuck in inefficient job configurations. The newer system is better an finding the best overall configuration; but the relative value of science, commerce, and hammers has not been changed. So if you're getting unwanted specialists now, then I'm sure you would have been getting unwanted specialists in the previous version as well. That's not to say it can't be improved; but getting those specialists is not a good reason to be 'disappointed' with the changes.

The thing is, what you want your cities to do might not be the same as what some other player wants. The governor has a particular evaluation system in mind when it chooses its citizen jobs. The system could be tweaked to suit what you personally want, but it can't be changed to suit what every player wants, because different people want different things.

I just had a situation where I think the Ai was being a genius. It sent a large stack after my easternmost city, while sending 3 well promoted units after my iron on our southern border.

I tried to kill the 3 stack with whatever I had lying around, but only got 2 of the 3 stack.

But instead of pillaging my iron and hurting my war effort substantially, the last guy decided to try killing my even healthed neighboring unit, on a hill, and lost.

Is there a larger priority setting that could be increased so that the ai burns resources before chasing down wounded enemy units?

Still an amazing effort by the ai!
Hmm.. The AI does deliberately send small groups out with the aim of pillaging; and it does sound like the pillaging party you saw made a miscalculation about the whether it should attack or pillage. There are probably some minor improvements that could be made in AI_pillageMove without too much trouble - I'll look into it.

edit: A small bug to karadoc: A starving city with one rebel (total -1 food) building a settler gains +1 to both shown and actual settler production from food (hanging gardens caused the extra rebel, if it matters)
I looked briefly at the code and I didn't see any obvious problems. Do you happen to know if this always happens when you have angry citizens, or if it's only in rare cases (such as after building the hanging gardens)? And do you get more 'bonus food' if you have more angry citizens? Otherwise, I'll do some testing to find the problem at some later time.
 
So if you're getting unwanted specialists now, then I'm sure you would have been getting unwanted specialists in the previous version as well. That's not to say it can't be improved; but getting those specialists is not a good reason to be 'disappointed' with the changes.

You're right. I'm not disappointed because you did a bad job, but because of my own overly-optimistic expectations, which are a side effect of how much I like the changes you've made to the game thus far. I guess I should have chosen my words more carefully there. My apologies.

The thing is, what you want your cities to do might not be the same as what some other player wants. The governor has a particular evaluation system in mind when it chooses its citizen jobs. The system could be tweaked to suit what you personally want, but it can't be changed to suit what every player wants, because different people want different things.

That is actually what I meant. I don't want an automation that does everything the way I'd be doing it; I want an automation that allows me (that is "me, the player", not "me, Zholef") to get results reasonably close to what I want without having to do everything manually. Personally, I think that's one of Civ4's most pronounced weak points that could be fixed, but maybe that's just me. Anyway, I'm already sitting here in mouth-watering anticipation of that upcoming release you mentioned, so feel free to ignore me and playtest that instead of replying.
 
The governor has a particular evaluation system in mind when it chooses its citizen jobs. The system could be tweaked to suit what you personally want, but it can't be changed to suit what every player wants, because different people want different things.

I'm curious if, in general, the AI operates as a bunch of separate components that do not communicate much, or if there is a lot of communication (for example a "big plan" that would affect the weights, or affect the weights per-city). That is, different AIs might want different things.

I looked briefly at the code and I didn't see any obvious problems. Do you happen to know if this always happens when you have angry citizens, or if it's only in rare cases (such as after building the hanging gardens)? And do you get more 'bonus food' if you have more angry citizens? Otherwise, I'll do some testing to find the problem at some later time.

Meh, I expected it would be visible in the code. I should have done a backup of the save for your convenience, but.. "one more turn". I had never seen/noticed it before. Perhaps hanging gardens doesn't update some value that regular city growth does?
 
I'm curious if, in general, the AI operates as a bunch of separate components that do not communicate much, or if there is a lot of communication (for example a "big plan" that would affect the weights, or affect the weights per-city). That is, different AIs might want different things.
It's mostly independent stuff. The cities don't sent messages to cooperate with each other, but the value weights are adjusted separately for each city based on certain traits of the city, and based overall needs of the empire. For example, if only one of your cities has a market, then the governor will probably employ merchants in that city, because it has a better gold multiplier than the rest of the empire; but if all your cities have markets, then maybe none of them will employ merchants, because none of them have a particular advantage and so they might as well just get gold from commerce rather than specialists.


Meh, I expected it would be visible in the code. I should have done a backup of the save for your convenience, but.. "one more turn". I had never seen/noticed it before. Perhaps hanging gardens doesn't update some value that regular city growth does?
I looked again, and I think I've found it. It's actually a bit strange, because it looks like it might be deliberate...
Code:
	int iFoodProduction = ((bFoodProduction) ? std::max(0, (getYieldRate(YIELD_FOOD) - foodConsumption(true))) : 0);
That "true" in the foodConsumption thing means "ignore angry citizens". The default value is "false", so that food consumed by angry citizens is still counted. But in this case someone has deliberately chosen to set it to true - so that any food consumed by angry citizens is essentially refunded.

I don't know why they'd do this. I'm not sure I'd call it a bug; but I suppose I should change it anyway on the grounds that it's unintuitive.
 
I am aware that this is mainly an AI mod, so I wholly understand if no-one here shares my sentiment on the following Air Combat issue. I'm also aware that this would propably take some effort. In order of personal importance. 1:
Spoiler :
1: If I'm correct, in Air Combat, CombatI-VI line promotions are calculated twice (which is good, Air combat is kinda binary, so doubled effect is required for the promotions to have any practical effect at all), but no other promotions are. So, for example, a fighter having pinch against intercepting gunpowder unit could have just had combat II for practically the same effect. THIS SHOULD NOT BE, me thinks. Hell, if I made a promotion +25% vs air, I could have simply had further combat promotion for the unit.

2:
Spoiler :
2: While I agree that units should not get ordinary defense bonuses 25%/50% from hills/forests/jungles/cities, I think that (correct me, if this actually is implemented in the game) intercepting on a terrain/feature/city with a unit that has natural/promotional bonuses for defending on said feature/terrain should get them for Air Combat too, and the other way around for aircraft (so, attacking coast with one when they have +25% attack coast promotion would mean (with point 1) +50% when intercepted on mission on coast by unit on said coast).

3:
Spoiler :
3: I think that air units, instead for kills in air combat, should simply get 1xp for SURVIVING getting intercepted/intercepting on mission. This way even Bomber houdinis would get actual xp naturally over time, as long as someone intercepts them.
Also, and this I know for certain: withdrawal does NOTHING on air units, zero, null. There is no reason for this to be, even if normally they can't get it anywhere.


I do not suggest much of actual CHANGE in gameplay in mod itself (well, apart for point 3, which makes sense, at least to me), this is more of making tools more available (point 2 and latter part of point 3), and rules more consistent (point 1). I myself like to tweak the xml around (maxairdamage or whatever to 40%, airship I75%, S8, so on...), so it's not for that reason the three up there exist. I just think that making the compiling needing restrictions more permissive/consistent, without risking screwing this marvelous mod up, makes the general experience miles better. (Grumble, grumble game says never Blitz for M1 troops, grumble).

oh, and 4 (and this is simply me being annoying and not knowing when to shut up):
Spoiler :
Missiles should be interceptable by aircraft (simply give them S40 and they're good to go). In WWII, Brittish fighters intercepted German missiles by making them spin by putting tip of their wing underneath the missile wing, and giving a hard lifting to it, making the missile dive into the sea. This would make nukes less of a I WIN condition in 1v1vbunchofAIs. Cruise missile has evasion 100%, and the SDI would work as normal.
 
I've uploaded v1.44.

I still didn't get to do as much testing as I intended, because my friend's
computer died. But I know that the new version fixes several problems; so I figure I might as well just let people enjoy those benefits now.

From my point of view, the best thing is that it fixes some OOS bugs that have existed forever. I've also fixed some residual problems with the citizen placement of the city governor. Aside from that, the other things are just minor tweaks that most people probably won't notice.

Fixing the OOS bugs is a big deal for me. But the thing is, people generally notice problems more than they notice things running smoothly. When people talk about K-Mod on the main Civ4 forum, they usually talk about the AI. But no one mentions that K-Mod actually has heaps of user-interface improvements beyond what BUG has. For example, here are a few UI improvements in K-Mod which are not present in any other mod (unless they got it from K-Mod):

  • Confirmation boxes (for quit, world builder, etc) now explicitly specify what it is that you're meant to be confirming.
  • Combat animations are now orchestrated to reflect the actual combat mechanics, rather than just being completely arbitrary.
  • Asking for peace in the diplomacy screen now brings up a trade deal with the AI's offer for peace, rather than just instantly making a peace deal with no tribute at all.
  • It's now possible to ask the AI to prepare for war.
  • "Simple [shift] unit selection" option, which only adds units to a group one at a time when holding shift, rather than merging whole groups at once.
  • Fixed some inconsistencies in the way group selection normally works.
  • "Rapid Unit Cycling" option, which reduces the delay between moving units.
  • If you rename your cities, the game won't keep suggesting the same old city names over and over.
  • Alt-clicking a leader's name to declare war now brings up a confirmation box.
  • ...
There are many more changes like that. All of those things are small changes which most people wouldn't notice, or would quickly forget about. But from my point of view they really add up to reduce unnecessary frustrations in gameplay.

For v1.44, I was motivated to make the changes to the spaceship screen because I accidentally launched my spaceship before finishing the final casing. The original spaceship screen doesn't show the chance of success if you are currently adding a new piece; and so it's easy to assume that the ship is ready to go, and launch without realising that it's doomed to fail. That's the kind of frustration I want to eliminate.

People notice when the game does something annoying, such attacking a unit automatically when the player was just trying to explore the fog; but they don't necessarily notice when the game does something cool - like _not_ carrying out such an attack. People notice when the mouse-over text for buildings is inaccurate; but if it is accurate then they assume that's just normal. So these kinds of K-Mod improvements are generally ignored; but I suspect that for non-expert players, these are the improvements that players would enjoy most.

The AI and balance stuff is nice for experts; but the UI and stability stuff is good for everyone. So from that point of view, I sometimes think it's a shame that the AI changes generally overshadow the other changes when K-Mod is talked about on the main forums.
 
Yay, new version!

Anyway, people do notice these things. People like me, anyway. People who bother reading changelogs. But you're right. Most people only notice differences that force them to adapt.

Unfortunately, K-Mod is three in one. It's a UI mod, an AI mod, and a gameplay mod, which means it has plenty of opportunities to rub new or potential players the wrong way.

If you really want it to take off in terms of user base, you'll have to jump over your own shadow and give people what they want, whether or not you personally think those things ought to be included. Some examples: The traits part of BUG's civilopedia, pre-chopping, hidden diplomacy modifiers, WHEOOHRN-indicator, and of course a check box or something to disable K-Mod's AI and gameplay changes, perhaps even individual changes like those to culture or espionage.
 
That combat animation thing is a sneaky one. When I started civ4 I noticed the arbitrariness. Later when playing K-mod, I started reading battle events from the animations, even though I wasn't sure if they tell the truth.

Overall people don't post that the "UI works" because while it is positive feedback, it isn't constructive. Some of the UI things you listed are probably not used much as they need some key-combination or some checkbox ticked in the options. Personally I have no idea what you have fixed in the UI that would help me, as I haven't played civ4 without K-mod in a long time, so I cannot possibly remember. :) The ability to ask the AI to prepare for war sounds more like an AI improvement.

Regarding UI, I recall you removed (or didn't introduce?) the ability to see how many turns to improvement/chopping completion on non-worked tiles in the hover-text? I can't immediately find it in the changelog though. Was there a reason?

As for feedback in general.. I could throw you some of my old comments "why only 18civs?" "why does the AI pay for marble?", but instead of doing that ( :crazyeye: ), I'll politely ask if there is a certain type of feedback (or subject) that you'd find more useful/interesting than other?
 
The UI improvements are magnificent indeed. Never feel underappreciated, because the UI and AI both matter at least to me. And the forced specialist change is simply awesome, now the cities stop spamming scientists when I want merchants.

An anecdote of mine from this evening (previous version of the mod), long story:
Spoiler :
I was minding my own business running my renaissance empire of Japan, when war is declared to me by nearby continent egypt. The transported troops tried naval assault on one of my outpost cities (which was Islam holy city), which had a Longbowman and an Archer defending.
The thing is, The city was Walled and Castled (yes, I build them), on Hill, and obviously my troops had Garrisson (even if I had not given any further promotions), so my Longbowman was having something approaching +250% to the combat.
So my enemy assaults with knights and Pikemen (oddly, no Macemen), failing to kill either of the defenders. Supprisingly, they had less than ten troops in almost as many Galleons. Thus their invasion fleet attaced and fled before I had any literal turn time to react.

Question: Why would the second most powerful player send assault fleet of less than ten troops to take a city heavily blessed with combat bonuses and more than 1 defender from sea? They had the ships, why so small an army, without siege equipment? The Civ in question apparently sent some troops to take a city from my Vassal with similar troops but more success at the same time.
This was actually second time this happened THIS game, same Civ, defending single Samurai (actually sweated about that one), no castle, as little success.
Two defending wars, total losses for me: two caravels, in their territory at the war declaring moment.
Just something I wanted to share.
 
In advanced start mode it seems that AI never chooses to buy meditation nor polytheism (even when it starts with mysticism) thus leaving the human players with possible uncontested double holy capital. (This happens when starting with default amount of gold on huge map (720), and AI does buy those techs when starting with more gold.)
 
In any case, I didn't notice anything that would cause the missing info problem. Are you sure that the vassal is actually still a vassal?

I encountered missing vassal info again in a new game today.

Good news is that when I used alt+z cheats to take control of the vassal and used WB to create conditions for declaring independence (I made vassal bigger than its masters) it was then possible to cancel capitulation. So it seems that the only problem is missing info and that this issue is not affecting gameplay mechanics. Also capitulation was listed in active deals only with the original master, but I assume that is expected.
 
I used to switch to serfdom in some games, before lumbermills became available. This worker boost was pretty much aimed for lumbermill construction. Now I won't consider serfdom because it has been changed to punish my towns and benefit some farm-ier strategies. That's OK, assuming someone uses such amounts of farms.

I think as a result it would flow nicely if lumbermills were changed to require machinery, but that they would not produce their hammer before replaceable parts. This would leave them with two slight benefits: 1. Able to be built earlier 2. Minor commerce boost for riverside forests.

Regarding workers, Hagia Sophia is the worst wonder ever.
 
I think as a result it would flow nicely if lumbermills were changed to require machinery, but that they would not produce their hammer before replaceable parts. This would leave them with two slight benefits: 1. Able to be built earlier 2. Minor commerce boost for riverside forests.

I changed Lumbermills to require Paper: A tech that has a wonder and map trading as practically the only things going for it, and logically connected to forests. Works nicely for me, now my workers have something to do at late medieval.

I too think that Serfdom punishing towns kinda kills it for me, as I favor heavy cottage playstyle. I thought about implementing reverse emancipation for Slavery (slavery gives a happy face, each known civ without slavery or tribalism gives your cities fraction of an unhappiness), but that would require some work. Now Slavery is kinda as good as it should be, so it should not be nerfed early game, but it kinda becomes the default labor until Democracy for the simple reason that rarely do you need Tribalism, Serfdom or Caste System.

PS. The bloody Romans had primitive Lumbermills. I think renaissance is simply too late even from historical perspective.
 
Lumbermills not only need to come earlier, they need a straight up buff.

A grassforest lumbermill is 2:food:2:hammers: gaining an additional :hammers: at Railroad. Keep in mind that Railroad is a very expensive tech, almost rivaling Assembly Line.

And while a 2:food:3:hammers: tile is a strong tile, you have waited a long time for this.

A grass workshop with Caste+State Property flat out beats lumbermills. A grassland workshop is 2:food:4:hammers: Of course at some point you'll get forced into Emancipation reducing the workshops to the same level as lumbermills.

For riverside a 3:food:2:hammers: watermill is more attractive than the 2:food:3:hammers: lumbermill allowing faster growth and feeding a plains tile. Really, riverside Lumbermills? Who can afford to let a nice riverside grass just idle for that long?

It's also worth noting that the workshops are solid tile improvements as soon as you have 2 out of caste/guilds/chemistry when they compete with mines.

This puts lumbermills in an awkward situation where it is really only in Free Market games they are actually better. And corporations themselves take a long time to set up. An improvement where you have to forgo so much early and midgame shouldn't be dependent on a civic to give a small advantage lategame.

So how much better should they be? Something like this:

Lumbermill
Available at Machinery
+1 Production
+3 Commerce (next to river)
+2 Commerce (Paper)
+1 Production (Replaceable parts)
+1 Production (Steel)

Might still be a bit weak, but its closer to reasonable. As it stand lumbermills are something you use in cities captured from the AI.
 
Lumbermill
Available at Machinery
+1 Production
+3 Commerce (next to river)
+2 Commerce (Paper)
+1 Production (Replaceable parts)
+1 Production (Steel)

Might still be a bit weak, but its closer to reasonable.
There must be some kind of misunderstanding here. You seem to be saying that a plot which gives 2:food:, 4:hammers:, 5:commerce: and 0.5:health: still might be a bit weak.
 
There must be some kind of misunderstanding here. You seem to be saying that a plot which gives 2:food:, 4:hammers:, 5:commerce: and 0.5:health: still might be a bit weak.

Have to admit I added the Paper-commerce after I wrote it "might still be weak" just to stress my main point: Lumbermills needs to come online significant earlier and with a much greater strength.

People still vastly underrate early advantages and snowballing.
 
Top Bottom