-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix Monster Look Direction Behavior #4785
base: master
Are you sure you want to change the base?
Conversation
Screencast from RL, fleeing sheep will always look in the direction it's fleeing, never looks back at player: Screencast.from.2024-09-16.01-34-01.webmHowever, if the creature is fleeing AND decides to attack player (i.e. Dragon running in low health) with a directioned attack (a wave), it will direct the attack towards the player. It turns to the player for a split second only to wave, and then will continue fleeing. |
perhaps we should make it work only with creatures that have aggressive flag? |
I have an idea to get it working. Working on it now. It seems rl probably has monsters check if they can attack once they finish their walk. @ranisalt do you know if it is possible for monster on rl to cast without updating their look direction sometimes? |
So after checking RL. The monsters look like they are having spasms with how fast they turn.... I guess I need to make my code look even more messed up lol. |
Alright I think this looks even better than rl. Ranged monster also behave the same way as fleeing as shown in the video. |
Alright, LGTM |
updateLookDirection(); | ||
lookUpdated = true; | ||
lastStep = OTSYS_TIME() - 200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This made the sheep extremely slow 🐢
Pull Request Prelude
Changes Proposed
Allow monsters to update their look direction even if they cannot attack.
Stop fleeing monsters from updating their look direction.
As of now monsters will not update their look direction if they cannot attack (rl they do)
As of now fleeing monsters will look at the player randomly (rl they do not)
I can't figure out how to record rl so if someone can tell me, otherwise I can't get a video of it.
Issues addressed:
closes #4339