YesNoOk
avatar

AI guards when enemy isn't attacking (Read 13310 times)

Started by WastedCoder, August 09, 2024, 03:48:39 pm
Share this topic:
AI guards when enemy isn't attacking
#1  August 09, 2024, 03:48:39 pm
  • **
    • Ukraine
Hello.
For whatever reason, AI keeps guarding while enemy is charging. Until enemy leaves charging state, AI keeps guarding non-stop. (hundreds of ticks)
And it happens to different enemys. I've checked those characters' code, and I didn't find anything that is active at the time they're charging with 'movetype =A'. Everything is "movetype = I". I tried removing guard changestate fully (didn't help), tried putting back original guarding code in common.cns, but it doesn't solve the problem(with and without changestate to guard). If put the same code into a different character, this same issue happens.
At first I thought it was inguarddist trigger, maybe he doesn't function right, so I tried to change them all to 'enemynear,movetype = A'... didn't work.
Do you have any idea how to solve it?
And I don't have any other changestates that lead to 120-155. I've checked.
I've also tried forcing AI out of Guard state after X ticks pass, but he returns to it asap.
Maybe there's a workaround for this kind of thing?

Changestate:
Spoiler, click to toggle visibilty

Guard code:
Spoiler, click to toggle visibilty
Last Edit: August 09, 2024, 04:22:45 pm by WastedCoder
Re: AI guards when enemy isn't attacking
#2  August 09, 2024, 05:14:53 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Hard to say but you can narrow it down. In which state does the char freeze? Does state time advance while the char is in that state?

Also the -1 code could use inguarddist.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: AI guards when enemy isn't attacking
#3  August 09, 2024, 05:48:25 pm
  • **
    • Ukraine
Hard to say but you can narrow it down. In which state does the char freeze? Does state time advance while the char is in that state?

Also the -1 code could use inguarddist.

Thanks for ur reply.

in -1 it had inguarddist always. I forgot to change it back after testing my assumption that something is wrong with inguarddist trigger.
It happens when enemy enters state 500(charging state). Mostly, characters of this style have this state as a charging state.
My AI, after enemy enters state 500, starts guarding and stays like this right until enemy stops charging.

I tried deleting enemy's helpers(all that exist during charge) but that didn't help. If it isn't guarding, my AI can do other things, they should, when enemy attacks, like dashing back, walking back etc.

I will try detecting enemy's charging state and somehow prevent my AI from guarding.
Re: AI guards when enemy isn't attacking
#4  August 23, 2024, 05:54:58 am
  • ****
check your enemy .

it he/her create invisible helper in attack mode while charging?
this is kinda cheating
Re: AI guards when enemy isn't attacking
#5  August 23, 2024, 01:06:35 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
why would a power charge move be marked as movetype=A?
The AI blocks when the enemy is performing an attack, that is movetype=A.

Use the correct movetype flags. That's all
Use Stateypeset if you need to change the type during a state.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: AI guards when enemy isn't attacking
#6  August 24, 2024, 09:48:03 am
  • **
    • Ukraine
why would a power charge move be marked as movetype=A?
The AI blocks when the enemy is performing an attack, that is movetype=A.

Use the correct movetype flags. That's all
Use Stateypeset if you need to change the type during a state.

Yep, this actually was the case... enemy had statetypeset to movetype = A :c
And since some people used this same code in their characters, the bug got carried over to other chars... I didn't notice that statetypeset.... :c