YesNoOk
avatar

Best way to handle AI for ABK-style projectile parry (Read 3297 times)

Started by Dawn de Era, June 07, 2021, 06:56:23 pm
Share this topic:
Best way to handle AI for ABK-style projectile parry
#1  June 07, 2021, 06:56:23 pm
  • ***
  • Come On You Know LGx
  • biblical (yea)
    • USA
    • Skype - eddsworldtrash
    • remixsparta.wix.com/mugensdawn
I'm working on a character that has an Akatsuki Blitzkampf-style parry, and with the AI code that I have built up so far, they seem to attempt to parry a second time after the initial one was successful, even though there is no longer an active hitdef. Is there an effective way to detect if there is still an active hitdef whilst a move is still out? If it helps, I have Inktrebuchet's Helper Projectile detection code within the character.
Re: Best way to handle AI for ABK-style projectile parry
#2  June 09, 2021, 11:19:31 pm
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
You have it attempting to parry on "movetype=A", yeah?

If so, this is part of why people are very adamant about having a "movetypeset=I" to return to idle in every attack state, not only because it's how the games work for proper guardstate timing, but because the AI is dumb and wants to read it as an attack even during the recovery frames.

Imo best way around it is to have a variable to confirm the parry window, like

Trigger1 = p2movetype = A
Trigger1 = enemy, time = 0

and reset it to 0 with

Trigger1 = p2movetype != A
Trigger1 = enemy, time = 0
Trigger2 = [parry state/parry confirm variable]
Re: Best way to handle AI for ABK-style projectile parry
#3  June 10, 2021, 01:56:43 am
  • ***
  • Come On You Know LGx
  • biblical (yea)
    • USA
    • Skype - eddsworldtrash
    • remixsparta.wix.com/mugensdawn
You have it attempting to parry on "movetype=A", yeah?

If so, this is part of why people are very adamant about having a "movetypeset=I" to return to idle in every attack state, not only because it's how the games work for proper guardstate timing, but because the AI is dumb and wants to read it as an attack even during the recovery frames.

Imo best way around it is to have a variable to confirm the parry window, like

Trigger1 = p2movetype = A
Trigger1 = enemy, time = 0

and reset it to 0 with

Trigger1 = p2movetype != A
Trigger1 = enemy, time = 0
Trigger2 = [parry state/parry confirm variable]

This isn't really gonna help in my case, as this only applies for instances where an enemy is attacking once. This does not take into account any multi-hits or projectiles for that matter. I'm asking specifically about multi-hit projectiles. More specifically, how to differentiate single hit ones from multi hit ones.
Last Edit: June 10, 2021, 03:11:37 pm by Dawn de Era
Re: Best way to handle AI for ABK-style projectile parry
#4  June 13, 2021, 07:35:52 am
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
ah no you're right, but there is something else that may of better help.

You're using a parry state, right? Maybe you could use something close to Kn's Just Defend counter. He uses a background var to count the time you press back to confirm a successful JD frame. So if you press back within 6F like in MOTW, then the counter var will confirm it and allow for the guard state to register it as a JD instead of a normal guard.

In MOTW you can mash after a successful JD to JD things like Kain's Ball, and Kn's code can do that pretty well. It's not as exact as how the game works, but how it's implemented could be useful for your multi parry situation


His variables
Code:
; var(7) = ジャストディフェンス受付時間	/ just defense input counter
; var(8) = ジャストディフェンス不能時間 / un-JD-able frame counter
; var(9) = ジャストディフェンス成功 / just defense success

His -2 code
Code:
[State -2, just defense]
type = varSet
trigger1 = command = "JDF"
trigger1 = (command != "release_back") && (command != "release_downback")
trigger2 = StateNo = 52
var(7) = 0

[State -2, just defense]
type = varAdd
trigger1 = 1
var(7) = 1
ignorehitpause = 1

[State -2, just defense]
type = varAdd
trigger1 = var(8) > 0
var(8) = -1
ignorehitpause = 1

[State -2, just defense]
type = varSet
trigger1 = stateNo != [120, 153]
var(9) = 0
ignorehitpause = 1

[State -2, just defense]
type = varSet
trigger1 = moveType = I
trigger1 = (stateNo = 50) || (stateNo = [154, 155])
trigger1 = stateType = A
trigger1 = var(3) = 0
trigger1 = var(8) = 0
trigger1 = var(7) <= 10
var(9) = 1
ignorehitpause = 1

[State -2, just defense]
type = varSet
trigger1 = var(9) = 0
trigger1 = (command = "release_back" || command = "release_downback") && command != "JDF"
var(8) = 4
ignorehitpause = 1

[State -2, no air guard]
type = assertSpecial
trigger1 = 1
flag = NoAirGuard
ignorehitpause = 1

[State -2, hitoverride]
type = hitOverRide
trigger1 = stateType = A
trigger1 = var(9) = 1
attr = SCA, AA, AP
slot = 0
stateNo = 154
time = 1

[State -2, hitoverride]
type = hitOverRide
trigger1 = stateno = [154, 155]
trigger1 = var(9) = 0
attr = SCA, AA, AP
slot = 0
stateNo = 5020
time = 1

The state code
Code:
[State 150, just defense]
type = varSet
trigger1 = time = 0
var(9) = ifelse(((var(7) <= 8) && (var(8) <= 0)), 1, 0)
Re: Best way to handle AI for ABK-style projectile parry
#5  June 13, 2021, 06:28:00 pm
  • ***
  • Come On You Know LGx
  • biblical (yea)
    • USA
    • Skype - eddsworldtrash
    • remixsparta.wix.com/mugensdawn
I should probably mention that ABK's parries function more like counters that negate all damage with projectiles. I already have a functioning ABK parry, I just need to get the AI to understand when it needs to parry a projectile multiple times and when a projectile is clearly not going to land again, i.e. when there are no active hitdefs or the projectile is past the player by a considerable amount.

I apologize if I didn't explain my issue well enough, I was very tired when I opened this thread.
Re: Best way to handle AI for ABK-style projectile parry
#6  June 14, 2021, 01:54:18 am
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
Ah no it's fine, I wish I had more experience with that sort of parry to help you out here.