Thunderbrd
C2C War Dog
Ok, will look at this as soon as I can. Probably later today.I have just finished updating all the units but if you look in Thebes you will see a number of guard units that have used 16 or more of the 5 exp they have. With the latest upgrade of unit they did not even increase the 16 it just stayed the same and allowed me to give the new promotion. I think you can give one of the investigators 4 crime fighting promotions right now to see what is going on. It should not be able to get any more but it is still glowing blue. It may be the crime fighter can get investigation promo.
When you select a quality promo, you do lose your strength promos and you should then be able to reselect them. As for 'quality promotions are doing nothing' what do you mean exactly?That issue with quality promos doing nothing still stands. Could it have anything to do with strength promos being removed with a quality promo, so you are essentially in retraining mode?
A building review is needed, yes, but what also needs done is to adjust costs of units across the board according to the new cost assignment methods. However, this takes deeper evaluation. As do the buildings I suppose.What needs work to resolve this are all the buildings, wonders and other things which increase production or military unit production. The AI builds all those buildings and there are even slowdowns then AI players build lots of units in the same turn.
But this particular case wasn't so much caused by it being too easy to build units so much as the flaw that was making the AI build them like mad, thinking they could never get as much as they wanted.
If you only count up the amount of times the first round of battle takes place, yes. But the likelihood of a success in battle is only pure on that first round. It used to be that every round was equal. It no longer is. Thus the reliability of the law of large numbers only now applies to those first rounds and subsequent rounds get more and more difficult and less likely to make a difference and less damaging when they do. So its a world of difference from the original vanilla combats which the AI is still evaluating based on.Please stop pretending that the outcome of a large stack vs a large stack battle depends on good luck or bad luck. According to the law of large numbers, the bigger the stacks involved, the closer the result will be to the average. i.e. the influence of luck becomes smaller and smaller as a relevant factor, until you can completely ignore it.
Probably true.I repeated the attack in the save that I posted two times more (with new random seed on reload of course) and the result was the same: AI lost 145+ units and I lost 1 unit. I'm confident that repeating the battle several more times will not alter its outcome in any significant way.
I'm not saying the AI is smart here. Just not... 'bugged' in the classical sense of the term.And if you think that an attack that sacrifices 145+ units to kill one (average) unit of mine is in any way or situation a good decision, then I think you are violating common sense.
I do as well. I'll take some time here and respond to your comments and suggestions but rest assured I have been looking into this section of code as I see it process during debug efforts lately. And I think I've figured out how to fairly simply adjust the way the AI perceives power and stack differentials so that its more accurate to the way battle recalculates every round now.However you are right that smarter AI requires more calculations which leads potentially to larger turn times. But I think that using smarter maths could improve this greatly. I might have an idea....
Currently there are 2 flaws.
1) generally speaking, stacks add up the value of all its units and compares that to the sum value of all the units in the opposing stacks. What this means is that there is no consideration for how the ratio differences between the individual units in those stacks will dramatically adjust the value of a point of strength based on how much stronger one unit is over another.
Solution) Adjust this comparison so that its based on the AVERAGE strength of a stack vs the AVERAGE strength of an opposing stack, thus showing a bit more accurately the strength variation differential between the stacks, not just in overall volume. Adjust the str totals by the ratio difference in the averages. That should give a much better picture.
2) when the strength totals are derived, each unit's contribution is modified by some of the unit's tags. These modifiers are questionable because most of them are considering some strange tags to be including in it and not being modified very rationally for this particular purpose, which is one reason for slowdown as well. Koshling asked me to include these modifiers to the unit value but his answers to why we were doing this did not quite make the sense it should've made to me and I was left to think this was just a generic unit value tally. But this is supposed to be a quick, combat value tally and imo very few tags should make much of a difference to that. So some review and improvement to that side of things is in order.
Mostly, yes. I think there is still a small amount of min damage per hit, like 1 pt.Hmm if you say that the minimum damage is gone, then that opens up mathematical possibilities to speed up combat calculations.
There are other factors but assuming those factors, such as accuracy, dodge, armor, puncture, etc... are not in place, yes. Although, you must consider too that combat modifiers play into determining final strengths for each unit in a given battle.1) assuming equal hitpoints, the outcome of the battle depends solely on the ratio of strenghts. In other words: a strength 4 unit fighting a strength 2 unit (ratio 2:1) would have the same average outcome as a strength 6 unit fighting a strength 3 unit (also ratio 2:1).
hmm... final strength is adjusted by % of HP left. So then we are back to #1 ALSO.2) assuming the same ratio in strength, the battle depends solely on the ratio of hitpoints. In other words: a 100 hp unit attacking a 50 hp unit has the same AVERAGE chance of winning as a 50 hp unit attacking a 25 hp unit. N.B. smaller amounts of hitpoints would cause a higher average "overkill" (damage wasted because the target unit is already dead) but let's neglect that.
Let's say a str 6 fighting a str 3 unit. But the str 6 unit has 50% of its Max HP remaining. The str 3 unit actually has the upper hand here. Because both end up at str 3 when they start fighting but the str 6, 50% damaged unit is also 50% damaged and has (lets assume) roughly 50hp left while the str 3 unit has 100hp left. So if they trade blows every round (both hit every round) then you will have the str 6 unit having lost all its hp before the str 3 unit does (and it will be losing more str each round than the str 3 unit because its ratio of str per hp is higher still.)
Additionally:
Old way: Every round of battle the combat odds stay according to the first round's odds evaluation. Thus as a unit got damaged once it entered battle, it would not weaken until after battle was fully resolved.
New way: Every round of battle the combat odds recalculate according to the new HP. Injured units thus lose actual combat strength according to those injuries with each round. Thus if I damage my opponent the first round but I manage to avoid damage, my odds dramatically improve for the next round.
Always: Odds form the basis of likelihood to score a hit on your opponent in a round and also forms the basis of the amount of damage you do when you do score a hit.
This holds true on a round by round basis but since we re-calculate all odds each round of battle, a total full battle odds is hard to pin down as it depends dramatically on the outcome of each round that takes place. It tends to make the strength/health differential between units mean exponentially more than it did in vanilla.3) the AVERAGE outcome is one of these: a) defender dies, attacker gets x amount of damage. b) attacker dies, defender gets x amount of damage, or c) both die. If you depict (a) as a positive number (i.e. +x) and (b) as a negative number (i.e. -x) and zero if both die, then the average outcome can be rendered in a single number (which can be either positive or negative).
It is not so simple because strength ratios change as hit points are lost...then the outcome of all battles can be plotted in the following formula:
Average combat outcome = function of (input ratio of strengths; input ratio of hitpoints)
There are methods for odds calculation on a unit vs unit basis - and its got a fair degree of accuracy and takes into account first strikes, withdrawal and more. But running that for each unit against each unit in each stack is what starts taking a LOT of time on these longest turns (that must be done for the actual attack determination.) For a faster stack vs stack evaluation that is in place to determine if the stack should try to attack or not, a more simplistic evaluation becomes necessary, and it's not THAT bad... just needs some adjustments to get it to be a little smarter is all.This is a 3 dimensional plot: on the X axis you plot the ratio of strengths, on the Y axis you plot the ratio of hitpoints, and on the Z axis you plot the average battle outcome.
The result will be a curved 2 dimensional plane in this 3 dimensional plot.
Now you can run a lot of simulated battles to construct this 2 dimensional plane. Make sure that you space out the possibilities: 1-100 hitpoints vs 1-100 hitpoints gives 10,000 possibilities, but if you go in increments of 5 hitpoints, then it is only 20x20 = 400 possibilities, less if you remove duplicates, like 100 hp vs 50 hp is the same as 50 hp vs 25 hp. Size Matters increases the range of hitpoints, and if I remember correctly, every level of the unit gives another 1 hp, but the principle is the same.
Since you only have to construct this plot once, calculation time is less critical (just let it run overnight) so you can e.g. take into account that the weaker unit drops strength faster than the stronger unit so the stronger unit has an extra advantage.
Once you have this 2 dimensional plane sufficiently mapped out (in the form of many, many calculated values in a table: input x, input y, and calculated result z) then you enter this table into a statistics program, and let it calculate a formula that is "best fit" in the form
Average combat outcome (z axis) = formula (input x axis which is ratio of strengths; input y axis which is ratio of hitpoints)
It is a lot of work and computer calculation time, but once it is done, calculating average battle odds would be much faster for the AI; it only has to put ratio of strengths and ratio of hitpoints into a single formula and out rolls the average combat outcome.
Three things complicate this: 1) ranged attacks 2) first strikes 3) withdrawal chance.
The first two are straight damage dealers that can be calculated before calculating the ratio of hitpoints. The third one, withdrawal, happens not that often and if it happens, it happens when most of the battle is already done. So for stack vs stack attack, it won't be much difference if you leave out withdrawal chance.