If you have trouble registering or do not receive a verification e-mail, please ask for help in chat.

bot improvements mod

Release and discuss things you've made, including mods.
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Sun Jul 04, 2021 9:49 pm UTC

killing time wrote:Suggestion: Have a minimum health percentage to evolve. If you evolve with low health and get in a fight right away, then you will probably end up wasting your evos. If you don't get in a fight, then evolving at that time did not benefit you.


Good point, I'll had this to TODO (should be easy to imlement, at least)

Something I've talked about before, but was not mentioned in this thread - human bots sometimes won't fire at aliens in plain sight. This can happen if humans are on the ledge in the karith elevator room and aliens are on the other ledge. (I think you said it happens because there must be a mesh path to an enemy?)


From what I understand from your description, yes, it's likely to be because of navmeshes are not connected. For buildings roofs and ceiling, there's a workaround in code, but it only works if they are above "current navmesh" in short. I still don't understand it enough to improve the situation though.

When playing today, the human bots seemed kind of cowardly sometimes. As a mantis, I did around 30-40 damage to a human bot with light armour close to its base and it fled back in.


This is because I implemented "opportunistic healing" (BotGetHealScore()) and the code is still about comparing scores with a "hard-coded" (in BT) value. I don't like that, but it's better than before when they would only run away at 50% hp, which means you could have human bots starting to rush at 60hp even i they're near the medistat.
What you noticed is a side effect, this code needs improvements, tweaking the values to find good ones.

In short, the HealScore depends on their skill, their health and distance from heal source, and it's not a linear function. Some values in there were only chosen "because they look good on the graphics" and I'm open to suggestions about how to improve them (I'm not good at maths, but doing my best to have rather logical behaviors out of the data bots can access).

I feel like the bots' aiming skill with Painsaw might be too high compared to their skills in other areas.


Well, the problem is, there's no distinction between alien and human bots on aiming. Human bots miss a lot, because their target is far. When using painsaw, it's melee. They miss as often as aliens.
The painsaw problem is not bots, it's that it is OP (higher damages per second than a tyrant, for roughly the same range). Skill 7 (on my server) is meant to be good bots, yet they suck with their aiming. Observe them when they use the sniper, you'll see how bad they are (certainly too much for "high skill bots" which they are meant to be).
Maybe the aiming code could be changed though, but I don't think making bots with painsaw weak is a good idea: painsaw is a cheap weapon, they rarely use it (now, because in vanilla they love this weapon) and only temporarily (when unable to buy decent armors, mostly)
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Mon Jul 05, 2021 7:16 pm UTC

New iteration upcoming: mod-betterai_0.52.1+5.

  • fixing the BS "moonwalk" bug (which is an old bug shown by my modifications since otherwise bots almost never run)
  • prevents aliens to evolve if they are either under 50% hp or have a too high healScore
  • make humans use their medkit when retreating for heal

As for the results since last iteration:

Code: Select all

     17  Aliens win.  antares
     16  Aliens win.  chasm
     15  Aliens win.  forlorn
     17  Aliens win.  perseus
     17  Aliens win.  plat23
     15  Aliens win.  station15
      1  Aliens win.  vega
      2  Humans win.  antares
     17  Humans win.  parpax
     17  Humans win.  yocto


[edit]
Alright, the moonwalk fix introduces a regression which makes bots no longer keeping stamina to jump, which means they can be stuck against buildings, unable to jump, and code won't make them do the work around... which is another bug, but not one that I'll target soon. I'm trying to fix the regression without reintroducing the moonwalk problem, but that might be quite annoying. Should not break bases not built stupidly though.
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Mon Jul 05, 2021 10:34 pm UTC

New release, mod-betterai_0.52.1+6 hopefully fixes definitely the sprint problems: no more moonwalk, yet bots will keep stamina to jump at level 5 or more (and thus, not suicide because of badly placed turrets or nodes).
No stat, previous iteration died too early.
Enjoy.
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Tue Jul 13, 2021 12:05 pm UTC

No update except for some minor manual fixes in navmesh.

Current scores:

Code: Select all

     29  Aliens win.  antares
     29  Aliens win.  chasm
     28  Aliens win.  forlorn
      8  Aliens win.  parpax
     25  Aliens win.  perseus
     24  Aliens win.  plat23
     31  Aliens win.  station15
     14  Aliens win.  yocto
      1  Humans win.  antares
     20  Humans win.  parpax
      1  Humans win.  perseus
     15  Humans win.  yocto


I'll keep the server running with current patchset to see if the navmesh patches change something on yocto (they don't on perseus, and I have not patched other maps for that).
Note that I have found a minor bug in my stat script. Not surprising, and probably does not invalidates all scores, but it slightly affects precision. Or maybe it's simply because of log rotation... I need to spend more time on that.
User avatar
afontain
Posts: 10
Joined: Fri Nov 13, 2020 8:41 am UTC

