Unofficial BTS 3.13 patch

[...]
The main trouble I'm running into right now is trying to balance practical starting yield with theoretical improvement yield. My current formula over-values water tiles (even without lighthouses in the picture) because they generate 1 :food: and 2 :commerce:. Leaving aside the food/production/commerce weighting issues, that means that a water tile "looks" better than a normal non-river, non-forested tile (which all generate only 2 food/production/commerce). Obviously the land tiles can be improved, but trying to "value" the improvement potential is both difficult and frustrating. If anyone has any ideas on that front, I'm all ears.
[...]
What about giving land tiles (grassland, plains are the issue, as I assume) a "dummy evaluation" of say xf, 1p, 1c while evaluating the available space? (Numbers just for illustration).

As far as I understand, the problem is in evaluating tiles which later on will be improved in a way which can not yet been foreseen. Thus, the water tiles win, which they shouldn't do.
 
I feel kind of silly, because I thought levees could be built anywhere. It was just a question of whether or not it was worth it. I guess in the past anytime I wanted to build one, it was in a city with a river. I imagine the dutch dikes do not have the requirement?

As a quick side note, how did you mod this? I'm not seeing this restriction anywhere in the XML. Perhaps that's because it's not in the XML.

In the normal unmodded game, levees can be build in cities next to a river and dikes can be build in cities next to a river or on the coast. This greater freedom of in which cities dikes can be constructed is one of the reasons why this unique building is so strong (the other is the obviously great hammer bonus to all coastal tiles). I think it is really overpowered (and I'm Dutch so I should like an overpowered building for my home country).

In which cities the building may be constructed is controlled in the xml, more specifically in CIV4BuildingInfos.xml

There are 2 lines (for each and every building) which control this. For the levee they are:

<bWater>0</bWater>
<bRiver>1</bRiver>

The bWater and bRiver line will allow the building only on water and river sites. Note that this is an OR setting. If both bWater and bRiver are set to 1, then the building is allowed in a city with coastal access or a river. If both are set to 0, then you can build the building in every city.

Note that if you decide to mod the requirements of the levee (and the dike), then you should consider that you're allowing the building to be build in cities where it won't help at all. Maybe you should consider adding a benefit independent of a river. I don't know for sure if the AI won't build it when the building is useless.

If you want to discuss this further, then PM me. It has the risk to derail this thread a little.

No, doing that wouldn't be terribly difficult. But it would also be particularily futile. The other AIs would end up settling spots that would cause problems for the "master plan". The only time it'd be even vaguely useful is when the AI was alone on a continent - and even then things like Barb cities would get in the way.

Yes, such a 'master plan' should continuously be re-evaluated, making it even more computationally intensive.

The main trouble I'm running into right now is trying to balance practical starting yield with theoretical improvement yield. My current formula over-values water tiles (even without lighthouses in the picture) because they generate 1 :food: and 2 :commerce:. Leaving aside the food/production/commerce weighting issues, that means that a water tile "looks" better than a normal non-river, non-forested tile (which all generate only 2 food/production/commerce). Obviously the land tiles can be improved, but trying to "value" the improvement potential is both difficult and frustrating. If anyone has any ideas on that front, I'm all ears.

What about giving land tiles (grassland, plains are the issue, as I assume) a "dummy evaluation" of say xf, 1p, 1c while evaluating the available space? (Numbers just for illustration).

As far as I understand, the problem is in evaluating tiles which later on will be improved in a way which can not yet been foreseen. Thus, the water tiles win, which they shouldn't do.

There already exists a certain code that allows the city-tile-selecting AI to prefer a grassland cottage (2 food, 1 commerce) over a lighthouse enhanced coastal tile (2 food, 2 commerce). This code is probably doing something along the lines of what Commander Bello is suggesting. It is overvaluing a tile based on its future production.

In a more general case, a distinction needs to be made on what improvements can be made to a tile. For instance, a non-river tundra tile cannot be improved, a non-river forested tundra tile can get a lumbermill, but that is it. Lumbermills aren't available for a long time, so the tile isn't that great. The overvaluing of hills should also be significant because they can get a mine very early in the game greatly enhancing their output.

So how to do this in general and in such a way that it is modding friendly (if someone mods mines into 10 hammer producing improvements, then the AI will like hills):

Value tiles as a weighted average of the various outputs they can get at the present level of technology. For instance a plains/tundra/ice hill:
Weights: bare (2), mined (4), windmill (2).
Value of a hill before windmills: (2 * bare value + 4 * mined value)/6
Value of a hill after windmills: (2 * bare value + 4 * mined value + 2 * windmill value)/8
The windmill value and mined value will of course change throughout the game when various upgrades for these improvements appear.
Maybe some improvements should be considered available from the start of the game so that the AI doesn't undervalue hills before mining is available.

I don't know if this kind of valuation is feasible.

Another remark: You mention that the AI prefers a 1 food, 2 commerce tile over a 2 food tile. Of course, a city created with just non-improvable 2 food tiles is quite worthless, but still in general the AI should value food higher than commerce. In general food is the hardest resource to acquire and production (hammers) is also fairly hard to acquire, commerce is the easiest to acquire. The AI should value these resources accordingly and thus value food higher than production and production higher than commerce. But I guess it already does that looking at the preferences of the city governor.
 
There already exists a certain code that allows the city-tile-selecting AI to prefer a grassland cottage (2 food, 1 commerce) over a lighthouse enhanced coastal tile (2 food, 2 commerce). This code is probably doing something along the lines of what Commander Bello is suggesting. It is overvaluing a tile based on its future production.

Oh, sure. But the cottage has already been built, and the game "knows" that a cottage will develop if worked. But in this case, we don't know what improvement is going to be built. So the "valuation" system needs to account for all the possibilities in some fashion.

Maybe some improvements should be considered available from the start of the game so that the AI doesn't undervalue hills before mining is available.

That's another part of the problem. One you've got Civil Service and can chain irrigate, a city that looks "mediocre" may suddenly become "good". But there's very little chance that the city spot is still going to be available once Civil Service is researched. So waiting until you've researched it to modify the value of a square is a poor choice.

On the other hand, if you assume chain irrigation, a city spot might look "great" early on, and get excessive priority from the AI when it's currently only "mediocre". So the AI might end up founding sub-par cities because it's assuming it can chain irrigate.

Basically a case of "damned if you do, damned if you don't". Of course, no system is going to be perfect, but it'd be nice to figure something out that'll result in something closer rather than farther from ideal.

Another remark: You mention that the AI prefers a 1 food, 2 commerce tile over a 2 food tile. Of course, a city created with just non-improvable 2 food tiles is quite worthless, but still in general the AI should value food higher than commerce. In general food is the hardest resource to acquire and production (hammers) is also fairly hard to acquire, commerce is the easiest to acquire. The AI should value these resources accordingly and thus value food higher than production and production higher than commerce. But I guess it already does that looking at the preferences of the city governor.

Yes, of course I understand the importance of food. I think I mentioned that for the sake of the example, I was overlooking the importance differential between the three, in the same way I was overlooking lighthouses. It was just to illustrate the fact that it's exceedingly difficult to compare unimproved tiles.

Bh
 
The Imports/Exports ranking system on the Demographics screen seems to operate the wrong way round.

Being ranked no. 1 means you're actually supplying more commerce to other civs than you're receiving from them, and being rank 8 means vice versa.

Would this be considered a bug worthy of attention for the unofficial patching process? I'd certainly hope so.
 
That's another part of the problem. One you've got Civil Service and can chain irrigate, a city that looks "mediocre" may suddenly become "good". But there's very little chance that the city spot is still going to be available once Civil Service is researched. So waiting until you've researched it to modify the value of a square is a poor choice.

On the other hand, if you assume chain irrigation, a city spot might look "great" early on, and get excessive priority from the AI when it's currently only "mediocre". So the AI might end up founding sub-par cities because it's assuming it can chain irrigate.

Basically a case of "damned if you do, damned if you don't". Of course, no system is going to be perfect, but it'd be nice to figure something out that'll result in something closer rather than farther from ideal.

Yes, rewriting the city founding algorithm is a real challenge.

In general, I think farms are the poorest terrain improvements available. You don't want to acquire food with a city, you want hammers and commerce. Food is just a means to an end. You just require some of the stuff to get hammers and commerce from other tiles.

So how about assuming chain irrigation (except for tiles which cannot be irrigated at all) but adding a penalty to cities with a very low base food output. A very low base food output basically means that the city needs a lot of farms and windmills and these are not the best improvements to get a city with a lot of hammer and commerce production.
So for instance, a city which can use 16 tiles (some overlap, some useless tiles) which has a base food output of 24 isn't that great. There exists a food shortage of 8. Usually that will be a plains or tundra city or a city with lots of hills and these need lots of farms which reduces the output of hammers and commerce.
(Maybe it's best to compare the food output of a city location after the food resources in its workable area have been improved with the amount of food needed to work the tiles in its workable area. Food resources add so much food that the improved value should be considered and not the unimproved value.)

I guess there will always be a problem with a city founding algorithm. A human player might also not place the city in the same spot at the start of the game compared to at the end of the game. There is no perfect spot for the entire game.
 
Could it help to calculate the food value for a given (assumed) city tile to calculate the max. possible food value and divide it through the value of the unworked tiles?
This should result in some number like 1.59 or 2.34 (number just for illustration) and thus would allow to build a ranking, which might be (temporarily) stored and used to find the best location.
Modifiers could be the possible number of hammers and/or the number of commerce possibly created (an optimization run for the assumed fat cross would be needed).
 
Huh, what? Where is that number (124) coming from. That doesn't make any sense.

That's not how city maintenance is calculated. Number of cities maintenance has a maximum dependent on difficulty level. that value is 5 at noble level and you won't reach that level in the early game and every city of yours will have that upkeep once you've acquired a large empire.
City distance upkeep varies based on distance from the capital (Versailles, Forbidden Palace) and size of the city. But it usually isn't a high number either. It's 0 in State Property.
The courthouse halves these upkeep values.
A typical increase in upkeep thanks to one sizeable city is around 5-8 in the late game with courthouses. I wonder how you ever thought it could be anywhere near 124. Really weird.
124 is the increase for your entire empire and it was a guess. Obviously it will depend on # of cities and will vary from game to game.

To use your number, an increase of 5-8, it would only take 15-20 cities to reach the 124 mark. In a 50 tile area, 11 cities will fit comfortably. So yeah I guessed a little high. Still, 11 * 5-8 = an increase of 55-88 per city added. How long will it be before that new city is generating more than 55-88, even if you whip a courthouse? A while.

Anyway, this is all just general discussion. The point is that maintenance is a significant factor to consider when we're talking about ICS, basically.

I wasn't talking about a specific game period. Early to mid game, the 3 cities with overlap won't be limited by the overlap because of their limited size due to the happiness and health cap. Late game, you have huge trade route bonuses, corporation bonuses and the 3 cities combined are using more tiles and thus produce more commerce and production.
Late game, how are 3 cities with total X tiles in their fat cross working more than 2 cities with the same X tiles? X is X, and late game all cities are maxed out in their pop.

Hmm, building construction is on a per city basis. I don't get what you're saying. :confused:
We're talking increase in maintenance. This occurs in every city, not just the new city.

It seems that you're getting angry at me
My abject apologies... I wasn't angry at all but I certainly see how you might think that. I was just trying to place emphasis and I went overboard.

for the limitations of the AI. I can't help that. The so called intelligence of the AI is very limited. I would love it if the AI were intelligent enough to plan the cities on an entire continent all at once, but you'll just have to accept that this is not going to happen. And it's not going to happen if you take 20 AI programmers and let them work on it for a year.
If Bhruic thought he couldn't fix some of the problems then he wouldn't be trying. He asked for our suggestions.

The AI is actually simulating intelligence by using well thought through algorithms. Writing an algorithm that searches through all the possible city locations on a continent and picks the perfect set of city locations is totally out of the question even with full information about the continent.
It already does this (except for the "perfect" part). All we're trying to do is to make it a little bit better.

The number of permutations would be way too big for even the fastest computer. But usually you don't even have full information because not all the terrain is known.
The AI scouts immediately and fully. It knows all the terrain VERY quickly.

How do you write a valuation code for settling the best city without causing the AI to greedily grab a position of 4 health resources and not sharing them with many cities. That is very hard to do.
A recursive algorithm is probably easiest, but I can think of several ways to do it without recursion.

Bhruic isn't trying to make the AI plan the cities in a large area in advance. He's trying to improve the algorithm that values the city locations so that the AI makes a better choice about where to build its next city.
Those two statements are the same thing.

And he tries to do that in such a way that the final pattern of cities is also fairly good. Since the cities are placed one by one, it's pretty hard to control the final pattern of cities.
Agreed. So if the current pattern using the current algorithm is "fairly good" why can't we make it "better than fairly good"?

It just seems like the crux of your argument is "this is hard" and giving up thereby.

Wodan
 
If Bhruic thought he couldn't fix some of the problems then he wouldn't be trying. He asked for our suggestions.

Yes, and I certainly appreciate the debate, it's good to get multiple viewpoints.

The AI scouts immediately and fully. It knows all the terrain VERY quickly.

Spoken like someone who hasn't watched the AI with autorun repeatedly. ;) The AI is actually quite poor at scouting for the reasons that a human would scout. Humans (most of us, anyway) scout our immediate area first to look for suitable city locations. The AI seems to value exploring farther away rather than closer to its cities, so will often charge off in some direction, leaving a good chunk of land around it unexplored. This can be compounded if it happens to lose its early scout/warrior.

Changing the scouting code is on my list of "things to do". :) Although all of these AI changes are completely subject to other people's opinions as to whether they are made for general release, or personal usage.

A recursive algorithm is probably easiest, but I can think of several ways to do it without recursion.

Can you list those ways?

Those two statements are the same thing.

I don't think so. Selecting where the best location is to found an individual city, while difficult based on terrain factors, is relatively easy. Trying to form a city pattern designed to maximize resource sharing among multiple cities is a whole lot more difficult.

I'm not saying I'm against the idea, just that before we can do the latter, we have to make sure the former is rock-solid. That's my focus right now.

Bh
 
Spoken like someone who hasn't watched the AI with autorun repeatedly. ;) The AI is actually quite poor at scouting for the reasons that a human would scout. Humans (most of us, anyway) scout our immediate area first to look for suitable city locations. The AI seems to value exploring farther away rather than closer to its cities, so will often charge off in some direction, leaving a good chunk of land around it unexplored. This can be compounded if it happens to lose its early scout/warrior.

Changing the scouting code is on my list of "things to do". :) Although all of these AI changes are completely subject to other people's opinions as to whether they are made for general release, or personal usage.

Bh
I would be wary of changing the scouting code too much - are you sure it doesn't value scouting "far" more because of the research bonuses granted from knowing more of the civs?

...not that I've looked at the code, just musing.
 
Yes, and I certainly appreciate the debate, it's good to get multiple viewpoints.
No sweat. We here at CFC pride ourselves in participating in debates. :lol:

Spoken like someone who hasn't watched the AI with autorun repeatedly. ;)
Ha, touche.

Changing the scouting code is on my list of "things to do". :) Although all of these AI changes are completely subject to other people's opinions as to whether they are made for general release, or personal usage.
Yeah I was wondering when that issue would crop up again. I figured somebody would speak up as soon as you mentioned you were thinking of improving the city placement code.

Can you list those ways?
Sure. Please recognize this is off the cuff. And, I'm taking as assumptions the way that the current algorithm establishes a value to each tile, and has modifiers on that value which then becomes some sort of a "rating" as to how good that tile would be as a city site. Let's call this the TR (tile rating).

It's a valid question whether it would be good to scrap that whole plan and consider whether a different approach would be superior. But, I'm not nearly that ambitious and that would be a can of worms I think.

The first step I think would be to add in a new factor for the TR which takes into account the "bounds" of an area. For example, it's a given that one bound is existing cities. We can assume that the algorithm only comes into play for cities beyond the capitol, since the AI always settles in place at game start. So, the 2nd city has the capitol's fat cross as the "inside bound".

So, given unlimited room and no other constraints (mountains, seas, etc.), what's the optimum distance from the capitol? I would say 4.5 but some people would say less than that. Currently I think the AI uses 3.0 far too often, and it sounds like you agree (hence your whole introduction of this topic). So, anyway, let's say that optimum is somewhere between 3 and 4.5... let's use 4.0 simply to have something to move forward with. (But, we should note that there could be considerable analysis and discussion of what this optimum should be.)

So, it should be simple to come up with a function which gives the TR a modifier based on whether it's the optimum distance from existing cities fat cross bounds. If the tile being rated is closer or further than that, it gets less of a modifier. With me so far?

Step 2 would be to consider the outside bound. There are several possibilities:
  • coast
  • another player's city
  • mountain range (isolated mountains we can probably ignore)
Coast itself should be considered (by the algorithm) as an effective string of city sites. Thus, the algorithm should rate them as the center of an effective fat cross. Thus, any given tile would get a TR modifier for how far it is from the coast. Optimum would be either 0.0 or 6.0 (4.0 plus 2 to get the fat cross of the eventual coast city).

Another player's city would be treated the same as your own cities... optimum is 4.0 away. You can get fancy here if you want, by taking current culture boundary into account. I'm pretty sure the current algorithm already does this. Plus, you don't necessarily want to found a new city in a tile which is going to undergo tremendous culture pressure; again, I'm pretty sure it already does this.

