LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
286 stars 158 forks source link

siege units in new tactical AI #2660

Closed ilteroi closed 7 years ago

ilteroi commented 7 years ago

the setup for ranged attacks is gone. the UI doesn't show the button anymore, but the units still have the promotion.

regarding alternatives to setup, there were several in discussion, but reducing the CS for siege units is the simplest solution by far. second best would be "attacks only with full movement points" but that's not implemented right now.

LoneGazebo commented 7 years ago

What about a promotion that doubles move costs in enemy land?

ilteroi commented 7 years ago

that was also an option, yes. that would also be an easy solution i guess.

in related news: i finally got around to implement the last piece of the puzzle (virtual visibility updates) and now shaka and montezuma seem unstoppable :)

Iamblichos commented 7 years ago

What does virtual visibility entail?

LoneGazebo commented 7 years ago

I assume its a predictor of where enemy units might end up/be?

LoneGazebo commented 7 years ago

I say just add that promotion - that way I can just add the element to the existing 'setup' promotion and then change the help text and call it a day.

ilteroi commented 7 years ago

when units move around on the battlefield, invisible plots become visible and additional enemies might enter the picture. this new information is now considered. called it virtual because the actual visibility state of the plot is not changed before the moves are executed.

Iamblichos commented 7 years ago

So Iroquois will also have a nice advantage with that too, correct?

ilteroi commented 7 years ago

eh, why?

Iamblichos commented 7 years ago

I haven't looked at your new code yet for virtual visibility to understand it, so how does Shaka and Montezuma have a new advantage with it?

ilteroi commented 7 years ago

just because they are the biggest warmongers :)

LoneGazebo commented 7 years ago

@ilteroi only bug I see in current build (pre virtual target above) is that the AI will sometimes embark land units into water tiles around a city while trying to defend it. Might be an issue with melee land units being called to target water units.

ilteroi commented 7 years ago

can't really explain that. embarked units are ignored and embarkation is explicitly forbidden.

of course this doesn't rule out that other moves are responsible for that

LoneGazebo commented 7 years ago

It is fairly rare, could even be an operation move for close_city_defense.

ilteroi commented 7 years ago

all pushed

LoneGazebo commented 7 years ago

Great, will merge. Are you gonna do the 'double moves in enemy land' thing for a promotion, or should I?

LoneGazebo commented 7 years ago

Ran a test game, encountered some oddities with overseas attacks. These two AI at war (America and Austria) are just sending a bunch of land units out into the ocean:

20161018012555_1

Probably should be organizing operations and escorting instead of whatever that is.

LoneGazebo commented 7 years ago

From what I can tell it looks to be a deployment, not sure why, though:

`328, Austria, Deploying Fusilier 4956 (to get out of way), To X: 53, To Y: 36, At X: 53, At Y: 36, Distance Before Move: 1
328, Austria, Deploying Lancer 3856, To X: 53, To Y: 38, At X: 53, At Y: 38, Distance Before Move: 1
328, Austria, Deploying Fusilier 4708, To X: 53, To Y: 37, At X: 53, At Y: 35, Distance Before Move: 2
328, Austria, Deploying Musketman 4180, To X: 51, To Y: 36, At X: 50, At Y: 36, Distance Before Move: 2
328, Austria, Deploying Fusilier 4752, To X: 54, To Y: 37, At X: 54, At Y: 34, Distance Before Move: 2
328, Austria, Deploying Musketman 4307, To X: 50, To Y: 37, At X: 49, At Y: 35, Distance Before Move: 2
328, Austria, Deploying Gatling Gun 5080, To X: 51, To Y: 35, At X: 52, At Y: 28, Distance Before Move: 4
328, Austria, Deploying Fusilier 4796, To X: 52, To Y: 35, At X: 52, At Y: 24, Distance Before Move: 5
328, Austria, Already in position, no move for Lancer, X: 52, Y: 36`
LoneGazebo commented 7 years ago

Also, the optimizations you made to sea patrols and blockade naval improvement moves (cutting the max distance down for finding units) did speed things up, but it also seems to have hurt the AI's ability to deal with long coastlines or getting around the tip of a continent (when they have cities on both sides).

ilteroi commented 7 years ago

maybe there's a way to implement the "need full movement points for attacking" thing without a lot of pain. but it would still need a change to the promotion. problem is that there is no UI feedback on why you cannot attack, just like with the setup.

so i think the permanent great wall promotion is the way to go. how would it stack with the real great wall? i can do the DLL side changes but it's probably best if you handle the database side.

re: embarked units - didn't touch that. different problem.

LoneGazebo commented 7 years ago

I'll handle database yep.

ilteroi commented 7 years ago

by the way, should i change the great wall effect so that units end their turn at the border and that's it? always struck me as strange that it should have an effect after passing it ...

ilteroi commented 7 years ago

went ahead and did it, feels better this way.

i would like to rename the methods in the DLL so that they reflect the new meaning of the promotion. but they are exported to lua. how to handle this?

LoneGazebo commented 7 years ago

Just don't edit the lua name and I'll add a descriptor tag in the CP.

So how does the Great Wall work, now? Keep in mind that it also affects the Krepost and Minefield as well. Are you sure that was a worthwhile change?

ilteroi commented 7 years ago

no worries, it's easy either way. can also be different effects for the different buildings

LoneGazebo commented 7 years ago

Sounds good - I'm fine with editing the great wall, but let's leave the minefield and krepost code as-is for the sake of having to rewrite all those text entries. :)