The Mugen Fighters Guild

M.U.G.E.N Central => Development => Topic started by: DNZRX768 on September 15, 2011, 03:00:59 pm

Title: New Methods to activating AI in MUGEN 1.0
Post by: DNZRX768 on September 15, 2011, 03:00:59 pm
I know that there is a new way to activate the AI in MUGEN 1.0.

But I can not find any information about this fact.

Can anyone post a link or give me information about this new way of activating AIs?
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Cybaster on September 15, 2011, 03:04:28 pm
AILevel

"triggerXXX = AiLevel" means CPU controlled, with AILevel going 1 to 8, depending on Difficulty settings in the Options.
"triggerXXX = !AiLevel" means human controlled.

No need for any AI activation shit with variables and all, AiLevel alone does the job.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Rajaa on September 15, 2011, 03:05:31 pm
Could've sworn you asked this before.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: DNZRX768 on September 15, 2011, 03:30:09 pm
Could've sworn you asked this before.

Maybe I have. Maybe I have not.

But thanks Cybaster.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: 2OS on September 19, 2011, 05:01:36 am
Quick way to convert WinMugen AI to 1.0+ is to re-write the variable and that's it jussayin.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: sander on September 21, 2011, 04:00:18 pm
Cool, so it's easier to code now.   :D
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Cybaster on September 21, 2011, 04:03:00 pm
Cool, Sander is back. :D
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: DNZRX768 on September 25, 2011, 07:14:47 pm
AILevel

"triggerXXX = AiLevel" means CPU controlled, with AILevel going 1 to 8, depending on Difficulty settings in the Options.
"triggerXXX = !AiLevel" means human controlled.

No need for any AI activation shit with variables and all, AiLevel alone does the job.

Is it possible that this will work:
Code:
[State -1, Activate AI]
type = VarSet
triggerall = var(59) = 0
triggerall = !isHelper
trigger1 = AiLevel = 8
v = 59
value = 1

This is a streamlined AI activation code when you are too lazy to completely redo your entire AI.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Makkah on September 25, 2011, 09:06:00 pm
That will only activate if the player has their difficulty set to the highest level; simply using Ailevel will do.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: DNZRX768 on September 26, 2011, 01:34:29 am
You mean Ailevel without the equals sign?
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: 2OS on September 26, 2011, 01:36:04 am
Yes.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: DNZRX768 on September 26, 2011, 04:16:18 am
Yes.

Cool, this will greatly simplify the code and make the process of making AI's simpler!  ;D
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Bastard Mami on September 26, 2011, 04:23:26 am
or you could use batch replace
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: DNZRX768 on September 26, 2011, 04:37:11 am
or you could use batch replace
???
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Cybaster on September 26, 2011, 04:47:50 am
He means removing all occurrences of var(59) by batch changing them with your favorite text editor.

You just want all var(59)>=1 triggers to be changed by AiLevel in your CMD, right ?
- Just open your CMD in Notepad/Notepad++/Wordpad/whatever.
- Press Ctrl+H.
- First line : Search for var(59)>=1 (or var(59)=1, dunno which you're using).
- Second line : Replace by AiLevel.
- Press the "Replace All" button.
- You're done.

Time of process = 10 seconds.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: 2OS on September 26, 2011, 04:50:25 am
Because AILevel functions weirdly in Survival Mode, I don't do that, besides the fact that re-writing the var is even simpler, especially if you have .ST's where this var exists.

But, myah.


Anyway, ""AILevel>0"", ""AILevel!=0"", and ""AILevel"" all mean the same thing.

""AILevel=0"" and ""!AILevel"" both mean the same thing.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Cybaster on September 26, 2011, 04:57:57 am
Because AILevel functions weirdly in Survival Mode, I don't do that
What do you mean ?
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Cyanide on September 26, 2011, 05:12:02 am
I think i encountered issues using AILevel > 0, i should retest that but iirc it didn't work or threw an error. Had to use != 0 instead. Must look into that again
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: 2OS on September 26, 2011, 05:54:44 am
Never Mind. Cracked open Mugen.CFG and screwed around with AI Ramping.

In survival mode, AILevel is defaulted to start at level 1, win 2 rounds, level 2, win 2 more rounds, level 3, etcetera until level 8. It basically ignores the option menu's difficulty setting.

To override that entirely I just keep my AI Var, but I might not have to do that anymore since I found this.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Bastard Mami on September 26, 2011, 06:14:50 am
I used to use a changestate based ai that depende on a helper's state, I could simply use the time = X trigger for the change states so changing the value of X meant that the ai wouldtake longer to react, now there is not need to do that since I can use the difficulty directly, I will still need to rewrite the var tree instead of the helper but I think it's very worthy sicne the code will be much easier to mantain now. will do so after having estable versions of mai and samus, tho.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: DNZRX768 on October 02, 2011, 03:04:32 am
Wait, I'm confused.

Does the Ailevel screw up the survival mode difficulty?
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Cyanide on October 02, 2011, 03:13:37 am
No. But AIramp will change how your AI reacts if you use the current trigger to scale it.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Bastard Mami on October 02, 2011, 05:29:24 am
it will act like it is supossed to act so I don't see what's the fucking problem.
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Seravy on October 17, 2011, 10:21:16 pm
Quote
No need for any AI activation shit with variables and all, AiLevel alone does the job.
The variable is necessary though if you want
-To be able to disable your AI under specific conditions. (after the end of the round, or while a certain striker does something you don't want to interrupt by your AI attacking the opponent, etc)
-To be able to activate the AI from code (like when the character can summon a clone that is controlled by AI)
-To be able to activate the AI on a helper with keyctrl (AIlevel returns 0 when used by helpers if I remember well.)
-To be able to adjust difficulty of each level of difficulty individually instead of using a formula.
-To be able to adjust difficulty easily while making progress in testing it.

Also, when removing the variable (which I don't recommend but it's your choice), keep in mind that AI does appear in files other than the .cmd. Guard, jump, other common states, and any attack state that requires player interaction (holding buttons for example) can have AI related code in it.
Additionally, the original Ai might not had exactly 8 difficulty levels or they might not correspond to the levels in the difficulty menu (1 might be normal, 2 might be hard and 3-8 might be ultra/extreme/nightmare etc, while hard should appear at 6+ instead)
In short, if you just replace the variable with AIlevel, don't expect to get a balanced, good AI.

Quote
This is a streamlined AI activation code when you are too lazy to completely redo your entire AI.
Too bad it only activates the AI if the difficulty is set to maximum, and does nothing otherwise. You are better off without an AI if it only has a "Hardest" difficulty level and nothing more reasonable.

More about AI here : http://elecbyte.com/wiki/index.php/AI (http://elecbyte.com/wiki/index.php/AI)
Title: Re: New Methods to activating AI in MUGEN 1.0
Post by: Toonar12X on June 14, 2014, 07:19:06 am
ailevel? that's some really simple thinking there.
the shit worked for me.