Re: bot improvements mod

Postby afontain » Tue Jul 20, 2021 9:44 am UTC

Ok, so here's a part of my todolist with ideas you can be interested to implement. You may have fixed or partially fixed some of these already.

  • You should check that when, say, an human is hurt, they add the enemy to the enemy queue (look for enemyQueue_t, I guess). Maybe it's not the actual bug and it happens only when you attack an human healing (I think I've confirmed it's not though). Currently you can sometimes kill an human bot and they don't even seem to notice as long as they don't see you in their view cone.

I'm thinking, as we make the bots stronger at every skill, that we should also make them easier at low skill.

  • Maybe continue firing a bit after the target has exited the pointer? As a mean to have them waste more ammo and spend more time reloading. If you look at newcomers, you will notice they are often trigger-easy.
  • Have bots forget healing even exist at very low skill. Bots used to roam the map with low health, and that meant an easy human sandwich with 40hp from times to times. In low skill matches, this is not a bug, it's a feature!
  • Have bots buy weapon before armor at low skill. Every newcomer does that. This seem like a good mistake to lower the bot skill.
  • Have bots evolve even at low health.
  • Have bots do fast retreat at high skill only. This thing is insanely powerful. That's probably not just a bot bug, mind you.
  • Have bots do all the stupid things stupid players do (yeah, I know, easy to say :tongue:)

And as a last point, I'd very much like to have a "bot skill" tree :) I've talked about it a bit, but here's something written on something less ephemeral than IRC.

The idea would be that bots would have some number of skills to spend here and there, and those would unlock the smart behaviour, enable good heuristics or on the other hand, disable bad behaviours. It would help give bots some personallity so they don't all feel the same, and don't feel too much the same from a game to another.

Code: Select all

base
        -> healing
                -> smart healing (with good heuristics)
                -> knows how to run
                -> fast retreat
        -> better weapon choices
                -> can buy grenades
        -> knows how to reload
                -> buy armor before weapon
        -> …
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Wed Jul 21, 2021 10:50 pm UTC

So, I now host 2 other instances, with different skill levels: 3 and 5. I'll let them play for a while and see if I can get some stats there, too. I'll probably need to spy bots on them too, especially for skill level 3.

afontain wrote:
[*] You should check that when, say, an human is hurt, they add the enemy to the enemy queue (look for enemyQueue_t, I guess). Maybe it's not the actual bug and it happens only when you attack an human healing (I think I've confirmed it's not though). Currently you can sometimes kill an human bot and they don't even seem to notice as long as they don't see you in their view cone.[/list]


To react to enemy's attacks is something I want to build too, yes. Not sure that struct will help much though. Still worth investigating.

afontain wrote:
I'm thinking, as we make the bots stronger at every skill, that we should also make them easier at low skill.

  • Maybe continue firing a bit after the target has exited the pointer? As a mean to have them waste more ammo and spend more time reloading. If you look at newcomers, you will notice they are often trigger-easy.
  • Have bots forget healing even exist at very low skill. Bots used to roam the map with low health, and that meant an easy human sandwich with 40hp from times to times. In low skill matches, this is not a bug, it's a feature!
  • Have bots buy weapon before armor at low skill. Every newcomer does that. This seem like a good mistake to lower the bot skill.
  • Have bots evolve even at low health.
  • Have bots do fast retreat at high skill only. This thing is insanely powerful. That's probably not just a bot bug, mind you.
  • Have bots do all the stupid things stupid players do (yeah, I know, easy to say :tongue:)


Most of those proposals are likely easily doable honestly, and might be interesting. Some are, as you said, already implemented though (Have bots forget healing even exist at very low skill <- the new healScore function I have does not make them forget they can heal, but really it's hopefully close enough... if not, I'll have to tweak the code more.).
Few things I have to say though.
About "[*] Have bots do fast retreat at high skill only. This thing is insanely powerful.": you understand that currently, they don't really aim at where they pounce/jump?
If that was properly implemented, they would be WAY stronger that what the very naive implementation I've done makes them.
And, well, yes, clearly: "not just a bot bug" this is the gameplay which makes aliens bots fleeing ridiculously fast. Well, on the other hand, it's required to "peek at bunker, don't attack because can't, and stay alive". But those are, indeed, different problems.

