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

NPC flee from being run over by vehicles #76050

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

SurFlurer
Copy link
Contributor

Summary

Bugfixes "NPC flee from being run over by vehicles"

Purpose of change

This feature traces back to #120. However it's not working because of buggy code.

Describe the solution

The PR reuses the collision-preventing code for autonomous driving protocol, to determine whether the NPC will be run over by a vehicle. If true, make the NPC flee from the player.

Describe alternatives you've considered

  1. Fine tune the flee behavior, e.g. running sideways away from the vehicle.
  2. Extend the search range for dangerous vehicles.

Testing

  1. Spawn a few bandits.
  2. Spawn a car and drive toward them.
  3. They do try to escape from the car ( though with poor results, because they usually can't move faster than 1 maptile per turn.)

Additional context

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 30, 2024
@Maleclypse Maleclypse merged commit b51dc34 into CleverRaven:master Aug 31, 2024
28 checks passed
@SurFlurer SurFlurer deleted the npc_flee branch September 17, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants