SetNet.Spawning 1.2.0

dotnet add package SetNet.Spawning --version 1.2.0
                    
NuGet\Install-Package SetNet.Spawning -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SetNet.Spawning" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SetNet.Spawning" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SetNet.Spawning" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SetNet.Spawning --version 1.2.0
                    
#r "nuget: SetNet.Spawning, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SetNet.Spawning@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SetNet.Spawning&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SetNet.Spawning&version=1.2.0
                    
Install as a Cake Tool

SetNet.Spawning

Zone-based mob spawning for SetNet, on top of SetNet.Mobs.

Define spawn zones as box or circle areas, say which mob types live in each zone, how many of each to keep alive, and how long after a death one respawns. The server keeps every zone populated — counting living mobs, scheduling a respawn for any that died, and spawning replacements when their delay elapses — snapping spawn points to walkable ground via SetNet.GeoData when you supply it. Headless-drivable or self-timed.

var mobs = server.UseMobs(mobOptions);       // your SetNet.Mobs hub, brains already registered

var spawning = server.UseSpawning(mobs, new SpawnOptions
    {
        GeoData          = world,            // optional: snap spawn points to walkable ground
        UseInternalTimer = true,             // default — or false to drive Update(dt) yourself
        Seed             = 1234,             // optional deterministic RNG
    })
    .AddZone(SpawnZone.Circle("forest", center, radius: 40f)
        .Add("goblin", count: 8,  respawnMs: 30000)
        .Add("wolf",   count: 3,  respawnMs: 45000))
    .AddZone(SpawnZone.Box("cave", min, max)
        .Add("bat",    count: 12, respawnMs: 15000, health: 20));

// If UseInternalTimer = false, tick it from your own loop:
spawning.Update(dtMs);

Concepts

  • ZonesSpawnZone.Circle(id, center, radius) / SpawnZone.Box(id, min, max); the id is also set as each spawned mob's Zone. Custom shapes: subclass SpawnArea and pass it to new SpawnZone(id, area).
  • Populationszone.Add(mobType, count, respawnMs, health?, faction?) declares one mob type to keep alive. The mobType matches a brain's MobType you registered on the MobServer. A zone can hold several populations.
  • Filling & respawning — each tick the server tops zones up to count, and when a mob dies it schedules a respawn respawnMs later. It spawns mobs with their own respawn disabled (RespawnMs = 0) so this server owns the timing.
  • Driving it — the internal Timer runs at TickIntervalMs (default 1000 ms) by default; set UseInternalTimer = false and call SpawningServer.Update(dtMs) from your game loop instead. SpawningServer is IDisposable (stops the timer).

Notes

  • Server-side, no wire protocol of its own. Spawns flow through MobServer.Spawn, so clients see them via the usual SetNet.Mobs events / replication. SpawningRuntime.Enable() exists for symmetry and is a no-op.
  • Depends on SetNet + SetNet.Mobs + SetNet.GeoData. GeoData is optional — without it, spawn points are used as-is; with it, each point is SampleNearestWalkable-snapped to the ground.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 75 8/5/2026