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

2 additional AI turn actions #718

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

2 additional AI turn actions #718

wants to merge 2 commits into from

Conversation

mmind
Copy link
Contributor

@mmind mmind commented Jan 15, 2025

AI_WhirlAround is doing the same as ai_turntonpc, just faster.
The script does not contain specific values for whirl-speed, so just use
double of the NPc's turn-speed.

AI_turnaway does what the name implies and turns the back to the npc.
There might be a nicer way to calculate that angle than in my code.

mmind added 2 commits January 15, 2025 08:44
It is supposed to be a faster version of AI_TurnToNpc and seemlingly
used in Gothic 1 in a number of places.

The script does not contain specific values for whirl-speed, so just use
double of the NPc's turn-speed.

This looked quite nice with the guards at the New Camp when drawing a
weapon behind them.
Defined as 'npc' turns away from 'other', just like turnTo
but +180 degrees.

One user is for example the crazy Baal Netbek in the swamp where the
player character ends the dialog with turning away saying
"This guy won't be of help"
auto dx = oth.x-x;
auto dz = oth.z-z;
auto gl = guild();
float step = float(owner.script().guildVal().turn_speed[gl]) * 2;
Copy link
Owner

Choose a reason for hiding this comment

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

Based on video evidence you shared previously:

https://youtu.be/GKpt0Y07gJw?t=1538 ... when talking to Xardas' daemon, which is this sequence from above

Rotation speed appears(not 100% sure) to be the same, but with different animation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhhh ... you're right ... thanks for noticing that discrepancy.

Digging deeper, the animation data does have t_surprise_ccw and t_surprise_cw states and G1 data comes uncompiled with "//WhirlAround" comments intact above those :-) .

Additionally, it looks like in G1 everybody including humans have the whirl animation, where in G2, monsters have it - including the newly added ones - but not humans.

So I'll continue digging :-) .

break;
}
// Not looking quite correct in dialogs, when npc turns around
// Example: Esteban dialog
Copy link
Owner

Choose a reason for hiding this comment

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

Copy-paste?

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