Erork-ZombieJoiner icon

ZombieJoiner

Spawn controllable computer zombies that follow the latest player ping to reach destinations. Press J to spawn and K to delete the nearest zombie.简单说就是能生成可控制的电脑僵尸哦!

By Erork
Last updated a day ago
Total downloads 67
Total rating 1 
Categories Mods Host Only
Dependency string Erork-ZombieJoiner-1.0.1
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack_PEAK-5.4.2403 icon
BepInEx-BepInExPack_PEAK

BepInEx pack for PEAK. Preconfigured and ready to use.

Preferred version: 5.4.2403

README

ZombieJoiner

ZombieJoiner is a PEAK BepInEx mod that lets the host spawn computer-controlled zombie companions. These zombies are generated in-game, listen to player ping markers, and try to travel to the marked destination by simulating normal character movement.

Features

  • Press J to spawn one controlled computer zombie.
  • Press K to delete the nearest controlled zombie.
  • Zombies follow the latest player ping marker as their destination.
  • The zombie AI attempts to reach the pinged point using local path planning.
  • Supports direct walking, detours, climbing, jump-grab attempts, gap jumps, and drop-down decisions.
  • Includes safety handling for deleted zombies, invalid references, destroyed objects, missing Photon views, and interaction states.
  • The spawned zombie is intended to behave like a computer-controlled player-style zombie rather than a normal passive NPC zombie.

Controls

Key Action
J Spawn a controlled zombie near the local player
K Delete the nearest controlled zombie
Player ping Set the zombie destination

How it works

When a zombie is spawned, the mod creates a MushroomZombie object and attaches a custom controller to it. The controller reads the most recent player ping marker and treats that point as the active destination.

Instead of using a simple straight-line movement command, the zombie tries to move more like an in-game character. It checks the terrain around itself, decides whether the destination is directly reachable, and then chooses an action such as walking, detouring, climbing, jumping, or dropping down.

The path system is based on several action types:

  • Direct: Move directly toward the goal when the route looks clear.
  • Detour: Move around an obstacle or approach the goal from a better angle.
  • Climb: Attempt to climb when the target is above the zombie and the wall looks usable.
  • JumpGrab: Try a jump-grab when the target is above but not directly reachable by normal walking.
  • GapJump: Jump across a gap when the landing point appears reachable.
  • DropDown: Move down from a ledge when the drop is considered acceptable.
  • Hold: Pause or hold position when no safe movement is available.

The controller continuously replans while moving. If a route segment fails, the zombie records that failure and tries to avoid repeating the same bad route immediately.

Pathfinding design notes

ZombieJoiner does not rely on a full NavMesh. The AI uses local probing and player-like input simulation. This makes it flexible in dynamic terrain, but it also means the zombie may sometimes make imperfect decisions in complex areas.

The current navigation approach is best suited for:

  • Short and medium distance ping destinations.
  • Simple terrain transitions.
  • Platforms that can be reached by walking, climbing, or a small detour.
  • Situations where the player gives reasonable ping points on or near walkable ground.

The navigation can be less reliable when:

  • The ping is placed on a wall, cliff face, or unsupported edge.
  • The target requires a long human-style route around the map.
  • The zombie must distinguish between a dangerous drop and a safe route.
  • The terrain requires precise stamina management.
  • The route requires intentionally moving away from the destination before approaching it.

Behavior analysis and known limitations

The zombie follows the latest ping marker as a coordinate, but it does not fully understand player intent. A human player can tell the difference between a wall ping, an edge ping, a platform ping, or a route hint. The zombie currently treats the marker mainly as a destination point and then tries to resolve a nearby standable position.

The local path planner is mostly greedy. It looks around itself and chooses a nearby action that appears useful. This works for simple movement, but it may not always pick the same route a real player would choose. For example, a player may walk around to a ramp, while the zombie may try to climb a nearby wall.

Climbing and jump-grab logic are intentionally available so the zombie can handle vertical terrain, but these actions can sometimes be too aggressive. If the zombie is near a wall and the goal is above it, it may attempt to climb even when a safer player-like route exists nearby.

Drop-down and gap-jump decisions are also approximate. The zombie checks whether a landing point appears valid, but it cannot perfectly evaluate every danger or special terrain case. For this reason, extreme cliffs, narrow ledges, and unusual map geometry may still cause bad movement.

To reduce crashes and broken states, the mod includes defensive checks around common failure points such as missing characters, missing data objects, destroyed GameObjects, invalid Photon ownership, deleted zombies, and stale interaction references.

Multiplayer notes

The zombie AI is intended to be driven by the client that owns the spawned zombie object. Remote clients should mostly receive visual and network state updates. If ownership or room state changes unexpectedly, the zombie may temporarily stop moving until the owning client or host state is valid again.

For the most stable results, spawn and delete zombies as the host or master client.

