How smartlydressedgames/u3-sdk works
1. This is a Unity 2022.3 game project for Unturned, not a typical app/service repo. The architecture is organized around Unity scenes, asset folders, and a large runtime codebase under Assets/Runtime, with game-specific content in Assets/Game and editor/build tooling in Assets/Editor.
2. The entry points are scene-based: Assets/GameStartup.unity is the main startup scene, while Assets/Game/Sources/Scenes contains the major gameplay scenes (Game, Loading, Menu, Menu_Fallback). The project boots through Unity’s scene lifecycle rather than a custom server/client executable.
3. Runtime code is split into two broad layers: shared infrastructure under Assets/Runtime and game-specific logic under Assets/Runtime/Assembly-CSharp/Unturned. The game layer contains the full domain model for players, zombies, items, levels, interactions, commands, editing tools, UI, and save/data handling.
4. The codebase has a strong subsystem boundary around networking. SDG.NetTransport, SDG.NetPak, NetMessaging, NetInvokable, and the NetTransport_* adapters form the communication stack. Transport implementations exist for Steam Networking, Steam Networking Sockets, system sockets, loopback, and legacy UNet LLAPI, while NetPak handles compact binary serialization and NetInvokable generates strongly typed remote method bindings.
5. There is a second major boundary around platform/service abstraction. The Provider interfaces define capabilities such as achievements, matchmaking, economy, workshop, cloud, browser, translation, and multiplayer. SteamworksProvider supplies the Steam-backed implementation, while TempSteamworks* and DebugCloudService indicate fallback or transitional adapters. This lets game code depend on service contracts rather than Steam directly.
6. Content and asset management are central to the architecture. The Unturned/Bundles area defines the asset taxonomy for items, weapons, vehicles, NPCs, quests, weather, roads, skins, and more. Assets/Resources stores the runtime-loaded prefabs, materials, fonts, UI themes, and always-available material variants that the game resolves by name at runtime.
7. World simulation is split into managers, level objects, and volume systems. Unturned/Managers coordinates major world state like players, zombies, vehicles, barricades, structures, items, lighting, oxygen, safezones, and saving. Unturned/Level, Framework/Devkit, Framework/Foliage, Framework/Water, and Framework/Landscapes provide the world geometry, environmental volumes, spawn tables, navigation, and terrain interactions that these managers act on.
8. Player, NPC, and interactable behavior form a distinct gameplay layer. Unturned/Player, Unturned/Interactable, Unturned/Useable, Unturned/Throwables, and Unturned/Damage contain the core first-person survival mechanics: movement, inventory, crafting, equipment, life/death, dialogue, vehicle interaction, weapons, explosives, and damage resolution. These are the core gameplay systems most other subsystems feed into.
9. The UI architecture is dual-stack and abstracted. The shared Glazier layer provides reusable widgets, with separate concrete implementations for IMGUI, uGUI, and UI Toolkit under Assets/Runtime/Glazier_* and Assets/Runtime/SDG.Glazier. Game UI is then organized by context: menu screens, player HUD, editor panels, workshop screens, configuration screens, and loading UI all live in Unturned/UI and Unturned/Sleek.
10. The editor tooling is extensive and separated from runtime code via editor assemblies and Assets/Editor. It includes asset import/postprocess hooks, shader preprocessing, TMPro setup, build/bundle tools, Jenkins helpers, SteamCMD packaging, and a custom network code generator (NetGen). This indicates a workflow where content packaging, code generation, and build automation are first-class parts of the repository.
11. Data formats are a notable architectural concern. UnturnedDat implements the game’s .dat parsing/writing layer, SystemEx and UnityEx provide reusable extensions, and the Framework/IO stack includes JSON, XML, key-value-table formatted file support, and bit/network stream helpers. This suggests the game ingests multiple persistence/configuration formats and uses shared readers/writers rather than ad hoc parsing.
12. Testing is split between general runtime tests and domain-specific tests. Assets/Tests and Assets/Editor/Assembly-CSharp-Editor/Tests cover serialization, networking, geometry, text parsing, path utilities, and region/visibility logic. The tests focus heavily on foundational libraries and simulation primitives, which aligns with the repo’s large amount of reusable infrastructure.
13. External dependencies are few but important. The project ships the com.rlabrecque.steamworks.net package in-tree and relies on Steam at runtime for ownership, networking, matchmaking, workshop, and economy features. It also includes Json.NET as a plugin and has build artifacts and helper projects such as JenkinsBootstrapper and WindowsAssertionFix for CI and Windows runtime stability.
14. For an architecture diagram, the most important boundaries are: scene/bootstrap, runtime game systems, shared framework libraries, service/provider abstraction, networking transport/messaging, asset/content pipeline, and editor/build tooling. Most flows go from Unity scenes into managers and UI, from managers into provider/network/data layers, and from editor tooling into generated assets and build outputs.
Main entry points: Managers Managers · UnturnedNexus.cs Game Nexus · NetInvokable NetInvokable · Editor Editor Tooling
Components 22
Bootstrap
Scene entry points and startup lifecycle
- Game Startup · Main Unity entry scene for bootstrapping the game.
Assets/GameStartup.unity - Gameplay Scenes · Primary scene flow for menu, loading, and in-game states.
Assets/Game/Sources/Scenes
Runtime
Core game logic, world simulation, and shared runtime libraries
- Game Nexus · Central runtime bootstrap and dependency nexus for the game layer.
Assets/Runtime/Assembly-CSharp/Unturned/UnturnedNexus.cs - Managers · Coordinates major world state: players, zombies, vehicles, structures, items, lighting, and saving.
Assets/Runtime/Assembly-CSharp/Unturned/Managers - Player · Player movement, inventory, crafting, equipment, life, and interaction.
Assets/Runtime/Assembly-CSharp/Unturned/Player - Interactables · Doors, storage, vehicles, NPC objects, and other interactable gameplay objects.
Assets/Runtime/Assembly-CSharp/Unturned/Interactable - Level · Level objects, spawn points, volumes, lighting, navigation, weather, and region infrastructure.
Assets/Runtime/Assembly-CSharp/Unturned/Level
Networking
Transport, messaging, serialization, and generated RPC bindings
- Transport · Abstract client/server transport base layer and connection model.
Assets/Runtime/SDG.NetTransport - NetPak · Compact binary serialization for network payloads and type-specific readers/writers.
Assets/Runtime/SDG.NetPak - NetInvokable · Strongly typed remote method binding and invocation deferral infrastructure.
Assets/Runtime/Assembly-CSharp/NetInvokable - Messaging · Client/server message definitions and handlers for connection lifecycle and gameplay sync.
Assets/Runtime/Assembly-CSharp/NetMessaging
Services
Platform abstraction and Steam-backed implementations
- Provider · Abstract capability contracts for achievements, matchmaking, economy, workshop, cloud, browser, translation, and multiplayer.
Assets/Runtime/Assembly-CSharp/Provider - Steamworks · Steam-backed implementations for provider services.
Assets/Runtime/Assembly-CSharp/SteamworksProvider - Steam Package · In-tree Steamworks.net dependency and native/runtime bindings.
Assets/com.rlabrecque.steamworks.net
UI
Shared UI layer and game-specific menus/HUD
Tooling
Editor, build, generation, and import workflow
- Editor Tooling · Asset import/postprocess hooks, build tools, generator tools, and CI helpers.
Assets/Editor - Tests · Runtime, editor, NetPak, and Dat-format tests.
Assets/Tests
Data
Runtime-loaded assets, resources, and persistence formats
- Assets Model · Definitions for items, weapons, vehicles, NPCs, quests, weather, roads, skins, and related bundle assets.
Assets/Runtime/Assembly-CSharp/Unturned/Bundles - Resources · Always-available prefabs, materials, UI themes, fonts, and other named runtime resources.
Assets/Resources - Dat Format · Parser/writer for the game's .dat data files and metadata-preserving edits.
Assets/Runtime/UnturnedDat - IO Framework · Shared JSON, XML, key-value table, and stream helpers.
Assets/Runtime/Assembly-CSharp/Framework/IO
Connections 26
- Game Startup → Game Nexus: boots · Startup scene drives the runtime composition root.
- Gameplay Scenes → Game UI: instantiate · Gameplay scenes host the primary UI flows and overlays.
- Gameplay Scenes → Managers: load · Scenes bring world managers and simulation systems online.
- Game Nexus → Provider: configure · Bootstraps platform/service abstraction before gameplay logic runs.
- Game Nexus → Transport: select transport · Chooses the active client/server transport implementation.
- Game Nexus → Managers: compose · Wires core world managers into the runtime.
- Managers → Player: govern · Player manager and related systems coordinate player state and actions.
- Managers → Level: coordinate · Managers act on level objects, volumes, and region systems.
- Managers → Interactables: spawn · World managers create and update interactable entities.
- Managers → Assets Model: resolve content · Managers consume bundle-backed asset definitions and content taxonomy.
- Player → Interactables: uses · Player actions and interactions target world objects and vehicles.
- Player → NetInvokable: replicate · Player state and actions are exposed through generated remote methods.
- Interactables → NetInvokable: replicate · Interactable gameplay objects expose networked RPC bindings.
- Level → IO Framework: persist · Level systems use shared IO helpers for config, state, and serialized data.
- Dat Format → IO Framework: build on · Dat parsing/writing complements the shared file and stream utilities.
- Transport → NetPak: encodes · Transport payloads are packed using NetPak.
- NetInvokable → Messaging: dispatches · Generated method invocations travel through the message layer.
- Messaging → Transport: sends over · Protocol messages ride on the active transport.
- Provider → Steamworks: implemented by · Steamworks supplies the concrete provider implementation.
- Steamworks → Steam Package: depends on · Steam-backed services use the in-tree Steamworks package.
- Glazier → Game UI: backs UI · Game UI is built on top of the shared Glazier abstraction.
- Editor Tooling → Assets Model: imports · Editor tooling processes and packages asset bundles and content.
- Editor Tooling → NetInvokable: generates · Editor NetGen tooling produces strongly typed invocation bindings.
- Editor Tooling → Tests: supports · Editor-side test harnesses and build validation live alongside tooling.
- Tests → NetPak: verifies · Tests cover serialization and packing behavior.
- Tests → Dat Format: verifies · Tests cover dat parsing, writing, and metadata preservation.