SGOTM 15 - One Short Straw

I thought that he was on the forest at gold resource-2N at the start of your turn... checking save... yes, he was. He moved 1W this turn.
 
If we delay pottery we can save enough gold to upgrade a warrior to an axe to escort the 2nd settler.
 
If we delay pottery we can save enough gold to upgrade a warrior to an axe to escort the 2nd settler.

That is a great idea and would work for sure... :goodjob: but I'd like to keep it in our back pocket for now. ZPV or LC quoted the upgrade cost and it was equivalent to 3ish turns of 100% research IIRC. That's pretty steep at the moment. To me, we have multiple options which include:

1. Pray that Toku takes care of our mess for him. It's the least he can do for us after we took his only worker...

2. Hope the archer heads east or west so that can get eyes on him and know that it's safe to settle the marble city. In a test game, I settled right next to a barb animal and he moved away the next turn. I assume that a human barb would attack the city instead, but I'm not sure.

3. Delay the settling of marble city, build/whip/chop an axe somewhere and then get back to the Oracle. This doesn't sound appealing to me.

4. Your plan of upgrading a warrior to an axe. This idea of yours is the only one that lets us 100% control the situation at the cost of research... assuming our axe wins the 99% battle, of course.

So, let's hope options 1 or 2 pan out in the next several turns so that we don't have to make a tough choice.
 
Would we be willing to consider the possibility of settling on the Grassland Hills square 1W of the Marble?



No, we would not get a Lighthouse. No, we would not be able to build a Work Boat from this City, nor a navy.

Yes, we could share the Corn and the Flood Plains squares.

Yes, we would trade one Grassland Hills square (by settling on it) for a Grassland Hills River square (which is ever so slightly better).

Yes, we would gain two Grassland River squares that might otherwise never get worked.

Yes, we would gain a 30-Hammer Forest Chop by not settling on top of it.


Now, if we can consider settling there, we can potentially lure the Barb Archer away by using a sacrificial Warrior.

As long as we are under the "30 Cities Globally" mark, then as long as the Barb Archer is not 1-square-away from our Settler when we settle Marble City, the Barb Archer will not approach our Crab Rangoon (Marble City).

We buy ourselves 1 turn of potentially avoiding the Barb Archer by settling on the Grassland Hills square, not to mention buying ourselves a greater chance of not having to walk next to the Barb Archer, since the Grassland Hills square is closer to our area.


For example, let's say that we used one of the Gem Mine Workers. The Gem Mine requires 4 Worker turns. With 2 Workers Mining it, it takes 2 turns to complete. Yet, sine we're working the Pig Pasture, we end up completing the Gem Mine 1 turn sooner than we need it. Thus, we could instead send one of the Workers ahead as a scout and complete the Gem Mine 1 turn later, just in time to start working it.




That Worker could then scout the area in the south for us safely... no sign of a Barb and he can just build a Road on the Marble, otherwise he can retreat.




Not every possible location for the Barb Archer to exist at that time is workable, but if the Barb Archer is to the east somewhere, then we can send our Warrior 1 (John) to the Grassland square to the SE--that's the Warrior that is on the GRiv For that is 1S of the GRiv Copper. That would place him 2E of the Marble square, where, if the Barb Archer was adjacent to him, he would successfully lure the Barb Archer into attacking him and thereby ensure that our Settler could settle safely on the Grassland Hills square that is 1W of the Marble.

Of course, if the Barb Archer is in an inconvenient location, then we'd either wait for the Barb Archer to move or else would have to consider a suckier settling location, such as on top of the GRiv For that is 1NW of the Marble.
 
We could even aim to settle 1N of the Marble and later settle a different City on top of the Banana to grab the Crab. Then we'd have no worry with the Barb Archer until we hit the 30-Cities mark.

Attached is an updated test saved game.
 
@ZPV:

When the barbs switch to AREAAI_OFFENSIVE (3 cities per player), do they remain in that state for a set number of turns?

With this formula:
Code:
else if GC.getGameINLINE().getNumCivCities() > GC.getGameINLINE().countCivPlayersAlive() * 3
doesn't that mean there have to be 10*3+1 cities to get a TRUE value?

For pillaging, does the 1 mean the barb has to already be on the tile? In other words, for attack 1, the barb is next to the tile it attacks, but for pillage 1, the barb would have to be on the tile to pillage it. (I vaguely remember something from klarius on this point, but it may be faulty memory).
 
I played around with getting the Barb Archer to be lured by a Road or a Farm 2 squares away from it and he didn't bite. So, you're probably right that pillaging 1 = on top of the square and pillaging 2 = one square away... while one square away isn't happening since the Barb Archer keeps avoiding our Cultural Borders.

Also, I confirmed that the Barb Archer will not pillage Roads or improvements outside of our Cultural Borders.

Thus, I have given up on the idea of building a Road (or a Farm) to try and lure the Barb Archer... it's just not going to work.


I'm still not sure which City location is the best, but I am seriously tempted to settle at a different location than we'd originally planned to put Crab Rangoon, particularly if we don't settle on top of a Forest.


Even settling on top of the Marble could be a feasible option and could free up some Worker turns (say, to help with Chopping a Granary in either Delhi or Nature's Candi).
 
@ZPV:

When the barbs switch to AREAAI_OFFENSIVE (3 cities per player), do they remain in that state for a set number of turns?

With this formula:
Code:
else if GC.getGameINLINE().getNumCivCities() > GC.getGameINLINE().countCivPlayersAlive() * 3
doesn't that mean there have to be 10*3+1 cities to get a TRUE value?

For pillaging, does the 1 mean the barb has to already be on the tile? In other words, for attack 1, the barb is next to the tile it attacks, but for pillage 1, the barb would have to be on the tile to pillage it. (I vaguely remember something from klarius on this point, but it may be faulty memory).

I'll try and find out about the AREAAI.
Yes, it needs 31 cities before this returns TRUE.
Nope - pillage(1) will pillage an adjacent tile (or for units with 2 moves, a tile 2 tiles away).
 
Nope - pillage(1) will pillage an adjacent tile (or for units with 2 moves, a tile 2 tiles away).
Well, for whatever reason, the Barb Archer wasn't being lured by improvements 2 squares away... perhaps the Hills and Forests blocked its view and without the improvement existing for 20 turns and without visibility, the Barbs "don't know about it" and thus can't target it?

Anyway, the net result is that with the wall of Hills and Forests to our south, the Barb Archer won't be lured by an improvement at the south or south-east of Delhi's Cultural Borders.


The more that I think about it, the more that I'd like to settle on top of the Marble if it is free or else on the GRiv square 1N of there if the Barb Archer is blocking the Marble square.

Fishing could be delayed (pleasing Mitchum) and we'd still aim to settle filler Cities later... Cow + Deer and on top of the Banana for Crab... Fish to the south-east... another Fish further east of there... all after our warring.


Alternatively, we could still get Fishing and eventually build a Work Boat out of Nature's Candi (Gems City) to go exploring, particularly past Toku's borders either once we declare war or once we capture his capital.
 
There are now 25 cities worldwide, still no barb cities. That means there are probably 5 AIs with only 2 cities. Hard to say when we'll reach 31 cities worldwide. If not before, most likely when we build Crab, so barbs will then beeline our cities. It will be preferable to eliminate that barb archer before then.
 
We could even aim to settle 1N of the Marble and later settle a different City on top of the Banana to grab the Crab. Then we'd have no worry with the Barb Archer until we hit the 30-Cities mark.

Attached is an updated test saved game.

I like this solution the most. Note we dont "have" to settle on the banana to get the crab. We could also settle a city 2 tiles s of marble as well and settle I think its nw of banana (Which happens to be river connected)
 
I simply can't remember if we saw Toku's scout come back from Hammy or not. If not, then I believe this well represents the tiles he has defogged so far. Not sure about the red tiles to the SE.



Assuming that TOku's archer doesn't run into any barbs, he'll continue to explored, I assume. So the question is, how are AI movements weighted when exploring? Can we come up with a reasonable estimate of the likelihood he'll go SW?

Note: I don't understand why he went T53 1W. I'm pretty sure that gave him no new information other than to see our 2nd border expansion. He defogged no new tiles with that move.
 

Attachments

  • SG15 T54 Tokus defogged tiles.jpg
    SG15 T54 Tokus defogged tiles.jpg
    116.5 KB · Views: 119
Okay, ZPV, I took a stab at code-diving, just for a bit of fun. I might be completely out to lunch on this, but this is what I've got. COrrect me where I'm wrong, or don't bother if I'm all wrong. :)

Looking in UnitAI.cpp, I studied the ExploreRange function, which seems to be the key function called from other functions such as AttackMove and Explore. ER(3) calls the searchRange function and returns (3+1)*(1+1)=8. So this crazy ER function examines an area of 17x17 tiles iiuc. :crazyeye: (No wonder AI scouts seem like they're able to beeline goody huts.) For each tile, it seems to only assign points to three characteristics:

100,000 Goody hut
10,000 fogged
1,000 each for adjacent tile(s) fogged

Then if the tile has received any points and satisfies a few more conditions (no enemy there, MISSIONAI, whatever that is, reachable by peaceful path, within 3 tiles of starting point) if can get more for:

RNG(10,000)
10,000 Next to land tile
5,000 owned by AI
Adjusted for diagonal direction (I didn't bother to study carefully but I assume it's divided by some part of 1.5 for diagonalness)

Then the most valuable tile wins the contest, if there is at least one and the archer sets off in that direction. Rinse and repeat each turn.


There are some details in the above function that I definitely don't understand. I couldn't find the PROFILE function anywhere and I couldn't find the AI_plotValid function.

----------------

Okay, looking at the above map I made, I understand why T54 1W would make sense, but now I don't understand why T53 1SE :crazyeye:. That move was in the opposite direction of any fogged tiles.

----------------

With all that said, my general impression from this function is that, yes, the archer is likely to explore to the SW because that direction provides more path-reachable fogged tiles.
 
Three more questions to the above:

1. I'm not sure what atPlot() is.
2. As far as I can tell, iPathTurns must be <= iRange, that is, the best tile must be within 3 tiles for ER(3) or this function returns FALSE. If that's the case, then why in the world does it examine a 17x17 matrix?
3. I couldn't figure out if fogged water tiles count too.
 
@magnus: Let's go ahead and switch our espionage points to Hammy.
Sure, let's do it.

By the looks of it, Hammy is already spending a lot of Espionage Points on us, so it can't really hurt to spend back on him, at at worst case he'll marginally spend more on us, while we'll still be closing the relative gap.

FYI, here are the current Espionage Spending numbers:
Toku spent on us: 171
We spent on Toku: 192

Hammy spent on us: 102
We spent on Hammy: 0


LowtherCastle said:
There are now 25 cities worldwide, still no barb cities. That means there are probably 5 AIs with only 2 cities. Hard to say when we'll reach 31 cities worldwide. If not before, most likely when we build Crab, so barbs will then beeline our cities. It will be preferable to eliminate that barb archer before then.
Maybe, maybe not. It might work out better to have the Barb Archer "rush" us, since then we can defend on a fortified position and will have more time to have whipped up an Axeman.


Here's a very interesting thought, too: Once we have completed The Oracle, we don't necessarily NEED a Marble City... and, Barbs can't raze Cities any more than we can. So, worst case, we abandoned Marble City at the time of the Barb Archer rushing us in favour of us going out to spawn-bust. A Barb Archer will not "rampage across the lands" but will instead capture the City and hold onto it.

It's obviously better not to lose the City, but it's also not the worst thing in the world to lose it, since, unlike in a regular game, the City can't be razed.


A Warrior does get a 25% Defence bonus when defending inside of a City, so two Warriors parked inside of a City should be enough to hold said City, but we could also just fortify on a nearby Forest square, hope that the Barb Archer attacks the Forest, and if he does not, then let him have the City while we ignore his possession of said City. :p


magnusmarcus said:
Note we dont "have" to settle on the banana to get the crab. We could also settle a city 2 tiles s of marble as well and settle I think its nw of banana (Which happens to be river connected)
Well, I was suggesting settling on top of the Banana for a couple of reasons:
1. Settling on top of a Banana is not a bad play. It's a Resource that you can't improve for a while and it gives us 3 Food in our City Centre (as opposed to eventually being able to work it for 5 Food once we learn Calendar and build a Plantation there), which is kind of similar to settling on top of the PH Stone--it's not the full value of working the square but we get a passive bonus every turn for free.

2. It's near some Grassland River squares and some Grassland Hills squares, so there are some decent squares to work

3. It's got slightly nicer land than south of the Marble and it has a couple of squares that no other City could work (while settling 1N of the Marble plus 2S of the Marble would, say, overlap all of the Hills squares, so we wouldn't gain new production squares in the long run)

