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 behaviour curiosities, maybe due to full map life simulation? #565

Closed
Abendlied opened this issue Jan 8, 2024 · 14 comments
Closed

NPC behaviour curiosities, maybe due to full map life simulation? #565

Abendlied opened this issue Jan 8, 2024 · 14 comments

Comments

@Abendlied
Copy link

  • escorting NPCs like Lares do not wait for player to follow (unless there is a dialog to be triggered). The NPC will continue to run even if out of viewable distance. My suspicion is this could be due to the full life simulation on the map.

  • Grimbald the hunter: When I first arrived there, only one snapper was there. My suspicion is that Grimbald killed them already over time but I am not sure. I found no snapper corpses.

@Nindaleth
Copy link
Contributor

@Abendlied Yes, you're right about the full simulation cauing both of these.

However, if Lares in original stops for the player to catch him (even within visible range), he still should do that in OpenGothic. Is there such issue?

@Try
Copy link
Owner

Try commented Jan 9, 2024

Hi @Abendlied !

escorting NPCs like Lares do not wait for player to follow

Hm, sort of yes and no. In game-scripts of original game npc suppose to wait for you, but it not always - it just doesn't work well.
When it doesn't - in vanilla npc teleport it the finishing point, in opengothic it walks there.
Lares script is different and he programed to wait for you (this is why he has dummy dialogs along the way) - this should be similar in opengothic.

My suspicion is that Grimbald killed them already over time but I am not sure. I found no snapper corpses.

I've seen such issue a few times, yet it hard to catch it in action. My theory snappers scudded on a nearest cliff and issue is might be related to #542

@Abendlied
Copy link
Author

Thanks for the replies.

However, if Lares in original stops for the player to catch him (even within visible range), he still should do that in OpenGothic. Is there such issue?

Lares script is different and he programed to wait for you (this is why he has dummy dialogs along the way) - this should be similar in opengothic.

I can confirm, Lares dummy dialogues work and Lares will be waiting there. But he will run uninterrupted to the next dummy dialog spot and does not wait inbetween if player does not catch up.

I noticed that

  • Mika does not wait for you if he escorts you to Akils, he will only stop at Akils.
  • If I let Lares guide me to the forest stone ring and trigger the escort to Onars from there, he has no intermediate script and will walk the whole way only to stop at Orlans, his final destination with a dialog.

@Abendlied
Copy link
Author

Abendlied commented Jan 9, 2024

I've seen such issue a few times, yet it hard to catch it in action. My theory snappers scudded on a nearest cliff and issue is might be related to #542

@Try You might be right. I went to Grimbald again and used F8 and K to see if monsters were clipping through somewhere. I actually found two snappers swimming in the lake just next to the cliff.

image
edit: picture

@thokkat
Copy link
Contributor

thokkat commented Jan 12, 2024

escorting NPCs like Lares do not wait for player to follow

Reverting 8716db0 makes it work.

State loop is not executed because Lares is in goto mode, so PERC_ASSESSPLAYER's function B_AssessGuidePlayer() was used as replacement loop that checks distance. Commit prevented that perc trigger.

They used sense smell as bypass to get the trigger. Script comment says sense smell is required for Lares because otherwise player can't be seen.
self.senses = SENSE_SEE|SENSE_HEAR|SENSE_SMELL; //Sense_Smell erforderlich, da der Sc sonst nicht "gesehen wird)!!

@Try
Copy link
Owner

Try commented Jan 12, 2024

Reverting 8716db0

Hm, I remember this was done, to fix case when the seeker can notice player from behind

@thokkat
Copy link
Contributor

thokkat commented Jan 12, 2024

I tested a bit more. If npc has senses smell ASSESSPLAYER is triggered if within perc distance without any further conditions. So either senses see + visibility or senses smell.

This would explain ZS_GolemDown start function:

func void ZS_GolemDown ()
{
	self.senses			=	SENSE_SMELL ;
	self.senses_range	=	2000;	
	Npc_SetPercTime		(self, 1);	
	Npc_PercEnable  	(self, 	PERC_ASSESSPLAYER	, 	B_GolemRise	); 

	self.aivar[AIV_TAPOSITION] = NOTINPOS;
};

@hwnde
Copy link
Contributor

hwnde commented Feb 26, 2024

Reverting 8716db0

Hm, I remember this was done, to fix case when the seeker can notice player from behind

Notice as in attack or trigger dialogue?
I did some testing in OpenGothic and vanilla and there seems to be a difference in behavior when I approach a seeker from behind. In vanilla it triggers the dialogue. In OpenGothic the seeker starts attacking me.
Reverting the commit makes it work like in vanilla.

@hwnde
Copy link
Contributor

hwnde commented Feb 29, 2024

@Try would you agree, based on the above comments, to revert the change?

Try added a commit that referenced this issue Feb 29, 2024
as pointed in ticket - this breaks followers and seekers
#565
@Try
Copy link
Owner

Try commented Feb 29, 2024

Reverted, thanks everyone for testing it and thanks @hwnde for reminding - I've forgot about this ticket :)

@thokkat
Copy link
Contributor

thokkat commented Mar 3, 2024

There are two kinds of seeker's. Some wanna talk, some attack. I pushed a pr for the Lares case but seekers should behave as expected too. #589

@Try
Copy link
Owner

Try commented Mar 3, 2024

There are two kinds of seeker's.

It's not 2 completely different. Seeker behavior is controlled by aivar[AIV_EnemyOverride] = TRUE line, and there a few minor variations for the very first one and some on dragon-island.

This fixes Lares not stopping if guiding the player and shattered golem not attacking

Lares work on current master as-is. I'm sorry, but I can't quite see what this PR is about

@thokkat
Copy link
Contributor

thokkat commented Mar 4, 2024

Revert was faster than pr, so yes for now there's only golem fix. After bug report I disabled senses piecewise and looked what they do and pr is the result. Technically this is ready for some time except maybe final testing but I don't like having multiple pending pr's. Wanted to wait until delay stuff is done.

Another thing which I planned for implementation of some G1 percs is the removal of empty aiqueue check. This currently blocks percs there because script loop often has AI_Wait call. Aiqueue check has been introduced to make sneaking work. Removal right now would break it again but switch to walkbit instead of bodystate for sneak check would allow that.

I see this point is a bit unlucky because it's only in pr because the "what i think senses\percs should behave like" breaks sneaking otherwise. But as explained it's useful on it's own, should have just added aiqueue empty check removal there too.

@Try
Copy link
Owner

Try commented Jul 24, 2024

escorting NPCs like Lares

Fixed.

found two snappers swimming in the lake just next to the cliff.

Snappers can be part of: #657

Perc related side-topic seem to be already tracked in:
#639

@Try Try closed this as completed Jul 24, 2024
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

No branches or pull requests

5 participants