Installation

  1. Install BepInEx for the game.
  2. Place the compiled ZombieJoiner plugin DLL into the BepInEx plugins folder.
  3. Launch the game.
  4. Join or host a room.
  5. Press J to spawn a controlled zombie.
  6. Use player ping markers to guide it.
  7. Press K to delete the nearest controlled zombie.

Configuration

The mod exposes basic BepInEx configuration values after first launch:

  • SpawnZombieKey: key used to spawn a zombie. Default: J.
  • DeleteZombieKey: key used to delete the nearest zombie. Default: K.
  • ZombiePrefabName: Photon prefab name used for the zombie. Default: MushroomZombie.
  • SpawnForwardOffset: distance in front of the player where the zombie spawns.
  • SpawnNearPlayer: whether the zombie should spawn near the local player.

Package metadata

  • Mod name: ZombieJoiner
  • Main purpose: spawn computer-controlled zombies that can travel toward player ping markers.
  • Default spawn key: J
  • Default delete key: K

中文介绍

ZombieJoiner 是一个用于 PEAK 的 BepInEx 模组。
它可以在游戏中生成一个由电脑控制的僵尸角色,让僵尸根据玩家的标点自动移动、爬墙、绕路、跳跃或下落,尽量到达玩家指定的位置。

功能介绍

  • J 键 生成一个电脑僵尸。
  • K 键 删除距离玩家最近的电脑僵尸。
  • 僵尸会读取玩家最后一次打出的标点,并把该标点作为移动目标。
  • 支持追踪“最后一个玩家的最后一个标点”,而不是只追最近的标点。
  • 僵尸会尝试通过局部寻路到达目的地。
  • 僵尸可以根据地形尝试:
    • 直接移动
    • 绕开障碍
    • 爬墙
    • 跳抓高处
    • 跳过小断层
    • 从较低风险的位置下落
  • 删除僵尸时会尽量清理抓取、背负、引用和网络对象,减少残留对象导致的崩溃。
  • 对常见空引用、Photon 对象失效、角色数据未初始化等情况加入了安全检查。

默认按键

按键 功能
J 生成一个电脑僵尸
K 删除最近的电脑僵尸

按键可以在 BepInEx 生成的配置文件中修改。

配置项说明

模组启动后会在 BepInEx 配置目录中生成配置文件。

常见配置项包括:

配置项 默认值 说明
SpawnZombieKey J 生成僵尸的按键
DeleteZombieKey K 删除最近僵尸的按键
ZombiePrefabName MushroomZombie 要生成的僵尸 prefab 名称
SpawnForwardOffset 2.5 在玩家前方多少距离生成僵尸
SpawnNearPlayer true 是否在玩家附近生成僵尸

寻路逻辑说明

ZombieJoiner 的僵尸寻路并不是传统 NavMesh 寻路,而是模拟玩家输入进行移动。

整体流程大致如下:

  1. 玩家在游戏中打出标点。
  2. 模组记录所有玩家的标点。
  3. 僵尸选择最后一次出现的标点作为目标。
  4. 僵尸根据自己当前位置和目标位置,判断应该直接走、绕路、爬墙、跳跃还是下落。
  5. 如果当前路线失败,僵尸会重新规划路径。
  6. 如果僵尸被拖拽、背起或处于交互状态,会暂停自己的 AI 输入,避免和玩家操作冲突。

当前寻路特点

这套寻路逻辑更偏向“局部地形判断”,不是完整地图级寻路。

优点:

  • 不需要预生成 NavMesh。
  • 可以适配很多动态地形和复杂地形。
  • 可以模拟玩家的移动、跳跃、攀爬行为。
  • 对简单路线、短距离标点、普通平台移动效果较好。

可能的不足:

  • 遇到复杂地图时,僵尸可能会更倾向于爬墙,而不是像玩家一样绕远路。
  • 对悬崖、平台边缘和高低差地形的判断可能不够像真实玩家。
  • 有些时候可能会频繁跳跃、反复尝试爬墙或在局部区域重新规划。
  • 远距离路径选择不如真正的全局寻路稳定。
  • 多人联机时,如果 Photon 所有权异常,可能需要房主重新生成或删除僵尸。

安全措施

模组中加入了一些防崩溃处理:

  • 生成僵尸前检查是否在房间内。
  • 生成僵尸前检查本地玩家是否存在。
  • 初始化僵尸前检查 MushroomZombieCharacterCharacterDataPhotonView 是否存在。
  • 删除僵尸前清理角色抓取、背负、携带、当前物品等引用。
  • 删除网络对象时优先使用 PhotonNetwork.Destroy
  • 如果网络删除失败,会尝试使用本地销毁作为兜底。
  • AI 更新逻辑中加入异常捕获,避免单个僵尸异常导致整个模组更新崩溃。

安装方法

  1. 安装 BepInEx。
  2. 将编译后的 ZombieJoiner.dll 放入:

##作者

  • 抖音:dline
  • 欢迎关注
BepInEx/plugins/