Introduction
BSGameLib is a set of NuGet packages for writing games in C# on .NET 10, on Windows, Linux and macOS. Each package is versioned and released on its own. Where each platform gets its native libraries is covered in Publishing a game.
The packages
| Package | What it is |
|---|---|
BSGameLib.Game |
The engine: window, rendering, shaders compiled at build, content, input, audio, localization, Dear ImGui. |
BSGameLib.UI |
Views in XML or C#, bound to view-models; layouts, controls, styles and themes. |
BSGameLib.Game.ShaderCompiler |
An optional runtime shader compiler, for shaders the build never saw. |
BSGameLib.Sdl3.Interop |
.NET bindings for SDL3, SDL3_image and SDL3_mixer. |
BSGameLib.Networking |
Client and server networking over QUIC. |
BSGameLib.Chat |
Chat and slash commands, with no networking of its own. |
BSGameLib.Server |
A dedicated server host: dependency injection by convention, a QUIC listener, a game loop. |
Some packages come in with others and are never referenced on their own: BSGameLib.Core, the
types every package shares, and the native libraries, BSGameLib.Sdl3.Native,
BSGameLib.MoltenVK.Native and BSGameLib.MsQuic.Native.
Which to reference
- A single-player game:
BSGameLib.Game, andBSGameLib.UIfor menus and other UI. - An online game's client: the same, plus
BSGameLib.Networking. - An online game's server:
BSGameLib.Server, which brings Networking and Chat with it.
Code both sides share, such as packet classes, goes in a library that references
BSGameLib.Networking. Never reference BSGameLib.Server from code the client uses: it brings the
whole server host with it. Setting up a project shows a layout that keeps the
two apart.
Previews
Every package is a preview version for now, so add them with --prerelease, or name the version.
The API can still change between versions.