REPO_JP-EnemySpawnRange icon

EnemySpawnRange

【Host Only MOD】Adjust enemy spawn distance range from players.プレイヤーからの敵スポーン距離範囲を調整

By REPO_JP
Last updated 2 months ago
Total downloads 3584
Total rating 8 
Categories Mods Monsters Server-side AI Generated
Dependency string REPO_JP-EnemySpawnRange-4.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

EnemySpawnRange

COMPATIBLE WITH COSMETICS UPDATE V0.4.0.

This mod is a host-only mod that changes the enemy spawn distance range from players.

By default, enemies try to spawn at valid level points between 5 and 15 units away from players instead of the vanilla 18 to 35 range.

It does not force enemies to spawn directly on top of players, inside players, or always in line of sight. The game still uses valid internal level points and collision checks.

Features

  • Change the minimum enemy spawn distance from players
  • Change the maximum enemy spawn distance from players
  • Apply one shared distance range to all enemies
  • Use vanilla fallback when the custom range fails
  • Respect the game's debug close-spawn behavior when enabled
  • Skip custom spawn control in arena levels by default
  • Skip custom spawn control in shop levels by default
  • Run only after level generation is complete by default
  • Host-only operation

How it works

The mod patches the shared enemy spawn function:

  • SemiFunc.EnemySpawn

When an enemy is spawned, the mod reads the configured minimum and maximum distance, searches for a valid level point in that range, checks whether the point is blocked, and teleports the enemy there if the point is valid.

If no valid custom point is found, the mod can retry with the vanilla distance range of 18 to 35.

For REPO v0.4.0, the mod also avoids running before level generation has completed. This prevents the mod from affecting menu, lobby, region selection, shop, or arena timing.

Important behavior

  • This mod changes the allowed distance range for enemy spawn candidate points
  • This mod does not guarantee line-of-sight spawns
  • This mod does not guarantee face-to-face spawns
  • This mod does not place enemies directly at player coordinates
  • Very small ranges can reduce valid spawn points and may increase fallback usage
  • If fallback is disabled and the range is too narrow, some enemy spawns may fail more often

Vanilla and default settings

Vanilla REPO:

  • MinSpawnDistance = 18
  • MaxSpawnDistance = 35

EnemySpawnRange default:

  • ModEnabled = true
  • MinSpawnDistance = 5
  • MaxSpawnDistance = 15
  • RespectDebugSpawnClose = true
  • FallbackToVanillaOnFailure = true
  • ExcludeArena = true
  • ExcludeShop = true
  • RequireLevelGenerated = true
  • LogEnabled = false

Configuration

ModEnabled

Enables or disables the mod.

  • Default: true
  • Minimum: false
  • Maximum: true

MinSpawnDistance

Minimum allowed distance from players for enemy spawn points.

  • Default: 5
  • Minimum: 0
  • Maximum: 999

MaxSpawnDistance

Maximum allowed distance from players for enemy spawn points.

  • Default: 15
  • Minimum: 0
  • Maximum: 999

RespectDebugSpawnClose

If enabled, the mod respects the game's debug close-spawn mode and temporarily uses the debug spawn range instead of the configured range.

  • Default: true
  • Minimum: false
  • Maximum: true

FallbackToVanillaOnFailure

If enabled, the mod retries with the vanilla 18 to 35 range when the custom range fails.

  • Default: true
  • Minimum: false
  • Maximum: true

ExcludeArena

If enabled, the mod does not override enemy spawn distance in arena levels.

  • Default: true
  • Minimum: false
  • Maximum: true

ExcludeShop

If enabled, the mod does not override enemy spawn distance in shop levels.

  • Default: true
  • Minimum: false
  • Maximum: true

RequireLevelGenerated

If enabled, the mod only runs after level generation is complete.

  • Default: true
  • Minimum: false
  • Maximum: true

LogEnabled

Enables detailed debug log output.

  • Default: false
  • Minimum: false
  • Maximum: true

Installation

  1. Install BepInEx 5 for REPO
  2. Place the mod DLL into the BepInEx plugins folder
  3. Start the game once to generate the config file
  4. Edit the config file if needed
  5. Host a game

Host-only behavior

Only the host needs to install this mod. Clients do not need to install it for the enemy spawn distance changes to take effect.

Recommended values

  • 0 to 8: very aggressive close spawning
  • 5 to 15: close-range pressure
  • 18 to 35: vanilla behavior
  • 30 to 60: farther and less immediate pressure

Compatibility

This mod is most compatible with mods that do not replace the enemy spawn pipeline.

Mods that also patch SemiFunc.EnemySpawn may conflict depending on patch order and implementation.

Notes for modders

This mod keeps the game's existing level point search and collision validation flow. It changes the spawn distance range, but it does not create a completely custom enemy spawn system.

The v0.4.0-compatible implementation includes safety checks for:

  • Level generation completion
  • Normal level state
  • Arena exclusion
  • Shop exclusion
  • Host or singleplayer authority
  • Player list availability
  • Fallback to vanilla spawn range

※Mod created by AI


EnemySpawnRange

COSMETICS UPDATE V0.4.0対応済み.

