ThePredictdocs v0.0.1 RC

Authoring

Profiles, tactics & contexts

A profile lists what a mob can do (choices), what it can decide (tactics) and when each tactic makes sense (contexts). This page explains each part and how Jev reads it.

Turning a mob on

A mob is driven by ThePredict when all three hold:

  1. Its MythicMobs file has Predictor: true. Any value other than true or false is a catalog error: <Mob>.Predictor: must be true or false.
  2. A profile in plugins/MythicMobs/AIConfig/Profiles/ has MythicID equal to the mob's exact ID. IDs are case-sensitive; when only the case differs, the error suggests the right one: unknown mob 'guardian'; IDs are case-sensitive, did you mean 'Guardian'?
  3. The profile has no errors. A mob with Predictor: true and no valid profile is reported as <Mob>.Predictor: is true but no valid AI profile targets this mob.

The mob file can also carry PredictorTraining, PredictorDifficulty and PredictorEntropy (see Mob file keys). After a change, run /mm reload and check the Profiles: line of /thepredict status.

Mob tips:

  • Options.FollowRange is how far the mob perceives participants (capped by decision.searchRadiusBlocks, 48 by default) and the maximum range of its APPROACH goal. The example uses 32.
  • Modules.ThreatTable: true is needed for the enriched threat; without it the mob still works, but ThePredict cannot steer its target (see Targets, participants & threat).
  • No AIGoalSelectors needed. With Predictor: true, ThePredict generates the movement goals. The mob's own AIGoalSelectors are only used as its base AI when the profile has no BaseAI.
  • Triggered skills keep running. Skills on ~onAttack or ~onTimer still fire while ThePredict controls the mob. If you do not want their damage on top of the tactics, gate them with predictorcontrol false (see MythicMobs vocabulary). The catalog warns when the mob also casts a choice's skill from a trigger: mob '<Mob>' also casts '<Skill>' from its Skills with a trigger; it may add damage while ThePredict controls the mob.

Profile files

A profile file is a .yml or .yaml file in AIConfig/Profiles/ that starts with schemaVersion: 2 and holds one or more profiles. Each profile is keyed by its ID; snake_case is recommended. Files ending in .yml.example are ignored.

AIConfig/Profiles/example.ymlYAML
schemaVersion: 2
example_ai:
  MythicID: ReplaceWithYourMythicMobId
  Objective: Survive while defeating the current target
  Choices:
    melee: { MythicID: ReplaceWithYourMeleeSkillId }
    ranged: { MythicID: ReplaceWithYourRangedSkillId }
    punch: { Kind: VANILLA_MELEE }
  Tactics:
    press_and_strike: { Movement: APPROACH, Choice: melee, Priority: 70 }
    keep_distance_and_shoot:
      Movement: KEEP_DISTANCE
      Choice: ranged
      Description: Stay outside melee reach and shoot while the target approaches
      Priority: 60
    brawl: { Movement: APPROACH, Choice: punch }
    hold: { Movement: HOLD, Priority: 10 }
  Contexts:
    wounded:
      Conditions:
      - healthpercent{p=<30%}
      Priority: 90
      Tactics: [keep_distance_and_shoot, hold]
    idle:
      Priority: 10
      Tactics: [hold]
      DirectTactic: hold

Loading is strict:

  • An unknown key is an error with the file and the path: is not a known field. A key from the old schema says is a schema 1 field; review the migration proposal under migration/.
  • A profile with an error is skipped; the other profiles keep loading.
  • Two profiles with the same ID, or two profiles for the same mob, are all excluded with an error.
  • Values follow this precedence: built-in defaults, then profileDefaults in config.yml, then the profile. The global decision.* limits are never widened by a profile.

Every key, with its type, default and range, is in the Profile reference.

Choices

A choice is something a tactic can cast: a MythicMobs skill, or a plain vanilla hit.

KeyDefaultWhat it does
KindMYTHIC_SKILLMYTHIC_SKILL casts a skill; VANILLA_MELEE deals a vanilla hit and takes no MythicID.
MythicIDrequired for skillsExact skill ID. The skill should carry an Intention line (Skills & intents).
RequiresTargettrueWhether the choice needs a target. A self-heal is usually false.
CD0Extra cooldown in ticks, for compatibility only. Use the skill's native Cooldown.

Choice IDs (melee, ranged) are local to the profile and never reach Jev: [a-z][a-z0-9_]{0,39}.

Note The vanilla hit while ThePredict controls

While ThePredict controls a mob, its base melee goal does not hit. A vanilla hit only comes as a VANILLA_MELEE choice, which takes the tactic like any skill, at most one hit every 20 ticks (the vanilla rhythm) and never farther than Movement.MeleeReach. A classic MythicMobs boss adds that passive melee hit to the skills it casts on triggers, so a ThePredict boss loses that passive damage against the same classic boss: put melee damage in a skill of the tactic, or use a VANILLA_MELEE choice, and size its Cooldown and damage accordingly.

Tactics

A tactic is one option the mob can pick: a movement, optionally a skill, and a priority.

KeyDefaultWhat it does
MovementrequiredAPPROACH, KEEP_DISTANCE, RETREAT, HOLD, FLANK or NONE (see Movement & goals). FLANK requires a Choice.
ChoicenoneThe choice it casts.
DescriptionnoneWhat it does, in English, for Jev.
Priority500 to 100. In local mode the highest priority among the eligible tactics wins.
Stancefrom its movementBase stance while it runs (see Stances, tells & poise).

A profile holds 1 to 255 tactics.

Naming tactics

The tactic ID is the name Jev reads, so it should describe the action in plain English. Format: snake_case, [a-z][a-z0-9_]{2,39} (3 to 40 characters, starting with a letter). none and the prefixes debug_, tell_ and stance_ are reserved.

GoodBadWhy
press_and_striket1, option_aJev only sees the name: without meaning there is no useful decision.
keep_distance_and_shootKeepDistance, keep-distanceDoes not match the pattern (capitals, dash).
retreat_and_defendretirarseJev reasons in English.
flank_and_strikedebug_flank, noneReserved.

Contexts

A context limits which tactics are eligible while it is active. When several are active, the highest Priority decides; with equal priorities the one declared first wins and the catalog warns (has the same Priority 50 as context '…'; the one declared first wins when both are active). With no active context, every tactic is eligible.

KeyRule
ConditionsMythicMobs condition lines, at least one. Not allowed in shortcut contexts.
Priority0 to 100; default 50.
TacticsAt least one tactic of the profile, no repeats.
DirectTacticOptional; must be in Tactics. In local mode it is picked directly.

A profile holds up to 16 contexts.

Shortcut contexts

These four names are computed by ThePredict and take no Conditions:

NameActive when
idleThe mob has no perceived target.
attacking_phaseThe target is in the MELEE band (Movement.MeleeReach or closer).
tracking_enemyThe target is farther than MeleeReach.
low_health_phaseThe mob's health is in the CRITICAL band (Health.Critical).

Native conditions

ThePredict evaluates a context's conditions on the mob itself, outside any skill. That has consequences:

  • Entity conditions work, for example healthpercent{p=<30%}. For health in percent use healthpercent{p=<N%} or {p=>N%}: health{h=…} compares absolute health and rejects %.
  • Conditions that only exist in a skill's context (trigger, skill target or metadata) are always false here. Put those in the skill's own Conditions.
  • A line MythicMobs rejects disables only that context, with a catalog error: MythicMobs rejected the condition '…'; context '…' is disabled. A condition from another plugin that nobody resolves is disabled a tick later: no plugin resolved the condition '…'.

Objective and descriptions in English

Jev was trained mostly on English, and other languages decide less accurately. ThePredict sends Jev the profile's Objective, each tactic's name, Description and movement, and what its skill is for (from the Intention line, as fixed English phrases without numbers). It never sends player names or UUIDs.

Write Objective and Description in short, clear English. The catalog warns, without blocking, when a text may not be English: may not be in English (contains the word 'objetivo', which is common in other languages); Jev reads English, or (contains the non-ASCII character 'ñ').

Request size is estimated at 1.5 characters per token, calibrated on English text. Text in other scripts, such as CJK, can use fewer characters per token and the estimate would fall short: one more reason to write in English.

How Jev sees each option

ThePredict never sends Jev two options that read the same, the name of a choice, or numbers. What it says about each tactic depends on Timing.QuestionDetail (default full):

DetailEach optionInstruction
compactA text of at most 120 characters: short movement and short skill, plus at most one poor fit now: … phrase computed in code (for example shield would block it). The Description only appears as a note: excerpt when two options would read the same.Short text: Which tactic best serves mob_1's objective now?
standardAn object with the same keys for every option, empty ones left out: movement, skill, best_when, risks and note (your Description).The question, the assumption of a contingency and the parts of the state Jev should look at.
full (default)standard plus fits_now and poor_fit_now: up to 3 phrases each about what in the current moment favors or hurts the option, computed in code.standard plus a fixed focus sentence.

In compact, for the example boss with its target blocking at melee distance, press_and_strike reads close in; melee hit, medium damage; poor fit now: shield would block it, and retreat_and_defend reads retreat; self heal. With standard and full, put the essential first in each Description: a long one is sent whole.

Options Jev cannot tell apart. Two tactics with the same movement, the same Description and the same skill purpose (or no skill) are identical to Jev: only the higher-priority one is sent, and the binder warns Tactics.<a> and Tactics.<b> describe the same option to Jev; Jev only sees '<a>'. Give them different descriptions or purposes.

Option cap. Each question carries at most decision.maxOptionsPerQuestion options (8 by default), chosen by priority. The mob's current tactic is never cut, so the switch margin can still compare against it.

Contingencies. A contingency ("if your health becomes critical") only offers the tactics that would be eligible in that situation: shortcut contexts are evaluated under the assumption, and with the target in melee the melee skills count as in reach. Contexts with native MythicMobs conditions keep their real state. With compact, a contingency offers at most 5 options; with fewer than 2 it is not asked.

ThePredict 0.0.1 · release candidate. These pages describe this build, checked against its source code; it has not been verified on a live server yet.

ThePredict is an independent MythicMobs addon. Jev is TypeSafe's decision model; naming it does not imply endorsement. Fonts: Pixelify Sans, Inter and JetBrains Mono, under the SIL Open Font License.