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

Let AI engulf even if running out of atp #5729

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Patryk26g
Copy link
Contributor

Brief Description of What This PR Does

If there is a microbe nearby and the cell is not moving make it able to engulf the prey in order to survive

Related Issues

closes #5678

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    break existing features:
    https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
    (this is important as to not waste the time of Thrive team
    members reviewing this PR)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    styleguide.

Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.

@hhyyrylainen
Copy link
Member

This is for the AI, right? That's unclear from just the title (so I had to open up this PR immediately when I received the notification to make sure this wasn't a fix for a critical regression in the game).

@hhyyrylainen hhyyrylainen added this to the Release 0.8.0 milestone Dec 5, 2024
@hhyyrylainen hhyyrylainen requested review from a team December 5, 2024 19:56
@Patryk26g
Copy link
Contributor Author

This is for the AI, right? That's unclear from just the title (so I had to open up this PR immediately when I received the notification to make sure this wasn't a fix for a critical regression in the game).

Yes it is, sorry for not being clear

@Patryk26g Patryk26g changed the title Engulf even if running out of atp Let AI engulf even if running out of atp Dec 5, 2024
@HexapodPhilosopher
Copy link
Contributor

From testing this today, the AI still doesn't engulf while out of ATP.

@Patryk26g
Copy link
Contributor Author

From testing this today, the AI still doesn't engulf while out of ATP.

It should work now, the "if statement" was built improperly

{
if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE)
{
// even if we are out of ATP and there is microbe nearby, engulf them.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// even if we are out of ATP and there is microbe nearby, engulf them.
// Even if we are out of ATP and there is microbe nearby, engulf them.

Comments should be started with a capital letter. I'll comment just this once but I saw this elsewhere as well).

{
// even if we are out of ATP and there is microbe nearby, engulf them.
// make sure engulfing doesn't kill the cell
bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles,
Copy link
Member

Choose a reason for hiding this comment

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

I would have asked to add a blank line for readability before if (isMicrobeHunting) but I think it makes more sense to just inline this method call in there.

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

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

I'm not seeing any references to EnterEngulfModeForcedState so how does this actually force the engulf mode?

@Patryk26g
Copy link
Contributor Author

Well, tried rebasing onto master but it seems to mess up my branch again

@Patryk26g Patryk26g marked this pull request as draft December 12, 2024 18:44
@hhyyrylainen
Copy link
Member

hhyyrylainen commented Dec 12, 2024

Probably easiest if you just start a new fresh local branch and either cherry-pick the commits you want from here or just redo the changes manually. Then delete your local branch named engulfEvenIfOutOfAtp and make that branch again but starting from that new fix branch, then force push to overwrite all commits here.

Edit: also I wanted to mention that usually when duplicate commits get created like that you've either messed up a merge (with losing the info that the branch is actually merged) or an interactive rebase ended up rebasing remote commits (this is pretty easy to accidentally do if you do an interactive rebase onto a different branch and you have merge commits made in your branch, it's better to either rebase or squash first).

@Patryk26g Patryk26g force-pushed the engulfEvenIfOutOfAtp branch from 1d8f921 to fecacc8 Compare December 13, 2024 12:00
@Patryk26g Patryk26g marked this pull request as ready for review December 13, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Microbe AI should be able to use the enter engulf mode at the cost of health without ATP
4 participants