AI work - call for example saves

Look at 1st post, need a savedgame, thx.

you asked for save where ai is about to attack, this would be opposite ai declared wars never attacked, but definitely needs a look at so here you go

by the way i have very quick turn times on this game compared to ones i used to have before( not the first game with very fast turn times but first i got far and its still fast.. maybe because ai is kinda broken? )
 

Attachments

I always figured if the AI declares war but never attacks, its probably due to a diplomatic action by another nation asking that nation to declare war - then the country starts trying to prepare for the war they declared and by the time they are ready, the war's usually over.
 
Yes bombarding units or even just attacking unit stacks (suiciding).

my instance was while i was trying to attack the enemy's city it defended with like 100 cannons :eek::cry:
 
OK in the savedgame, i have 2 different enemies coming at me, one from the west(Chinese pic 1), one from the east(barbs pic 2).

btw this has been the 1st game in 20 that i have seen an AI use it naval and go to a continent and build a city, nice work!:goodjob:
 
my instance was while i was trying to attack the enemy's city it defended with like 100 cannons :eek::cry:

I can think of 3 cases right now where a unit vanished without a notification.
1. Terrain damage (eg reef)
2. Unit lost due to damage from city defenses (the building(s), not units)
3. Opportunity fire

I don't know if it matters but DCM got a new version yesterday.
 
Not sure if this is the right place for it, but if you're also interested in save games where the turn time takes longer than usual, this one takes me almost 4 minutes. The next turn was "only" just above 2 minutes.

I've caused some serious havoc with my spies in the Persian empire, gone all out on them with revolutions left and right, which most probably is the cause for this.
Maybe helpful for profiling.

Cause is several cities changing hands, which causes large scale recalculation of trade networks, which in turn force reprocesses bonuses, and building supported by bonuses in many cities. I have a handle on how to deal with this much more efficiently, so watch for an update on the SVN thread at some point today or at the weekend.

Thanks for the save as usual - it was an instructive one.
 
Cause is several cities changing hands, which causes large scale recalculation of trade networks, which in turn force reprocesses bonuses, and building supported by bonuses in many cities. I have a handle on how to deal with this much more efficiently, so watch for an update on the SVN thread at some point today or at the weekend.

Thanks for the save as usual - it was an instructive one.

Good to hear. Really appreciate your work on improving the speed of the game (which in my opinion is the largest drawback currently).
And by the way, if you need more examples of unusual high city anarchy times, I've had some fun with the Arabs later in that game and have set a new personal best with >140 turns for revolt time... (and another one with >90).
I think the cities were in disarray themselves the time I captured them.
 
Good to hear. Really appreciate your work on improving the speed of the game (which in my opinion is the largest drawback currently).
And by the way, if you need more examples of unusual high city anarchy times, I've had some fun with the Arabs later in that game and have set a new personal best with >140 turns for revolt time... (and another one with >90).
I think the cities were in disarray themselves the time I captured them.

That is not really an issue I plan to look at (I have plenty to do on performance and AI), but hopefully someone will.
 
I can once the issues with Edited Traits get sorted out.

Ok, done some testing with the world builder over the last hours with the attached save game (man, I reall hate those MAF errors when reloading!).

The revolt time is actually exactly 150 turns for the city of Medina. The city has a population of 95, a culture rate of 246237 and is currently in 6 turns of turmoil. And it has the Castle Keep building, which increases the duration of the resistance by 200%.

Reduced population to 50 (which is reduced to 38 by capturing):
81 turns

Reduced pop to 5:
15 turns

Removed Castle Keep from city (with 95 pop):
50 turns

Removed all buildings from the city (except automatic like housing, crime & pest):
50 turns

Set culture rate to 1:
150 turns

So maybe this is a combination of city revolt + large populations?
 

Attachments

@sp00n:

No, it is a process of the fact that the Revolt time is primarily determined by a GlobalDefine for population. As it stands now it adds one turn of revolt per 2 population points (quite a lot really in C2C). The even more ridiculous thing is that it doesn't have anything to do with Gamespeeds whatsoever, so if you took that city on Normal speed it would revolt for the same amount of time that it revolts on Eternity! That is not good.

What I've done (This will be going into my next commit, as soon as the Trait bugs get sorted out) is added a new tag to the Gamespeeds that does exactly what the GlobalDefine does now, except that now it can scale by gamespeed. I'll also be bumping that down to a base of 6% of a turn per population point on Normal. So that would mean 18% per pop on Marathon, 30% on Snail, and 150% (or 1.5 turns per pop) on Eternity.

The Keep is not helping either, but that is another tweak entirely in someone else's stuff.
 
@sp00n:

No, it is a process of the fact that the Revolt time is primarily determined by a GlobalDefine for population. As it stands now it adds one turn of revolt per 2 population points (quite a lot really in C2C). The even more ridiculous thing is that it doesn't have anything to do with Gamespeeds whatsoever, so if you took that city on Normal speed it would revolt for the same amount of time that it revolts on Eternity! That is not good.

What I've done (This will be going into my next commit, as soon as the Trait bugs get sorted out) is added a new tag to the Gamespeeds that does exactly what the GlobalDefine does now, except that now it can scale by gamespeed. I'll also be bumping that down to a base of 6% of a turn per population point on Normal. So that would mean 18% per pop on Marathon, 30% on Snail, and 150% (or 1.5 turns per pop) on Eternity.
For that kind of adaptions to gamespeed, difficulty or world size check out the new Percents tag in these info files:
Code:
			<Percents>
			  <Percent>
			    <ID>ADAPT_DEFAULT</ID>
			    <iValue>1250</iValue>
			  </Percent>
			</Percents>
You can then in the code adapt your value with adaptValueToGame on CvGameObject.
 
For that kind of adaptions to gamespeed, difficulty or world size check out the new Percents tag in these info files:
Code:
			<Percents>
			  <Percent>
			    <ID>ADAPT_DEFAULT</ID>
			    <iValue>1250</iValue>
			  </Percent>
			</Percents>
You can then in the code adapt your value with adaptValueToGame on CvGameObject.

If i wanted a certain unit to begin at a certain date, how then?? Or should i put this in the Help Wanted thread??
 
@sp00n:

No, it is a process of the fact that the Revolt time is primarily determined by a GlobalDefine for population. As it stands now it adds one turn of revolt per 2 population points (quite a lot really in C2C). The even more ridiculous thing is that it doesn't have anything to do with Gamespeeds whatsoever, so if you took that city on Normal speed it would revolt for the same amount of time that it revolts on Eternity! That is not good.

What I've done (This will be going into my next commit, as soon as the Trait bugs get sorted out) is added a new tag to the Gamespeeds that does exactly what the GlobalDefine does now, except that now it can scale by gamespeed. I'll also be bumping that down to a base of 6% of a turn per population point on Normal. So that would mean 18% per pop on Marathon, 30% on Snail, and 150% (or 1.5 turns per pop) on Eternity.

The Keep is not helping either, but that is another tweak entirely in someone else's stuff.

Yeah, I've tested several cities with different populations and from different civs now, and it's a direct function of the city's population, Although the code already said so, I always suspected something else I just hadn't found yet was at play here as well, which doesn't seem to be the case now though.

I just wonder why this hasn't come up earlier, and no one else seemed to have noticed that problem, at least the according to the recations to my previous bug reports.


Regarding the upcoming changes, do you really think that 1.5 turns per pop is a good idea though? For a 100 pop city that'd already 150 turns of base revolt, which I think is to much under any circumstances (granted, I don't know the scaling for the Eternity game speed). And 100 population isn't even that much in a C2C game (the AI always seems to have larger cities than me anyway).
I'd much rather like to see some sort of upper limit for the amount of turns a city revolt can take place. Personally I regard anything above 30-35 turns as ridiculously out of whack, but your mileage may vary.

And I would also like to pledge for the removal of the Castle Keep building (or just heavily modify its effect). Going from the above mentioned 150 turns to 450 turns doesn't seem like a good idea. And even going from 30 turns to 90 turns doesn't really add anything to the game except the wish to simply raze that damn city.

Maybe one could think about adding a +revolt value for each world wonder built in the city, but that's rather something for the long term, whereas disabling the Castle Keep will help already help on the short term.
 
Yeah, I've tested several cities with different populations and from different civs now, and it's a direct function of the city's population, Although the code already said so, I always suspected something else I just hadn't found yet was at play here as well, which doesn't seem to be the case now though.

I just wonder why this hasn't come up earlier, and no one else seemed to have noticed that problem, at least the according to the recations to my previous bug reports.


Regarding the upcoming changes, do you really think that 1.5 turns per pop is a good idea though? For a 100 pop city that'd already 150 turns of base revolt, which I think is to much under any circumstances (granted, I don't know the scaling for the Eternity game speed). And 100 population isn't even that much in a C2C game (the AI always seems to have larger cities than me anyway).
I'd much rather like to see some sort of upper limit for the amount of turns a city revolt can take place. Personally I regard anything above 30-35 turns as ridiculously out of whack, but your mileage may vary.

And I would also like to pledge for the removal of the Castle Keep building (or just heavily modify its effect). Going from the above mentioned 150 turns to 450 turns doesn't seem like a good idea. And even going from 30 turns to 90 turns doesn't really add anything to the game except the wish to simply raze that damn city.

Maybe one could think about adding a +revolt value for each world wonder built in the city, but that's rather something for the long term, whereas disabling the Castle Keep will help already help on the short term.

The castle keep element is (IMO) legitimate and a valid gameplay mechanic - use spies to destroy the castle keep before you capture the city if you feel the need. Having a poison-pill defense in the form of a castle keep adds to gameplay (at least in principal). However, it's just a modifier, and if it's acting on a base figure that is not reasonable then obviously there IS a problem, but in my view the problem is simply with the base figure (which is what ls612 plans to address)
 
The castle keep element is (IMO) legitimate and a valid gameplay mechanic - use spies to destroy the castle keep before you capture the city if you feel the need. Having a poison-pill defense in the form of a castle keep adds to gameplay (at least in principal). However, it's just a modifier, and if it's acting on a base figure that is not reasonable then obviously there IS a problem, but in my view the problem is simply with the base figure (which is what ls612 plans to address)

3 times though I'd say is a bit overboard. I'm going to bump down the base times (and since the tag works exactly like the globaldefine works now AIAndy's method wouldn't work), but I'd also support reducing the effect of the Keep to +75% or so (and not +200% like it is now).

As for that 1.5 turns per pop, that is on Eternity, a speed with 14000 turns, so I don't worry too much about that.
 
I'm going to bump down the base times (and since the tag works exactly like the globaldefine works now AIAndy's method wouldn't work)
It works whenever you want to scale something but saves you the effort of adding new tags.
 
It works whenever you want to scale something but saves you the effort of adding new tags.

Yeah, but the way that it works now is that it multiplies the number of population in the city by the globaldefine (now a new tag) and then divides taht by 100, and that is the number of turns of resistance per population. That won't work with the default Adapt tag (which is at the numbers for GPs and other generic Gamespeed stuff).
 
Yeah, but the way that it works now is that it multiplies the number of population in the city by the globaldefine (now a new tag) and then divides taht by 100, and that is the number of turns of resistance per population. That won't work with the default Adapt tag (which is at the numbers for GPs and other generic Gamespeed stuff).
I did not suggest using the Adapt tag (which is an integer expression tag) but the new tags and functions that Adapt relies on.

So what I suggest is this:
You calculate the resistence as described and then scale it with the adaptValueToGame function.
Something like this:
iResistanceAnarchy = GC.getGameINLINE().getGameObject()->adaptValueToGame(GC.getInfoTypeForString("ADAPT_RESISTANCE_ANARCHY"), iResistanceAnarchy);
 
Back
Top Bottom