collapse

Author Topic: AI coding the proper Way?  (Read 548 times)

0 Members and 1 Guest are viewing this topic.

Offline DEMONKAI

  • The Visionary and IMT's
  • Contributor
  • ****
  • Posts: 8335
  • Country: United States us
  • Last Login:October 11, 2022, 09:44:18 PM
  • Never limit your vision as a creator!!
    • DTHECHEMIST
    • D THE CHEMIST
    • Demonkai's Mugen
AI coding the proper Way?
« on: May 02, 2010, 03:23:17 AM »
Ok as you guys know i released that 1.0 Beta of Awakened Terry a while ago. I wanted to get some very early feedback on it for particular reasons. Fallen Angel and some others were giving tips here n there...

Sadly my pc crashed as some of you know so I lost all my coding notes and tips ive ever acquired over the years so me finishing The project totally and officially has been pushed back.

Anyway i wanted to Ask Fallen Angel or someone about how again it works with AI.

I know he mentioned before that My AI trigger against a human apponent was shut off in the 2nd round er somethin??

I have been just free styling and experimenting that whole time so i really dont have everything nailed yet but i have an idea how it works to get my char to be agressive against CPU apponents...


In short, what The proper code set up for example to have the AI trigger on "Both rounds" Against a Human Apponent?

I would like to fix that.


Post Merge: May 02, 2010, 03:28:40 AM
heres the code in my Cns file:

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------;
;                               [ATERRY CVS AI ]                               ;
;---------------------------------------------------------------------------;
[statedef -2 ]

[State -2:          Check IA]
type                = Helper
triggerall          = !numHelper(9741) = 0
trigger1            = var(59) && RoundState = 2
name                = "The awakening"
id                  = 9741
stateno             = 9741
pos                 = 999,999
helpertype          = normal
keyctrl             = 1

[State -2:          Random Var(500)]
type                = VarRandom
trigger1            = 1
range               = 999999
v                   = 1
ignorehitpause      = 1

[State -2, Stop AI]<------------------I ASSUME THIS MAY BE THE ISSUE RIGHT?
type=varset
trigger1= var(59)!=0
trigger1= roundstate!=2 || !alive
var(59)=0
ignorehitpause=1

from experimenting so much then taking a break then looking back with new notes im begining to see the stuff i did wrong or didnt do right but that "Stop AI" im guessing thats what Fallen Angel was talking about? I mean i can use hints but that doesnt mean imma get it right away. ill have to be flat out told "This shouldnt look like this, It should look like that"...thats how i learn better. Ill try it fail. Show the error and then all i need is the right answer haha...

anyway i wanna finish this project. So much he hasnt done to em.

Thanks forum
« Last Edit: May 02, 2010, 03:28:40 AM by DEMONKAI »


Lots and lots of supers so f*ckin what

HAIL CROM!!

Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: AI coding the proper Way?
« Reply #1 on: May 02, 2010, 11:17:57 AM »

Offline DEMONKAI

  • The Visionary and IMT's
  • Contributor
  • ****
  • Posts: 8335
  • Country: United States us
  • Last Login:October 11, 2022, 09:44:18 PM
  • Never limit your vision as a creator!!
    • DTHECHEMIST
    • D THE CHEMIST
    • Demonkai's Mugen
Re: AI coding the proper Way?
« Reply #2 on: May 02, 2010, 01:07:12 PM »
Lots and lots of supers so f*ckin what

HAIL CROM!!

Offline Fallen_Angel

  • Global Moderator (out of the office)
  • *****
  • Posts: 1358
  • Last Login:July 04, 2012, 03:11:05 PM
    • Email
Re: AI coding the proper Way?
« Reply #3 on: May 03, 2010, 09:04:53 PM »
I kind of remember our conversation...what I told you was, that you were using parts of differents AI activation method , the only one that you used properly was the immposible commands method , and you had some issues because you wanted to add more moves, so I suggested, that you took off  that AI activation method, and use the winane AI


sig made by shullbocka

Offline DEMONKAI

  • The Visionary and IMT's
  • Contributor
  • ****
  • Posts: 8335
  • Country: United States us
  • Last Login:October 11, 2022, 09:44:18 PM
  • Never limit your vision as a creator!!
    • DTHECHEMIST
    • D THE CHEMIST
    • Demonkai's Mugen
Re: AI coding the proper Way?
« Reply #4 on: May 04, 2010, 06:11:12 AM »
I kind of remember our conversation...what I told you was, that you were using parts of differents AI activation method , the only one that you used properly was the immposible commands method , and you had some issues because you wanted to add more moves, so I suggested, that you took off  that AI activation method, and use the winane AI

Hmm ok so pretty much i have to get rid of whats in the "Cns" state. I have the winane AI in the helper state.
But anyway I do want to get the CPU to react properly to a Human Apponent. That code above you see, Is that the reason why the char is not responding well? btw i have been changing things up since then
Lots and lots of supers so f*ckin what

HAIL CROM!!

Offline Alexziq

  • Infinite Loyalist
  • *****
  • Posts: 2624
  • Last Login:November 10, 2017, 01:10:16 PM
    • Email
Re: AI coding the proper Way?
« Reply #5 on: May 04, 2010, 10:27:21 AM »
Basically just use one type of AI.

I think the AI from the IMT template is the easiest to use. Then you just have to customize the AI commands to each move. Alter the random to increase, or decrease the likelyhood the computer will choose the move. Depending on the move you may also want to increase or decrease the move based on p2 distance. Obviously for a grab move you only want the pc to do it when close, where certain projectiles you want done from a little distance.

Its pretty easy once you start playing with it. look for lines in the command like so

trigger1 = enemynear, p2dist y <= -10 && p2bodydist X < 180 && random <= 300

