Jump to content

Friendly AI

From WarhammerWorkshop
Revision as of 21:21, 26 April 2025 by HAPPYMAN5 (talk | contribs) (Created page with "thumb|355x355px|Image of Squad mates on Decapitation. Sniper and Assault pictured = Squad Mates = In Space Marine 2's [https://spacemarine2.fandom.com/wiki/Operations Operations Game Mode] you have the option to play with 3 other players through a mission, or run a mission solo. When you run a mission solo you are given squad mates in the form of AI. They can be any of the 6 classes in game, and they have their own predefined weapo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Image of Squad mates on Decapitation. Sniper and Assault pictured

Squad Mates

In Space Marine 2's Operations Game Mode you have the option to play with 3 other players through a mission, or run a mission solo. When you run a mission solo you are given squad mates in the form of AI. They can be any of the 6 classes in game, and they have their own predefined weapons and armor. In vanilla, while useful, these squad members are bland and cannot be edited at all. But by editing their files, they become heavily customizable. Before continuing, you should read: Squad Mates

What Files Contribute to Squad Mate Customization?

There are a lot of files that will allow you to customize your squad mates, and there are multiple different methods for customization. These files can control weapon loadouts, armor, and color of each Squad Mate.

This is the armor the bot will use

Character_Customization_Library.sso

This file among other things, contains one of the simplest ways to edit the armor of AI squad mates. This file is located in: "client_pc\root\paks\client\default\default_other.pak\ssl\body\customization." This file, among other things, contains one of the simplest ways to edit the armor of AI squad mates.

This is how character_customization_library.sso defines what goes into the first armor slot.

Predefined Armor Presets

The reason AI squad mates look bland and without helmets in vanilla is because that is the first predefined armor slot. (see right) character_customization_library.sso is the file that defines all of these predefined armor slots for every class. (see left) Each preset can be edited to show different armor parts including DLC and Community Event Armor, and even armor parts of other classes.

Squad mates using edited armors on Decapitation

Every preset is split up into 10 entries: HELMET, BACKPACK, CHEST, LEFT_PAULDRON, RIGHT_PAULDRON, LEFT_GAUNTLET, RIGHT_GAUNTLET, LEFT_GREAVE, RIGHT_GREAVE, and VANITY. Changing these entries will edit how the predefined armor slot will look. And changing PREDEFINED_PRESET_1 will change how the AI squad mates look in game. (see right) To find the names of armor pieces look at the other presets for a class, or scroll down to the "bodySections" section for each class. To know what they look like, have the game open in another window and look at the armor with the corresponding name. Example: "chest_soldier_common_01" will be the first common (grey) chest plate option on Tactical.

Dark Angels chapter presets

Global_Armor_Color_Pattern_Library.sso

This file defines colors, decals, and the colors of decals for every chapter preset in the game. By changing the defined colors and decals of a preset you can create custom chapter preset to use in your mods. This file is located in "client_pc\root\paks\client\default\default_other.pak\ssl\body\customization."

Predefined Chapter Presets

A predefined Chapter Preset typically looks like the image on the right for the Dark Angels preset. There will be slight differences between presets. Some define the color of decals, some will specify shoulder pauldron markings by class, all of these can be copied and pasted into one preset for maximum customization.

Custom Preset replacing the default Ultramarines preset.

The AI Squad mates are programmed to always be Ultramarines. But the Ultramarine colors can be changed. I'm going to sneak in a quick tutorial here. If you look at the Ultramarines section at the very top of this file, you will notice it does not have color definitions. To change the color definitions that don't exist we have to steal them from another Chapter Preset. Copy the "mainColoring" section from the Dark Angels preset, and paste it right above the "decals" section in the Ultramarines preset. You can now edit the Primary, Secondary, and Tertiary colors of the Ultramarines preset, and any colors you set it to will appear on your squad mates while playing solo. A list of available colors can be found in "armor_color_library". Changing the colors of a predefined color preset will replace it with your colors, so changing the colors of the Ultramarines preset means you will no longer have an "Ultramarines" preset.

Custom preset being applied to bots in game.

Coloring Specific Body Parts

As you can see in the Dark Angels preset there is a "bodySectionsColoring" section. Inside of this section it says "CHEST" with color definitions below it. You can think of this as using the UI in game to add a color rule for a body part, just doing it through text. So "mainColoring" is the "General Rules" for your custom pattern, and "bodySectionsColoring" is the "Custom Rules" for your custom pattern. You can copy and paste this section and change the "CHEST" to HELMET, HELMET_LENSES, BACKPACK, LEFT_PAULDRON, RIGHT_PAULDRON, LEFT_GAUNTLET, RIGHT_GAUNTLET, LEFT_GREAVE, or RIGHT_GREAVE. Then edit the colors to whatever you would like When adding HELMET_LENSE colors, you only need a primary slot and where it says "_type =" in the colors section, change "CustomizationBodyColoringInfo" to "CustomizationBodyColoringInfoLenses" for proper light emissions from the color.

Weapon_Bot_Loadout_Templates_Library.sso

AI squad mates get their weapons predefined by Class, and then Difficulty, in weapon_bot_loadout_templates_library.sso. This file is located in "server_pc\root\paks\server\default\default_other.pak\ssl\main\user\weapon_loadouts\bot_templates"

Soldier Weapon Loadouts by difficulty.

Defining Weapons

Each difficulty section has a primarySkill, secondarySkill, and meleeSkill. These "Skills" define the type of weapon each class will use when they are a Bot. Changing the entries for these 3 spaces will change the type of weapon that the Bot will use in a mission. You can find a list of available weapon names in firearm_library_pve.sso. A weapon does not have to be one that is on the class in the vanilla version of the game. You can give the Bulwark a Heavy Bolter using this file.

Underneath weapon skills are the variables that define the version of the weapon. primaryVersion corresponds to primarySkill, secondaryVersion to secodnarySkill, and meleeVersion to meleeSkill. These versions are the versions you can select in the Armory.

01 = Common (Grey), 02 = Master Crafted (Green), 03 = Artificer (Purple), 04 = Relic (Gold)

You can get even more specific with "0#_x". So if you wanted the 3rd Relic variant you would fill in the space as "04_b" because 04 is the first variant. For a list of weapon Variants you can chose from see firearm_modificators_library.sso. When you set a weapon to a specific version, the skin applied to that version will be equipped, and state values associated with that version will also be applied to the weapon.

Weapons and weapon versions do not have to be the same on every difficulty so you can make your Heavy bot use a Heavy Bolter on the first 3 difficulties, and a Multi-Melta on the last 3 difficulties.

Expanding Arsenals

You will notice that some characters do not have a primary or a melee slot. In cases like this if you would like to have a squad mate like the Bulwark have a primary weapon, you need to add a primarySkill and primaryVersion, and then define the weapon and version. A character having a skill slot does not have to remain consistent on all difficulty levels. Your bulwark can have no primarySkill on the first 3 difficulties, and have a primarySkill on the last 3 difficulties.

Bots with Relic/DLC weapons on Decapitation, Sniper and Vanguard Pictured.

Other Friendly AI

Other Friendly AI can be spawned through the ESD Manager and the Factions and Compositions Library. Things Like Imperial Guard, Space Marines, and Dreadnoughts can be spawned in to assist the player using these files. But if their packTypes are set to AGGRO instead of IDLE they will attack the player.

Imperial Guard

Imperial Guard spawn in some missions by default, but they can be added to all Operations, and have their squad numbers increased using the ESD Manager or the ESD Factions and Compositions Library. They can have various stats like Health, Damage Sensitivity, and Speed edited in their server file located in "server_pc\root\paks\server\default\default_other.pak\ssl\characters\imperium". This file is called npc_guardsman_server.cls. You could also use this file to give them space marine weapons if you wanted.

They can have their size and TPL (model) edited in their client file located in "client_pc\root\paks\client\default\default_other.pak\ssl\characters\imperium". This file is called npc_guardsman_client.cls. You could also use this file to give them a boss bar if you wanted for some reason.

Space Marines

Spawning Space Marines in Operations is a little more complicated but editing them is almost the same. Server and Client files exist for a Tactical Marine, an Assault Marine, a Deathwatch Space Marine, these units all link back to npc_imperial_marine_server.cls on the server side, and editing this file should change the stats for the rest of them. Things like Damage Sensitivity and Speed. The file should be located in "server_pc\root\paks\server\default\default_other.pak\ssl\characters\imperium\impmarine".

The Models of each of these can be changed in their respective client files located in "client_pc\root\paks\server\default\default_other.pak\ssl\characters\imperium\impmarine".

Dreadnoughts

Dreadnoughts can be spawned through the ESD Manager and the ESD Factions and Compositions Library. They can have their stats like speed, damage sensitivity, and weapon they are using inside the npc_dreadnought_server.cls file located in "server_pc\root\paks\server\default\default_other.pak\ssl\characters\imperium\dreadnought"

Inside the npc_dreadnought_client.cls file you can edit their Model and size. This file is located in "client_pc\root\paks\server\default\default_other.pak\ssl\characters\imperium\dreadnought"

How can I spawn these characters in my Operations

Some characters are set up for most operations like Guardsmen and Dreadnoughts, and getting them to spawn is as simple as replacing an archetypeUid with their own. But in some cases characters are not set up on missions, and need to be set up manually. A tutorial will be made sometime soon on how to do that.

This Page is incomplete but the Tech Priest(s) who scribed it has exhausted their memory banks on this subject. If you have more information please feel free to complete the page.