AetherNet.Shared
0.0.3
See the version list below for details.
dotnet add package AetherNet.Shared --version 0.0.3
NuGet\Install-Package AetherNet.Shared -Version 0.0.3
<PackageReference Include="AetherNet.Shared" Version="0.0.3" />
<PackageVersion Include="AetherNet.Shared" Version="0.0.3" />
<PackageReference Include="AetherNet.Shared" />
paket add AetherNet.Shared --version 0.0.3
#r "nuget: AetherNet.Shared, 0.0.3"
#:package AetherNet.Shared@0.0.3
#addin nuget:?package=AetherNet.Shared&version=0.0.3
#tool nuget:?package=AetherNet.Shared&version=0.0.3
<div align="center"> <h1>⚡ AetherNet</h1> <p><strong>GC-free, deterministic 2D physics for server-authoritative Unity games</strong></p>
<p> <img alt="Build" src="https://img.shields.io/github/actions/workflow/status/adielmag/aethernet/build.yml?style=flat-square&logo=github"> <img alt="NuGet" src="https://img.shields.io/nuget/v/AetherNet.Shared?style=flat-square&logo=nuget&label=AetherNet.Shared"> <img alt="NuGet Unity" src="https://img.shields.io/nuget/v/AetherNet.Unity?style=flat-square&logo=nuget&label=AetherNet.Unity"> <img alt="License" src="https://img.shields.io/github/license/adielmag/aethernet?style=flat-square"> <img alt=".NET" src="https://img.shields.io/badge/.NET-8.0-512BD4?style=flat-square&logo=dotnet"> </p> </div>
What is AetherNet?
AetherNet completely decouples 2D physics simulation from Unity’s native engine. A single, deterministic physics loop powered by Aether.Physics2D (a pure C# Box2D port) runs identically on a headless .NET 8 server and a Unity client — with zero runtime heap allocation.
Packages
| Package | Target | Description |
|---|---|---|
AetherNet.Shared |
.NET Standard 2.0 / .NET 8 | Core simulation: PhysicsWorldManager, collision, networking utilities, queries. Used on both server and client. |
AetherNet.Unity |
Unity (via NuGetForUnity) | MonoBehaviour components: AetherRigidbody, colliders, AetherViewManager, physics queries, scene baker, editor gizmos. |
Install
Server / .NET project
dotnet add package AetherNet.Shared
Unity project
- Install NuGetForUnity (free, open source).
- In Unity: NuGet → Manage NuGet Packages, search for AetherNet.Unity and install.
AetherNet.Sharedis pulled in automatically as a dependency.
Features
- ⚡ Zero runtime GC allocation — pre-allocated parallel arrays throughout
- 🎯 100% deterministic fixed-timestep simulation — identical results on server and client
- 🖥️ Headless .NET 8 server — no Unity license required; loads baked JSON map files
- 💥 Unity-style collision callbacks —
OnCollisionEnter/Exit,OnTriggerEnter/Exitvia interface dispatch - 💪 Full force API —
AddForce,AddTorque,AddForceAtPositionwithForceMode - 🔍 Physics queries —
Raycast,OverlapCircle,OverlapBoxwith zero-alloc buffers - 🏗️ Editor scene baker — AetherNet → Bake Scene to JSON exports map data for the headless server
- 🎨 Scene View gizmos — box, circle, and polygon colliders drawn in the editor
- 🔗 Transport-agnostic networking — plug in Mirror, FishNet, LiteNetLib, or raw sockets
- 🔒 Rigidbody constraints —
FreezePositionX/Y,FreezeRotationapplied post-step
Quick Start — Unity
Scene Setup
- Create a GameObject → Add AetherNet → View Manager.
- On entity prefabs, add AetherNet → Rigidbody + one of Box / Circle / Polygon Collider.
- Bake the scene for the server: AetherNet → Bake Scene to JSON.
Physics & Collisions
using AetherNet;
public class Player : MonoBehaviour, IAetherCollisionHandler, IAetherTriggerHandler
{
private AetherRigidbody _rb;
void Awake() => _rb = GetComponent<AetherRigidbody>();
void Update()
{
if (Input.GetKey(KeyCode.Space))
_rb.AddForce(Vector2.up * 500f, ForceMode.Impulse);
}
public void OnCollisionEnter(ref CollisionData d) => Debug.Log($"Hit entity {d.EntityIdB}");
public void OnCollisionExit(ref CollisionData d) { }
public void OnTriggerEnter(ref TriggerData d) => Debug.Log($"Trigger {d.OtherEntityId}");
public void OnTriggerExit(ref TriggerData d) { }
}
Quick Start — Headless Server
cd src/AetherNet.Server
dotnet run -- maps/level01.json
var world = new PhysicsWorldManager(WorldConfig.Default);
var loader = new MapLoader();
loader.LoadInto(world, "maps/level01.json");
var loop = new ServerTickLoop(world);
loop.SetSnapshotCallback((states, count, tick) =>
{
int bytes = StateSerializer.Serialize(states, count, sendBuffer, 0);
myTransport.BroadcastUnreliable(sendBuffer, bytes);
});
loop.Run(CancellationToken.None);
Networking
| Type | Purpose |
|---|---|
INetworkStateProvider |
Hook into the tick loop — implement to broadcast state |
StateSerializer |
Zero-alloc binary write/read of EntityState[] |
StateInterpolator |
Client-side snapshot lerp for smooth rendering |
SnapshotBuffer |
Circular buffer of authoritative snapshots |
TickAcknowledger |
Bitmask ack tracking for delta compression |
See examples/LiteNetLibExample/ for a complete LiteNetLib integration.
Contributing
- Fork and branch:
feature/your-featureorfix/issue. - All
AetherNet.Sharedchanges must passdotnet test. - PR checklist: build clean, tests green, no new GC allocs in hot paths.
License
| 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 is compatible. 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.0
- Aether.Physics2D (>= 2.2.0)
- System.Memory (>= 4.5.5)
-
net8.0
- Aether.Physics2D (>= 2.2.0)
- System.Memory (>= 4.5.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.