4. Unless we settle 1N, 1NW, or 1NE of the Marble, a City south of the Marble cannot be settled to get the Crab, due to the in-game rule that prevents you from settling a City within a 2-square-radius of another City


So, you are absolutely right that there is a possibility of settling down there, too, should we settle to the north of the Marble. If we find that we want to pack in a billion and one Cities, it'll be the way to go.

I'm thinking that we'll probably want fewer Cities due to the expected Maintenance Costs of having to keep a ton of Cities (since we can't raze any), but if it turns out that, say, after killing Toku, we are still trapped by Peaks, we may end up feeling the need to squeeze in Cities, particularly Coastal ones, so that we could break out of such a prison.


LowtherCastle said:
Assuming that Toku's archer doesn't run into any barbs, he'll continue to explore, I assume.
Obviously, we have a chance here, thanks to where Toku's Archer moved (1W) in the real game. I'm sure that there is an "explore unexplored land" factor and that there is a random factor. AI movement is not deterministic, but there is very likely a deterministic weighting... but, if you play a test game and then change some things that will cause a random number to change, you can get an AI unit to move in different directions. So, we're still going to have to rely on random number generation to some degree here.

The good thing is that if Toku's Archer and the Barb Archer end up standing next to each other, there WILL be an extremely high chance of a battle and Toku is almost certainly going to win said battle.

Of course, if the Barb Archer won, we'd need to be ready to kill it soon before it upgraded too much and became a Terminator unit. ;)


If the Barb Archer gets killed, we will pretty much have our pick of settling locations. Where would we settle given such circumstances?


As for where to settle if the Barb Archer is still alive, a lot of that will depend upon where the Barb Archer actually stands.

However, one thought is that we can afford to wait a couple of turns for the Barb Archer to move away or be lured away by our suicidal Warrior if we plan to settle on top of the Marble, as then we wouldn't need to settle the City 3 turns in advance in order to be able to build a Quarry.


So, I would suggest that we make the primary plan be to have the 2nd Gems Miner only Mine the Gems for 1 turn then come and explore the south as I depicted in my pictures. We will then use the Fast Worker to determine where the Barb Archer is located and decide which locations are feasible for settling on at the time in question.


In the meantime, if Toku is kind enough to kill the Barb Archer, we'll end up with more settling options.

In this way, we won't plan to either upgrade a Warrior to an Axeman or whip an Axeman in Delhi--we'll just "take whatever we can get" for a Marble City location--and if that fact means settling 1N of the Marble (3S of Delhi), then we'll do it (rather than having to delay The Oracle and perhaps miss building it). The acceptable part about settling there is that it will push out our Cultural Borders, such that the Barb Archer will hopefully not want to come 1-square-away from the Marble Resource.

We'll also have the Marble within our Cutural Borders a bit sooner than settling the southern location, which gives us a bit of flexibility if the Barb Archer threatens the Marble for a turn--our Workers can run away and come back the next turn to continue Quarrying it, while hopefully still having time to complete the Quarry before we need the Marble access for The Oracle.



Another way to look at the problem as a whole is:
- We could just pay the Gold fee that magnusmarcus keeps suggesting (3 times the unit cost in Hammers plus 20 as our Gold cost, if I recall the formula correctly)
- We could then spend some Hammers on The Great Wall to at least give us a 2:1 return on our invested Hammers, making us feel slightly better about the whole affair
- We could whip an Axeman and absorb the cost of not being able to work a "power" square (such as a Gold Mine or a Copper Mine) for several turns
- We could sacrifice a Warrior to gain "position" for settling Marble City (think about sacrificing a unit in chess in order to develop a better board position for yourself)
- We could just settle 1N of the Marble and not have to fight the Barb Archer for territorial possession at all, but would just need to defend the Marble square... or maybe, we could even let the square be pillaged or the City be captured as long as the Barb Archer is 2 squares away from the Marble on the turn that we Quarry it and if we Quarry it on the turn that we need Marble access, such that we can run our Workers away and won't need the Marble Resource
- If we allow our City to get captured, we might get it back for free, since this game option has been enabled: City Flip After Conquest. This fact will be particularly applicable if we build the City 1N of the Marble, where it is already in Delhi's Cultural Borders, or 1S (on the Marble) or 1SW (1W of the Marble) of the Marble there, where it will be within Delhi's Cultural Borders in about 13 turns (I forget the exact amount of turns)
 
Okay, ZPV, I took a stab at code-diving, just for a bit of fun. I might be completely out to lunch on this, but this is what I've got. COrrect me where I'm wrong, or don't bother if I'm all wrong. :)

