Skip to content

Basic Monster AI Editing

NSACloud edited this page May 10, 2024 · 7 revisions

Basic Monster AI Editing

This tutorial will go through the basics of monster AI file reading and editing.

Guide written by Narathin.

Requirements

  1. 010 Editor
  2. The RSZ template
  3. RszTool
  4. MHR-Editor
  5. Extracted chunk files
  6. First Natives plugin
  7. Latest Reframework version
  8. (Optional) EMV Engine

AI Files

What the monster will currently do is controlled by the rank of the quest Low, High, Master

The quest type Rampage, Normal Quest, Anomaly

The current phase of the fight Eg. Malzeno's transformed state

The monster's state Rage, Normal, Tired and current distance from the hunter.

Using 010 we can eaily identify each one of those from the most basic level which is Quest rank.

By going to the monster's folder find it's AI folder at the STM\enemy\emXXX\XX\ai_fsm_user_data.

You can find the monster's ID here

Inside the AI folder you should see this:

image

For this example we will use the hub files but you can also find by searching for the combat data in think.

The files used for combat are mainly those:

image

If for example we are searching for the Master rank the only file we will open is attack_stance_same_main_master, for High rank attack_stance_same_main_high and Low rank attack_stance_same_main.

After opening in 010 we will search for the Raw Data section to find the reference to the monster's mode.

Master rank attack stance file in 010:

image

Example of the mode reference data:

image

For monsters with multiple modes there's no easy way to find which mode you are looking for. However there are clues in the file. For example Golden Rathian's powered up AI should be close to references to said power up.

By clicking at the reference data we will be presented with an option to open the file directly.

Open all of the mode files you want to change. In doubt open them all those should also have clues of which mode we are dealing with.

Modes files are a mix of Quest Rank, Monster phase and Quest type. So changes to, for example, Apex Rathian's rampage AI, might not affect the normal quest version except if they share the same action files.

Inside the Mode's file we will search for the state we want to change the moves of

We find those in the Raw Data section as well

Anger, Normal and Tired states call different actions but the biggest part of the moveset is usually in the Anger state files:

image

We repeat the file opening process for all the State files we want.

The most relevant information is the action's path:

image

We can also edit the reference path in the ThinkState if we want.

The process of file opening is the same for Action files as well. Try opening all of the ones you see in the State files.

Action and Combo files

Action and combo files are the part of the AI that will call for whatever the monster will do, being moving, iddling, attacking, transforming and so on.

For all intents and purposes Action and Combo files will be pretty much the same for us.

Combo files usually call for multiple Action files, however Action files can and will call for multiple other Action files.

For a better understanding of how the monster's AI works we will be focusing in the most simple example which is just a simple attack.

Basic structure of the Action file inside 010:

image

Modifying Attacks using the RszTool

Using the path of the action file we just open we will drag and drop the file into the RszTool.

The Instances tab being 010's Raw data and Objects the Data section:

image

The Think states is what we will use to modify and add new attacks. Think states are types that hold 5 things, the state ID, an action list, a codition list the reference data and the Behaviour tree ID.

You will notice an unmodified action's ID always follows it's position in the list. This will be important later on.

The action list holds the action the monster will perform, the first states are usually reading something in the Behaviour tree and creating conditions to call for a move.

What is currently important to us is finding the move it will perform which is in the action list of a Think state.

Simply open the Action Lists until you find it.

Structure of a Think state:

image

We found an attack, in it, what's relevant to us is the v1_ID, and the _ActionNo. v1_ID being something that will create an action sequence. It needs to be unique in case we add more attacks for example. And finally the _ActionNo which is which attack it will perform.

It's also important to notice if the monster has variants (Subspecies, Rare species, Variant, Apex, Risen) the attack will have the monster's id in the action name. You must match the monster's ID in case of adding new ones else it will not work on the base version of those monsters which might not have that attack.

A list of action IDs can be found here.

Example of Rathian's attack IDs found in the Em001_02PowerUpData inside the user_data folder of Gold Rathian:

image

Rathian's attack, for this file it controls how much of a hidden meter it fills to reach the powered up state, and yes this is a Capcom typo in the word motion:

Using the EMV engine we can try those actions out by setting up a collection with the monster in a quest and openning it's action monitoring. If the monster T-poses it means it can't perform that attack. Also check if there's an active hitbox as some attacks have animations but no collision.

If we change the _ActionNo to another it will isntead perform that move, if we disable it won't perform the move and instead end the action.

This should finish what you can edit of the action file by itself, remember there are usually 200 to 300 sparate files so changing those without knowing might crash the game or freeze the monster.

Adding new moves and creating combo strings

This part of the tutorial is rather advanced and can crash things, so please practice by changing different actions around of monsters. My personal recomendation is modifying Tigrex's AI since his moveset is rather simple.

This is where the biggest advantage of the RszTool comes to place, you can copy entire think states, that way creating new actions.

Copied Think State:

image

You may notice they share the same IDs which is what we will change next to it's place in the list. Also change the attack v1_ID to make it unique, just add one and it should work.

After changing both and the _ActionNo we need to understand how conditions work before testing things out.

Condition list structure:

image

The most simple condition for an action to end is EnemyActionEnd which simply calls an ID for the next action.

The final action always has to call the _NextStateID to 1 to end the file reading.

For Actions files with multiple actions those may be used to identify combos and other behaviour.

Changing the ID of the next state will call another think state instead, for example, the think state we just copied. Change it to it's ID, make sure the final Think state resets to 1 and it's ready for testing.

This concludes the tutorial, you can also copy think states from other files then making it do different things, such as moving, checking for SubType potentially making hazard monsters, checking for states like Rage or Anomaly, and so on.

Clone this wiki locally
  翻译: