Caveman 2 Cosmos

9996
  • Adjust Inflation rate for Blitz.
  • Adjust AIWeight for all properties But education. Bring AIWeights to scale with Education's weight
Just asking here but what's the intention behind the AI weight adjustment exactly? From what I recall... and I'm just going off of recollection here, those values are very capable of making the AI react in unintended ways and I found that the only meaningful way to adjust them was to watch the code as it made determinations based on them. I'm not saying this is necessarily going to be problematic but are you trying to make the AI MORE reactive or LESS reactive to these properties? I'm just curious so we can keep note of the change being made now and watch for improvements or worsening performances at reacting to these properties in an effective (neither over reactive nor under reactive) manner.
 
I pulled it back from a -150 to a -50. You had set Education to +50. I remember koshling long ago warning about making the AIWeight too big in either direction. Since we are still getting complaints that the AI is slow to respond to crime, disease, air and water pollution properties I had been considering doing this pull back for awhile now. If this makes the AI too sluggish to respond or speeds up their response then we will have a better idea of the range we can work with.
 
I pulled it back from a -150 to a -50. You had set Education to +50. I remember koshling long ago warning about making the AIWeight too big in either direction. Since we are still getting complaints that the AI is slow to respond to crime, disease, air and water pollution properties I had been considering doing this pull back for awhile now. If this makes the AI too sluggish to respond or speeds up their response then we will have a better idea of the range we can work with.
IIRC, from the last time I worked on this, a lower number will make them less responsive. Negative values means it's a 'bad' property when positive numbers exist and positive values means it's a good property when positive numbers exist. So at least never cross that barrier.
 
IIRC, from the last time I worked on this, a lower number will make them less responsive. Negative values means it's a 'bad' property when positive numbers exist and positive values means it's a good property when positive numbers exist. So at least never cross that barrier.
I understand the need for the properties I adjusted to stay in the Negative range. But it's going beyond the range of -100 to +100 that is my concern. Which may turn out not be a real concern. In that case then the -150 that I had put there 2 years ago can be made even more negative, especially Crime and Disease.

If this is not to your liking then on your next commit return them to the -150 or more as you see fit.
 
I understand the need for the properties I adjusted to stay in the Negative range. But it's going beyond the range of -100 to +100 that is my concern. Which may turn out not be a real concern. In that case then the -150 that I had put there 2 years ago can be made even more negative, especially Crime and Disease.

If this is not to your liking then on your next commit return them to the -150 or more as you see fit.
Without going in and watching the code run in numerous city and unit AI situations, I cannot say if its to my liking or not. Just watch how the AI responds very closely please. That's all.

I just wanted to remind, in the words of Koshling, that in this region of the code, 'there be dragons'. (aka a lot of potential for unexpected and unintended consequences)
 
10000
  • A limited fix to the overflow problem on technology cost calculations. It doesn't work past a point, which is only the last era or two on the hardest/longest settings. When it stops working, it should just cap out, though displays might be a bit funny, showing only one turn to research, because the display is independently calculated. I'm leaving that display issue to tell us where the limit is. If we have to do more than this to correct the problem, it's going to get pretty complicated and go into realms like python where I'm not sue the unsigned long long data type can even apply. So hopefully we are able to work with this as-is for the foreseeable future. A capping of research costs at the point it maxes out may not make the last few eras on the longest game setting seem all that bad anyhow.

Sorry for making a whole new post over this but, c'mon, we JUST HIT rev 10,000! :dance:[party]:band::cheers::woohoo::banana::bounce::clap::high5::eekdance::beer::band::dance:

I quickly scanned techs in chronological order in pedia (something like this could be done by looking at tech tree too).
There are no overflows and capping out on Eternity/Standard.
For test I'll raise tech cost global 10x.

No problems here too.
It managed to display future tech cost as 507 069 522:science:
Tech tree also displayed this value correctly.
 
Last edited:
It starts showing an issue in the last era on Eternity/Huge/Deity. I think we're ok.
Handicap doesn't scale tech cost for player :p
I multiplied global by 10 as stress test, and used Eternity/Standard/Noble.
No problems.

Unless you meant "x turns" hover on tech tree.
This hover overflowed since always if it was displaying huge number of turns.
It stops overflowing as you gain higher research rate.
Cost in beakers is fine.
Spoiler :

OYqDr5s.jpg

That is purely graphical error similar to one with worker turns to build X, if it has queued build actions.

Just for fun stress test lets multiply tech global by 1000.
No problems, tech cost capped out on Nanotech era with 2 147 483 647.
Turn timer gave up at 100x smaller value 21 077 760.
Place where it will give up depends on research rate.
2 147 483 647/960 359 = 2236.125 <- Absolute maximum tech cost modifier before last tech capping out.
Now our maximum tech cost modifier is 63: Global of 320, Future Era modifier of 165, Gigantic Size of 120, and Eternity Speed of 1000.
AI on Settler has slightly higher tech costs.

We have space for 5 more eras. :mischief:
Alternatively we can freely adjust tech cost modifiers.
 
Last edited:
Map size does, and it was the peak mapsize where I saw some overflow.
Overflow in beakers or in turn amount counter?
My screenshot shows that beakers are fine, but turn counter is overflowed.
Also I didn't saw any tech overflows with tech global of 320000....
 
Also I didn't saw any tech overflows with tech global of 320000....
So the techs in the column before Future tech cost less than future tech even with the global tech cost set to 320 000?
If they cost the same amount of beakers it means there was an overflow and the beaker cost was capped at the highest integer the game allows.
The number of turns to invent is probably overflowing on several game options combinations, but that's not a big issue, we could change it so that if it takes more than 10 000 turns to invent it should show the infinity ∞ sign instead of a number.
It could alternatively simply show "..." if there is an overflow on the number of turns to invent a tech.
 
Last edited:
So the techs in the column before Future tech cost less than future tech even with the global tech cost set to 320 000?
If they cost the same amount of beakers it means there was an overflow and the beaker cost was capped at the highest integer the game allows.
The number of turns to invent is probably overflowing on several game options combinations, but that's not a big issue, we could change it so that if it takes more than 10 000 turns to invent it should show the infinity ∞ sign instead of a number.
When I set it to 320 000 techs started overflowing in Nanotech era.
That is maximum tech cost increase was 63000x

Current maximum tech cost increase is 63x (global*gigantic*eternity*future*settler (for AI) modifier)
To make last tech overflow you need maximum tech cost increase of 2236.125x

I guess its much easier to check that with your modmod :p
That is by looking at tech costs when they are sorted chronologically.
 
Last edited:
So the techs in the column before Future tech cost less than future tech even with the global tech cost set to 320 000?
If they cost the same amount of beakers it means there was an overflow and the beaker cost was capped at the highest integer the game allows.
The number of turns to invent is probably overflowing on several game options combinations, but that's not a big issue, we could change it so that if it takes more than 10 000 turns to invent it should show the infinity ∞ sign instead of a number.
It could alternatively simply show "..." if there is an overflow on the number of turns to invent a tech.
That's python side stuff right? The calculation must be limited to MAX_INT and just display that amount if need be. Curious... is it possible to use an unsigned long long in python at all?
 
That's python side stuff right? The calculation must be limited to MAX_INT and just display that amount if need be. Curious... is it possible to use an unsigned long long in python at all?
Python automatically promote ints to longs if need be, we don't declare the variable type in python. an integer can even become a float if you add/substract/multiply/divide it with a number that has decimals in it.

This is the largest integer supported by python 2
2 147 483 648
the moment you go above that value the variable will seamlessly be promoted to a long.
I'm not sure what the upper bounds of a python long is....
 
Last edited:
Python automatically promote ints to longs if need be, we don't declare the variable type in python. an integer can even become a float if you add/substract/multiply/divide it with a number that has decimals in it.

Thios is the largest integer supported by python 2
9223372036854775807
wow... that's a very nice feature for python that I was not aware of. Thanks for the info!

Still possible that the turn calc and value display is generated in the DLL. I'll have to look for that.


So this gets really weird if we have to go further from here but shouldn't be as bad as I thought given what you just explained. I only hope that it won't have to report the end amount to the exe accurately at some point. Sometimes they setup the exe to do some value grabs for the sake of calls to who knows what.
 
AI currently seems extremely reluctant to attack barbarian cities without a massive tech advantage, even if they are blocking expansion.
 
AI currently seems extremely reluctant to attack barbarian cities without a massive tech advantage, even if they are blocking expansion.
This is something I have studied some in the code and its a tricky issue because since there is a state of always war with barbs the ai tends to either be all out or completely apathetic towards barb cities and its tough to guide them to a good balance between that doesn't cripple them in some manner.
 
Back
Top Bottom