YesNoOk
avatar

"All Attacks Detection" Algorithm Issue (Read 1040 times)

Started by Fighting Toys Freak, March 04, 2019, 06:08:58 pm
Share this topic:
"All Attacks Detection" Algorithm Issue
New #1  March 04, 2019, 06:08:58 pm
  • **
  • New changes, new me!
Hey all,

I have been attempting to implement a detection algorithm that enables the player to modify its movements for dodging attacks dished out by its opponent(s). I have incorporated a reversal state controller in an effort to accomplish this goal. Furthermore, I have added the "Dodge v Dodge" string alongside the "priority =" parameter under the "HitDef" state controller to avoid opponents from being interrupted of their attacks, however to no avail. Here are examples of my algorithm:
Spoiler, click to toggle visibilty

Spoiler, click to toggle visibilty

Spoiler, click to toggle visibilty

How should I modify this algorithm to produce its desired effect?
UPDATE - Think of this endeavor like creating a sensory algorithm for the player: if an opponent's movetype is A and the sensory helper (invisible) does get triggered off, then the player will not react; otherwise, the player would act in defense before the attacking opponent can make contact with the player.

All suggestions will be considered.
Last Edit: March 08, 2019, 04:04:47 pm by Fighting Toys Freak
Re: "All Attacks Detection" Algorithm Issue
#2  March 06, 2019, 11:38:43 pm
  • ***
  • Glorified Verison of a Pellet Gun
This is quite an interesting way to handle this. I'm not entirely sure I understand it, but

I'm not entirely sure what the HitDef accomplishes. However, I think it completely works at odds with the ReversalDef. Having trigger1 = time = 0 on the ReversalDef means that, as soon as the HitDef activates, the ReversalDef goes away until you reach time = 0 again. And that's even if the ReversalDef is sticking around at all, considering I think you need a Time parameter to make it last more than one frame.

I think the main answer to your problem, though, is that you're using ReversalDef and not HitOverride. ReversalDef is like a HitDef in that it only works when you're MoveType is A. HitOverride would require some different coding but would actually produce results when hit while in MoveType = I

I also just think you could scrap this entire thing and use
Code:
trigger4 = enemynear,hitdefattr=SCA,NA,SA,HA && inguarddist
in your AI changestate but I'll let you be the judge on whether that works for you. (Assuming that's not a version thing. I have no idea.)
Re: "All Attacks Detection" Algorithm Issue
New #3  March 08, 2019, 01:41:57 am
  • **
  • New changes, new me!
Thanks for the advice, DrKelexo.

In regards to using the "HitOverride" state controller instead of the "ReversalDef" state controller, I cannot do that: you see, I have been attempting to prevent any opponent's attack from being interrupted by the helper because the helper will become affected by the opponent's attack rather than the player. Instead, because the helper is invisible, its "HitDef" state controller is only intended to cause the attacking opponent or opponent's helper to "dodge" their "HitDef" state controllers and, consequently, send the player's helper state to its reversal state, i.e. state #904 (see previous). Hence, the detection algorithm is not intending to interrupt the opponent's attack. This way, the attacking opponent or opponent's helper still has the chance to make contact with the actual player.

Sorry for the wall of text if you find it as confusing.

So, could anybody advise me as to how I can achieve this clarified, desire effect while maintaining the "ReversalDef" state controller?

UPDATE - Think of this endeavor like creating a sensory algorithm for the player: if an opponent's movetype is A and the sensory helper (invisible) does get triggered off, then the player will not react; otherwise, the player would act in defense before the attacking opponent can make contact with the player.
Last Edit: March 08, 2019, 04:05:18 pm by Fighting Toys Freak
Re: "All Attacks Detection" Algorithm Issue
#4  March 08, 2019, 12:22:32 pm
  • *****
  • Shame on you!
    • USA
Have you tested this against moves that use HitOnce? I feel like it'd mess some things up.

I'm honestly getting confused on what player you refer to throughout your posts. "Player's helper" is P1?? So if Player = P1 what's  "opponent's attack rather than the player" player here? And do you mean the Opponent's Helper's attack? Because the P2's attack could just be a SLP or any other basic.
vVv Ryuko718 Updated 10/31/22 vVv
Re: "All Attacks Detection" Algorithm Issue
New #5  March 08, 2019, 02:13:13 pm
  • **
  • New changes, new me!
Thanks for your questions, Odb718.

To clarify furthermore, the player's helper refers to the helper with the "ReversalDef" algorithm in question; the opponent's attack refers to the attacking opponent, and the opponent's helper...well...refers to the attacking opponent's helper. That is the extent to which I can simplify the variables at play; I hope that my explanation dispels your confusion.

Now, about testing the algorithm against an opponent's attack whose "HitDef" state controller possesses a "hitonce" parameter, ...yeah...I have already done so. The problem is that the mentioned "HitDef" state controller of the player's helper has been interrupting any attacking opponent whose moves use the "HitOnce = 1" parameter.

UPDATE - Think of this endeavor like creating a sensory algorithm for the player: if an opponent's movetype is A and the sensory helper (invisible) does get triggered off, then the player will not react; otherwise, the player would act in defense before the attacking opponent can make contact with the player.

So, could anybody suggest as to how can I prevent the interruption from happening in such instances, while implementing the desired effect(s) in question?
Last Edit: March 08, 2019, 04:05:37 pm by Fighting Toys Freak