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

WIP: Improve doCover logic #368

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rekterakathom
Copy link
Contributor

@rekterakathom rekterakathom commented Jan 10, 2024

When merged this pull request will: Make doCover activate for all danger sources and make it consider the direction of the danger.

  1. Describe what this pull request will do
    Hopefully make firefights more dynamic by having the AI actually attempt to use cover by occasionally dashing behind soft- and hard cover, slightly biased towards the enemy so it'll "advance" towards the enemy.

  2. Each change in a separate line

  • doCover might now activate for all sources of danger, including gunfire
  • doCover now takes into account the direction of the danger to make units hide behind trees, rocks, etc
  • doCover now has a slight bias for cover in front of the unit, so it might "advance" towards the enemy

I've declared this a draft, because I am not sure if this fits into lambs. It's pretty nice watching the AI now take cover, but I can see imagine it having some some issues, such as formations breaking, units wandering off, moving between two pieces of cover unnecessarily, etc. So, discussion is very much welcome.

Edit: Changed the wording in the last paragraph to clarify that I personally haven't seen any of the mentioned problems, but that I think that they can happen

Make doCover activate for all danger sources and make it consider the direction of the danger.
@rautamiekka
Copy link
Contributor

Fits perfectly, but the unwanted side effects are another story, especially if there just ain't a way to fix them without a huge Engine redesign. I suppose it could be a CBA setting.

Make sure units roughly stay within the formation
@rekterakathom
Copy link
Contributor Author

Made an edit to clarify that I haven't personally seen any of the side effects I've described, but I can imagine them being possible. A lot of playtesting is definitely needed in many kinds of scenarios and maps. I do agree that this could maybe be in 2.6.1 as a CBA setting as an experimental feature so it can be widely tested.

@nk3nny
Copy link
Owner

nk3nny commented Feb 19, 2024

I think this feature works fine. The only thing I would be somewhat concerned about is the change from Walk to Fast animations-- as these sometimes cause the AI to move through walls (as we see with doDodge). With my limited testing I saw no issues.

I have generally avoided using doMove where I can, because it means that player controlled groups will have some units "stuck" in cover (they won't automatically rejoin the player). Here moveTo, while less reliable, does mean that the unit will try to return to formation. This is for player controlled groups only.

@nk3nny nk3nny self-requested a review February 19, 2024 23:21
@nk3nny
Copy link
Owner

nk3nny commented Feb 19, 2024

I like this feature. I'm going to compile it into our internal modset and run it there. I'd also be happy to push it to dev for further testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants