LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
288 stars 159 forks source link

AI embarking military units into death zones repeatedly. #5526

Closed ridjack closed 5 years ago

ridjack commented 5 years ago

1. Mod version (i.e Date - 4/23): 7/29

2. Mod list (if using Vox Populi only, leave blank):

image image

3. Error description:

Screenshot shows the example that prompted this. Attila continually embarked units into the same two spots the Heavy Skirmishers are embarked in, despite them continually getting one-shotted and making no progress on establishing a beachhead. There's a perfectly good shoreline just a few tiles north that could have been a lot more problematic if he'd pushed hard enough there.

This is in-line with a trend I've seen over the last few games where the AI consistently loses wars against me before they've even begun simply by starting off with a full army rowing, un-escorted, directly into my fleet of warships, or by trying to make their beachhead literally right next to the city that's blowing them up while they're still in the water.

It's not just the amphibious warfare, either; I've also been in multiple games where the world was 80% ocean and basically every city was coastal, but the AI never once maintained a navy even while Frigates, Ironclads and Cruisers were in play. It trivialized the entire game once I hit that era, and generally ended with me quitting out of boredom.

  1. Screenshots (optional):

image

ilteroi commented 5 years ago

i agree that the AI should be building more ships. a fix should be relatively easy.

however the other issue with repeatedly losing units in the same spot is hard. the AI is still braindead despite all my efforts. they don't remember from one turn to the next. also they cannot infer the presence of invisible units. these are fundamental problems impossible to solve without a complete rewrite.

ridjack commented 5 years ago

In this specific instance, the AI is embarking right next to a city, which is almost never a good idea unless you're doing it with a huge, preferably escorted army and/or you're okay with losing several of them to land a few(or you're Denmark).

Is it possible to give the AI some idea of areas that are likely to be more or less dangerous? IE, embarking right next to a city will likely kill at least one unit if there's no other military there, while embarking near to open land like the space directly north at the very least removes the city bombardment as a factor.

ilteroi commented 5 years ago

the AI does have a sense of danger, but pathfinding for an army doesn't consider it and uses the shortest path instead. the individual units have little leeway around each waypoint, so they walk into the trap.

maybe there is some potential for improvement here, i need to think about it.

ridjack commented 5 years ago

I know very little about what I'm about to comment on, so I apologize in advance if it's completely loony:

You said the the AI's army pathfinding uses the shortest path; would it be possible to temporarily assign a tile a higher degree of "terrain roughness" when a unit is killed?

My logic is that if an AI's unit gets killed on a specific tile, you could trick the AI into thinking it's no longer the shortest path and thus trying from a different angle. Again, don't know what I'm talking about, this is probably loony-toons territory but I had the thought and figured I'd toss it out there.

ilteroi commented 5 years ago

it's not a bad idea, in fact i've been experimenting with a "heatmap" of killed units before. the question is how it decays over time, especially when the tactical situation is changing. and it can give you oscillations between different paths. not so easy after all ..