beyond-all-reason / Beyond-All-Reason

Main game repository for Beyond All Reason.
https://www.beyondallreason.info/
Other
1.68k stars 276 forks source link

AI improvements concerning player bases #2620

Open Nitromachine opened 7 months ago

Nitromachine commented 7 months ago

Description

I would like an option that forces friendly AI units and the player's own units to avoid moving through defenses that have been built by human players, such as dragon teeth or walls, instead of constantly destroying them. In addition, a second option that forces allied AI to avoid placing structures inside the general area of a human player's base(s).

Why?

My biggest frustration with this game is having to deconstruct structures built by allied Barbarian AI or having to rebuild critical defenses because a Titan decided to take a shortcut through a wall and then crushing the rest of that same wall for no reason. I've had an AI ally build a single dragon tooth in the middle of an area that I left purposely empty for the output of my vehicle factories: 15 minutes after removing the tooth, the AI built it again in the same spot. I often have to deconstruct AI built T1 laser turrets because they are in the way of wind turbines or fusion reactors that I need to build. If an AI spawns next to me, I have to rush building metal extractors in certain spots or else the AI will take them. I don't want the AI building T1 radars in the middle of my base while an entire side of theirs is defenseless and lined with a chain of very explosive structures. I've had many more problems but you get the idea.

What area of the game does this feature request pertain?

Gameplay, Settings, Controls or Hotkeys

Other (optional)

This could perhaps be implemented as a circular zone of avoidance around structures built by human players, with bigger structures having a bigger radius. AI players can continue to ignore each others' boundaries to prevent the units of one AI from being boxed in by another friendly AI. Another possibility would be to enable players to draw zones where the AI shouldn't move or shouldn't build.

PtaQQ commented 6 months ago

Approved by the GDT, pending the concept of implementation.

pandaro commented 6 months ago

why me? im not able to work with barb :( i can try to do something on STAI, but it is not my prio at moment

pandaro commented 6 months ago

@WatchTheFort thanks for your trust anyway

rlcevg commented 6 months ago

Walls are neutral units. Ignorance of neutral units requires polling and maintaining list of neutral units; there are no messages like NeutralUnitEnteredLOS/Radar. Also there's no way to distinguish who built walls, so i propose to set UnitRulesParam "builderTeamId" or "builderAllyTeamId" when unit transferred to neutrals (for the future).

rlcevg commented 6 months ago

BARb, avoidance and scriptable ally zone size: https://github.com/beyond-all-reason/spring/commit/f3ba23635e1462ae2084f10bf9ba777467d16090 Requires testing. Doubt someone will implement walls / neutral units avoidance. Won't expect it in a free version.


Another possibility would be to enable players to draw zones where the AI shouldn't move or shouldn't build.

Is an interesting idea. Just like cooperation with AI through map marks. Waiting for UI implementation: presumably AI can receive drawn on a map polygons as a list of vertices encoded in a string (unfortunately) and process it in any way it wants internally: parse and map to a grid with specific cell size, or raw in-polygon test, whatever AI implements.