A mountain range would be a special case. Most of the time, 3.0 away would result in the most worked tiles. However, we wouldn't want to rate that as highly as distance from previous cities. So, maybe this TR factor only gets 50% of the value as other TR factors.

I don't think so. Selecting where the best location is to found an individual city, while difficult based on terrain factors, is relatively easy. Trying to form a city pattern designed to maximize resource sharing among multiple cities is a whole lot more difficult.

I'm not saying I'm against the idea, just that before we can do the latter, we have to make sure the former is rock-solid. That's my focus right now.
I'm ecstatic you're tackling the issue at all. Take it a bit at a time. No need to rush things and complicate matters by taking a huge bite and having to swallow it all at once... as we all know, that just leads to an "ice cream headache". :crazyeye:

Wodan
 
Hi

I agree with wodan bout just taking it little steps at a time. Like just start with capitol placement. I mean if only thing that ever gets accomplished is AI is less likely to plant it's capitol 1 square aware from coast but after that it plants its cities like it usually does I think lots of ppl would see even just that as HUGE improvement.

Kaytie
 
124 is the increase for your entire empire and it was a guess. Obviously it will depend on # of cities and will vary from game to game.

To use your number, an increase of 5-8, it would only take 15-20 cities to reach the 124 mark. In a 50 tile area, 11 cities will fit comfortably. So yeah I guessed a little high. Still, 11 * 5-8 = an increase of 55-88 per city added. How long will it be before that new city is generating more than 55-88, even if you whip a courthouse? A while.
n

