-
Notifications
You must be signed in to change notification settings - Fork 103
Implement ai_quicklook #743
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
base: master
Are you sure you want to change the base?
Conversation
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.
Try
left a comment
There was a problem hiding this 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: |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
`
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 :-) |
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.