And then, about "Have bots buy weapon before armor at low skill" the shopping code is already messy enough, I don't really want to make things impossible to maintain.
In theory, I'm not against the idea, but for that, the game needs a proper management of equipment, not that horrible global variable system it have right now. Equipements should also, *not* be artificially split between "upgrades" and "weapons". Is CKit a wepon? No. Are grenades and firebombs weapons? Yes.
The current inventory system is, at the very best, impractical. It requires a good cleanup, but that would require lot of work and would result in absolutely zero gameplay improvement by itself. Maybe I'll do that, someday, when my casual mod will be advanced enough and that I'll be willing to experiment with new weapons though :)

afontain wrote:
The idea would be that bots would have some number of skills to spend here and there, and those would unlock the smart behaviour, enable good heuristics or on the other hand, disable bad behaviours. It would help give bots some personallity so they don't all feel the same, and don't feel too much the same from a game to another.


By itself, I'm not against that idea, it would even not be that hard to implement (just set 3 or 4 gauges and attribute N points in them, N being a multiple of their skill, and done. Well, got to then grep for the current skill variable and replace it by the correct gauge, sure, but that's a matter of less 1H), but the problem is that there not that much ways to have "personality" in unvanquished.
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Wed Jul 21, 2021 11:03 pm UTC

Btw, here are current results, the only changes were artificial connections in navmesh, and as you can see, this results in a huge difference on yocto. The changes were only about creating links that should have been made by the current daemonmap, so this is really about working around serious bugs:

Code: Select all

     18  Aliens win.  antares
     20  Aliens win.  chasm
     17  Aliens win.  forlorn
      7  Aliens win.  parpax
     17  Aliens win.  perseus
     18  Aliens win.  plat23
     19  Aliens win.  station15
     11  Aliens win.  yocto
     13  Humans win.  parpax
      1  Humans win.  perseus
      8  Humans win.  yocto


This makes basically human bots only able to compete on parpax, which is not really surprising since bots don't take the elevator... and I can't fix it, since otherwise alien bots will likely just walk against the door endlessly and suicide when it's high. Yes, this is still old parpax.
I just uploaded the last parpax's version from Viech, so next stats will be on latest one, which might be less flawed for bots... might, really (I don't think so, since they can't use elevators and ladders, which leads to the fact they can only use one path, but hey)
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Thu Jul 22, 2021 12:47 am UTC

New release: 0.52.1+7.

Brings:

  • Have bots evolve even at low health: limitation is based on healScore < 0.5, which depends on the skill.
  • Have bots do fast retreat at high skill only. (no fast retreat below skill 5)

There's also quite the code and git history cleanup in it, but nobody really cares about that :)
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Sat Jul 24, 2021 5:59 pm UTC

new version, 0.52.1+8, which brings various changes related to skill, but the most notable feature is that bots have various skills, and that their level in those is randomly distributed.
There are 3 (temporary) "skills": aiming, aggressiveness and moving. The normal "level" is multiplied by the number of skills to get the points to distribute, and those are then randomly distributed, while still not being able to go out of the normal range ( from 1 to 9, included).

I also modified other bot skill related stuff, namely, how fast they react and how much they pursue: I removed the cVars allowing to control those things and replaced them by that skill rewrite I did.
This means they should be slower or faster to aim depending on their aim skill, and should chase more or less depending on their aggressiveness.

Since this is very experimental, I am very curious to know your feelings, this very likely still need work, but the base is here and it should be rather easy to improve on it.

[edit]
Alright, I modified my update script last time so that I would have less manual stuff to do... turns out I made it buggy, so that the behavior trees used where vanilla's ones, which are, of course, less "nice" (I hope at least). I fixed the script and overwrote that iteration. I don't think anyone had time to notice the problem, but just in case, if you have problems joining there, try to 1) close game 2) remove the mod from your local data, 3) restart game and join.
If that does not work, please ping me on IRC.
User avatar
freem
Marauder
Posts: 163
Joined: Mon Feb 11, 2013 1:02 pm UTC

Re: bot improvements mod

Postby freem » Sun Jul 25, 2021 2:49 pm UTC

new version, 0.52.1+9, this is just a bugfix. Hopefully the skill randomisation works correctly, now.

Return to “Community Development”

Who is online

Users browsing this forum: No registered users and 2 guests