REPOが好きな日本人のための日本人のみのREPOのDiscordサーバーあります! 参加は以下のリンクから! https://discord.gg/h5ATY4m5bZ

このMODは、ホスト専用の、プレイヤーからの敵スポーン距離範囲を変更するMODです。

初期設定では、敵がプレイヤーから 5 から 15 ユニット離れた有効なレベルポイントにスポーンしようとします。 バニラの距離範囲は 18 から 35 です。

敵をプレイヤーの体内、真上、必ず視界内に出現させるMODではありません。 ゲーム内部の有効なレベルポイントと衝突判定を使う仕様は維持します。

機能

  • プレイヤーからの敵スポーン最小距離を変更
  • プレイヤーからの敵スポーン最大距離を変更
  • 全敵共通でひとつの距離範囲を適用
  • カスタム距離で失敗した場合にバニラ距離で再試行
  • ゲーム本体の debug close spawn 動作を尊重可能
  • 初期設定ではアリーナ中のカスタム制御を除外
  • 初期設定ではショップ中のカスタム制御を除外
  • 初期設定ではレベル生成完了後のみ実行
  • ホストのみ導入で動作

動作概要

このMODは、敵スポーンの共通処理をパッチします。

  • SemiFunc.EnemySpawn

敵がスポーンする時、Config の最小距離と最大距離を読み取り、その範囲内の有効なレベルポイントを探します。 その地点がブロックされていない場合、敵をその地点へ移動します。

カスタム距離で有効な地点が見つからない場合、設定によりバニラ距離の 18 から 35 で再試行できます。

REPO v0.4.0向けに、レベル生成完了前は処理しないようにしています。 これにより、メニュー、ロビー、リージョン選択、ショップ、アリーナのタイミングへ干渉しにくくしています。

重要な仕様

  • このMODは敵スポーン候補点の距離範囲を変更するMODです
  • 視界内スポーンを保証するものではありません
  • 真正面スポーンを保証するものではありません
  • プレイヤー座標そのものに敵を配置するものではありません
  • 距離範囲を狭くしすぎると、有効候補点が減ってフォールバックが増える可能性があります
  • フォールバックを無効化して距離範囲を狭くしすぎると、敵スポーン失敗が増える可能性があります

バニラ値と初期設定

REPO バニラ:

  • MinSpawnDistance = 18
  • MaxSpawnDistance = 35

EnemySpawnRange 初期設定:

  • ModEnabled = true
  • MinSpawnDistance = 5
  • MaxSpawnDistance = 15
  • RespectDebugSpawnClose = true
  • FallbackToVanillaOnFailure = true
  • ExcludeArena = true
  • ExcludeShop = true
  • RequireLevelGenerated = true
  • LogEnabled = false

設定項目

ModEnabled

MODの有効無効

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

MinSpawnDistance

敵スポーン候補点として許可するプレイヤーからの最小距離

  • 初期値: 5
  • 設定可能最小値: 0
  • 設定可能最大値: 999

MaxSpawnDistance

敵スポーン候補点として許可するプレイヤーからの最大距離

  • 初期値: 15
  • 設定可能最小値: 0
  • 設定可能最大値: 999

RespectDebugSpawnClose

有効時、ゲーム本体の debug close spawn が有効なら Config の距離より debug spawn range を優先

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

FallbackToVanillaOnFailure

有効時、カスタム距離で失敗した場合にバニラ距離の 18 から 35 で再試行

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

ExcludeArena

有効時、アリーナ中は敵スポーン距離を変更しません

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

ExcludeShop

有効時、ショップ中は敵スポーン距離を変更しません

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

RequireLevelGenerated

有効時、レベル生成完了後のみMOD処理を実行します

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

LogEnabled

詳細ログ出力の有効無効

  • 初期値: false
  • 設定可能最小値: false
  • 設定可能最大値: true

導入方法

  1. REPO用の BepInEx 5 を導入
  2. MODの DLL を BepInEx の plugins フォルダへ配置
  3. 一度ゲームを起動して Config を生成
  4. 必要に応じて Config を編集
  5. ホストとしてゲームを開始

ホストオンリー仕様

このMODはホストのみ導入すれば動作します。 参加者側は導入不要です。

おすすめ設定例

  • 0 から 8: かなり近距離寄りで圧が強い
  • 5 から 15: 近距離寄りで緊張感が高い
  • 18 から 35: バニラ挙動
  • 30 から 60: 遠距離寄りで即圧が弱い

互換性

敵スポーン処理を置き換える他MODとは競合する可能性があります。

特に SemiFunc.EnemySpawn を同時にパッチするMODとは、パッチ順や実装次第で競合します。

MOD制作者向け補足

このMODは、ゲーム本体のレベルポイント探索と衝突確認の流れを維持します。 完全独自の敵スポーンシステムを作るのではなく、スポーン距離範囲だけを変更します。

v0.4.0対応版では、以下の安全判定を含みます。

  • レベル生成完了確認
  • 通常レベル中確認
  • アリーナ除外
  • ショップ除外
  • ホストまたはソロ権限確認
  • プレイヤー一覧確認
  • バニラ距離フォールバック

※AI生成MOD