AI improvements

Talk about anything related to Unvanquished.
freem
Mantis
Posts: 98
Joined: Mon Feb 11, 2013 1:02 pm UTC

AI improvements

Postby freem » Mon Mar 01, 2021 11:12 pm UTC

Hello.

I want to improve bot's AIs, so that they would be less a burden when at high skill level, and ideally, make them useful even without cheating (seeing through walls).
There's a lot to do, of course, some changes won't be easy, but some can be trivial. I would notably like to discuss (and implement) tools to make them smarter as in teamwork.
The point of this thread is to discuss what would be ideal behaviors and to detail points when they are too vague. Of course, I do no promise at all, because some stuff will be horribly hard to implement, but keeping them in mind when reading/patching might make it a bit easier on long-term.

So, here's a start with stuff that popped on IRC (numbers were just line numbers I kept while moving lines for easier reference in discussions):

Aliens:
1 : if you see an enemy with luci, don't walk straight to it
2 : if you see an enemy with pulse, try to move around the ray
3 : ambush
4 : wait behind doors
5 : learn about wallwalking
6 : don't evolve under a certain health threshold (say, 75% of health? Have this depending on skill level, maybe, 50 + skill_ratio * 40?)
7: do not try to go on unreachable booster/heal place
8: heal on any building, not only OM, depending on how much exposed to danger building is and remaining health
9: tyrant devolve when base attacked by a human playing "chat perché"
10: tyrant don't go heal when allies are too close (block allies moves otherwise)


All:
1 : if you see an enemy but are far away (enemy is faster and out of range?), don't engage
2 : walk back to your base, don't turn your back upon an enemy (especially for humans, a difference between fleeing and retreating would be useful)
3 : stop at when passing near medipad or booster if you don't have a medikit or poison
4 : learn how to hit bases
5 : jump when you are on a small navmesh (that's already the case, but is too slow to trigger): it means you are on a box or in a hole
6 : learn about "hey, there's a shortcut if I jump here" (think aliens on yocto)
7 : learn about basic concept of situational awareness (like hey, there's an alien here because I just got bitten, how about looking behind me?)
8 : have a basic sense of strategy: hey, aliens have been attacking on that side for 5 minutes, how about having a look instead of roaming on the other side?
9 : mix weapons in teams/groups (if following a group which already have a radar, don't buy a radar, for example, try to keep squads balanced as in, mix short, medium and long range weapons, big and small classes, ... ideas welcom)
10 : establish squads
11 : real players should be able to give bots basic orders (follow me, defend here, defend base, defend outpost, target enemy's outposts, target enemy's main base... please add more!)
12 : keep money/evol points for next spawn
13: defend self and base when trying to heal
14: do not strafe when there is no danger around (trying to reach a human for example)
15: bots should go inspect beacons (that seems easier to do than some team awareness improvements actually). THat should obviously include "base is under attack", but could be used for beacons player can place

Humans:
1 : run when fleeing
2: reload when your ammo is low
3 : go back to base when you don't have many clips left
4 : learn how to use ladders
5 : do not move on occupied medipad
Last edited by freem on Tue Mar 02, 2021 11:07 pm UTC, edited 2 times in total.
User avatar
killing time
Programmer
Posts: 104
Joined: Wed Jul 04, 2012 7:55 am UTC

Re: AI improvements

Postby killing time » Tue Mar 02, 2021 2:01 pm UTC

jump when you are on a small navmesh (that's already the case, but is too slow to trigger): it means you are on a box or in a hole


Bots try to jump away when they have stayed within a small radius of an origin point for a long period of time. But adding something to detect small navmeshes could indeed make the situation better. Maybe connected components with a very small of nodes could be deleted from the navmesh, either in the navmesh generator or at navmesh load time.
freem
Mantis
Posts: 98
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: AI improvements

Postby freem » Tue Mar 02, 2021 4:59 pm UTC

Added to list:
Bots should not strafe when they are trying to go in melee and no enemy can see them. Can often be seen when running to base while wearing a radar: dretches take lot of time to hit you because... they strafe without reason.
User avatar
illwieckz
Project Head
Posts: 535
Joined: Sat Aug 11, 2012 7:22 pm UTC
Location: France
Contact:

Re: AI improvements

Postby illwieckz » Tue Mar 02, 2021 9:12 pm UTC

killing time wrote:
jump when you are on a small navmesh (that's already the case, but is too slow to trigger): it means you are on a box or in a hole


Bots try to jump away when they have stayed within a small radius of an origin point for a long period of time. But adding something to detect small navmeshes could indeed make the situation better. Maybe connected components with a very small of nodes could be deleted from the navmesh, either in the navmesh generator or at navmesh load time.


If we manage to remove small navmeshes at generation time, do the alien will be stuck? If yes the existing escape code would be triggered, and then, problem solved without adding specific game code.

On the other hand detecting small navmeshes in game to trigger the escape code without delay would be better.
This comment is licensed under cc ​​by 4 and antecedent.
freem
Mantis
Posts: 98
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: AI improvements

Postby freem » Tue Mar 02, 2021 11:06 pm UTC

tyrants really needs improvements:

* devolve when base attacked by a human playing "chat perché"
* don't go heal when allies are too close (block allies moves otherwise)

Also:

* bots should go inspect beacons (that seems easier to do than some team awareness improvements actually)
User avatar
killing time
Programmer
Posts: 104
Joined: Wed Jul 04, 2012 7:55 am UTC

Re: AI improvements

Postby killing time » Wed Mar 03, 2021 8:52 am UTC

I'm sure that the great majority of cases of bots getting stuck are due to deficiencies in the navmesh. I let marauder bots play for a few minutes on parpax and observed them getting stuck in two places visible in this screenshot below: atop the spherical structure on the left, and on the group of three boxes on the right. In both cases, the navmesh at least visually appears to be disconnected. This is not always the case though; in another room a bot got stuck in a place where the mesh was not visually disconnected.

Image

However, I'm not sure about the fidelity of this visual representation of the navmesh (displayed by navedit enable level2); there is no guarantee that the apparent disconnection exists in the internal graph representation.

Places where bots can be stuck without navmesh deficiencies also exist. For example, exiting from the depicted human base to the right, there are some shallow holes which human bots can fall into.

I do believe that deleting the bad parts of the navmesh would help the problem. I think there is code for bots to try to get back onto the navmesh when they are off it. Unfortunately, in the presence of deficiencies this can make things worse: I've seen bots deliberately going back to the disconnected part of the mash after they have managed to get off it using the unstick procedure.
freem
Mantis
Posts: 98
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: AI improvements

Postby freem » Wed Mar 03, 2021 11:41 am UTC

killing time wrote:Places where bots can be stuck without navmesh deficiencies also exist. For example, exiting from the depicted human base to the right, there are some shallow holes which human bots can fall into.


This one is worked around in parpax mini: there are grids to prevent the problem. Note that in original parpax, those holes are small enough to trigger the unstuck routines.

I would argue that those holes are simply unncessary and useless, so it would be better to fix the map *in this case*, but... parpax have lot of traps for the unwarry bot dretch.
After human base stairs, there's a grid which dretches can go under, for example. This one "sadly" could be used by human players to get advantages... but maybe a AINOCLIP material could be placed in there?
I don't know if that exist... but if so, could have bots trigger the unstick routine if they stay too much in such noclip area (and ultimately suicide)? Not a great fix, but anything that can improve stuck bot situation should be taken imo, because this can really break experience when playing solo or with limited number of players, which is the currently most often meet situation.

Maybe a meta-issue could be created on github, to make official maps bot-friendly, and list the number of places in which bot can be stuck (top of crates being one of the most often ones, but don't know how to fix that)?

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests