SetNet.Locomotion 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SetNet.Locomotion --version 1.2.0
                    
NuGet\Install-Package SetNet.Locomotion -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.Locomotion" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SetNet.Locomotion" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SetNet.Locomotion" />
                    
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.Locomotion --version 1.2.0
                    
#r "nuget: SetNet.Locomotion, 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.Locomotion@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.Locomotion&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SetNet.Locomotion&version=1.2.0
                    
Install as a Cake Tool

<p align="center"> <img src="https://raw.githubusercontent.com/Povstalez/SetNet/master/assets/icon.png" alt="SetNet" width="96"> </p>

SetNet.Locomotion

One unified server-side tick that moves everything — players, mobs, NPCs, projectiles — and replicates nothing.

Create a Mover and it's automatically part of the tick; the system advances its position along a pathfound route N times per second. It sends nothing over the network — you read positions and replicate them your own way. When a mover gets a new destination it fires Started, so you can send just the destination point to clients (L2-style; the client re-paths locally — see SetNet.Locomotion.Unity).

Server

IGeoData geo = GeoDataFile.LoadFromFile("world.geo");
var loco = server.UseLocomotion(geo, new LocomotionOptions { Hz = 10 });   // one unified system

// send just the destination to nearby clients when something starts moving (client re-paths from the point):
loco.Started += m => SendMoveTo(m.Owner, m.Destination!.Value);

// anything that moves creates a Mover — that's the whole subscription:
var mover = loco.CreateMover(spawnPos, speed: stats.Get("move_speed"), owner: character);

// on a client move command / mob AI decision:
mover.GoTo(destination);      // paths there, starts following (false if unreachable)

// the system advances mover.Position every tick — read it for range/AoI or to write into your replicated state:
mover.DestinationReached += m => { /* arrived */ };
mover.Dispose();              // auto-unsubscribe when the entity leaves

What it is (and isn't)

  • It simulates, it doesn't replicate. No packets, no StateSync writes — just positions advancing. You decide how the position reaches clients (a NetworkVariable field, an L2 "move to point" event on Started, whatever).
  • Automatic subscription. CreateMover registers it; Dispose() removes it. No manual Register.
  • Unified. Players, NPCs, projectiles — anything holding a Mover shares the one tick. (Mobs has its own tick; point its movement here too if you want a single system.)
  • One reused pathfinder (Pathfinding.For(geo), pooled) for every mover.

API

server.UseLocomotion(geo, options?) (or new LocomotionSystem(geo, options?)) → LocomotionSystem:

  • CreateMover(start, speed, owner?)Mover (auto-subscribed), Movers, Count.
  • Update(dtMs) when UseInternalTimer = false (drive it from your own loop).
  • Started event — a mover got a new destination (send the point to clients here).

Mover: Position, Speed, Owner, Destination, IsMoving, GoTo(point), Stop(), Warp(point), DestinationReached, Dispose().

Notes

  • Server-authoritativeGoTo paths on the server; an unreachable point does nothing.
  • L2-style pairing: replicate only the destination on Started; the client runs its own FindPath and walks the model with the Unity NavAgent. Between destinations the server sends nothing.
  • Uses SetNet.GeoData.Vec3.

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 (1)

Showing the top 1 NuGet packages that depend on SetNet.Locomotion:

Package Downloads
SetNet.Mobs.Locomotion

The opt-in bridge that makes SetNet.Mobs advance mob positions through the unified SetNet.Locomotion tick instead of their own path-follower: loco.AsMobMover() → MobOptions.Mover. Mob AI/perception/threat/combat/replication are unchanged; only the movement stepping moves into the one shared system, so players and mobs share it (and its Started hook, for L2-style "send the point" replication). Depends on SetNet.Mobs + SetNet.Locomotion.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.0 76 8/18/2026
1.3.2 85 8/15/2026
1.2.0 117 8/5/2026