try altering, and playing with these to see how the computer reacts in watch mode. After you play with it for a while you start to pick up on what works.

Offline DEMONKAI

  • The Visionary and IMT's
  • Contributor
  • ****
  • Posts: 8335
  • Country: United States us
  • Last Login:October 11, 2022, 09:44:18 PM
  • Never limit your vision as a creator!!
    • DTHECHEMIST
    • D THE CHEMIST
    • Demonkai's Mugen
Re: AI coding the proper Way?
« Reply #6 on: May 04, 2010, 12:19:29 PM »
Basically just use one type of AI.

I think the AI from the IMT template is the easiest to use. Then you just have to customize the AI commands to each move. Alter the random to increase, or decrease the likelyhood the computer will choose the move. Depending on the move you may also want to increase or decrease the move based on p2 distance. Obviously for a grab move you only want the pc to do it when close, where certain projectiles you want done from a little distance.

Its pretty easy once you start playing with it. look for lines in the command like so

trigger1 = enemynear, p2dist y <= -10 && p2bodydist X < 180 && random <= 300

try altering, and playing with these to see how the computer reacts in watch mode. After you play with it for a while you start to pick up on what works.

Thanks for the input AL 8) Yeh the thing is im familiar with messing with that configuration you just showed, hence the reason why my beta is fairly agressive against another cpu :P. But i failed at making em the same way against a "Human apponent" o.O#. Fallen Angel mentioned to me that after he tried out my beta he noticed that it wasnt fighting too well against him (being the human apponent). So i wanted to know exactly what i missed and did wrong because he said the AI was cut off during the 2nd round er somethin? ??? Thats what i wanted to be clear on. haha im not too hip to this AI stuff fully yet to pin point AI issues yet @^@.

Dunno if u tried Awakened Terry out yet but you probably will see what hes sayin too to give me another insight

just let me know AL :)
Lots and lots of supers so f*ckin what

HAIL CROM!!

Offline Alexziq

  • Infinite Loyalist
  • *****
  • Posts: 2624
  • Last Login:November 10, 2017, 01:10:16 PM
    • Email
Re: AI coding the proper Way?
« Reply #7 on: May 04, 2010, 12:44:51 PM »
I think what he was getting at is that youre using multiple AI activation. Thats why I suggested converting it all to one. I would suggest altering it alltogether to the IMT style, or you could just do winane as FA suggests.

Offline DEMONKAI

  • The Visionary and IMT's
  • Contributor
  • ****
  • Posts: 8335
  • Country: United States us
  • Last Login:October 11, 2022, 09:44:18 PM
  • Never limit your vision as a creator!!
    • DTHECHEMIST
    • D THE CHEMIST
    • Demonkai's Mugen
Re: AI coding the proper Way?
« Reply #8 on: May 04, 2010, 01:17:44 PM »
I think what he was getting at is that youre using multiple AI activation. Thats why I suggested converting it all to one. I would suggest altering it alltogether to the IMT style, or you could just do winane as FA suggests.

Ooh...had ta think back a bit :-[. Yeh i think i mixed n matched stuff up as i was going along. ight cool AL. i see what ya mean  :)
ill look back over my stuff again ::salute::
Lots and lots of supers so f*ckin what

HAIL CROM!!

Offline Fallen_Angel

  • Global Moderator (out of the office)
  • *****
  • Posts: 1358
  • Last Login:July 04, 2012, 03:11:05 PM
    • Email
Re: AI coding the proper Way?
« Reply #9 on: May 04, 2010, 08:58:10 PM »
yeah you mixed some stuff.

Also I told you that your AI is good, but it can be very predictable (so I suggest to use the trigger random, and code the Ai to be able to use different moves in the same circunstances)


sig made by shullbocka

Offline DEMONKAI

  • The Visionary and IMT's
  • Contributor
  • ****
  • Posts: 8335
  • Country: United States us
  • Last Login:October 11, 2022, 09:44:18 PM
  • Never limit your vision as a creator!!
    • DTHECHEMIST
    • D THE CHEMIST
    • Demonkai's Mugen
Re: AI coding the proper Way?
« Reply #10 on: May 04, 2010, 09:08:36 PM »
yeah you mixed some stuff.

Also I told you that your AI is good, but it can be very predictable (so I suggest to use the trigger random, and code the Ai to be able to use different moves in the same circunstances)

Ah ok 8). Ill mess with that a bit more then now. cool cool. This is the feedback from the authors i needed. Thanks peeps :)
Lots and lots of supers so f*ckin what

HAIL CROM!!

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

Street Fighter 1 Ultimate Ryu by ELECTRO
[May 22, 2024, 03:58:25 PM]


China Town (Revenge of Shinobi) by Lord_Enemil
[May 22, 2024, 03:02:10 PM]


Neon Light Force Demo by Uche_of_IMT
[May 22, 2024, 10:21:37 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by Uche_of_IMT
[May 21, 2024, 11:50:20 PM]


The Spider release + Spider-Man game by kobun
[May 21, 2024, 02:05:24 AM]


Let's all try it together! Yazawanainn gose breakdancing in MUGEN! by GTFoxN6Y
[May 18, 2024, 05:00:14 PM]


[WIP] Pocket Dimensional Clash 2 by O Ilusionista
[May 18, 2024, 11:17:34 AM]


Classic VS : Athena by ELECTRO
[May 15, 2024, 01:25:51 PM]


D2TD VS Showcase Thread by D2TD
[May 12, 2024, 10:20:11 AM]


Ballroom Hallway (1.1 Only/AIGS) by Vegaz by LightFlare
[May 09, 2024, 11:53:48 AM]

* IMT Calendar

May 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 31

SimplePortal 2.3.5 © 2008-2012, SimplePortal