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

Make mobs alert other mobs when target found #150

Open
Arcanorum opened this issue Jul 26, 2021 · 1 comment
Open

Make mobs alert other mobs when target found #150

Arcanorum opened this issue Jul 26, 2021 · 1 comment
Labels
code Requires code (logic/configuration) to be created or modified. good first issue Good for newcomers

Comments

@Arcanorum
Copy link
Owner

Arcanorum commented Jul 26, 2021

Task description

It is currently too easy to pick off single mobs that are in a group and lure them away.

It would be better if when a mob notices a target (another character type of an opposing faction) then it would broadcast that information to any other mobs of the same faction within a certain range, so they too would be alerted of the target being found.

For example:
There is a group of knights near each other facing in different directions.
A bandit moves into the view range of a knight, so the knight notices it.
The knight would check for all nearby knights (and any other characters that have a friendly faction relationship to the knight) and tell each one of them to focus on the bandit (if they don't already have a target).

References/notes

Character factions: https://github.com/Arcanorum/dungeonz/blob/master/server/src/gameplay/Factions.js
Mob logic: https://github.com/Arcanorum/dungeonz/blob/master/server/src/entities/classes/destroyables/movables/characters/mobs/Mob.js

  • See onDamage for what the mob should do when it is damaged.
  • See getNearestHostileInLOS for when a hostile character is found by this mob.

Try with a range of 4 (in all directions) to check for other friendly mobs, though this may change depending on testing/feedback, as long as it is configurable.

Acceptance criteria

  • When a mob is damaged, it should check the source of the damage and if it is another character, then it should target that character, and also check for characters of a friendly faction within a 4 tile radius that do not have a target and set their target to the damaging character.
  • When a mob finds a character of a hostile faction, it should target that character, and also check for characters of a friendly faction within a 4 tile radius that do not have a target and set their target to the hostile character.
  • The 4 tile radius should be added as a property to the Mob prototype, something like alertRange.
@Arcanorum Arcanorum added good first issue Good for newcomers code Requires code (logic/configuration) to be created or modified. labels Jul 26, 2021
@Sebasflow23
Copy link
Collaborator

Zombie pigmen flashbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Requires code (logic/configuration) to be created or modified. good first issue Good for newcomers
Projects
Status: Needs refinement
Development

No branches or pull requests

2 participants