Mabinogi World Wiki is brought to you by Coty C., 808idiotz, our other patrons, and contributors like you!!
Want to make the wiki better? Contribute towards getting larger projects done on our Patreon!
Pet AI Editor
- "Mabinogi" contains an in game Pet AI Editor (Animal Character AI Settings). Using this editor a user can create behavior patterns for pets. The data can be shared, or edited by hand.
- The pet AI data does not get saved on any "Mabinogi" server, and is the responsibility of the user to backup or store.
- It is the client's job to process the pet AI, and not the server. (needs be verified.)
- The Pet AI Editor can be accessed by going into the 'Character Info' dialog, selecting 'Pet' tab, and selecting 'AI Settings' button.
- Any saved changes made to any pet AI will take effect immediately, even if pet is in process of using it. (not recommended to change an AI while it is in use.)
- It is only possible to edit any of the default AIs, by first creating a duplicate to modify.
- Changing the current selected AI to use will only affect the current pet that is summoned, the setting is remembered per pet.
Default AIs can be switched to by either using the dialog window, or by typing special keywords into the chat box.
The default AIs have a '*' symbol in front of their name, indicating a default AI.
These are the default AI's you can select:
- Auto Attack Mode - Pet will target and battle enemies nearby on its own.
- Collaborative Mode - Pet will attack with the master.
- Healing Mode - Pet continuously uses Healing on its master.
- Command Mode - Pet does nothing until commanded. See Pet Commands.
The default AI's cannot be deleted or edited, but they can however be copied to make an editable duplicate.
The three parts of an AI rule set
- Event: Event defines why to activate a rule set.
- Condition: Condition defines specific situations required for the rule set to be used.
- Act: Act defines the actions the pet will perform when the rule set is activated.
- Both event and condition must be true for the act to be processed.
- Either the acts or the conditions can be omitted, but the event must always be defined.
List of Events
|Pet finds the enemy.||0||If the pet recognizes an enemy, the pet will use this rule set.||
|Pet is targeting the enemy.||0||If the pet is in combat, this rule set will be triggered.||
|Pet attacks the enemy.||9||If the pets attacks an enemy, this rule set is used.||
|Pet is recognized by the enemy.||2||If an enemy targets the pet for the first time.||
|Pet's enemy uses Ranged Attack.||0||If the pet's target uses ranged attack.||
|Pet's enemy uses Melee Attack.||0||If the pet's target does melee.||
|Pet's enemy uses Magic Attack.||0||If the pet's target uses magical attack.||
|Pet blocks the attack with Defense.||11||If the pet succeeds in blocking an attack with defense skill.||
|Pet is attacked by the enemy.||17||If the pet is attacked by an enemy.||
|Master is recognized by the enemy.||2||If the pet's master is targeted by an enemy for the first time.||
|Master's enemy uses Ranged Attack.||0||If the Master's target uses ranged attack.||
|Master's enemy uses Melee Attack.||0||If the Master's target uses melee.||
|Master's enemy uses Magic Attack.||0||If the Master's target does magic attack.||
|Master blocks the attack with Defense.||11||If the Master succeeds in blocking an attack with defense skill.||
|Master is attacked by the enemy.||34||If the master is struck by an enemy.||
|Master prepares a skill.||19||If the master prepares a skill for use.||
|Master attacks.||17||If the master strikes an enemy with an attack.||
List of Conditions
|Not Selected.||0||This gives the rule set with no condition rule.||
|Enemy Condition.||8||This condition defines the behavior of the enemy for activation.|
|Enemy Distance.||225||This condition defines enemy distance from pet for activation.||
|Skill Availability.||15||This condition limits the rule set to Pet with specified skill.||
|If the master's lost HP is above a certain number.||10||Activates if master has specified HP damage.||
List of Actions
|Not Selected||0||Used to give an event and condition no action by pet.||
|Wait for the enemy||100||Causes pet to wait for a specific time.||
|Run away from the enemy for a set amount of distance.||24||Move away from the enemy for a specific amount of time.||
|Chase the enemy.||48||Causes the pet to move towards it's target.||
|Hover around the enemy.||480||The pet will do circles around its target.||
|Attack the enemy using Melee Attack.||12||The pet will attempt to make melee strike on its target.||
|Attack the enemy using Magic Attack.||4||The pet will charge, then use the magic.||
|Prepare skill.||15||The pet will prepare a skill ready for use.||
|Charging a magic skill.||4||The pet will charge up a skill to the specified amount.||
|Use a prepared skill.||6||This will activate on the defined location, or target.||
|Cancel skill||0||This will cause pet to cancel any prepared skill or magic.|
|Use Rest||2||This will either start or stop the rest skill.||
Tips and tricks
- Sometimes a new rule set can be triggered, breaking out of the currently unfinished rule set.
- An example is a pet charging firebolt, which then uses it, but before finishing is struck by the enemy.
- The pet has a trigger rule for being hit by melee, which causes the pet to cancel the current ruleset and begin the other.
- It's good practice to put 'cancel skill' at the beginning of all action rules in any rule set. A pet might try to complete a rule set, but fails because of a prepped skill.
- More than one rule set can be defined with the same trigger and condition.
- Duplicate rule sets with different names are possible.
- It is possible to create rule sets that only have a trigger, and no conditions or actions.
- The source code can be edited outside of the game AI editor.
- It is possible to have pets output text. (currently not implemented using the in game pet AI editor.)
- If the pet is sitting down, the pet will not perform the actions defined by the selected pet AI. The pet AI will still be processed. However a rule set to end the rest skill can be defined.
- Pets can receive Pet Commands from the player's chat box.
- The procedure of the Action Prepare Skill followed by Use a prepared skill sounds ideal yet will fail to execute or to use the certain specific skills.
- Use a prepared skill is preferable with executing Counter and Windmill, however:
- Prepare skill: Windmill > Wait for the enemy: 3 to 5 sec > Use a prepared skill: My location > Cancel skill
- Prepare skill: Counter > Wait for enemy: 5 to 7 sec > Cancel skill
- Adding the Action Cancel Skill at the end will help or hurt depending on the situation. Having to wait too long can deplete Stamina with some skills while cancelling a defensive skill too soon may get the pet hurt. The skill should still be cancelled for a tactical balance, especially if there is no more target around.
- Specific melee skills like Basic Attack and Smash will automatically be executed if the Prepare Skill to Attack the enemy using Melee Attack is used, which also applies to specific magic skills like Icebolt and Thunder with Prepare Skill to Attack the enemy using Magic Attack were used instead.
- Prepare skill: Smash Retry: 1x Time: None > Attack the enemy using Melee Attack: Time: None
- Prepare skill: Basic Attack Retry: 1x Time: None > Attack the enemy using Melee Attack: Time 5 sec
- Prepare skill: Icebolt Retry: 1x Time: None > Attack the enemy using Magic Attack: Time: None
- Including the amount of Retry and including how much Time the attack procedure has left will cause the whole thing to cancel out or move onto the next phase of the battle. Having the Retry set to 1x is preferable when the enemy changes tactics or attacks the pet which can cancel out the entire procedure. Adding the amount of Time can also cause the pet to stand still waiting like a sitting-duck. It is much better to put the amount of Time in with the Action Attack the enemy using Magic Attack/Melee Attack or with Use a prepared skill where it is by the end of the whole procedure.
- Use a prepared skill is preferable with executing Counter and Windmill, however:
Sharing, backup and restore
To share, backup, or restore a pet AI the clipboard is used. (copy and paste)
- With the AI open in the AI editor, select the button, 'see source'.
- With the source in view you can choose copy or paste.
- Press copy to have the source code inserted into your clip board ready for pasting.
- Press paste to have the source code inside the clip board inserted into the pet AI. This will erase any current AI.
A backup can be created by saving the copy and paste into a text document.
Sharing with a friend can be done by uploading a text document of the copy and paste using an instant messenger.
An example pet AI
- The following clip board data is an example of a pet AI, created using the Pet AI Editor.
- It's suggested to copy the coding and paste it into the game's Pet AI Editor for viewing.
- This AI is useful against weak mobs, exposing mimics, along with assaulting archers.
- It gives the pet one specific action, and that is melee.
- There is room to improve or customize it.
- Public domain but is subject to 'Mabinogi' rules, and 'Mabinogi' copyright laws
<rules> <rule name="See it, attack it"> <conditions/> <pattern> <param_decl/> <sequence> <cmd name="melee_attack" timeout="0"/> </sequence> </pattern> <event name="seek_target"/> </rule> <rule name="Seen, attack it"> <conditions/> <pattern> <param_decl/> <sequence> <cmd name="melee_attack" timeout="0"/> </sequence> </pattern> <event name="targeted" targeting_type="alert"/> </rule> <rule name="hit! Attack it"> <conditions/> <pattern> <param_decl/> <sequence> <cmd name="melee_attack" timeout="0"/> </sequence> </pattern> <event name="attacked" master_skill="all" down="false"/> </rule> <rule name="hit! Attack it 2"> <conditions/> <pattern> <param_decl/> <sequence> <cmd name="melee_attack" timeout="0"/> </sequence> </pattern> <event name="attacked" master_skill="all" down="true"/> </rule> <rule name="Just attack"> <conditions/> <pattern> <param_decl/> <sequence> <cmd name="melee_attack" timeout="0"/> </sequence> </pattern> <event name="now_targeting"/> </rule> </rules>
Known glitches or bugs
- The pet AI rule set will fail to save when including, 'run away from enemy'.
- This can be worked around by creating a duplicate of the healing AI, and making changes with out changing the 'run away from enemy' rule. The set time can be changed, and rules can be created around it.
- Sometimes having undefined events can cause pets to behave as if they are doing things by random.
- A work around is to include the event in the pet AI.
- After the pet's target is defeated and there are no more enemies around, the pet might still have a skill prepped such as defend or counter. The pet will not cancel the skill until commanded by the master.
- This bug can be worked around by including, 'cancel skill' at the end of any rule set that might be used last by the pet.
- Another fix can be to include a hot key for command the pet to sit down, or come over to the master. Either will cause the pet to cancel a prepped skill.
- One more fix is to type a command to cause the pet to sit, stand, or come.
- After selecting the option to create a new rule set, if the name of the rule set is inputted before defining the rule set, the name will be lost.
- to work around this, it is best to wait until the rule set is complete, and then define it's name. The name stays preserved when putting an AI in edit mode.