Skip to content

cherry picks of some betterai BT changes#2504

Merged
5 commits merged intomasterfrom
BT-API
Mar 26, 2023
Merged

cherry picks of some betterai BT changes#2504
5 commits merged intomasterfrom
BT-API

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 15, 2023

This PR cherry picks 3 commits allowing bots to go grab ammo and poison when they need to. Needs to be used by BT to have any impact on gameplay.

@ghost ghost marked this pull request as ready for review March 15, 2023 09:14
@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 15, 2023

Note that this PR does not include a BT action that make bots reload, as I remember that this action required some heavier modifications to work reliably.

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 15, 2023

I removed the commit that implements action resupply as it's already possible to do that with the current API, using changeGoal and moveToGoal actions.

This was referenced Mar 15, 2023
@ghost ghost force-pushed the BT-API branch 2 times, most recently from 8478c11 to 74aa70a Compare March 15, 2023 20:41
Copy link
Copy Markdown
Contributor

@slipher slipher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it's been simplified a bit by removing goon barb support. Reducing the scope of the resupply score to a single responsibility (only poison rather than poison + barbs) resolves my concern about getting poison not always being feasible. LGTM

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 22, 2023

I see it's been simplified a bit by removing goon barb support. Reducing the scope of the resupply score to a single responsibility (only poison rather than poison + barbs) resolves my concern about getting poison not always being feasible.

No, there is still barb support: if the bot have no need for poison (because it already have poison), then it still might go (or rather stay) at booster for ammo, this is what bool needAmmo = !( weapon->infiniteAmmo && weapon->maxAmmo == 0 ); is for: there is a need for ammo if either condition is met: no infinite ammo, or maxAmmo != 0. This means that melee attacks won't set needAmmo, but barbs (the only weapon which have regenerating ammo) will.

I think those commits represent almost all the resupply API I used in betterai, with the only exception of the action reload which triggers bugs in the memory system. Those bugs i've fixed too, but the changeset is huge and I would not consider it ready for merge. It works without known problems, but it does not completely fix bot's memory issues so I'm not happy with it and won't try to push that for now (but maybe I could extract few changes from there that fix some actual bugs in enemy detection? I'll think about it.).

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 24, 2023

I updated the comments as discussed on IRC, and added support for energy resupply near drills, as when I wrote this drills were not able to resupply energy weapons.

@slipher
Copy link
Copy Markdown
Contributor

slipher commented Mar 26, 2023

LGTM

@ghost ghost merged commit 794c328 into master Mar 26, 2023
@ghost ghost deleted the BT-API branch March 26, 2023 04:33
This pull request was closed.
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.

1 participant