Skip to content

Conversation

@mmind
Copy link
Contributor

@mmind mmind commented Feb 15, 2025

The quicklook function is meant to have the Npc just move its head to the player for two seconds.

Testcase in vanilla Gothic 1 was at the exchange place, while Diego walks back to the old camp. Stand next to where he is walking and pick up one of the berries, arrows, etc. Diego will continue walking but turn his head over for those 2 seconds.

So the implementation does the same, not changing the currentLookAtNpc but storing the temporary one in a separate variable for the duration of the action. That way this cinematic should not influence any other parts or save/load mechanisms.

The quicklook function is meant to have the Npc just move its head to the
player for two seconds.

Testcase in vanilla Gothic 1 was at the exchange place, while Diego walks
back to the old camp. Stand next to where he is walking and pick up one of
the berries, arrows, etc. Diego will continue walking but turn his head
over for those 2 seconds.

So the implementation does the same, not changing the currentLookAtNpc
but storing the temporary one in a separate variable for the duration
of the action. That way this cinematic should not influence any other
parts or save/load mechanisms.
Copy link
Owner

@Try Try left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not changing the currentLookAtNpc but storing the temporary ... not influence any other parts or save/load mechanisms.

Unfortunately, you still need to store those in save file, as it's a part of npc state. Here opengothic is somewhat different to vanilla, by keeping as much state of the game as possible in the save.

case AI_OutputSvmOverlay:
aiQueueOverlay.pushBack(std::move(a));
break;
case AI_QuickLook:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a partial workaround for:
#523

My understanding, that some commands, such as AI_QuickLook has to run in dedicated queue, with own command-level tracking

Npc* currentOther =nullptr;
Npc* currentVictim =nullptr;

Npc* quickLookNpc=nullptr;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be mutually exclusive with currentLookAtNpc and occupy same variable?

case AI_QuickLook:
// QuickLook is supposed to last for 2 seconds
// and should not interrupt other AI actions like walking
quickLookEnd = owner.tickCount()+2000;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State change should always occur when executing Npc::nextAiAction. Since AI_QuickLook should overlap with walking, aiQueueOverlay has to be utilized.
`

@mmind
Copy link
Contributor Author

mmind commented Feb 21, 2025

not changing the currentLookAtNpc but storing the temporary ... not influence any other parts or save/load mechanisms.

Unfortunately, you still need to store those in save file, as it's a part of npc state. Here opengothic is somewhat different to vanilla, by keeping as much state of the game as possible in the save.

ha, you're right ... just checked by causing a quicklook and saving while it is ongoing. After loading, Diego keeps the turned head forever - he must get quite the neck-pain from that :-)

@Try Try marked this pull request as draft July 24, 2025 20:00
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.

2 participants