Tactical CPC NPCs (G1/G2/G3)
Generative AI Mod: Tactical CPC Mod
A mod that integrates CPC naming/spawning with a locally running generative AI for patrol, decision-making, and combat.
Why I made this mod
Slugcat sits at the very bottom of the food chain and, aside from the player and slugpups, it’s basically absent as a species—almost endangered. I wanted more of them in the world, so I added additional slug NPCs.
How to start the server
Run start_server.bat inside:
C:Program Files (x86)Steamsteamappsworkshopcontent3125203584980186
If the server shows “ON” like in the screenshot, it succeeded.
Controls (extra features)
Press Numpad Enter to start recording the player’s actions (no noticeable frame drops).
Press Numpad + to let the AI auto-control your character (still rough).
Press Numpad 0/1/2/3 to spawn CPCs for each faction (factioning isn’t fully set up yet).
Original plan & current limitation
I originally used the phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4 model to build a self-learning mod.
But my gameplay skills are limited, and my coding time is constrained because I’m preparing for the Electrical Engineer practical exam.
I plan to update this later. Right now it runs only with an MLP; using an LLM for strategy/planning isn’t available.
Ultimate Goal
An AlphaStar-like generative-AI CPC.
Implemented
Improved CPC combat AI (initial AI uses the ArenaPlus AI model).
Added lots of action features so CPC can imitate player behavior (this is where my lack of gameplay skill shows).
Below is what gets trained:
Action set
ACTS = ["MoveX", "MoveY", "Jump", "Throw", "Pickup", "Map", "Grab", "Swallow"]
Feature set
FEATS = [
# Base 12 + 4 weapon + 4 enemy-type + 2 enemy-velocity + 2 lead-shot + 1 distance ring
"hasWeapon",
"enemyVisible",
"distanceNearest",
"hpRatio",
"vx",
"vy",
"posX",
"posY",
"enemy_dx",
"enemy_dy",
"onGround",
"isClimbingOrPipe",
# Weapon info (4)
"weaponVisible",
"distNearestWeapon",
"weapon_dx",
"weapon_dy",
# Enemy type info (4)
"enemy_is_scavenger",
"enemy_is_lizard",
"enemy_is_elite",
"enemy_count",
# Enemy velocity (2)
"enemy_vx",
"enemy_vy",
# Lead-shot hints (2)
"pred_dx",
"pred_dy",
# Distance ring (1)
"dist_ring",
]
Scavenger spawns so they and CPC slugcats can fight each other.
Names above CPCs and Scavengers (toward “named” units; partially works). Final aim: if you drop in a custom slugcat JSON and sprite atlas, it should render. Special skills are hard, but something like an Artificer-style jump should be possible.
Random CPC spawns across the world map.
CPC is a separate NPC from slugpup.
Not Yet Implemented
Faction setup — not sure which approach will actually work; I keep failing.
CPC obstacle traversal at player level — likely needs referencing all images and TXT files under
C:Program Files (x86)SteamsteamappscommonRain WorldRainWorld_DataStreamingAssetsworld
which I don’t have time for right now.
Spawning with weapons — keeps erroring; reason unknown.
Fully realized named CPC characters.
Boss monster and boss respawn after a threshold of deaths (I made the pixel art, but detailed behavior is hard).
Stronger CPC AI — planning continuous updates.
Art note
The images were generated by AI and then retouched by me.