Horrible City Placement

DrewBledsoe

Veteran QB
Joined
Nov 6, 2005
Messages
2,634
Location
Cheering For Mr Sanchez
I'm not sure if this is anything you guys have worked on, if not then apologies here and now.



What on earth is Shanghai doing where it is? It's attempting to share one 4 Of Bejing's tiles-unnecessarily-, and it's basically killed 4 of it's own tiles by being one away from the coast-also stopping any "sea" buildings eg. Harbor, Lighthouse, Customs House, Drydock etc. Just one further North, and it would be excellently placed, on a river by the coast, allowing said "sea" buildings while not compromising anything else...

Thoughts?
 

Attachments

  • HorribleCityPlacement.jpg
    HorribleCityPlacement.jpg
    108 KB · Views: 732
It's badly placed.

I've read that the AI tries to place cities at a certain distance from one another (with all kinds of modifiers) in order to avoid unnecessary loss of tiles in no mans land. There exist a few of these 'lost' tiles between Beijing and Xian because they were placed at distance 7 from one another (counting the center city tiles themselves in the distance). Does Xian grab a (sea) resource by placing it at this distance from Beijing?

I'm trying to look for the decision making process in this case so that it might be improved. In this case, losing a few tiles between Beijing and Xian should be seen as a lesser problem than placing a city 1 of the coast. Is the tile 2 south, 1 west of Shanghai a resource tile? That would likely influence the AI.

Let's see what jdog, yakk or glider say when one of them comes along. I don't think that they looked at the city founding code a lot. It's hard to get it right because the AI doesn't think ahead. We human city founders try to balance tile loss with tile overlap and usually think a few city placements ahead. We also can value resources better because we understand their local benefit and empire wide benefit better.

I personally think that the AI should look at the value lost/gained by placing a city 1 of the coast/on the coast by valuing the various coastal only building bonuses in the game/mod. In the main game that is the 1 food per coastal tile of the lighthouse and various trade bonuses from the harbor and customs house. Maybe wonder related bonuses can be ignored as long as they haven't been constructed by this AI (like +2 trade routes from the Great Lighthouse).
 
It's badly placed.

I've read that the AI tries to place cities at a certain distance from one another (with all kinds of modifiers) in order to avoid unnecessary loss of tiles in no mans land. There exist a few of these 'lost' tiles between Beijing and Xian because they were placed at distance 7 from one another (counting the center city tiles themselves in the distance). Does Xian grab a (sea) resource by placing it at this distance from Beijing?

I'm trying to look for the decision making process in this case so that it might be improved. In this case, losing a few tiles between Beijing and Xian should be seen as a lesser problem than placing a city 1 of the coast. Is the tile 2 south, 1 west of Shanghai a resource tile? That would likely influence the AI.

Let's see what jdog, yakk or glider say when one of them comes along. I don't think that they looked at the city founding code a lot. It's hard to get it right because the AI doesn't think ahead. We human city founders try to balance tile loss with tile overlap and usually think a few city placements ahead. We also can value resources better because we understand their local benefit and empire wide benefit better.

I personally think that the AI should look at the value lost/gained by placing a city 1 of the coast/on the coast by valuing the various coastal only building bonuses in the game/mod. In the main game that is the 1 food per coastal tile of the lighthouse and various trade bonuses from the harbor and customs house. Maybe wonder related bonuses can be ignored as long as they haven't been constructed by this AI (like +2 trade routes from the Great Lighthouse).

Hi Roland, haven't spoke in a long time, good to again :)

I know we have had this convo in another thread a while back, so I won't restate uneccessarily. I put this screenshot in the better ai thread, because, well it's included in the mod I play, and I don't know if it's something the better ai team want to look into.

I must admit, seeing cities placed in that horrible "one away from coast" form, has become somewhat of a rarity. How ever hard I try (and I spent a while looking at this particular city, and overall map and surrounding cities), I can't find a reason for Shanghai. The closest I can get, is that the ai has an obsession with founding its 2nd city 3 tiles diagonally from its Capital (which only gives 2 overlap) and is often a good idea. Here, that would have missed the rice, so it went one tile east instead...

Personally, I think part of the problem stems from the fact that the founder code is based on a normal sized map. On a huge map (which I and I think you exclusively play), there really isn't the same need to squeeze in the cities. I hate the idea of founding a city, which really has only 12 of its 20 tiles available, especially your 2nd, 3rd or 4th city, which will generally be amongst the largest (given the time they've had to grow), and hence will be missing the tiles for well over half of the game..

I still hope the ai can be shown, that it doesn't need to use every single tile of land, if in doing so, it compromises it's cities long term potential.
 
