- Home-
- Valheim-
- Miscellaneous for Valheim-
- Mob Ilib

Mob Ilib
About This Mod
## RagnarsRökare MobAILib ##
MobAILib is a library used to replace the built-in AI characters in Valheim.
The goal is to provide a set of AI types and behaviors that modelers can use to create a brighter world.
RagnarsRökare MobAILib.
MobAILib is a library for replacing AI characters built into Valheim.
The goal is to provide a number of different types of AI and behaviors that modelers can use to create brighter worlds.
How to use.
First, add a reference to MobAILib to your mod project.
RagnarsRokare.MobAI.MobManager is used to register and monitor managed mobs.
It contains a list of MobAI that can be used as the mob's "brain" and control its behavior.
Each MobAI has its own configuration file containing its settings: WorkerAIConfig and FixerAIConfig.
They inherit from MobAIBaseConfig, which contains basic attributes:
Awareness - general awareness. Used to calculate search range and ability to detect enemies.
Aggressiveness - Aggressiveness determines behavior in combat and when to surrender and escape.
Mobility - Mobility is used to determine how often and how far a mob moves.
Intelligence - general intelligence determines how much a mob is capable of memorizing.
-LabourerAI.
Allows the character to move around and fill smelters, ovens, fireplaces, and torches. He's looking for objects on the ground and in chests.
Fighting when wounded but easily surrendered (low attack level) The FeedDuration setting is only valid if the Tameable component is attached to the player object.
WorkerAIConfig.
public int FeedDuration = 1000;
public string[] IncludedContainers = new string[] { «piece_chest_wood» }
public int TimeBeforeAssignmentCanBeRepeated = 120;
public int TimeLimitOnAssignment = 60;
- Repair of artificial intelligence.
If you find a damaged structure, send it for repair. Equip a 0 item in your inventory or hammer, if available, and use attack animation when repairing again. If he is wounded, he will fight aggressively (increased attack strength).
The FeedDuration option is only valid if the Tameable component is attached to the game object.
FixerAIConfig.
These are the default values.
public int PostTameFeedDuration = 1000;
public int TimeLimitOnAssignment = 30;
public string[] IncludedContainers = new string[] { 'piece_chest_wood' }
RegisterMobAI(Type mobAIType) Used to register a custom MobAI.
MobAIType must inherit from MobAIBase and be a class that implements IMobAIType.
An example implementation of mobAI can be found at [GitHub](https://github.com/di98feja/RagnarsRokare/wiki))のwikiを参照。).
RegisterMob(Character character character, string uniqueId, string mobAIName, string configAsJson)Used to register a mob with MobAI.
- character - component of Character mob.
- uniqueId - a string used to uniquely identify the mob among all other mobs.
- mobAIName is the MobAI type to be used. Available types can be found in **'MobManager.GetRegisteredMobAIs()'**.
- configAsJson - MobAI specific configuration serialized as JSON.
RegisterMob(Character character, string uniqueId, string mobAIName, object config) is used to register the mob with MobAI.
- character is a component of Character mob.
- uniqueId - a string used to uniquely identify the mob among all other mobs.
- mobAIName is the MobAI type to be used. Available types can be found in **'MobManager.GetRegisteredMobAIs()'**.
- config - MobAI specific configuration.
UnregisterMob(string uniqueId)
Used to turn off control of the mob.
IsRegisteredMob(string uniqueId)Checks whether the mob with the specified unique identifier is registered.
IsAliveMob(string uniqueId)Checks whether the mob is active according to the specified unique identifier.
Mob becomes active when his MobAI is instantiated and assigned.
Dictionary<string, MobAIBase> AliveMobAll live mobs are stored in a dictionary where UniqueId is the key. Value is the base class of MobAI and has access to CurrentAIState.
The code is available on GitHub.
This repository also has a SlaveGreylings mod that uses this library.
Under the hood, he uses (or may be misusing) Stateless State Machine (also on GitHub).
Thank you, Stateless team.
MobAILib is under development and, like any hobby, there is a limit to the amount of time you can spend on this project, no matter how much fun you get.
Therefore, even with the feedback we will not be able to fulfill everyone's wishes.
// Berg and Morg.
Plans for the future.
- Add more specific combat behavior that all MobAI classes can use.
- Add interface templates and strategies that allow you to choose combat behavior at run time.
- More built-in MobAI classes.
- More general behaviors.
Change log.
- Version 0.3.9.
Changed that the mobs control only 2D distance when moving to the target.
If a container is unavailable, sorters have changed their behavior to free up items they hold.
- Version 0.3.8
Bugs fixed.
- Version 0.3.7
Bug fixes.
- Version 0.3.6.
Add BasicFarmingBehaviour behavior
- Version 0.3.5
Redesigned for Valheim v0.206.5
- Version 0.3.4
Updated for Hearth&Home
-version 0.3.3
Bug fixes.
- Version 0.3.1
Backward compatibility with version 0.2
- Version 0.3.0
Added markers for mobs on the map
Various stability fixes and improvements
AI roaming is disabled by default. Works well in single-player and single-player games on private servers. Multiplayer setup required.
- Version 0.2.1.
Removed [BepInProcess ("valheim.exe")] to make it compatible with private servers.
- Version 0.2.0.
Added a base mob attribute to control behavior.
Requires direct visibility for containers and jobs.
Added FeedingBehaviour and removed the need for Tameable component.
Rebuilt the tree mechanisms.
Some configuration values are no longer valid.
- Version 0.1.3.
Added basic FightingBehaviour function for FixerAI and WorkerAI.
Fixed an error when adding fuel to the fireplace without mobs.
- Version 0.1.2.
Added ability to save custom MobAI classes
- Version 0.1.1.
Added overload in RegisterMob to accept settings as objects
- Version 0.1.0
Initial release
Similar Mods/Addons
Whetstone - repair kits and sharpening stonesallMiscellaneous for ValheimValheim
This October, the mod is adding a kit for repairing supplies for repairing outfitted weapons and too...000
Customizable autosaveallMiscellaneous for ValheimValheim
You can set the autosave interval, turn it off completely, or even keep it in sleep mode.If you like...200
MD DockhouseallMiscellaneous for ValheimValheim
A small dock for BuildShare (formerly AdvancedBuilding).Doc 6x12 for BuildShare MOD (formerly Advanc...000
Valheim Tree Status / Tree status module for version 1.0.0allMiscellaneous for ValheimValheim
Valheim mode shows the health status of the trees. You can choose between percentages and health bar...000
Real Creative Mod / Real creative mod for Valheim version 1.0.1allMiscellaneous for ValheimValheim
Valheim's mod greatly improved the creative mode and made it look like the one in Minecraft.What's n...600
Automaps with configurationallMiscellaneous for ValheimValheim
This mode is a legacy* AutoMapPins mode, but is configured for each pin. With special pins for each...200
Endless buildallMiscellaneous for ValheimValheim
In this mode, the physics of the game settings is disabled800
Ultra-realistic 4k retexture of Peanut's stone castleallMiscellaneous for ValheimValheim
The most realistic textures of stones and locks you can find ! Updated and improved! New textures ar...100
Spawn for MonsterLabZaallMiscellaneous for ValheimValheim
Lut and the gangs have been slightly reworked, and the names have been translated into Russian.Lut a...000
Deadly Messages from the ValkyriesallMiscellaneous for ValheimValheim
Declare the cause of your death by shouting.Sometimes you don't know what kills you. On other occasi...000
Valheim HUD Hiding Mod / HudHide version 0.9 MODallMiscellaneous for ValheimValheim
In this mode, you can easily hide the HUD by pressing F1. Pressing again restores the HUD....000
Valheim Plus (according to Grantafer)allMiscellaneous for ValheimValheim
This is an unofficial community fix supported by Grantafer.Valheim Plus.It is a mod for HarmonyX aim...200
Thornstone FortressallMiscellaneous for ValheimValheim
Preserving the world with a big castle. This build uses a number of mods, most of which are necessar...200
ZethProj 1.7.1 - (More than 10 new food products and two new cultivators)allMiscellaneous for ValheimValheim
More than 10 new work products, Black Metal Cultivator + Flometal + Flometal Axe + Flometal Cultivat...000
No fog.allMiscellaneous for ValheimValheim
Valheim mod No Fog Bruh to remove fog from the game.Wapok by No Fog BruhNo Fog Bruh is a fog removal...800
Compass HUDallMiscellaneous for ValheimValheim
A compass with a display on the head with pins on the map and dynamic markers for ships, cars and po...200
Favorite servers of ValheimallMiscellaneous for ValheimValheim
The MOD is based on Bepinex, which provides a config file for storing hosts and passwords of servers...000
WaypointallMiscellaneous for ValheimValheim
In five different biomes (meadows, black forests, swamps, mountains and plains) you can find additio...000
Personal teleportsallMiscellaneous for ValheimValheim
Hotkeys to teleport the player to the spawn point, the end point of death, or the last ship.With Per...100
Passive thrown forces.allMiscellaneous for ValheimValheim
Turn Forsaken buffs into passive effects!End of sale.Try TastyChickenLegs's Forsaken Powers Plus.Fea...600