-
Notifications
You must be signed in to change notification settings - Fork 86
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
Fix Gothic 1 melee blocking #630
Conversation
game/graphics/mesh/animation.cpp
Outdated
@@ -263,7 +263,7 @@ bool Animation::Sequence::isInComboWindow(uint64_t t, uint16_t comboLen) const { | |||
|
|||
bool Animation::Sequence::isDefParWindow(uint64_t t) const { | |||
if(data->defParFrame.size()!=2) | |||
return false; | |||
return true; |
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.
Pose::isDefence
uses isDefWindow
, not isDefParWindow
.
Also, after checking the source, I've find out that isDefParWindow
is not in use. Was this change made by mistake or this is some kind of leftover?
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.
isDefWindow
is also used for attack anis which made no sense for me in parade if there's DEF_PAR_FRAME
extra for it. Though this is never used for humans so my plan was to just check the animation and leave def window/parade out completely. Decided to check against isDefParWindow
later in case this is actually used somewhere. At least form testing it felt parade was always blocking.
Did some search now for DEF_WINDOW
and modding wiki gives:
Set a “window” in the animation - an interval of frames during which you need to press the “up” (G1) or the left mouse button (G2) to continue the combo strike.
https://gothic-modding-community.github.io/gmc/zengin/anims/events/#def_window
After testing this PR: It looks to me that in opengothic block is handled conceptually wrong.
My suggesting is to:
case 2 will help with Gothic1 and also makes sense in G2. Not sure about animals in G1 |
Do you mean Vanilla is using |
Yes def-window, sorry. Maybe it's easier to post the code: bool Pose::isDefence(uint64_t tickCount) const {
for(auto& i:lay) {
if(i.bs==BS_PARADE && i.seq->isDefWindow(tickCount-i.sAnim))
return true;
return false;
}
This will fall-thru to jump-back case. Here My assumption that vanilla script is slightly buggy, and engine should interpret such cases as jump-back (aka unconditional block) bool Pose::isJumpBack() const {
for(auto& i:lay) {
if(i.bs==BS_PARADE && i.seq->data->defParFrame.empty())
return true;
}
return false;
} Reason, why I'm thinking that this can be correct way: no name checks + simplicity of code. |
I let animation names as is because it already works and avoids the bug you mentioned. One more reason is waran in G1 uses both |
I've added
to animation solver, to avoid issues with |
Merged, thanks! |
Problem was a character confusion. For G2 the number 0 is used in
T_1HPARADE_0
but in G1 the letter O is used inT_1HPARADE_O
.What I'm unsure about is the
FIXME: seems like name check is not needed
part. Testing shows this is necessary because theDefWindow
can be reached during attack animations. ButDefWindow
refers to a combo window andDefParWindow
should be the correct one to choose. But then again this one is always empty.For now I checked against
DefParWindow
and consider empty window as blocking always enabled during animation.Fixes #557