ThePredictdocs v0.0.1 RC

Getting started

Quick start

Your first smart mob in three lines, then a tour of the example boss that ships with the plugin.

Your first smart mob

You add three things on your side: one key in the mob, one line in each skill, and a short profile. That is it: no timers, no AIGoalSelectors, no extra skills.

1. In the mob file, turn ThePredict on:

plugins/MythicMobs/Mobs/Brute.ymlYAML
Brute:
  Type: ZOMBIE
  Display: 'Brute'
  Health: 80
  Predictor: true
  Modules:
    ThreatTable: true

2. In each skill, say what it is for with one Intention line, and keep its native Cooldown:

plugins/MythicMobs/Skills/Brute.ymlYAML
BruteSmash:
  Intention: DAMAGE, MELEE, DAMAGE_MEDIUM
  Cooldown: 2
  Skills:
  - delay 4
  - damage{a=7} @target

3. A profile tells ThePredict which mob it drives and which tactics it may pick:

plugins/MythicMobs/AIConfig/Profiles/brute.ymlYAML
schemaVersion: 2
brute_ai:
  MythicID: Brute
  Objective: Defeat the current target
  Choices:
    smash: { MythicID: BruteSmash }
  Tactics:
    press_and_smash: { Movement: APPROACH, Choice: smash }
    hold: { Movement: HOLD }

Then run /mm reload and /thepredict status. The Catalog section should report the profile as LOADED with one profile active and no errors. Spawn the mob, fight it in survival and run /thepredict inspect nearest.

Tip Why these three pieces

  • Predictor: true binds the mob. Without it the mob is a plain MythicMobs mob, even with a profile.
  • The Intention line tells ThePredict what the skill does (hit, reach, risks) without numbers: reach, radius and wind-up are read from the skill itself. A skill without it still works, but only fires as its own tactic's choice. See Skills & intents.
  • Tactic IDs such as press_and_smash are the option names Jev reads, so make them describe the action in English.

Note Melee damage goes in a skill

While ThePredict controls a mob, its base melee goal does not hit. Put melee damage in a skill (like BruteSmash) or in a choice with Kind: VANILLA_MELEE. Each skill fires on its own Cooldown, so the cooldown and the damage decide how hard the mob hits.

Without a Jev key the mob fights at level LOCAL: the profile picks the tactic by context and priority, at no cost. With a key and the service READY, Jev's answers put it at level JEV. See Jev connection.

The example boss

ThePredict ships a complete example, the ThePredict Guardian: a zombie with four skills (a melee strike, a ranged bolt, a self-heal and an area slam) and a profile with eight tactics. The first start writes it to plugins/ThePredict/examples/, where it stays inactive.

Try it

  1. Copy the three files: MythicMobs/Mobs/ThePredictGuardian.yml into plugins/MythicMobs/Mobs/, MythicMobs/Skills/ThePredictGuardianSkills.yml into plugins/MythicMobs/Skills/, and AI/ThePredictGuardian.yml into plugins/MythicMobs/AIConfig/Profiles/.
  2. Run /mm reload, then /thepredict status. The mob still has Predictor: false, so the profile is read but not active. On a fresh install the Catalog section shows (the revision number varies):
Console
Profiles: SETUP_PENDING (revision N, 1 profiles read, 0 active, 0 errors, 0 warnings): no mob targeted by a profile has Predictor: true; set it in MythicMobs and reload MythicMobs
  1. Spawn it with /mm m spawn ThePredictGuardian 1. With Predictor: false it is a plain MythicMobs zombie: it chases you and hits with its own attack.
  2. Set Predictor: true in the copied mob file, run /mm reload and /thepredict status:
Console
Profiles: LOADED (revision N, 1 profiles read, 1 active, 0 errors, 0 warnings)
  1. Fight it in survival and run /thepredict inspect nearest (it looks for the closest bound mob within 16 blocks).

The files

plugins/MythicMobs/Mobs/ThePredictGuardian.ymlYAML
# ThePredict 0.0.1 example boss. Predictor starts false: the mob fights as a plain MythicMobs zombie.
# ThePredict generates its movement goals when Predictor is true; do not add AIGoalSelectors here.
ThePredictGuardian:
  Type: ZOMBIE
  Display: 'ThePredict Guardian'
  Health: 100
  Damage: 3
  Predictor: false
  Options:
    FollowRange: 32
    PreventOtherDrops: true
  Modules:
    ThreatTable: true
  ThreatTable:
    UseDamageTaken: true
    DecayUnreachable: false
  Skills:
  - damage{a=2} @target ~onAttack
  - setstance{stance=pressing} @self ~onSignal:PREDICTOR_STANCE_PRESSING
  - setstance{stance=guarded} @self ~onSignal:PREDICTOR_STANCE_GUARDED
  - setstance{stance=evasive} @self ~onSignal:PREDICTOR_STANCE_EVASIVE
plugins/MythicMobs/Skills/ThePredictGuardianSkills.ymlYAML
# Skills of the ThePredict Guardian. ThePredict casts them with its own trigger; the mob never casts them
# with a normal trigger. Each skill declares its Intention. PredictValues stay as history and are not read.
# Cooldown is the native one, in seconds. The slam hits players only (@PlayersInRadius).
ThePredictGuardianMelee:
  Intention: DAMAGE, MELEE, DAMAGE_MEDIUM, WHEN_TARGET_IN_MELEE
  PredictValues: [MELEE_ATTACK, SINGLE_TARGET, MEDIUM_DAMAGE]
  Cooldown: 2
  Skills:
  - effect:particles{p=crit;a=12;hs=0.4;vs=0.4;y=1} @self
  - delay 5
  - damage{a=6} @target

ThePredictGuardianRanged:
  Intention: DAMAGE, HITSCAN, DAMAGE_LOW, WHEN_TARGET_FLEEING, WHEN_TARGET_AT_RANGE, RISK_NEEDS_LINE_OF_SIGHT
  PredictValues: [RANGED_ATTACK, SINGLE_TARGET, LOW_DAMAGE]
  Cooldown: 3
  Conditions:
  - targetwithin{d=16} true
  TargetConditions:
  - lineofsight true
  Skills:
  - effect:particles{p=flame;a=20;hs=0.3;vs=0.6;y=1} @self
  - delay 10
  - effect:particles{p=flame;a=10;hs=0.2;vs=0.2;y=1} @target
  - damage{a=4} @target

ThePredictGuardianDefense:
  Intention: SUSTAIN, SELF, WHEN_SELF_LOW_HEALTH
  PredictValues: [DEFENSE, HEALS_CASTER]
  Cooldown: 5
  Conditions:
  - healthpercent{p=<90%} true
  Skills:
  - effect:particles{p=heart;a=6;hs=0.5;vs=0.5;y=1.5} @self
  - heal{a=8} @self

ThePredictGuardianSlam:
  Intention: CONTROL, DAMAGE, AREA_AROUND_SELF, DAMAGE_MEDIUM, WHEN_ENEMIES_GROUPED, WHEN_TARGET_IN_MELEE, RISK_ROOTS_CASTER
  PredictValues: [MELEE_ATTACK, AREA_TARGET, MEDIUM_DAMAGE]
  Cooldown: 8
  Skills:
  - effect:particles{p=cloud;a=30;hs=1.5;vs=0.1;y=0.2} @self
  - delay 15
  - damage{a=5} @PlayersInRadius{r=3}
  - throw{velocity=6;velocityY=1} @PlayersInRadius{r=3}
plugins/MythicMobs/AIConfig/Profiles/ThePredictGuardian.ymlYAML
# ThePredict example profile (schema 2) for the ThePredictGuardian mob. Copy it to plugins/MythicMobs/AIConfig/Profiles/.
# Each choice takes its purpose from the Intention line of its skill.
schemaVersion: 2
thepredict_guardian:
  MythicID: ThePredictGuardian
  TypeOfMythicID: MOB
  Type: NORMAL
  Objective: Survive while defeating the current target
  Choices:
    melee:
      MythicID: ThePredictGuardianMelee
      TypeOfMythicID: SKILL
    ranged:
      MythicID: ThePredictGuardianRanged
      TypeOfMythicID: SKILL
    defense:
      MythicID: ThePredictGuardianDefense
      TypeOfMythicID: SKILL
      RequiresTarget: false
    slam:
      MythicID: ThePredictGuardianSlam
      TypeOfMythicID: SKILL
  Tactics:
    approach:
      Movement: APPROACH
    press_and_strike:
      Movement: APPROACH
      Choice: melee
      Priority: 70
    keep_distance:
      Movement: KEEP_DISTANCE
    keep_distance_and_shoot:
      Movement: KEEP_DISTANCE
      Choice: ranged
      Description: Stay outside melee reach and shoot while the target approaches
      Priority: 60
    retreat_and_defend:
      Movement: RETREAT
      Choice: defense
      Priority: 90
    flank_and_strike:
      Movement: FLANK
      Choice: melee
    close_in_and_slam:
      Movement: APPROACH
      Choice: slam
      Priority: 65
    hold:
      Movement: HOLD
      Priority: 10
  Contexts:
    low_health_phase:
      Priority: 90
      Tactics: [retreat_and_defend, keep_distance_and_shoot]
    idle:
      Priority: 10
      Tactics: [hold]
      DirectTactic: hold
  Stances:
    Native: hybrid
    Describe: false
    ByMovement:
      APPROACH: PRESSING
      HOLD: GUARDED
      RETREAT: EVASIVE
  Telegraph:
    AgainstPlayers: enforce
    AgainstEntities: off
    Commitment: 100
    EntropyCommitment: 25
    ShortWindUp: lead
    DefaultRecoveryTicks: 20
  Poise:
    Max: 0.15
    RegenDelayTicks: 60
    RegenPerSecond: 0.05
    WindUpMultiplier: 1.5
    BlockedHitPoise: 0.05
    StaggerTicks: 30
    ImmunityTicks: 100
  Movement:
    Band: { Inner: 5, Outer: 9 }
    Retreat: { Distance: 10, Speed: 1.2 }
    Arena: { Radius: 24 }
  Threat:
    AssistsOthers: 1.5
    RangedHarass: 1.0
    BlockedHits: 0.25
  BaseAI:
  - 1 meleeAttack
  - 2 randomStroll

A few things worth noticing:

  • Each skill declares its Intention; the profile declares no purpose. ThePredict reads the reach, the radius and the wind-up from the skills themselves (targetwithin, the r of the targeter and the delay lines), describes every option to Jev with them, and waits until the target is in reach before casting.
  • The ranged bolt needs line of sight and a target within 16 blocks; the heal does nothing at full health, so it only comes out when the mob is hurt.
  • The slam hits every player within 3 blocks and throws them back. It targets @PlayersInRadius, so it never hurts other mobs: this boss is built to fight players.
  • PredictValues stay in the skills as history. ThePredict no longer reads them.
  • The three setstance lines react to ThePredict's stance signals. ThePredict itself never changes the stance, plays a sound or spawns a particle; the particles you see come from the skills.

What to read in inspect

LineWhat it tells you
GoalsThe goal set ThePredict generated from the profile: float, fleeConditional, moveWithinConditional, moveTowardsTargetConditional, goToSpawnLocation, meleeAttack, randomStroll, lookAtTarget and the goals thepredict:flank, thepredict:hold and thepredict:owner.
SessionThe control level: LOCAL without a key, JEV with one.
IntentThe tactic, its movement, the ticks left and whether its skill was tried.
WhyThe last fallback reason and the last cast result: they explain a LOCAL or BASE level.
ThreatThe MythicMobs threat table and the threat ThePredict added for assists, blocked hits and ranged harass.

Force a tactic

To try one tactic without Jev, a player with thepredict.debug (or the console, with the mob's UUID) can pin it and release it:

Console
/thepredict debug intent nearest keep_distance
/thepredict debug release nearest

A debug intent is local and never sends a request to Jev. thepredict.debug is not given to operators by default; see Commands & permissions.

Remove the example

Delete the three copied files and run /mm reload.

Next steps

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.