Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI fixes and improvements for Possession, Domination, Rocket jumping and Grappling #62

Closed
wants to merge 9 commits into from

Conversation

NeonKnightOA
Copy link
Contributor

@NeonKnightOA NeonKnightOA commented May 30, 2019

Redoing the pull-request again. Six months without coding practice leave quite a bit of rust. :/

Anyway. The commits are self-explanatory. These changes aim to improve offline botplay for the Domination and Possession gamemodes.

In Domination, bots are now willing to take the control points, and as a result, matches are more difficult than ever.

As for Possession, they prioritize taking the flag and chasing the flag carrier. Hopefully they also go to get the flag as well.

In addition, there's a new restriction for rocketjumping that checks if the bots can use the grapple and have it in their inventory. If they have the grapple and can use it (the safer alternative to rocket jumping) they won't use rocket jumps.

@NeonKnightOA NeonKnightOA force-pushed the newbotfixes branch 2 times, most recently from c996c2a to 28217da Compare May 30, 2019 22:12
@The-Gig
Copy link
Contributor

The-Gig commented May 31, 2019

About the "no rocket jump if you have hook", does it also check that the aas file has been compiled with -grapplereach option? Otherwise it would be useless.

However, I'm not really sure the "no nocket jump if you have hook" is really useful: currently, you cannot really enable bot_grapple as it's unfinished and badly bugged. So telling bots to use the grapple in the place of rocket jump is not very useful, if they cannot use grapple in general.

Also, I don't know how the code currently is, but maybe the bot "thought" algorythm should consider something like:

  1. I want to got up there (e.g. to take armor bonus), but it's too long to get there by walking.
  2. Can I use grapple (bot_grapple, having it, aas supporting it)? If yes:
    3a) If in aas there are grapplereach areas that allow me to get there from there, then check if there are enemies attacking me (using grapple requires time). If I'm not under attack, then use the grapple.
    3b) If there are no grapplereach areas to get there, check if I can perform rocket jump (quantity of health, etc.) and check if there are weapon jump areas to get there. Then rocket jump.

Note: Just a thought, I may be wrong.

@NeonKnightOA

This comment was marked as abuse.

@NeonKnightOA NeonKnightOA force-pushed the newbotfixes branch 2 times, most recently from 1371f9e to 49c19fe Compare June 1, 2019 18:07
@The-Gig
Copy link
Contributor

The-Gig commented Jun 1, 2019

Well.. spectate bots with bot_grapple enabled in maps compiled with grapplereach option, such as oacmpdm10, and you may notice them trying to use it when they do not have it, shooting at higher walls with other weapons. And if they have it, sometimes they do shoot it at the same spot multiple times in a row, I'm not sure why they do abort the attempt and try again. As these are major problems, I don't know if there are other problems.

About how/when they are supposed to use it exactly, maybe only some old id software employee knows what they planned... I can only guess. I guess as basic use they should use it to reach upper places if they consider it quicker than taking classic routes to go there.

@NeonKnightOA NeonKnightOA force-pushed the newbotfixes branch 2 times, most recently from 38f6f67 to 46a14e4 Compare June 1, 2019 21:07
@The-Gig
Copy link
Contributor

The-Gig commented Jun 1, 2019

As secondary use, humans may use grapple also horizontally, e.g. to pass to the other side of a gap (or even to the other side of the map, think about oacmpctf3)... but I have no idea if at id software they had also this use in mind for bots.

As third use, humans can use it to remain attached to a wall after reaching it (note: remain attached to jumppad kills you quickly), even switching to a weapon and firing at people while staying attached (pro: surprise attack, con: you're an easy target once spotted). I don't know if they planned even this kind of use for bots, maybe it's too much!

@The-Gig
Copy link
Contributor

The-Gig commented Jun 2, 2019

About grapple, I guess that just having bots using it for basic usage (using it to reach higher places) would be a great goal. I would suggest trying to fix those two annying bugs (it looks like you already tried to fix the first one) and then see what happens.

A thing I think would be important in case we fix bot_grapple, would be to rename the cvar then (bot_useGrapple maybe? bot_hook ?), as mods inherit their initial configuration from baseoa, and if in baseoa bot_grapple would be set to 1, then mods would have it enabled... but the feature would still be broken there (except maybe a few mods with theoretically may have fixed the boot hook behavior by their own -I don't know if there are-).

@NeonKnightOA

This comment was marked as abuse.

@NeonKnightOA NeonKnightOA changed the title AI fixes and improvements for Possession, Domination and Rocket jumping AI fixes and improvements for Possession, Domination, Rocket jumping and Grappling Jun 2, 2019
Neon_Knight added 7 commits June 3, 2019 13:22
Initial AI improvements for Possession.

This should solve the problem with bots not retrieving the flag on Possession.

Duplicated coding. Fusing the POS logic with the 1FCTF one and differentiating where needed.

Fusing the duplicated logic and differentiated where needed.

Oops...
Forgot this one. Oops!

Better check for Grappling Hook usage.

Oops...

Oops...
a) Possession: Accounting for the flag (for escaping or chasing) in BotAggression.
b) Adding the Grappling Hook to the list of weapons the bot can cycle.
@NeonKnightOA NeonKnightOA force-pushed the newbotfixes branch 6 times, most recently from b74d2f6 to 263b864 Compare June 3, 2019 20:31
Some checks for bot chats were moved to a more general function.

Teamplay checks replaced by the real deal. More generalization.
@NeonKnightOA

This comment was marked as abuse.

@The-Gig
Copy link
Contributor

The-Gig commented Jun 3, 2019

Just a note about "no rocketjump if you have grapple": from the first tests with grapple http://openarena.ws/board/index.php?topic=5458.msg55946#msg55946 it looks like the number of places where bots actually use grapple are quite limited. So I don't know how many chances there are that grapple really allows the bot to go to where it wanted to go via rocketjump.
Anyway, it looks like both features are quite rarely used by bots, so probably not a game changer.

@NeonKnightOA NeonKnightOA deleted the newbotfixes branch June 3, 2019 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants