Zen and the art of AI city placement.

Andvare

King
Joined
Sep 14, 2007
Messages
788
See attachment.

Now, this little city was placed by the AI, close to the AI's capital (former, that player is now dead). the two tiles that are inaccessible are accessed by the capital.
A placement of one north would have given one fish, one coast and three ocean tiles, for the cost of one floodplain tile and one grass/rive tile.
One north would also give the opportunity to build lighthouse and such. Given that this AI started inland, and this was the first city it placed (and only the last city on the continent it did place, were by the coast), why oh why did it place it like it did? The floodplain doesn't give it enough food to warrant the placement, the fish more than make up for that. Neither does the grass/rive, as both would still be only the same as the fish.
Really, I can't see any reason for this placement.
Now this isn't the most stupid AI placement by far, unfortunately, but what can be done to help the AI? (other than babysitting it via worldbuilder)
Anyone?


Oh, please feel free to post your own version of a stupid AI.


Edit: The pic is somewhat misleading, when it shows 5:commerce: alone it's actually 10 :commerce:, and when it shows 7:commerce:, it is 7:commerce:.
Oh, and why didn't I raze the city? Dunno, forgot :blush: .
 

Attachments

  • Stupid AI.JPG
    Stupid AI.JPG
    142.9 KB · Views: 658
The ai loves to build cities 1 away from the coast and their city placement is often very questionable overall.
 
this is from a game i'm playing right now, i'm literally tabbed out of it having a snack surfing the boards. i'm about to capture and raze this city from Willem. you know, the leader of the Netherlands, whose UB is really really spiffy, and can be built in any city that's on the coast or on a river. because of that UB, this city disgusts me about as much as any i have ever seen:



it manages to miss both the coast and a river by one tile! grrrrrrrrrrrrrr. and it overlapped a total of 5 tiles with other cities, you just can't see that since i already captured those cities, so this one gets all the tiles now. why would you do that? i looked at his map carefully while planning the war like i always do, to pick what to raze and what to keep, and wanted to shake him. there ought to be a law. yeah i know the formula can't account for the UB when placing cities but that's ugly for anybody. :rolleyes:

i can see it maybe if he wants to be really sure he doesn't lose his oil connection, i've done that before. but he settled this city in 1050 BC, so that wasn't it. :lol:
 
Ahh, abysmal AI city placement, my pet cIV peeve. In fact it's so bad I occasionally quit games after being immensely frustrated at having to raze nearly every city of some AI being 'liberated' by my troops.

IMO the following changes could immensely help the AI:
1. Less weight on resources in the city placement algorithm, esp. those it already possesses multiple instances of.
2. Evaluate the potential of tiles rather than (only) the immediate value. Or at least consider whether tiles can be improved, which just doesn't seem to matter to the algorithm.
3. Severely reduce weight of overlapping tiles, in particular those within the borders of another civ.
4. Reduce the weight of the hills defence bonus and fresh water bonus somewhat. Debatable, but I think they're currently considered too important by the AI.
5. More weight on hammers; they appear nigh-insignificant compared to commerce and food.
6. More weight on distance from capital. Again the algorithm will seemingly gladly settle a city at any distance, sometimes crippling the civ's economy in the process.

Ideally the AI should also consider the potential placement of multiple cities rather than just one at a time, but I suspect that would render the algorithm too cpu-intensive.
 
maybe the AI is placing these cities because they look pretty and form mystical zen-like patterns that only manifest themselves to the higher consciousness and thereby project secret messages to alien life forms who communicate with Earth through PC games in an effort to learn from our culture and someday conquer the planet with their Zyborg machines.
 
It annoys the heck out of me. I haven't done this yet, but I've seriously considered giving myself a settler via the world editor each time I raze an AI's city because it should have been built one tile over. It's seriously annoying having to build all those extra settlers and start cities from scratch because the AI is too stupid to place their cities properly.
 
The AI does this deliberately: 'I can afford to be sloppy and still have a kick-ass economy because I cheat, and my ugly city placement will discourage obsessive players from conquering me.'

While you're fuming about bad AIs, they're laughing at you and flipping you the bird behind your back.
 
1. Less weight on resources in the city placement algorithm, esp. those it already possesses multiple instances of.

I don't think there's much question that resources make for a better city in almost all circumstances. I don't think the weighting is off there.

2. Evaluate the potential of tiles rather than (only) the immediate value. Or at least consider whether tiles can be improved, which just doesn't seem to matter to the algorithm.

All tiles can be improved in some fashion.

3. Severely reduce weight of overlapping tiles, in particular those within the borders of another civ.

This I agree with.

4. Reduce the weight of the hills defence bonus and fresh water bonus somewhat. Debatable, but I think they're currently considered too important by the AI.

I'm not sure they are as out of line as you think. On average, a hill is only going to account for 1-2% of the "weight" of a square.

5. More weight on hammers; they appear nigh-insignificant compared to commerce and food.

Realistically, food is a more important determinant of a good city than hammers. And commerce is often more important than hammers as well. For the human player, for example, you often make a few "production cities", but you certainly wouldn't want all of your cities production-heavy (until late game, anyway). So I'm not sure how much more weight should be allocated to hammers.

6. More weight on distance from capital. Again the algorithm will seemingly gladly settle a city at any distance, sometimes crippling the civ's economy in the process.

There's plenty of weight applied to distance. You'll only see Civs building far-distant cities when there are no more close locations. Weighting isn't going to change that.

Ideally the AI should also consider the potential placement of multiple cities rather than just one at a time, but I suspect that would render the algorithm too cpu-intensive.

Yes, that'd be ideal, but not practical. At least not the way the game is currently set up.

Bh
 
this is from a game i'm playing right now, i'm literally tabbed out of it having a snack surfing the boards. i'm about to capture and raze this city from Willem. you know, the leader of the Netherlands, whose UB is really really spiffy, and can be built in any city that's on the coast or on a river. because of that UB, this city disgusts me about as much as any i have ever seen:



it manages to miss both the coast and a river by one tile! grrrrrrrrrrrrrr. and it overlapped a total of 5 tiles with other cities, you just can't see that since i already captured those cities, so this one gets all the tiles now. why would you do that? i looked at his map carefully while planning the war like i always do, to pick what to raze and what to keep, and wanted to shake him. there ought to be a law. yeah i know the formula can't account for the UB when placing cities but that's ugly for anybody. :rolleyes:

i can see it maybe if he wants to be really sure he doesn't lose his oil connection, i've done that before. but he settled this city in 1050 BC, so that wasn't it. :lol:

Love your posts, just for the nitpicking, we can see where four of the overlapping tiles are due to the city 3S2E of the Utrecht. And I'd beat him to death (which you surely are doing atm, congrats on successing oin declaring war on someone btw :)) for placing that city. S-t-u-p-i-d!
 
All tiles can be improved in some fashion.

Bh

Sorry for the doubleposting, but this is not true unless you count forts as an improvement, and doesn't count sea/coast/lake squares. I've seen an AI found a city with 12 water tiles, 2 snow tiles and six ice tiles. explain please. And it was FAR away from it's capital aswell -.-
 
I do count forts as improvements because, well, that's what they are classified as - improvements. That's my point, you can't make a "can this tile be improved" check because it'll always at least turn up forts.

As for your "I've seen a city", I'm not sure what exactly I'm supposed to explain about it.

Bh
 
SP is trainer mode. Sure AI are stupid, ever met a robot that wasn't? If you want a real challenge play multiplayer.
 
I've seen an AI found a city with 12 water tiles, 2 snow tiles and six ice tiles. explain please. And it was FAR away from it's capital aswell -.-

I think he is saying this is an example where there are no improvements that can be made for this city, right?
 
I think he is saying this is an example where there are no improvements that can be made for this city, right?

Right, but as I mentioned previously, forts can be built anywhere, and they are improvements. Also worth mentioning is that there is no current check for improvements, so why would the fact that that AI currently does that be relevant?

Anyway, one thing that people don't really consider is "low space" cities. I've been writing my own "city placement" code. So far it does a really good job of picking cities when it's got plenty of open space to do so. Where it starts to fall apart is when all the "good" locations are taken. It then starts squeezing cities in anywhere it can fit them. So all those "good" locations become "mediocre" locations because they are being shared with other cities. It also means that the AI is trying to put cities based on their cultural boundaries, so you get some odd placements because of that. I've virtually eliminated placing cities 1 away from the coast (except where it makes sense), but it'll still happen if that's the only place the AI can fit one. When you are watching the game unfold, you understand that. But if I were playing "normally" and came across the city a few hundred turns later, I'd think the city placement was really stupid.

What it comes down to is it's really damn difficult to do city placement so that all the factors work properly.

Bh
 
Sorry for the doubleposting, but this is not true unless you count forts as an improvement, and doesn't count sea/coast/lake squares. I've seen an AI found a city with 12 water tiles, 2 snow tiles and six ice tiles. explain please. And it was FAR away from it's capital aswell -.-

they were going for a failed domination win :crazyeye:
 
this is from a game i'm playing right now, i'm literally tabbed out of it having a snack surfing the boards. i'm about to capture and raze this city from Willem. you know, the leader of the Netherlands, whose UB is really really spiffy, and can be built in any city that's on the coast or on a river. because of that UB, this city disgusts me about as much as any i have ever seen:


If only that Egyptian city wasn't there... you could put the city one tile to the east and get 3 (count 'em) additional resources in the fat cross
 
ewww, one tile east would still be off the coast! i can get all the resources, they don't have to be in one city *giggle*. better to split them up between cities and let 'em all have harbors IMO. especially when you consider that one up top still in revolt has the hanging gardens in it. :)
 
Right, but as I mentioned previously, forts can be built anywhere, and they are improvements. Also worth mentioning is that there is no current check for improvements, so why would the fact that that AI currently does that be relevant?

Anyway, one thing that people don't really consider is "low space" cities. I've been writing my own "city placement" code. So far it does a really good job of picking cities when it's got plenty of open space to do so. Where it starts to fall apart is when all the "good" locations are taken. It then starts squeezing cities in anywhere it can fit them. So all those "good" locations become "mediocre" locations because they are being shared with other cities. It also means that the AI is trying to put cities based on their cultural boundaries, so you get some odd placements because of that. I've virtually eliminated placing cities 1 away from the coast (except where it makes sense), but it'll still happen if that's the only place the AI can fit one. When you are watching the game unfold, you understand that. But if I were playing "normally" and came across the city a few hundred turns later, I'd think the city placement was really stupid.

What it comes down to is it's really damn difficult to do city placement so that all the factors work properly.

Bh

Thanks, Bhruic, for sharing your perspective. I'm not sure how to say this. I don't want to come of as arrogant. I have a sympathetic view since I worked in software and programmed some. As a programmer I understand trying to create a program that has the sophistication of human decision-making is very difficult. Sometimes people who don't have that experience programming have trouble understanding how complicated it can be. Making a game shooting up tanks or zombies is not so hard as programming an AI that has human-like decision-making in an open envirnment such as Civ. I also understand the time and resource constraints that most software companies are under so I think considering that the AI in CIV iV is very good. Of course as a player I always want it to be better too :D and actually I personally feel that the city placement was better in Warlords. Maybe that is my imagination. Were there changes to the city placement from Warlords to BTS?
 
Top Bottom