collapse

Author Topic: AI Help  (Read 831 times)

0 Members and 1 Guest are viewing this topic.

Offline A!

  • Novice Coder
  • Infinity Regular
  • ****
  • Posts: 1318
  • Country: United Kingdom gb
  • Last Login:August 03, 2019, 06:10:28 PM
  • Don't Hate If You Cant Create
AI Help
« on: October 09, 2007, 05:59:26 PM »
Im not sure how ai's work but what do i do if i want a character to do a certain move wene you fight him

if you dont understand ask...


A guy told me one time, "Don't let yourself get attached to anything you are not willing to walk out on in 30 seconds flat if you feel the heat around the corner."

Offline ssjsongoku

  • Initiate
  • **
  • Posts: 23
  • Last Login:February 12, 2008, 08:00:06 PM
    • Email
Re: AI Help
« Reply #1 on: October 09, 2007, 06:10:10 PM »
Try checking out some Ai tutorials...

Offline A!

  • Novice Coder
  • Infinity Regular
  • ****
  • Posts: 1318
  • Country: United Kingdom gb
  • Last Login:August 03, 2019, 06:10:28 PM
  • Don't Hate If You Cant Create
Re: AI Help
« Reply #2 on: October 09, 2007, 06:12:20 PM »
nah..

if its just a basic code than i wont if it aint then i will
A guy told me one time, "Don't let yourself get attached to anything you are not willing to walk out on in 30 seconds flat if you feel the heat around the corner."

Offline ssjsongoku

  • Initiate
  • **
  • Posts: 23
  • Last Login:February 12, 2008, 08:00:06 PM
    • Email
Re: AI Help
« Reply #3 on: October 09, 2007, 06:46:03 PM »
lol Well Here are 2 short tutorials both taken from the FlowaGirl's Code Archive:


Thia is AI activation
Quote
==============================
AI Activation: Command method
==============================
Author: FlowaGirl
flowergirl@cutey.com
http://blargh.i-xcell.com

---------------------------------------------------------------------------
Until Elecbyte decides to add in a trigger that detects
whether the character is controlled by a player or by the
CPU, this code will be used as a workaround.

After implementing this little piece, you are free to program
your character's AI, providing that you know how it's done. Wink

This is amongst the 3 most commonly used methods of AI activation.
I'm not sure who first developed this concept, but it is a popular
belief that Visual Kreations first came up with this, showing a few
creators how it was done.
---------------------------------------------------------------------------

This method uses the CMD file to activate the AI. These commands
are impossible to execute by a player but for the CPU, it is not a
problem. However, it heavily relies that the CPU to execute this as
soon as possible, so it's not a guarantee that your character's AI
will activate immediately. (Which could mean a victory, or a lose.)

Add into your CMD file, several AI activation commands. Generally,
the more commands you put in, the odds of the AI activating more quickly
are increased. Adding in about 20-30 commands will suffice.

Here are some examples:

[Command]
name = "AI1"
command = D, D, D, D
time = 1

[Command]
name = AI2"
command = D, F, B, U
time = 1

The "time = 1" is very important, as the command must be executed in that
amount of time. This is of course, impossible for any human to do.

Next you add this in under StateDef -1. This is used to activate the AI
when the CPU executes one of the commands you've made.

[State -1: VarSet]
type = VarSet
triggerall = (Var(0) != 1)
trigger1 = (Command = "AI1") || (Command = "AI2")
var(0) = 1

Simple, no? =)

And this is AI coding

Quote
AI Programming Tutorial
========================
Author: FlowaGirl
flowergirl@cutey.com
http://blargh.i-xcell.com

---------------------------------------------------------------------------
Programming a character's custom AI is something extra; It's not needed in any
character, but most people seem to want to do it anyway, whether it is to kick
another character's arse, increase the gameplay of the character, or just for
watch mode.
---------------------------------------------------------------------------

When programming an AI, it is recommended that you have completed most of
the character. It will makes things easier, so you won't have to go back and change
anything in the script if you decide to add in more stuff.

Think about the moves for your character; How you want it to use a projectile,
when to guard, and when to attempt to throw the opponent? It's up to you. A well
planned AI is important, as poorly made AI's can end up extremely glitchy.

This example shows how your character will attempt to throw the opponent, only
when it is close to the opponent, and when the opponent is on the floor. I choose
to do the AI programming under StateDef -3, but this can be done under StateDef -2, or
even StateDef -1 of the CMD file.

[State -3: ChangeState]
type = ChangeState
trigger1 = (Var(0) > 0)
trigger1 = (Random <= 499)
trigger1 = (StateType != A) && (Ctrl)
trigger1 = (P2BodyDist X <= 40) && (P2StateType = S)
value = ****

The 1st trigger, "(Var(0) > 0)" means that the move can only be read by the AI.
Remember, the AI Activation sets the value of Var(0) to 1.

2nd trigger, "(Random <= 499)" means that the AI will make an attempt to throw the
opponent, but only half the time. This should be used, so your character
is not too predictable.

3rd trigger, is simply used, so that the character can only make the throw attempt
when he is on the ground, (StateType != A) and is able to do so. (Ctrl)

Finally, the 4th trigger, "(P2BodyDist X <= 40) && (P2StateType = S)" means that
the character will throw the opponent, only when the opponent is close, (P2BodyDist X <= 40)
and when the opponent is on the ground as well. (P2StateType = S)

Given this idea as how it is done, you can come up with your own character AI's.

This should give  you an idea...

Offline A!

  • Novice Coder
  • Infinity Regular
  • ****
  • Posts: 1318
  • Country: United Kingdom gb
  • Last Login:August 03, 2019, 06:10:28 PM
  • Don't Hate If You Cant Create
Re: AI Help
« Reply #4 on: October 10, 2007, 11:01:21 AM »
lol Well Here are 2 short tutorials both taken from the FlowaGirl's Code Archive:


Thia is AI activation
Quote
==============================
AI Activation: Command method
==============================
Author: FlowaGirl
flowergirl@cutey.com
http://blargh.i-xcell.com

---------------------------------------------------------------------------
Until Elecbyte decides to add in a trigger that detects
whether the character is controlled by a player or by the
CPU, this code will be used as a workaround.

After implementing this little piece, you are free to program
your character's AI, providing that you know how it's done. Wink

This is amongst the 3 most commonly used methods of AI activation.
I'm not sure who first developed this concept, but it is a popular
belief that Visual Kreations first came up with this, showing a few
creators how it was done.
---------------------------------------------------------------------------

This method uses the CMD file to activate the AI. These commands
are impossible to execute by a player but for the CPU, it is not a
problem. However, it heavily relies that the CPU to execute this as
soon as possible, so it's not a guarantee that your character's AI
will activate immediately. (Which could mean a victory, or a lose.)

Add into your CMD file, several AI activation commands. Generally,
the more commands you put in, the odds of the AI activating more quickly
are increased. Adding in about 20-30 commands will suffice.

Here are some examples:

[Command]
name = "AI1"
command = D, D, D, D
time = 1

[Command]
name = AI2"
command = D, F, B, U
time = 1

The "time = 1" is very important, as the command must be executed in that
amount of time. This is of course, impossible for any human to do.

Next you add this in under StateDef -1. This is used to activate the AI
when the CPU executes one of the commands you've made.

[State -1: VarSet]
type = VarSet
triggerall = (Var(0) != 1)
trigger1 = (Command = "AI1") || (Command = "AI2")
var(0) = 1

Simple, no? =)

And this is AI coding

Quote
AI Programming Tutorial
========================
Author: FlowaGirl
flowergirl@cutey.com
http://blargh.i-xcell.com

---------------------------------------------------------------------------
Programming a character's custom AI is something extra; It's not needed in any
character, but most people seem to want to do it anyway, whether it is to kick
another character's arse, increase the gameplay of the character, or just for
watch mode.
---------------------------------------------------------------------------

When programming an AI, it is recommended that you have completed most of
the character. It will makes things easier, so you won't have to go back and change
anything in the script if you decide to add in more stuff.

Think about the moves for your character; How you want it to use a projectile,
when to guard, and when to attempt to throw the opponent? It's up to you. A well
planned AI is important, as poorly made AI's can end up extremely glitchy.

This example shows how your character will attempt to throw the opponent, only
when it is close to the opponent, and when the opponent is on the floor. I choose
to do the AI programming under StateDef -3, but this can be done under StateDef -2, or
even StateDef -1 of the CMD file.

[State -3: ChangeState]
type = ChangeState
trigger1 = (Var(0) > 0)
trigger1 = (Random <= 499)
trigger1 = (StateType != A) && (Ctrl)
trigger1 = (P2BodyDist X <= 40) && (P2StateType = S)
value = ****

The 1st trigger, "(Var(0) > 0)" means that the move can only be read by the AI.
Remember, the AI Activation sets the value of Var(0) to 1.

2nd trigger, "(Random <= 499)" means that the AI will make an attempt to throw the
opponent, but only half the time. This should be used, so your character
is not too predictable.

3rd trigger, is simply used, so that the character can only make the throw attempt
when he is on the ground, (StateType != A) and is able to do so. (Ctrl)

Finally, the 4th trigger, "(P2BodyDist X <= 40) && (P2StateType = S)" means that
the character will throw the opponent, only when the opponent is close, (P2BodyDist X <= 40)
and when the opponent is on the ground as well. (P2StateType = S)

Given this idea as how it is done, you can come up with your own character AI's.

This should give  you an idea...


thanks for the help but i found out what i wanted
A guy told me one time, "Don't let yourself get attached to anything you are not willing to walk out on in 30 seconds flat if you feel the heat around the corner."

Offline Eddmug

  • Initiate
  • **
  • Posts: 20
  • Last Login:August 30, 2011, 06:55:27 PM
Re: AI Help
« Reply #5 on: December 06, 2009, 11:41:49 AM »
what did you find put cause there are some characters i want to make stronger and others weaker

Offline Alexziq

  • Infinite Loyalist
  • *****
  • Posts: 2624
  • Last Login:November 10, 2017, 01:10:16 PM
    • Email
Re: AI Help
« Reply #6 on: December 06, 2009, 12:48:12 PM »
what did you find put cause there are some characters i want to make stronger and others weaker

Well it depends if the character has an AI system in place or not. If there is one you can increase the frequency of a move pretty easily. If it doesnt have one then it depends on how involved in code you want to get. If there is no AI then youll have to create an additional AI command for almost all of the moves. It's not all that hard, but you have to be familiar with code.

For the average Fighter Factory fiddler this is how you can tweek the frequency of an AI command.

[State -1]
type = ChangeState
triggerall = (roundstate = 2) && (var(59) != 0)
triggerall = (Ctrl) && (statetype != A)
triggerall = (prevstateno != 5120)
trigger1 = (power >= 1000) && (random = [0,300])
value = 8999


To make a move more likely to happen ajust this number higher

trigger1 = (power >= 1000) && (random = [0,600])

To decrease the likelyhood the move will trigger do this

trigger1 = (power >= 1000) && (random = [0,100])


Offline Eddmug

  • Initiate
  • **
  • Posts: 20
  • Last Login:August 30, 2011, 06:55:27 PM
Re: AI Help
« Reply #7 on: December 09, 2009, 11:41:58 AM »
UMM oh boy....lol ok i want to get this and i apologize for me being mugen illiterate but lets say I want superman to be more aggresive...i want him to use his freeze breath and heat vision more often i know it would be located in the cns file or cmd file but do i need fighter factory to make him use his specials more often?

And two of my characters MVC2_Storm and MVC2_MBison manage to fly all the way up where i cant reach their asses how do i change that. if you know what i mean.

Thanks in advance

Offline Alexziq

  • Infinite Loyalist
  • *****
  • Posts: 2624
  • Last Login:November 10, 2017, 01:10:16 PM
    • Email
Re: AI Help
« Reply #8 on: December 09, 2009, 12:21:47 PM »
UMM oh boy....lol ok i want to get this and i apologize for me being mugen illiterate but lets say I want superman to be more aggresive...i want him to use his freeze breath and heat vision more often i know it would be located in the cns file or cmd file but do i need fighter factory to make him use his specials more often?

And two of my characters MVC2_Storm and MVC2_MBison manage to fly all the way up where i cant reach their asses how do i change that. if you know what i mean.

Thanks in advance

The CMD file is where you will find these. You need to find out what state the move is you want to tweek, and then find the AI code by searching the state# in the cmd. If you want a character to use the move more often then increase the number of the random.

Your issues with Storm, and Bison arent AI releated. That is more an issue with the code, and I don't have those characters to tell you what the problem is, and it's not something you can learn to fix overnight. Coding takes some people years to figure out.

Offline Eddmug

  • Initiate
  • **
  • Posts: 20
  • Last Login:August 30, 2011, 06:55:27 PM
Re: AI Help
« Reply #9 on: December 10, 2009, 09:55:24 AM »
Thanks

Offline Alexziq

  • Infinite Loyalist
  • *****
  • Posts: 2624
  • Last Login:November 10, 2017, 01:10:16 PM
    • Email
Re: AI Help
« Reply #10 on: December 10, 2009, 12:27:53 PM »
There is one thing you could do that might help the flying problem.

Again youd need to find the state # that the flying is coded under. You could control F in the CNS, and look for fly, flight, or arial mode.

If you could find the state you could then delete the AI code, or you could lower the random so the computor barely ever uses the move.

Heres where it gets tricky if you dont know what youre doing.  If you delete that AI code altogether you want to make sure and find the command that has (random = [?,??]) this is the AI code.

You dont want to delete the normal command because that will make the character crash.

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

Golden Axe Returns by gokudo99
[Today at 03:59:31 AM]


D2TD VS Showcase Thread by D2TD
[November 17, 2024, 08:36:39 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]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by ExShadow
[November 02, 2024, 04:54:41 AM]


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


Rooftop Skyline(1.1 Only/AIGS) by Vegaz by LightFlare
[October 21, 2024, 12:13:37 PM]


Secluded Base(1.1 Only/AIGS) by Vegaz by LightFlare
[October 17, 2024, 01:21:06 PM]

* 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