Actually to use a realistic Noble (since that's the AI level example)

Maximum Total cost increase for adding a city at noble level
5 from City number (the maximum City # maintenance can be at any city assume the others have already reached maximum)

Distance maintenance for a far new city (stick with pop 8 for this)
say 50% of the maximum map distance from the capital on a Standard map
(7/10) * 0.8 * 0.75 * .25 * 50 = 5.25

Civic Maintenance: (5 Medium Civics)
2.5 gold per city added

so for a New Distant city you get costs like
5 Number
5.25 Distance
2.5 Civic

So total cost is 13 gold.. 8 with courthouses.. 16 with +100% inflation
8 commerce needed to get the full payback for the city (the population of the city also costs gold... but that population is what you want)
 
I agree with wodan bout just taking it little steps at a time. Like just start with capitol placement. I mean if only thing that ever gets accomplished is AI is less likely to plant it's capitol 1 square aware from coast but after that it plants its cities like it usually does I think lots of ppl would see even just that as HUGE improvement.

I haven't really seen many instances of that taking place. And the few times I've seen it, I'd probably have put the city in the same spot because of the resource allocation.

It's usually not the capital that ends up 1 tile away from the shore, it's subsequent cities. Or so I've found.

Bh
 
In my experience the initial capitol site is almost always in the best spot. In the rare cases it isn't, it takes some pretty sophistocated analysis to come
to the decision to move it just one or two tiles. Just look at the threads talking about just this issue.

Wodan
 
Regarding how the A.I. values future improvements, you could modify the expected output of a tiles based on the length of time an improvement would be available. The lumbermill is about halfway up the tech tree, so it would be valued half it's output. Railroads are about 60% up the tech tree so the added production it gives to lumbermills and mines would be one sixth of a production point. Would that work? By the way, could the A.I. adjust those values as it moves up the tech tree? Like valuing a lumbermill closer to it's full value as it gets closer?
 
Hi

I have a question about vassals and war. Now I remember from Warlords that if say me and another civ are both at war with a third civ and the third civ capitulatesto the AI then peace is suddenly enforced all units I had in the third civs borders get booted at and if I wanted to continue the war i would have to declare war on the vassals new master.

Now I pretty much been using the unoffical patches almost from get go with BtS so it has been a LOOONG time since something like that happened. BUT what I have noticed is scenario like this,. Two (or more) AI civs are at war with each other but I am not at war with either. One of the AI civs in the war comes to me and offers to voluntarily be my vassal. I accept and next thing you know instead of enforced peace all of sudden I am at war with all the other civs that AI was at war with.

I also now notice if I am at war with a civ and that civ vassalizes voluntarily to a third civ that neither of us were at war with before I am now at war with the civ that civ a just vassalized to.

So did something change and instead of "enforcing" peace when a civ vassalizes to someone to keep from being wiped out it now keeps the war keeps war going by making the civs at war with the master even if they werent at war before? Or is that just how it works with voluntary vassalization and captitulation still enforces peace and it has always been like that?

Kaytie
 
@KaytieKat

You have to be involved in the war for there to be inforced peace. In essence the vassal has admitted defeat and the allies have won.

If you are not at war and someone in the war offers to be your vassal, the vassal is not admitting defeat and is instead asking the third party for protection. By accepting, you come into war on your vassal's side. :)
 
Hi

Okies thank you I figured not being at war was what made the diff but I just wanted to dbl check, thank you :)

Kaytie
 
124 is the increase for your entire empire and it was a guess. Obviously it will depend on # of cities and will vary from game to game.

To use your number, an increase of 5-8, it would only take 15-20 cities to reach the 124 mark. In a 50 tile area, 11 cities will fit comfortably. So yeah I guessed a little high. Still, 11 * 5-8 = an increase of 55-88 per city added. How long will it be before that new city is generating more than 55-88, even if you whip a courthouse? A while.

There seems to be some huge misunderstanding as you are talking about placing 11 cities in a 50 tile area. Since there are only 50 tiles to work and 11 are already taken with city centers, 39 are left for improvements shared by 11 cities. That's about 3-4 tiles per city. I can't imagine that that is what you want as you dislike city overlap. So you must have a very different idea about what I meant with a 50 tile area.

In my original post (1179 in this thread), I was talking about placing 2 or 3 cities inside a 50 tile area. The 2 cities would take 2 tiles from the 50 tiles and leave 48, an average of 24 per city for tile improvements. Because 2 cities can only use 20 tiles (outside the city centre), the 2 cities cannot use all the tiles in the area (at least 8 tiles aren't used).
If you place 3 cities in the area, then 47 tiles are left for tile improvements, an average of almost 16 per city. This means that the cities are necessarily having some overlap as they can have 20 tiles in their fat cross.

The difference between these 2 situations is one single city with an upkeep of 8-16 (depending on inflation level, using Krikkitones numbers and he's assuming distant cities with high distance upkeep and he's assuming maximum number of cities upkeep). The three cities will easily make more than 8-16 extra gold than the 2 cities. It just takes 1-2 good trade routes and you have 4 extra trade routes in these cities in the late game. And you're using at least 8 extra tiles and maybe several corporations.
Of course, you should watch overexpansion in the early game. I was just trying to show that 3 cities can get more out of a 50 tile area than 2 cities.

Since I guess that you must have been talking about a radically different situation, I don't know how useful it is to respond to the rest of your post.

Still some other things were discussed in your post and I'll react to those points.

We're talking increase in maintenance. This occurs in every city, not just the new city.

This is not true by the way. There is a cap, an upper limit to the number-of-cities maintenance. Once that cap is reached, founding another city won't raise the upkeep in other cities in your empire.

My abject apologies... I wasn't angry at all but I certainly see how you might think that. I was just trying to place emphasis and I went overboard.

No problem. I would just dislike it when anger would become part of the discussion. That would lead us away from any important issues. I apparently misread you. It's sometimes hard to see whether someone is angry by looking at written text.

If Bhruic thought he couldn't fix some of the problems then he wouldn't be trying. He asked for our suggestions.


It already does this (except for the "perfect" part). All we're trying to do is to make it a little bit better.


A recursive algorithm is probably easiest, but I can think of several ways to do it without recursion.

As Bhruic has stated himself, he's presently letting the AI place cities one by one. You said that it could be possible to program the AI to plan an entire continent full of cities in advance. I read your idea about that (post 1211), but I must say that I didn't get it.
It theoretically could be done recursively, but I believe that the number of calculations would become far too high. Planning the positions of multiple cities in advance requires an exponential number of calculations. It might be possible to plan 2 or 3 cities in advance without getting too many calculations, but I don't even know if that would lead to significantly better city placement by the AI. Mainly because the situation changes during placement of these cities (AI and barbarian city placement and further scouting). It could lead to some improvement in city placement on tiny islands.

Those two statements are the same thing.

I was pointing at the difference which Bhruic explained a bit more clearly a few posts after yours. Since you were talking about tackling the problem of planning a continent of cities recursively, I guess this was another example of miscommunication.

It just seems like the crux of your argument is "this is hard" and giving up thereby.

That remark was unneeded as I'm trying to suggest ways to improve the code in several other posts. But yes, I do think it is hard. Along with waging war, this is probably the most complicated part of the AI in civ4. And I don't think it will be feasible to plan an entire continent of cities in a meaningful way. I would love to be proved wrong about that and see the AI plan cities in a way a human does. But since I don't see improvement in that way, I'll just suggest stuff related to valuation of the city locations for the next city.


Regarding how the A.I. values future improvements, you could modify the expected output of a tiles based on the length of time an improvement would be available. The lumbermill is about halfway up the tech tree, so it would be valued half it's output. Railroads are about 60% up the tech tree so the added production it gives to lumbermills and mines would be one sixth of a production point. Would that work? By the way, could the A.I. adjust those values as it moves up the tech tree? Like valuing a lumbermill closer to it's full value as it gets closer?

Interesting idea. If this is considered, then I guess that the age (ancient, classical, medieval, renaissance, industrial, modern) could be used to see how long it takes before the improvement becomes available. Each technology has an age and the age has a number (1-6), so in that way the difference between the present technology level and the level at which the improvement becomes available could be quantified. Maybe not exact, but good enough I guess.
 
Top Bottom