Yes but we are talking about whether or not to draft a unit in a city that is under threat, not whether to draw in units from elsewhere. If the city is in fact about to be captured, surely drafting an extra defender can only help, right? I know what you mean about siege damage but 7 units are still going to have a better chance than 6, and it might even be better that your enemy gets 1 fewer pop point when he does capture the city.
3 comments:
-the starting city is small, poorly developed but has a high food output. Food is the only way it is well developed. That's good for drafting but not a typical AI-city at the time of the game that nationalism has been discovered.
-in the third situation, most of the units cannot leave the city to accomplish something as they are needed for happiness. Switching out of hereditary rule is also very bad for this city limiting civic options.
-how does the AI identify 'poor tiles' in a way that it works for each era of the game, that it works with various buildings that change plot output and works for mods. I do really think that this can be formalised in formulas, but it's not easy.
What was your goal with this post?
No particular goal. I just wanted to show an example of how the governor behaves while drafting heavily and drafting softly.
I just ran the same thing but this time with the globe theatre. With the city drafting a rifle every turn, the city had built 39 rifles by turn 43. With soft drafting, the city had built 15 rifles but had progressed research along by a bit more. Of course, the heavy drafting city would have had unit upkeep hitting harder and sooner.
But that is a pretty big discrepency. Going back to my original point, which was that when happiness is not an issue, waiting for the draft counter to go to zero is horribly unnecessary. In fact, in the game I was using above, it was on quick speed and the city when drafting heavily was not able to chew through all its food fast enough. The discrepency should be even larger if it was on Normal or Epic.
I know the city was not particularly developed like a typical AI city. Could you make a suggestion for how it could be changed?
If we suppose that 1is valued at 3
and 1
is "valued" as 2
, then any tile that yields less than 9
of "value" is IMO considered a poor tile.
I'm a bit tired at the moment so I might try to think of a formula tomorrow instead. But if it were to depend on the size of the city as well, to draft away a population point from a bigger city would require the worked tiles to be slightly worse in value. So at size 14 or 15, for example, drafting away a grass forest might be avoided.
The value of each tile worked should also depend on the modifiers in the city and the current position of the sliders I guess. In a Beuracracy capital, you'd be wanting to avoid drafting a lot of tiles.
Something I'm interested in knowing is this. Suppose an AI was amassing troops in preparation for an offensive war. Does it wait til its stack is big enough or does it go based on number of turns used to build up its army?
Of course. The thing is, I think there's still a fair bit of stuff in the code that like that. (Waiting for the draft counter for example - what if a mod made the draft penalty 1But such a valuation only works for the standard game, not for any modifications done to the game.
I'm not sure I would either. Maybe make it 9.1.I'm not sure if I'd put the border at 9 .
Generally, but considering the current governor tries to avoid growing into unhappiness this is not always the best idea. Cities that have just drafted will throttle back their growth even if they have a lot of food they could use. I'm not sure how to account for this without doing major work on the governor though.Maybe another modifier based on growth speed of the city. You'd rather draft in a city that could regrow faster.
This is mostly a good thing if you look at it from another angle. It seems you were implying the decision to draft should depend on how good the food to hammer conversion is somehow compared with the average tile output empire-wide. As you draft away the bad tiles, the average output per tile should improve because the AI is working better tiles. This means drafting becomes less favourable in comparison.Another problem that could arise with such an approach would be that due to drafting away the poor tiles, the calculated 'average tile output' could go up which would make tiles that were considered good when the AI started drafting become average or even poor after drafting away the worst tiles.
Of course. The thing is, I think there's still a fair bit of stuff in the code that like that. (Waiting for the draft counter for example - what if a mod made the draft penalty 1or last a lot longer). I know this is not a constructive argument but I just want to say it's not really any better at the moment.
I'm not sure I would either. Maybe make it 9.1.![]()
But when you think about it, plains hills convert 2into 4
each turn. Drafting an infantry, which is the least efficient unit to draft (except maybe some weird early ones like axemen I'm not sure), generates 140
for 21+2X food where X is the size of the city after drafting. This assumes a Granary is present, which reminds me... drafting should really only be done from cities that have a granary, except in the real emergencies. So for the non-emergency drafting we are thinking about the granary should be a necessary condition.
Going back to the infantry, even if X is fairly big like 20, that's still 140for 61
.
I wouldn't draft a plains hill for that conversion in that case but if an AI were to do it (assuming sufficient happiness) it wouldn't be the end of the world.
I too am bothered about a formula that is not going to generalise to other mods, which is why I think we need to address the problem as simply as possible. What I mean is not use any convoluted formulas that do not appear to depend on variables that can be pulled directly from the game. The cost of an infantry in, for example, should be easy for an AI. The food used could be taught to it via a formula that again depends on a few variables that can be retrieved.
Generally, but considering the current governor tries to avoid growing into unhappiness this is not always the best idea. Cities that have just drafted will throttle back their growth even if they have a lot of food they could use. I'm not sure how to account for this without doing major work on the governor though.
This is mostly a good thing if you look at it from another angle. It seems you were implying the decision to draft should depend on how good the food to hammer conversion is somehow compared with the average tile output empire-wide. As you draft away the bad tiles, the average output per tile should improve because the AI is working better tiles. This means drafting becomes less favourable in comparison.
This is a tad more reliable because you always compare against the drafting efficiency which should be relatively static, depending only on the hammer cost of the unit and the size of cities (plus whether a granary present or not). It sounds like you were suggesting the AI would be more willing to draft when it is working below-average tiles. This would be a problem because of the possible fluctuations (mostly downward) of that average compounding because of further drafting (a feedback loop I guess - worrying!).
So really the idea of using an average tile output empire-wide is not a bad one. It might take a bit of tuning though, as how do you rate specialists? Their outputs are typically very low if you ignore GPP. To include the value of GPP I suppose you'd then need to look at how many GPP had been born and then perhaps what sort of GPP are likely to be produced in future (GPP for better GPs being valued more highly). The "better" GPs are determined somehow by what the AI is emphasising in his strategy (engineers for wonder spammers, prophets for religious civs, to give very basic examples).
Even the food eaten per citizen is mod-dependent but I wouldn't mind betting again there are many peices of code that assume it's 2. When I have skimmed over some of the changes made by Blake that were put in the official game, I got that impresssion.
Oh? 21+2X comes form 20+2X (growing from X-2 to X-1) plus 20+2(X+1) (growing from X-1 to X), then all divided by 2 due to granary to give 21+2X. I didn't bother to mention the calculation but I think I did it correctly. Of course, if this were ever taught to the AI it would be done using references to the necessary variables.One point of disagreement with these regrowth calculations (which are broadly used on this forum) in general: it is assumed that regrowth happens at the food to hammer conversion of the top tile that is lost. In this case, 2 tiles are lost so these would both have to be tiles with a 1 to 2 food to hammer conversion. It is also assumed that regrowth doesn't suffer due to unhappiness.
I'm aware the tile's hammers go through modifiers. That's why I mentoined earlier the city's modifiers need to be taken into account. But as you said yourself, this is pretty much the worst case scenario and it doesn't look ridiculously aweful. In calculations I did previously, I found that in a typical gt draft city you can generate of the order of 7.3However, I don't agree with the direct comparison of a 140 to 61 conversion with the 4 to 2 conversion.
Agreed. I did try to do this with the modifiers that I mentioned but it might not have been clear. It was pretty late when I wrote all of that.
I like the sound of that.We could alternatively create a modifier that calculates the cost in food of the drafted unit (which would be very high without a granary or mod-dependant alternative of such a building) and compare that to the hammer value of the unit and create a modifier based on that quotient. That could work very well.
Yes!So, maybe we could create a modifier which encourages drafting when both food and net happiness are high.
Oh? 21+2X comes form 20+2X (growing from X-2 to X-1) plus 20+2(X+1) (growing from X-1 to X), then all divided by 2 due to granary to give 21+2X. I didn't bother to mention the calculation but I think I did it correctly. Of course, if this were ever taught to the AI it would be done using references to the necessary variables.
I'm aware the tile's hammers go through modifiers. That's why I mentoined earlier the city's modifiers need to be taken into account. But as you said yourself, this is pretty much the worst case scenario and it doesn't look ridiculously aweful. In calculations I did previously, I found that in a typical gt draft city you can generate of the order of 7.3per surplus
(when drafting riflemen at size 5. Drafting rifles at size 20 would be half that - 3.7
per
which is not as good, especially if compared with grass hill mines). At size 5 it equates to about 20
per worked tile in a city with 2 or 3 food resources. No multipliers on any tile can come close to matching that. In cities without the GT, it's not as silly because drafting can't be done as reguarly as every 1,2 or 3 turns, but the conversion of food to hammers is still extremely favourable.
On the point of how much to value the lower-xp unit, I don't really agree (with the one who would argue that).
Yes the units will be weaker but it's no where near half value. I find the problem of assigning hammer values to promotions fascinating and have always wondered what a reasonable value would be (e.g. if you made a mod where you could buy promotions), and if I were to put a rough estimate on the value of the lower-xp unit, I'd say 70% or 80% of the usual unit.
It's not really fair to compare the low-xp and high-xp versions of the same unit in one-on-one combat because they will rarely be used that way.
I agree however you need to keep this in mind when considering the conversion efficiency. The reason I think it is often often omitted in discussions (not forgotten) is that it is usually the human player using the drafted units, and for playing against an AI it's pretty easy to imagine scenarios where you just need the troop bulk and number of promotions is a minor technicality (siege does the heavy lifiting). After all it's not hard to get drafted units coming at 2xp (I usually do this) meanining they're only 1 promo short of regularly built units (5xp).
Keep in mind the AI doesn't really know how to use promotions intelligently anyway. For it, base str is normally going to be the most important factor. Since drafted units are usually the latest tech, drafting, I would argue, should work well for an AI if used on a large(r) scale.
Sorry I didn't mean to say your formula was convoluted, just that I could more easily imagine a convoluted formula that would do the job fine for the standard game but not work well with a mod, than one that works well for both.
I like the sound of that.
Yes!
...
#poor >-
- #draftpop + #draftanger.
Sadly, since the governor avoids growth into unhappiness it would most likely have particular trouble doing drafting when it is near the happy cap when drafting units that take more than 1 pop point. Growing slowly after drafting might be ok when it's only one pop point to regrow but when it's 3 the governor should be prepared to grow into unhappiness so that once the draft anger wears off it's back to or near the happy cap again.
So that leads me to another idea - when the governor avoids growing into unhappiness, it should consider the whip and draft timers and and add some factor of happiness based on how far the draft or whip timer has left. If it already does this, I'd be impressed.![]()
The (#poor >-
- #draftpop + #draftanger) rule for drafting is IMO better than the existing rule of avoiding drafting into unhappiness (even if the 2/3 pop condition is left in place, that's ok).
I forgot to mention earlier how #drafttimer comes into play. It would be muliplied by the number of tiles that would no longer be worked due to drafting to work out how many food, hammers and commerce are lost for the period of regrowth. This would be a cheap approximation to the opportunity cost of drafting in that instance.
Just FYI, the AI values yields by default as:
F: 10
H: 6
C: 4
So, not too far off what you guys had above. In at least some sections of the code, it considers a tile to be "good" if it has a value > 20 and will try to get to a population level where it is working all the > 20 tiles. With this it will work those initial 2F 1C cottages and also 1F 2H forested plains while waiting for lumber mills and such.
When it's working 2F 0H 0C tiles, then it has probably gone above the target population it set for the city ... so yes, if it's working poor tiles then burning off some population on drafting is reasonable.
Will try to catch up with the rest of what you've been posting ...
in the code? I'd like to have a look around that area.F: 10
H: 6
C: 4
Just FYI, the AI values yields by default as:
F: 10
H: 6
C: 4
So, not too far off what you guys had above. In at least some sections of the code, it considers a tile to be "good" if it has a value > 20 and will try to get to a population level where it is working all the > 20 tiles. With this it will work those initial 2F 1C cottages and also 1F 2H forested plains while waiting for lumber mills and such.
When it's working 2F 0H 0C tiles, then it has probably gone above the target population it set for the city ... so yes, if it's working poor tiles then burning off some population on drafting is reasonable.
Will try to catch up with the rest of what you've been posting ...
Now, I'm at a loss to explain how the AI is working these tiles in this city. (this is the non-drafting case from my example in post 43)
Spoiler :![]()
I've read something about the AI coding in other discussions. There exist various modifiers to tile valuation. I'm not 100% sure, but I recall something about lower valuation of food when the city is close to its happy and health cap.
That's a bit worrying. Health caps are nowhere near as important as happy caps. What makes it really appalling in this example is that the city is almost at its next pop anyway.
Working something as bad as 21
is almost inexcusable. Growing to the next pop is better by pretty much any reasonable measure. 1
is not a big worry if there's a 3
tile that can be worked. I hate to say it but even a spy specialist would probably be a better choice here, than that plains hill tile.
When extra population can't be used for drafting and whipping, then a 3 food tile is worth 0 and therefore all other sources of income are better. When the AI is not using slavery or nationhood, it should value food lower when it is about to go into unhealthiness and it does.
Don't want to be a PITA but this is not entirely accurate. Unhappy pop will still count for the diplo elections and for the trade routes output calculations ( when above 10 ), so the value of the 3 F tile in those conditions is not 0 in average, just a low value. How to compute it... well, that is far more complex, but in some situations growing unhappy even without draft or whip ( and no chance of fastWhen extra population can't be used for drafting and whipping, then a 3 food tile is worth 0 and therefore all other sources of income are better. When the AI is not using slavery or nationhood, it should value food lower when it is about to go into unhealthiness and it does.
Still, even without the draft, I find it hard to grasp using a 21
tile over a 3
1
tile.
The one reason I can think of to argue my case is that the 3tile is at least improved and could possibly allow more hammers to be earned when a hammer improvement is built later. Since 3
is a good "food" tile, but 2
is a bad hammer tile, it applies to this situation. However, this will work better when the food bar is nearer to empty than when it is nearer full.
For the AI to understand this it might need to appreciate which tiles are improved and which aren't, and also whether workers are working on the city's tiles or not.