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

Humans don't recognise orcs as monsters #78

Closed
i5sue5 opened this issue Jan 25, 2021 · 4 comments · Fixed by #113
Closed

Humans don't recognise orcs as monsters #78

i5sue5 opened this issue Jan 25, 2021 · 4 comments · Fixed by #113
Labels
compatibility: difficult This issue is difficult to make compatible. impl: replace func call This issue requires replacing function calls in the scripts. provided fix This issue has a fix provided in the comments. type: session fix The fix for this issues is persistent across a session.
Milestone

Comments

@i5sue5
Copy link

i5sue5 commented Jan 25, 2021

Humans ignore orcs until they're attacked by them. It's an old oversight from the alpha stage of the game where more interaction with orcs was planned.

@i5sue5 i5sue5 added the compatibility: easy This issue is easy to make compatible. label Jan 25, 2021
@i5sue5
Copy link
Author

i5sue5 commented Jan 25, 2021

func int C_NpcIsMonster(var C_NPC slf)
{
PrintDebugNpc (PD_ZS_DETAIL,"C_NpcIsMonster");
PrintDebugString (PD_ZS_DETAIL,"...name: ", slf.name);
if ((slf.guild > GIL_SEPERATOR_HUM) && (slf.guild < GIL_SEPERATOR_ORC))
{
PrintDebugNpc (PD_ZS_DETAIL,"...true");
return TRUE;
}
else
{
PrintDebugNpc (PD_ZS_DETAIL,"...false");
return FALSE;
};
};

changed to

func int C_NpcIsMonster(var C_NPC slf)
{
	PrintDebugNpc		(PD_ZS_DETAIL,"C_NpcIsMonster");
	PrintDebugString	(PD_ZS_DETAIL,"...name: ", slf.name);

	if (slf.guild > GIL_SEPERATOR_HUM)
	{
		PrintDebugNpc	(PD_ZS_DETAIL,"...true");
		return TRUE;
	}
	else
	{
		PrintDebugNpc	(PD_ZS_DETAIL,"...false");
		return FALSE;
	};
};

@AmProsius AmProsius removed the compatibility: easy This issue is easy to make compatible. label Jan 25, 2021
@AmProsius AmProsius added this to To Do in v1.0.0 Jan 28, 2021
@szapp
Copy link
Collaborator

szapp commented Jan 31, 2021

I am a bit hesitant about this fix, because there is a dedicated, analogous function for orcs (see below) and in the engine the guilds of orcs are also hard coded and often treated separately from monsters (after all they have humanoid models with dedicated head visuals and more elaborate ZS states, which makes them actually more similar to humans).