Looking in UnitAI.cpp, I studied the ExploreRange function, which seems to be the key function called from other functions such as AttackMove and Explore. ER(3) calls the searchRange function and returns (3+1)*(1+1)=8. So this crazy ER function examines an area of 17x17 tiles iiuc. :crazyeye: (No wonder AI scouts seem like they're able to beeline goody huts.) For each tile, it seems to only assign points to three characteristics:

100,000 Goody hut
10,000 fogged
1,000 each for adjacent tile(s) fogged

Then if the tile has received any points and satisfies a few more conditions (no enemy there, MISSIONAI, whatever that is, reachable by peaceful path, within 3 tiles of starting point) if can get more for:

RNG(10,000)
10,000 Next to land tile
5,000 owned by AI
Adjusted for diagonal direction (I didn't bother to study carefully but I assume it's divided by some part of 1.5 for diagonalness)

Then the most valuable tile wins the contest, if there is at least one and the archer sets off in that direction. Rinse and repeat each turn.


There are some details in the above function that I definitely don't understand. I couldn't find the PROFILE function anywhere and I couldn't find the AI_plotValid function.

----------------

Okay, looking at the above map I made, I understand why T54 1W would make sense, but now I don't understand why T53 1SE :crazyeye:. That move was in the opposite direction of any fogged tiles.

----------------

With all that said, my general impression from this function is that, yes, the archer is likely to explore to the SW because that direction provides more path-reachable fogged tiles.

Well, the first check is that the archer has to choose one of the explore_move options - after that, I think your understanding is correct. We look in AI_attackmove to make that decision.

PROFILE is for debugging/optimizing; it doesn't affect Toku's archer.
AI_plotValid tells you whether the land shape lets the unit move there - so for land units, it means TRUE if on the same landmass; for water units it's TRUE for water tiles and coastal cities, etc.

The direction adjustment is to give the AI a little incentive to circumnavigate the globe. It can safely be ignored.
Three more questions to the above:

1. I'm not sure what atPlot() is.
2. As far as I can tell, iPathTurns must be <= iRange, that is, the best tile must be within 3 tiles for ER(3) or this function returns FALSE. If that's the case, then why in the world does it examine a 17x17 matrix?
3. I couldn't figure out if fogged water tiles count too.

That's about right.
1. atPlot returns true if the unit is on the tile in question; false otherwise.
2. Roads mean a unit can travel further into the 17x17 square - but it's an ugly bit of code.
3. Yes.
 
Two further clarifications, ZPV:
1. The 5000 for Owned. Is that owned by anyone or by Toku?
2. Can the destination tile be inside our territory, since we're not at war with him? (I don't see it saying not, but then again, I also don't see a reachable path to us without OBs.)
 
I'd like for us to pick both:
1. Our preferred settling location for Marble City*, assuming that the Barb Archer is dead by the time that we are ready to settle the City

2. A settling location to plan to settle in order to guarantee access to Marble in time for building The Oracle, in the likely event that the Barb Archer is going to give us trouble


For option 1, it could feasibly be a location that I haven't screenshotted, but I think that I screenshotted the best options. We do need to settle adjacent to the Marble, if not on top of it--we can't settle 2 squares away from the Marble since then we wouldn't be able to Quarry it in time to build The Oracle.

For option 2, we're basically looking at picking between 1N of the Marble (or 1NW or 1NE of there, but either of those locations waste a Forest, so I don't really count those options as being very valid) OR on top of the Marble (since settling there requires less Worker turns and we'll have more turns available for the Barb Archer to safely wander away before we need to settle the City in order to have access to Marble).

* = We may need a new City name other than "Crab Rangoon" if we don't get the Crab within our Cultural Borders

Here are screenshots of what I believe are the best options available to us:
A] 1N of the Marble plus one more City: on the Banana



B] 1N of the Marble plus two more Cities: one for the Crab and one for the Banana



C] 1W of the Marble and no additional Cities



D] On the Marble plus one more City: on the Banana



E] 1SW of the Marble and no additional Cities



F] 1S of the Marble plus one more City: 1NW of the Banana
 
Top Bottom