ArceDev-GMMapLoader icon

GMMapLoader

Developer API for registering and synchronously loading custom maps for How to Fish game modes.

By ArceDev
Last updated 3 hours ago
Total downloads 8
Total rating 0 
Categories Mods
Dependency string ArceDev-GMMapLoader-0.1.0
Dependants 1 other package depends on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

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

Preferred version: 5.4.2305
ArceDev-GameModeCore-0.1.0 icon
ArceDev-GameModeCore

Developer API for registering, selecting, persisting, and synchronizing custom How to Fish game modes.

Preferred version: 0.1.0

README

GM Map Loader

A developer API for registering AssetBundle maps for custom How to Fish game modes and loading them consistently across multiplayer clients.

GM Map Loader associates every map with a mode registered through Game Mode Core. The host can only select maps whose ID and network version are available to every connected client.

Register from code

Reference ArceDev.GMMapLoader.dll, declare hard dependencies on ArceDev.GMMapLoader and ArceDev.GameModeCore, then register during your plugin's Awake:

GMMapApi.Register(new GMMapDefinition(
    id: "YourTeam.YourMaps.ArenaOne",
    gameModeId: "YourTeam.YourMode",
    displayName: "Arena One",
    bundlePath: Path.Combine(pluginDirectory, "arenas", "arena-one"),
    sceneName: "ArenaOne",
    networkVersion: 1));

Register content without a DLL

Place one or more files ending in .gmmap.json below BepInEx/plugins. Bundle paths are relative to the manifest and cannot escape its directory.

{
  "schemaVersion": 1,
  "id": "YourTeam.YourMaps.ArenaOne",
  "gameModeId": "YourTeam.YourMode",
  "displayName": "Arena One",
  "bundle": "arenas/arena-one",
  "scene": "ArenaOne",
  "networkVersion": 1
}

Each bundle must be self-contained and contain the named Unity scene. GM Map Loader deliberately does not define spawn points, checkpoints, boundaries, or game rules; those belong to the consuming game mode.

Select and load

Only the host requests transitions:

IReadOnlyList<GMMapDefinition> compatible = GMMapApi.SessionMaps(myModeId);
if (compatible.Count > 0
    && GMMapApi.TryLoadForAll(compatible[0].Id, out string error))
{
    GMMapApi.AllClientsLoaded += StartRound;
}

SessionMaps is the local catalog outside a running server and the multiplayer intersection while hosting. AllClientsLoaded fires on the host after every authenticated client confirms the transition. A transition aborts if a client fails, disconnects, or takes longer than 45 seconds.

Installation

GM Map Loader is a library and adds nothing by itself. Install the game mode or map pack you want with a Thunderstore-compatible mod manager such as r2modman; it installs GM Map Loader and Game Mode Core automatically. For a manual install, place ArceDev.GMMapLoader.dll in BepInEx/plugins together with Game Mode Core and BepInEx 5.

Multiplayer

Every player must install GM Map Loader. The host can only choose maps that every connected player also has installed with the same network version.

Support

Join DevArce Mods on Discord for questions, feedback, and bug reports.

AI Disclosure

This mod was developed with assistance from generative AI for programming, documentation, and promotional artwork. The author reviewed, tested, and approved the final implementation and assets.