OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

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

Open Abendlied opened this issue 1 year ago • 13 comments

  • 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.

Abendlied avatar Jan 08 '24 10:01 Abendlied

@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?

Nindaleth avatar Jan 08 '24 14:01 Nindaleth

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 https://github.com/Try/OpenGothic/issues/542

Try avatar Jan 09 '24 00:01 Try

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 avatar Jan 09 '24 00:01 Abendlied

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 https://github.com/Try/OpenGothic/issues/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

Abendlied avatar Jan 09 '24 00:01 Abendlied

escorting NPCs like Lares do not wait for player to follow

Reverting https://github.com/Try/OpenGothic/commit/8716db0b2e4ce5e5baa893ac1433b8b209c8d5ef 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)!!

thokkat avatar Jan 12 '24 18:01 thokkat

Reverting https://github.com/Try/OpenGothic/commit/8716db0b2e4ce5e5baa893ac1433b8b209c8d5ef

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

Try avatar Jan 12 '24 20:01 Try

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;
};

thokkat avatar Jan 12 '24 23:01 thokkat

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 avatar Feb 26 '24 08:02 hwnde

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

hwnde avatar Feb 29 '24 05:02 hwnde

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

Try avatar Feb 29 '24 19:02 Try

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. https://github.com/Try/OpenGothic/pull/589

thokkat avatar Mar 03 '24 16:03 thokkat

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

Try avatar Mar 03 '24 23:03 Try

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.

thokkat avatar Mar 04 '24 21:03 thokkat

escorting NPCs like Lares

Fixed.

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

Snappers can be part of: https://github.com/Try/OpenGothic/issues/657

Perc related side-topic seem to be already tracked in: https://github.com/Try/OpenGothic/issues/639

Try avatar Jul 24 '24 23:07 Try