func int C_NpcIsOrc(var C_NPC slf)
{
PrintDebugNpc (PD_ZS_DETAIL,"C_NpcIsOrc");
if (slf.guild > GIL_SEPERATOR_ORC)
{
PrintDebugNpc (PD_ZS_DETAIL,"...true");


Also, from the calls to this function is becomes apparent that orcs are treated differently from monsters. (Changing that function would have break some ZS states of orcs.) Some examples:

//-------- Angreifer ist Mensch/Ork ! --------
if (!C_NpcIsMonster(other))
{

if (C_NpcIsHuman(self) || C_NpcIsOrc(self))
{
AI_StartState (self, ZS_ReactToDamage, 0, "");
}
else if (C_NpcIsMonster(self))
{
AI_StartState (self, ZS_MM_Attack, 0, "");
};

I think it would be dangerous to change that function. Instead, it seems like a guild-attitudes issue to me - although the monster attitudes look fine too:

B_SetGuildAttitude (GIL_SEPERATOR_HUM, ATT_HOSTILE, GIL_ORCSHAMAN );
B_SetGuildAttitude (GIL_SEPERATOR_HUM, ATT_HOSTILE, GIL_ORCWARRIOR );
B_SetGuildAttitude (GIL_SEPERATOR_HUM, ATT_HOSTILE, GIL_ORCSCOUT );
B_SetGuildAttitude (GIL_SEPERATOR_HUM, ATT_FRIENDLY, GIL_ORCSLAVE );

I would rather investigate a bit further as to where exactly lies the origin for them not attacking.


In the end it comes down to this important question:

Is it noticeable? Do humans ever even encounter orcs in the vanilla game?

Because if it's not, I would stay away from it, to not mess up any mods that may depend on this behavior.

@szapp szapp added the validation: required This issue needs validation from one of the validators. label Jan 31, 2021
@szapp
Copy link
Collaborator

szapp commented Feb 1, 2021

I think the function to modify is C_NpcIsDangerousMonster. It seems exclusively used to determine actions in fighting context.

func int C_NpcIsDangerousMonster(var C_NPC slf, var C_NPC oth)
{
PrintDebugNpc (PD_ZS_DETAIL,"C_NpcIsDangerousMonster");
if (C_NpcIsMonster(oth))
&& (Wld_GetGuildAttitude(oth.guild,slf.guild) == ATT_HOSTILE)
&& (!oth.aivar[AIV_MM_PARTYMEMBER])
&& !C_NpcIsDown(oth)
{
PrintDebugNpc (PD_ZS_DETAIL,"...true");
return TRUE;
};
PrintDebugNpc (PD_ZS_DETAIL,"...false");
return FALSE;
};

Here are the three contexts in which this function is called. The second one explicitly states that orcs are included. So I suppose to modify the function above and add C_NpcIsOrc next to C_NpcIsMonster.

//######## ...dann muß der Enemy ein MONSTER sein ########
else
{
PrintDebugNpc (PD_ZS_CHECK, "... 'enemy' ist Monster/Orc!" );
if (Npc_GetDistToNpc(self, other) < HAI_DIST_ASSESS_MONSTER)
&& C_NpcIsDangerousMonster(self,other)
{
B_FullStop (self);
AI_StartState (self, ZS_AssessMonster, 0, "");
return;
};
};

//######## ...dann muß der Fighter ein MONSTER sein ########
else
{
PrintDebugNpc (PD_ZS_CHECK, "... 'fighter' ist Monster/Orc!" );
if (C_NpcIsDangerousMonster(self,other))
{
PrintDebugNpc (PD_ZS_CHECK, "... 'fighter' ist gefährliches Monster!" );
if (Npc_GetDistToNpc(self, other) < HAI_DIST_ASSESS_MONSTER)
{
B_FullStop (self);
AI_StartState (self, ZS_AssessMonster, 0, "");
return;
};
};
};

//-------- Eindringling ist ein MONSTER ! --------
else
{
PrintDebugNpc (PD_ZS_CHECK, "...Eindringling ist Monster!" );
if (C_NpcIsDangerousMonster(self, other))
{
B_FullStop (self);
AI_StartState (self, ZS_AssessMonster, 0, "");
};
};

@AmProsius
Copy link
Owner

So I suppose to modify the function above and add C_NpcIsOrc next to C_NpcIsMonster.

I agree, but I'd like @i5sue5's opinion on that. He knows more about the alpha and the intentions of the developers I suppose.

@szapp szapp added compatibility: difficult This issue is difficult to make compatible. type: session fix The fix for this issues is persistent across a session. labels Feb 8, 2021
@AmProsius AmProsius removed this from To Do in v1.0.0 Feb 9, 2021
@AmProsius AmProsius added this to To Do in v1.0.0 via automation Feb 10, 2021
@AmProsius AmProsius added this to the v1.0.0 milestone Feb 10, 2021
@AmProsius AmProsius added the provided fix This issue has a fix provided in the comments. label Feb 11, 2021
szapp added a commit that referenced this issue Feb 12, 2021
@szapp szapp moved this from To Do to In Progress in v1.0.0 Feb 12, 2021
v1.0.0 automation moved this from In Progress to Done Feb 12, 2021
AmProsius added a commit that referenced this issue Feb 12, 2021
#78: Humans recognize orcs as enemies
@szapp szapp added this to Replace calls in Fix templates Mar 15, 2021
@szapp szapp added the impl: replace func call This issue requires replacing function calls in the scripts. label Mar 16, 2021
@szapp szapp moved this from Replace function calls to Unsorted in Fix templates Mar 16, 2021
@szapp szapp moved this from Unsorted to NPC function in Fix templates Mar 17, 2021
szapp added a commit that referenced this issue Apr 20, 2021
@szapp szapp removed the validation: required This issue needs validation from one of the validators. label May 14, 2021
@szapp szapp moved this from Modify NPC function to Some NPC Test? (Todo adjust name) in Fix templates Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility: difficult This issue is difficult to make compatible. impl: replace func call This issue requires replacing function calls in the scripts. provided fix This issue has a fix provided in the comments. type: session fix The fix for this issues is persistent across a session.
Projects
Fix templates
NPC manual test (TODO rename)
v1.0.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants