collapse

Author Topic: How to make AI react to spam attacks  (Read 849 times)

0 Members and 1 Guest are viewing this topic.

Offline mulambo

  • Contributor
  • ****
  • Posts: 345
  • Country: Italy it
  • Last Login:July 01, 2023, 08:06:41 PM
  • Godsent Devil
    • Website
How to make AI react to spam attacks
« on: May 17, 2017, 07:06:36 PM »
I'd like to know how to code a decent AI system that actually reacts to spammers.
Reason  is that I want my game characters to actually recognize the opponent's cheap tricks and avoid them (possibly with a breaking move or something like that). For example: imagine the AI character receiving the same punch or the same move. I want to force the player to change his fighting strategy according to a smarter-reacting CPU.
Any good coding tip to share?



Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: How to make AI react to spam attacks
« Reply #1 on: May 19, 2017, 01:46:51 AM »
Set aside a helper that checks opponent states when his parent is hit. Use a bunch of vars. Increment values in a different variable each time your parent is hit and the opponent state matches

For eg

type = varset
trigger1 = parent, movetype = H
trigger1 = parent, time = 1
trigger1 = var(0) = 0
v = 0
value = p2stateno

type = varadd
trigger1 = parent, movetype = H
trigger1 = parent, time = 1
trigger1 = p2stateno = var(0)
v = 1
value = 1

Use the helpers values to determine if an attack is being spammed and hitting. You can go smarter and detect whether you were hit crouching or what with more vars. Then use all of that to decide what countermeasures you want to take. Kamekaze does this sort of thing in his AI already, i've never had the patience for it.

If you want to get smarter you can hold all sorts in a single variable with bitwise shifting to determine what you were doing when you were attacked, whether you were in the air, attacking etc etc without using up multiple vars for a single move

I can't explain bitwise shifting, i know the logic, i've just never had a reason to use it. MFG has some threads on it though.

Offline mulambo

  • Contributor
  • ****
  • Posts: 345
  • Country: Italy it
  • Last Login:July 01, 2023, 08:06:41 PM
  • Godsent Devil
    • Website
Re: How to make AI react to spam attacks
« Reply #2 on: May 23, 2017, 04:58:10 PM »
hmmm I feared there was the need to study variables.
one day, maybe, one day. still a bit too complex stuff for me.

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

D2TD VS Showcase Thread by D2TD
[November 24, 2024, 09:12:03 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by LightFlare
[November 21, 2024, 09:44:09 PM]


Terrordrome: Rise of the Boogeymen Extended Version ( jeepers creepers) version by leonardo
[November 19, 2024, 10:22:47 PM]


Hill of the Nameless(1.1 Only) by Vegaz by LightFlare
[November 19, 2024, 10:50:39 AM]


Golden Axe Returns by gokudo99
[November 19, 2024, 03:59:31 AM]


Barkley Shut Up and Jam! Stages by Vegaz by LightFlare
[November 12, 2024, 11:26:21 AM]


[BOR] _Avengers United Battle Force_ by O Ilusionista
[November 11, 2024, 12:35:24 PM]


Eternal Lament Stage 1.1 & 1.0 by O Ilusionista
[November 11, 2024, 12:34:54 PM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[November 11, 2024, 07:00:56 AM]


Spooky House(1.1 Only/AIGS) by Vegaz by LightFlare
[October 31, 2024, 11:31:36 AM]

* IMT Calendar

November 2024
Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 [26] 27 28 29 30

SimplePortal 2.3.5 © 2008-2012, SimplePortal