Indeed, good to speak to you again, Drewbledsoe. :)

I think I don't might some overlap as much as you, but still this case is pretty clear: the city should be on the coast. I'm trying to think as an AI (don't do that too often, it costs brain cells ;)) and thus looking at things the AI values. Clearly the rice is one of them. But because the resource bubbles are off and the picture is a bit dark, I'm not sure whether the tile 2 south, 1 west of Shanghai (next to the mined hill) is a resource tile. If that were the case, then I guess, the AI tries to capture that one and the rice one with Shanghai. It's not a good choice, but valuing resources in the BFC highly is one of the things the AI does.

Is that tile a resource tile or just a plains forest tile?

If it is a resource tile, a reasonable change to the AI valuation algorithm would be to value resources which will be in it's sphere of influence independent of the placement of Shanghai lower than resources that depend on the placement of that city. It's of course always nice to have a resource in a BFC of one of your cities as usually they are good tiles. But some of them are not that great that you really absolutely need to force your city placement in such a way that they are within the BFC of one of your cities. It's enough to have them within your cultural borders if you get a better city layout that way.
 
Is that tile a resource tile or just a plains forest tile?

Definitely a resource tile.
 
I think this is much worse - the AI's second city is in the middle of the jungle when there is another ridiculously strong city location available near the capital on the southern coast. The AI does go on to settle its third city there, but settling in the jungle on turn 50 and not even having iron working at turn 100 here is bad.

Does the AI know about iron/horses being there before it researched the appropriate tech? Theres iron in the northern cities BFC.

I ran this 4 times, the first time the AI settled on the south coast first, but he settled unoptimally 2 east of the plains hill losing all the hills and stone in BFC.. I'm assuming the circle is the AIs city location picks. On the south coast it starts the game out 2 east of the optimal plains hill, but sometime later moves onto the hill I don't know why. So in that case the 2nd city was settled there early. The other 3 runs were 2nd city north 3rd optimally.

With the 2nd city placed optimally this start is ridiculously good with the gems and the amount of hammers, though Saladin doesn't take advantage. I'd guess an aggressive civ would.

EDIT - you can see the circle in the first screenshot is suboptimal, I think it moves onto the plains hill (2nd screenshot city location) after AH is researched. Not sure why since stone, fish and clam are in the optimals BFC.

Spoiler :


3rd city (should have been second!)

 
Indeed, good to speak to you again, Drewbledsoe. :)

I think I don't might some overlap as much as you, but still this case is pretty clear: the city should be on the coast. I'm trying to think as an AI (don't do that too often, it costs brain cells ;)) and thus looking at things the AI values. Clearly the rice is one of them. But because the resource bubbles are off and the picture is a bit dark, I'm not sure whether the tile 2 south, 1 west of Shanghai (next to the mined hill) is a resource tile. If that were the case, then I guess, the AI tries to capture that one and the rice one with Shanghai. It's not a good choice, but valuing resources in the BFC highly is one of the things the AI does.

Is that tile a resource tile or just a plains forest tile?

If it is a resource tile, a reasonable change to the AI valuation algorithm would be to value resources which will be in it's sphere of influence independent of the placement of Shanghai lower than resources that depend on the placement of that city. It's of course always nice to have a resource in a BFC of one of your cities as usually they are good tiles. But some of them are not that great that you really absolutely need to force your city placement in such a way that they are within the BFC of one of your cities. It's enough to have them within your cultural borders if you get a better city layout that way.

The picture's dark because I didn't have enough :espionage: etc., just hit screen print.The tile you mentioned, is a plains/spices tile: 2:food:3:commerce:: a nice tile, but not worth losing the coastal placement over.

The isthmus shape of the land to the west/south west of Beijing, makes city placement quite awkward around that whole area, maybe the ai's initial dotmapping influenced matters?
 
I've only done a little bit on city placement so far, upping the value of being on the coast ... so it's gotten better, but there are still situations where it puts the city one tile from the ocean.

One factor for placing Shanghai is production. Moving the city one tile up loses one of the two hills out of the BFC while the other becomes tied distance-wise with Beijing. In addition, the horses leave the BFC. Sliding one tile to the left also loses the horses while both hills are then tied distance-wise with Beijing. I don't remember exactly how the tied-distance penalty works when evaluating plots, but it's significant.

So, where it is, the city has access to more production than elsewhere, so that's probably a big part of the decision (in addition to the AIs general preference for some overlap).
 
I've only done a little bit on city placement so far, upping the value of being on the coast ... so it's gotten better, but there are still situations where it puts the city one tile from the ocean.

One factor for placing Shanghai is production. Moving the city one tile up loses one of the two hills out of the BFC while the other becomes tied distance-wise with Beijing. In addition, the horses leave the BFC. Sliding one tile to the left also loses the horses while both hills are then tied distance-wise with Beijing. I don't remember exactly how the tied-distance penalty works when evaluating plots, but it's significant.

So, where it is, the city has access to more production than elsewhere, so that's probably a big part of the decision (in addition to the AIs general preference for some overlap).

Understand your reasoning, but the hills and horses belong to Bejing as far as I'm concerned. Trying to share limited production between two cities, is a really bad idea. Ok it might work in the short term, but all it leads to, is two mediocre cities. It's understandable in an area of extremely limited growth, but that isn't the case here. Shanghai (on the coast) probably had quite a few forests to aid it's early production, and if placed there, the ai would have an excellent production capital, and a very good science/commerce/trading city.

As it is, Shanghai would be an automatic raze, which is probably why the whole placement thing gets me so cross :lol:
 
Understand your reasoning, but the hills and horses belong to Bejing as far as I'm concerned.

Exact. You will also see settling advices for places where the ressources are already used by another city. The AI prefers sharing of ressource tiles or just cannot handle ressource tiles which are already used for the next city.

Better explained: I'm 100% sure you would get a blue settling advice sign on the shanghai tile even if beijing is already founded - just because of the 2 ressources in the fat cross of the blue settling advice tile - beijing gets ignored.
 
hm the more it's strange that the AI did not settle directly to the sea.
 
I found another issue which would contribute to this ...

Basically, the yields from a plot with 2F and a plot with 1F are multiplied by different amounts, with yields from a 2F plot worth about 70% more (because the city will definitely be able to work it). The added bonus for a coast tile and a coastal city plot was too small, it added +30 points which is about the equivalent of adding 1F to a 1F tile but keeping the 1F tile multipliers. If the plot was evaluated as if the city had a lighthouse, the bump to the next multiplier level would make the increase in value +75.

The full +75 is probably too much, because it will take time for the city to build a lighthouse and water tiles are more easily blockaded. I'm thinking something like +60, which should help keep the AI from parking 1-tile inland.
 
I found another issue which would contribute to this ...

Basically, the yields from a plot with 2F and a plot with 1F are multiplied by different amounts, with yields from a 2F plot worth about 70% more (because the city will definitely be able to work it). The added bonus for a coast tile and a coastal city plot was too small, it added +30 points which is about the equivalent of adding 1F to a 1F tile but keeping the 1F tile multipliers. If the plot was evaluated as if the city had a lighthouse, the bump to the next multiplier level would make the increase in value +75.

The full +75 is probably too much, because it will take time for the city to build a lighthouse and water tiles are more easily blockaded. I'm thinking something like +60, which should help keep the AI from parking 1-tile inland.

Nice find, excellent idea :goodjob:
 
Good find.

Shanghai captures 2 resource tiles with the present placement, rice and spices which aren't in the BFC of any other cities. It can't capture these 2 resources inside its BFC with any other city placement and thus the city needs to be 1 of the coast to capture both. I've heard that the AI loves to place cities near resources so I'm wondering if this is helping it to favour such a position.

Of course, the AI shouldn't do that as it can get the special resource benefits from the resources anyway by getting them inside its culture. But I'm wondering if it actually takes such reasoning into account when evaluating city placement. The special resource value shouldn't matter, just the food/hammer/commerce value of the tile as the resource will be controlled anyway. But that's probably hard to program as how can the AI realise that it will control the resources anyway even if it hasn't got them in the BFC of one of their cities and that it won't lose them to cultural pressure from opponents. That's not that easy.
 
With all the added benifits of being on the coast (Trade route yield modifiers, extra health, ability to build ships, etc), I think it would be best to give the tiles the full +75% value, if not more. That or the AI needs some sort of aditional logic that takes into account bonus health and commerce and construction options from being coastal, and weight them more highly.
 
With all the added benifits of being on the coast (Trade route yield modifiers, extra health, ability to build ships, etc), I think it would be best to give the tiles the full +75% value, if not more. That or the AI needs some sort of aditional logic that takes into account bonus health and commerce and construction options from being coastal, and weight them more highly.

The trade route modifiers, extra health, ability to build ships are just related to being on the coast. The present tile valuation is a per tile bonus. I don't think it would lead to good AI decision to mix these 2 valuations. It would lead to a high valuation of coastal tiles (which aren't so great) while we actually want to value 'being on the coast'. I've read there's already a separate bonus for being on the coast.
 
when will this make it into BAI?
 
Top Bottom