Experimental DLL for 4/21

Status
Not open for further replies.
We could, as part of the AI's handicap model, give the AI cheaty vision of FOW tiles x range outside of a unit's sight. Yeah it is technically cheating but it also gives the illusion that the AI is keeping up with unit movement better than it really is.

G
If you want to follow this way, I d rather have increased vision from city borders.
 
We could, as part of the AI's handicap model, give the AI cheaty vision of FOW tiles x range outside of a unit's sight. Yeah it is technically cheating but it also gives the illusion that the AI is keeping up with unit movement better than it really is.

G
+++++ :goodjob: :thumbsup:
Fully agree with such propose.
 
We could, as part of the AI's handicap model, give the AI cheaty vision of FOW tiles x range outside of a unit's sight. Yeah it is technically cheating but it also gives the illusion that the AI is keeping up with unit movement better than it really is.

G

i'd hate to start cheating now, when we're on a good way to eliminate the bonuses the AI gets. maybe give improved vision to all great generals? of course that's more of an advantage to human players in the end.

improved scouting (as in doing periodic checks on enemies, not limited to revealing terrain) could be useful though. maybe combine it with a short term memory of the opponents' army size and location (can't store it too long, it loses validity fast). ideally do the scouting at the beginning of the turn before deciding on the strategy (right now they don't reconsider anything when new information becomes available during the turn).
 
Method for determining best defensive tiles:

1. Set area.
Find the greatest area all surrounded by owned/friendly cities, with no fog of war inside. The line that connects every outer city, let's call it the inner boundary. All tiles that can be find inside the inner boundary is the safe area. Counting four tiles, including that of the inner boundary, we find the outer boundary. The boundary area is a ring located between the inner and the outer boundary, four tiles wide. We're trying to find the best defensible tiles inside the boundary area. Gaining or losing cities changes the boundary area.
Isolated cities or groups of cities have their own boundary area, but let that out for the moment.

2. Set defensive values to each tile within boundary area.
2a. Own terrain defensive value, and road presence. Bonus for having a river facing outwards the safe area. Bonus for being owned territory, and bonus for being a city with high defense value.
2b. Inward tiles. 2-3 Tiles that are facing inwards from the tile we are evaluating, should have also high defensive value, increasing value for each road and hill. Bonus for being owned territory. This is where our supporting units will be.
2c. Outward tiles. Those tiles gives a bonus to defense for each tile that cannot be used for units, like mountains, and another for tiles in range where units cannot shoot the evaluated tile, like lakes, or tiles screened by mountains. They have a malus for each road tile, for enemy/neutral owned territory and improved tiles.

3. Selecting best defensive tiles.
With all tiles in the boundary area evaluated, we pick a random tile and look for the best tile within 8 tiles. We go to the next set of tiles, 8 tiles long, and look for the best tile in that other area. Repeat until the ring is completed. We end up with a best tile for each subset of the boundary area. The tiles with highest values will be the defensive points, the tiles with the lowest values will be the weak points (but those are still the best defensible tiles in their small area).

Not all defensible tiles needs to be occupied, that will depend on priorities, but having them defined helps to set a defense around them.
 
I like the idea of improving scouts. You can level up 1 or 2 in time for war, but past that there's just no point to building them. A scout with survivalism 2 has what, 10 CS on defense? That's the same a spearman, and they get demolished by horsemen. I think expanding the usefulness of scouts would help, though it would require a number of new scouts to bridge the gap to explorer.

As for the AI I have 3 suggestions:
1- Have the AI focus on killing units more. 2 half health units =/= 1 dead one.
2- Work on plundering. Recently I had an AI that tried to take my city and was repeled. One unit was on a plantation and could only embark movement wise, but despite being damaged he chose to embark without pillaging, which might have saved him from my archers.
3- Maybe a counter for failed assaults on a position. I think we've all seen an AI fail to take a chokepoint for 500 years, so having it realize that it needs to try and crack the nut a different way would be smart.

Maybe just teaching it to recognize killboxes in general/premeptively, and to harass those areas while setting up flanks.
 
well this got buried quickly, i didn't realize G was about to do a new release anyway. but the question remains valid also for the latest version.

2- Work on plundering. Recently I had an AI that tried to take my city and was repeled. One unit was on a plantation and could only embark movement wise, but despite being damaged he chose to embark without pillaging, which might have saved him from my archers.

i fixed that, they should plunder and harass you with ranged attacks even when withdrawing now. not yet released though.

3- Maybe a counter for failed assaults on a position. I think we've all seen an AI fail to take a chokepoint for 500 years, so having it realize that it needs to try and crack the nut a different way would be smart. Maybe just teaching it to recognize killboxes in general/premeptively, and to harass those areas while setting up flanks.

that's a hard problem. i've been thinking about some sort of heatmap for unit losses, which would augment the danger calculation for the current turn. but it's hard to recognize when the circumstances have changed and the data has lost it's validity.

Method for determining best defensive tiles:

1. Set area.
Find the greatest area all surrounded by owned/friendly cities, with no fog of war inside. The line that connects every outer city, let's call it the inner boundary. All tiles that can be find inside the inner boundary is the safe area. Counting four tiles, including that of the inner boundary, we find the outer boundary. The boundary area is a ring located between the inner and the outer boundary, four tiles wide. We're trying to find the best defensible tiles inside the boundary area. Gaining or losing cities changes the boundary area.
Isolated cities or groups of cities have their own boundary area, but let that out for the moment.

2. Set defensive values to each tile within boundary area.
2a. Own terrain defensive value, and road presence. Bonus for having a river facing outwards the safe area. Bonus for being owned territory, and bonus for being a city with high defense value.
2b. Inward tiles. 2-3 Tiles that are facing inwards from the tile we are evaluating, should have also high defensive value, increasing value for each road and hill. Bonus for being owned territory. This is where our supporting units will be.
2c. Outward tiles. Those tiles gives a bonus to defense for each tile that cannot be used for units, like mountains, and another for tiles in range where units cannot shoot the evaluated tile, like lakes, or tiles screened by mountains. They have a malus for each road tile, for enemy/neutral owned territory and improved tiles.

3. Selecting best defensive tiles.
With all tiles in the boundary area evaluated, we pick a random tile and look for the best tile within 8 tiles. We go to the next set of tiles, 8 tiles long, and look for the best tile in that other area. Repeat until the ring is completed. We end up with a best tile for each subset of the boundary area. The tiles with highest values will be the defensive points, the tiles with the lowest values will be the weak points (but those are still the best defensible tiles in their small area).

Not all defensible tiles needs to be occupied, that will depend on priorities, but having them defined helps to set a defense around them.

the stuff that you "let that out for the moment" is exactly what makes the whole thing difficult :) what about water? of course, we could try and make the AI settle in a contiguous, easily defensible area, but there'll always be situations where that's not the best strategy. there already is a defensive value for each tile, quite similar to your proposal, which is used for deciding where to place forts and citadels. placing units around these defensive positions is tricky though, because there are conflicting goals, the AI recruits all but a certain baseline number of units for offensive operations, stripping the defenses bare. prohibiting this is a difficult tradeoff and very situational. the AI is quite bad at predicting player behavior, and for the most part doesn't even try. we could experiment with increasing the number of units kept in reserve, it's configurable, look for AI_STRATEGY_DEFEND_MY_LANDS_BASE_UNITS / AI_STRATEGY_DEFEND_MY_LANDS_UNITS_PER_CITY
 
Status
Not open for further replies.
Back
Top Bottom