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

fix gargoyles being always awake in mp #6736

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

Conversation

qndel
Copy link
Member

@qndel qndel commented Oct 22, 2023

Partial fix for #5600
It's not a perfect fix - basically changes gargoyle's perma awake behavior on subsequent visits to always sit - if player is close, gargoyle will get up anyway - checking for MFLAG_ALLOW_SPECIAL is pointless because I think it will be always set from initializing the monster. activeForTick wasn't useful either because it can be non-zero and the monster can be sitting anyway - the range at which they wake up is determined by their intelligence. A proper fix would be to rewrite everything to sync actual monster flags in MP - but that's a much bigger and more complex change and imo this fix improves current situation anyway.

After adding a check for nonzero activeForTicks, this PR is a straight improvement for current situation - gargoyles that are close will wake up anyway but this will prevent awakening them on the whole level.

@qndel qndel enabled auto-merge (squash) October 22, 2023 23:06
@ikonomov
Copy link
Contributor

I think this fix actually makes them behave in a way that is most logical. Once they sense no threat nearby (on that level) they take their stone-like form.

@StephenCWills
Copy link
Member

I agree with qndel that it's not a proper fix but is a huge improvement.

@ikonomov
Copy link
Contributor

I think the proper fix in this case wouldn't align as well as Qndel's fix with the expected behavior of these monsters with their unique ability. In my opinion either way would be perfectly fine really and the fact that we can have this fix is a huge improvement.

@StephenCWills
Copy link
Member

I think the proper fix in this case wouldn't align as well as Qndel's fix with the expected behavior of these monsters with their unique ability.

I have a feeling you don't understand how a proper fix would differ from what Qndel has implemented here.

The main problem with this fix is that Gargoyles that were in line-of-sight of the player within 13 seconds of them entering a Town Portal will still wake up regardless of whether they were close enough to do so. This is no different from how those Gargoyles would behave without this fix, but it is still unusual and would still cause desync.

A proper fix would resolve that issue by accurately tracking the monster flags. If a Gargoyle is not awake, that information would be written to the monster delta. Then we could more accurately determine whether the Gargoyle is supposed to be awake or not when entering a Town Portal and reloading the level.

Perhaps you meant to say that qndel's fix before he edited it was better than a proper fix (and also his edit). If so.. well, you might be right. That fix could still cause desync for Gargoyles that retreat to go heal, but I don't think syncing the flags alone would be enough to resolve that issue anyway.

@ikonomov
Copy link
Contributor

ikonomov commented Oct 26, 2023

I have a feeling you don't understand how a proper fix would differ from what Qndel has implemented here.

From Qndel's description I thought his fix makes all Gargoyles sit and heal once all players leave the level regardless of whether they are awake or not. I assumed that the proper fix he was thinking of was to save the already awoken/active gargoyles state when leaving the level so that they are still in that state when returning to it. I thought his fix made more sense.

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

Successfully merging this pull request may close these issues.

None yet

3 participants