HOLD ON! | |
This article has been considered a stub. Please help the MUGEN Database by expanding this article. |
Artificial Intelligence (commonly abbreviated to A.I.) is a set of executable instructions given to a computer for the purpose of having it emulate any number of logical thought processes. In M.U.G.E.N and fighting games where A.I. programming is present, a character that is being controlled by the computer may interchangeably be referred to as either "the CPU" or "the A.I.", though moreso the former than the latter in the case of established fighting games, usually due to it being a game's official terminology when referring to computer-controlled opponents.
There are two different forms of A.I. considered to be present in the M.U.G.E.N environment; the first is the engine's "default" internal A.I. process that attempts to emulate a basic form of human input logic, and the second refers to "custom" creator-made A.I.s that are coded directly into a character's states. Strictly speaking, any character that allows the computer to perform actions through its states has an A.I., but for the sake of avoiding confusion over terms, only characters that don't piggyback off the human commands for their A.I. and instead have their own dedicated code for the computer to make exclusive use of are stated to have custom A.I.s.
Basic Principles[]
An A.I. will perform actions in identical fashion to how a human performs them, wherein a changestate controller to the respective action will be executed by M.U.G.E.N's state processor if all of the arguments in one of its trigger sets returns true, and if more than one sets of triggers returns true across multiple changestates, then the first one processed will dictate a character's next action. It is not a requirement for the A.I. triggers to be coded into the same changestates that the human inputs are tied to, so long as there is a changestate in a state that's always being processed that the A.I. can utilise, it will perform the action specified in that changestate when one of its trigger sets returns true.
AILevel[]
AILevel is a trigger introduced in M.U.G.E.N 1.0 that returns the value of M.U.G.E.N's current difficulty level as an argument when a character is under the computer's control, varying between the values 1 to 8, and 0 when they are under a player's control. AILevel is primarily used to restrict a set of triggers in a command changestate for either a human player's or the computer's usage, but serves an equally important secondary purpose of further restricting a set of triggers to specific difficulty levels; while it's also possible restrict a trigger set to usage by a human player and specific difficulty levels, this goes against the general ideal of what AILevel is primarily used for and is thus almost never seen in characters. The returned argument for AILevel has an exact range of between 0 and 8, so any argument for AILevel that's outside of these values will cause the trigger to always return false.
The "Default" A.I.[]
The default M.U.G.E.N A.I. is a hard-coded internal process that always runs when the computer is given control of a character, regardless of whether they have a custom A.I. or not. Though the exact specifics of this A.I.'s decision making process are not fully known, editing Kung Fu Man to only allow him to activate certain moves shows that the A.I. executes at least two different functions, the first of which is to manually "press" and "hold" buttons, as for a given example where Kung Fu Man can only activate Normals assigned to (his light kicks), usage of them will be drastically reduced if the command tied to in the .cmd is made more complex than a single button press, and for a second example where Kung Fu Man can only perform the hardcoded actions, he will stop walking forward if the command tied to holding is similarly changed to something more complex than holding a single button; the reason why the Normals tied to are not prevented entirely is due to the second function the default A.I. carries out, which is to randomly "flag" the commands themselves as true for a single frame, allowing it to activate moves tied to command inputs more complex that a single button without having to deal with its random manual inputs almost never getting the command's input sequence correct, but will understandably not affect the actions that necessitate more than a single frame of continuously holding a button. If the AI.Cheat setting in mugen.cfg is disabled, the A.I. will visually act out the required inputs in any command it flags on.
A character is considered to be using the default A.I. if it has no custom A.I. implementation and its human commands are not restricted by the AILevel trigger or any WinMUGEN-equivalent workarounds, and can generally be observed to sparingly use random single-button inputs while it is attempting to approach an opponent, and upping the usage of those inputs once it's in a certain proximity to them. Once the A.I. has landed a successful hit, it will proceed to increase the frequency at which it flags commands as true in order to keep the opponent in a combo, but will not consider factors that it could reasonably account for such as whether a character that uses M.U.G.E.N's in-built juggle system has reached their juggle limit or not; when factors that the default A.I. cannot reasonably account for are added to the equation, such as distance checking, other character-specific limiting factors, and the arrangement of changestates in the .cmd, it will generally only succeed in performing short combos involving moves that reliably connect into each other, usually accomplishing no more that a chain of one or two Normals into one Special into one Hyper.
Because of the rudimentary nature of the default A.I. and the numerous limitations that spawn from it, any character that's under its control tends to not pose much of a threat to even a semi-competent player. It is possible that Elecbyte chose to make the default A.I. as simplistic as possible just so all characters without a custom A.I. would do something when under the computer's control, but it's also possible that the A.I. was somewhat designed around Kung Fu Man's melee-oriented playstyle, as the increasing frequency at which it performs actions when in closer proximity to an opponent, while generally not doing anything at longer ranges beyond approaching with basic movements (albeit clumsily), would coincide with Kung Fu Man's toolkit being entirely close-range focused; this generally makes the A.I. more effective when controlling similarly melee-oriented characters, especially those with singular hits that deal considerable amounts of damage, but hopelessly inept at controlling projectile oriented characters who are played more optimally at longer ranges such as those with zoner or keepaway playstyles.