SetNet.Spawning
1.2.0
dotnet add package SetNet.Spawning --version 1.2.0
NuGet\Install-Package SetNet.Spawning -Version 1.2.0
<PackageReference Include="SetNet.Spawning" Version="1.2.0" />
<PackageVersion Include="SetNet.Spawning" Version="1.2.0" />
<PackageReference Include="SetNet.Spawning" />
paket add SetNet.Spawning --version 1.2.0
#r "nuget: SetNet.Spawning, 1.2.0"
#:package SetNet.Spawning@1.2.0
#addin nuget:?package=SetNet.Spawning&version=1.2.0
#tool nuget:?package=SetNet.Spawning&version=1.2.0
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
- Zones —
SpawnZone.Circle(id, center, radius)/SpawnZone.Box(id, min, max); the id is also set as each spawned mob'sZone. Custom shapes: subclassSpawnAreaand pass it tonew SpawnZone(id, area). - Populations —
zone.Add(mobType, count, respawnMs, health?, faction?)declares one mob type to keep alive. ThemobTypematches a brain'sMobTypeyou registered on theMobServer. 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 respawnrespawnMslater. It spawns mobs with their own respawn disabled (RespawnMs = 0) so this server owns the timing. - Driving it — the internal
Timerruns atTickIntervalMs(default 1000 ms) by default; setUseInternalTimer = falseand callSpawningServer.Update(dtMs)from your game loop instead.SpawningServerisIDisposable(stops the timer).
Notes
- Server-side, no wire protocol of its own. Spawns flow through
MobServer.Spawn, so clients see them via the usualSetNet.Mobsevents / replication.SpawningRuntime.Enable()exists for symmetry and is a no-op. - Depends on
SetNet+SetNet.Mobs+SetNet.GeoData.GeoDatais optional — without it, spawn points are used as-is; with it, each point isSampleNearestWalkable-snapped to the ground.
License
MIT
| Product | Versions 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. |
-
.NETStandard 2.1
- SetNet (>= 1.2.0)
- SetNet.GeoData (>= 1.2.0)
- SetNet.Mobs (>= 1.2.0)
- SetNet.Ticks (>= 1.2.0)
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 |