You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-64Lines changed: 21 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,55 +4,29 @@
4
4
5
5
Following that spirit, Mibo.Raylib keeps it lean, just F# and the Elmish loop with a handful of commodities to get out of your way and let you enjoy the craft.
6
6
7
-
Mibo.Raylib is a port of the [Mibo](https://github.com/AngelMunoz/Mibo) micro-framework from **MonoGame** to **raylib-cs**, designed to allow **F#** developers to write games using familiar Elmish patterns for all kinds of game genres and sizes — no Content Pipeline, no `.mgcb` files.
7
+
Mibo.Raylib is a port of my first attempt at this [Mibo](https://github.com/AngelMunoz/Mibo) micro-framework from **MonoGame** to **raylib-cs**, designed to allow **F#** developers to write games using familiar Elmish patterns for all kinds of game genres and sizes.
8
8
9
-
Mibo aims to solve 90% of use cases for enabling developers to focus on game logic rather than boilerplate code, providing guidelines and architecture for structuring game code, handling input, rendering, asset management, and time management among others.
9
+
Mibo aims to solve 80/20 of use cases for enabling developers to focus on game logic rather than boilerplate code, providing guidelines and architecture for structuring game code, handling input, rendering, asset management, and time management among others.
10
10
11
11
## What's in the box?
12
12
13
13
-**Elmish runtime** (MVU loop) with `Cmd`, `Sub`, optional **fixed timestep**, and **frame-bounded dispatch**
14
14
-**Input** — raw input (`Keyboard`, `Mouse`) + semantic mapping via `InputMap` / `ActionState`
15
-
-**Assets** — texture, font, sound, and model loading with dictionary-based caches (no Content Pipeline)
16
-
-**Rendering** — `IRenderer<'Model>` and `RenderBuffer<'Key, 'Cmd>`:
15
+
-**Assets** — texture, font, sound, and model loading caches
16
+
-**Rendering** — Command buffer based rendering:
17
17
- 2D batch renderer with layers and multi-camera support
18
18
- 3D batch renderer with opaque/transparent passes and custom shader switching
19
-
- Escape hatches (`DrawCustom`) for custom GPU work
20
-
-**Camera** helpers (`Camera2D`, `Camera3D`) with screen-to-world, orbit, and ray casting
19
+
- Escape hatches for custom GPU work
20
+
-**Camera** helpers with screen-to-world, orbit, and ray casting
21
21
-**Layout** — 2D procedural grid layout (`CellGrid2D`) with platformer, top-down, and geometric primitives
22
22
-**Layout3D** — 3D voxel-style grid layout (`CellGrid3D`) with terrain, interior rooms, corridors, stairs, and procedural generation
23
23
-**Animation** — sprite sheet slicing, `AnimatedSprite` state machines, and grid-based animation definitions
24
-
-**Input Mapper** — push-based input mapping via reactive `IInput` observables
25
-
26
-
## Documentation
27
-
28
-
The docs live in `docs/` and are the authoritative reference.
29
-
30
-
| Topic | File |
31
-
|-------|------|
32
-
| Elmish runtime |`docs/elmish.md`|
33
-
| System pipeline (phases + snapshot) |`docs/system.md`|
34
-
| Scaling ladder |`docs/scaling.md`|
35
-
| Input |`docs/input.md`|
36
-
| Assets |`docs/assets.md`|
37
-
| Camera |`docs/camera.md`|
38
-
| Animation |`docs/animation.md`|
39
-
| Layout (2D) |`docs/layout.md`|
40
-
| Layout3D |`docs/layout3d.md`|
41
-
| Culling |`docs/culling.md`|
42
-
| Commands |`docs/commands.md`|
43
-
44
-
To build the docs site locally:
45
-
46
-
```bash
47
-
dotnet tool restore
48
-
dotnet fsdocs build
49
-
# or for live editing:
50
-
dotnet fsdocs watch
51
-
```
24
+
-**Input Mapper** — Listen to raw input and map it to semantic actions
52
25
53
26
## Getting started
54
27
55
28
Prerequisites:
29
+
56
30
-**.NET SDK 8** or later
57
31
- A working OpenGL setup
58
32
@@ -64,49 +38,32 @@ dotnet build
64
38
dotnet test
65
39
```
66
40
41
+
To build the docs site locally:
42
+
43
+
```bash
44
+
dotnet tool restore
45
+
dotnet fsdocs build
46
+
# or for live editing:
47
+
dotnet fsdocs watch
48
+
```
49
+
67
50
### Run the samples
68
51
69
52
**2D Platformer:**
53
+
70
54
```bash
71
55
dotnet run --project samples/PlatformerSample
72
56
```
57
+
73
58
Controls: **WASD / Arrows** to move, **Space** to jump, **R** to respawn.
74
59
75
60
**3D Platformer:**
61
+
76
62
```bash
77
63
dotnet run --project samples/ThreeDSample
78
64
```
79
-
Controls: **WASD** (camera-relative), **Space** to jump.
Copy file name to clipboardExpand all lines: docs/index.md
+19-65Lines changed: 19 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ Mibo.Raylib is a lightweight, Elmish-based game framework built on top of raylib
16
16
17
17
To get started with Mibo.Raylib, you need the [dotnet SDK](https://get.dot.net) installed.
18
18
19
+
> **NOTE:** Mibo.Raylib is currently in early development. NuGet packages are not yet available, but you can clone the repository and run the samples to see it in action.
20
+
19
21
Start by cloning the repository and running one of the samples:
20
22
21
23
```bash
@@ -42,71 +44,23 @@ You can then start building your game using any of the following:
42
44
43
45
## Why Mibo.Raylib?
44
46
45
-
Traditional game engines often rely heavily on mutable state and complex object hierarchies. Mibo.Raylib offers an alternative:
46
-
47
-
-**Functional First**: Write your game logic as pure functions that transform state.
48
-
-**Predictable State**: The entire game state (the Model) is centralized and immutable.
49
-
-**Elmish Architecture**: Leverage the robust MVU pattern for clear separation of concerns.
50
-
-**raylib Power**: Benefit from the performance and simplicity of raylib.
51
-
-**Deferred Rendering**: Built-in 2D and 3D batchers that handle sorting and lighting for you.
52
-
53
-
## Core Patterns
54
-
55
-
### The Elmish Loop
56
-
57
-
Shader-based multi-pass rendering. Every Mibo.Raylib game follows a simple loop:
58
-
59
-
1.**Init**: Define your initial state.
60
-
2.**Update**: Purely calculate the next state based on messages (input, timers, etc.).
61
-
3.**View**: Describe what should be rendered based on the current state.
62
-
4.**Subscribe**: Listen to external events like keyboard or touch input.
63
-
64
-
### Semantic Input Mapping
65
-
66
-
Instead of checking for specific keys in your player logic, Mibo.Raylib encourages mapping keys to **Actions**. This allows for easy input rebinding and multi-device support.
67
-
68
-
### Deferred Batched Rendering
69
-
70
-
All rendering is deferred into a `RenderBuffer`, sorted by layer, and executed in a single pass per renderer. This enables efficient 2D lighting and post-processing without coupling render logic to the update loop.
71
-
72
-
## Getting Started
73
-
74
-
Run one of the samples, then copy its program setup (composition root) into your own project.
Traditional game engines often rely heavily on complex object hierarchies, vendor specific tooling and no specific architecture guidance. Mibo.Raylib offers an alternative:
48
+
49
+
-**Functional First**
50
+
- Write your game logic as pure functions that transform state.
51
+
- When you grow enough you adopt mutable state in a predictable way to squeeze out more performance, but you can start simple and keep it pure as long as you want.
52
+
- F# inline, compiler optimizations around functions, byrefs, structs and value types allow you to write high-level code without sacrificing performance.
53
+
-**Predictable State**
54
+
- The MVU architecture enforces a clear separation of concerns with a single source of truth for your game state, making it easier to reason about and debug.
55
+
- The unidirectional data flow ensures that state changes are predictable and traceable, which is especially beneficial in complex game logic.
56
+
-**Elmish Architecture**
57
+
- A well-known architecture in the F# community with a twist for games.
58
+
-**raylib Power**
59
+
- Built on top of raylib, a simple and easy-to-use library to enjoy videogames programming.
60
+
- Cross-platform support and a rich set of features for graphics, input, audio, and more.
61
+
-**Deferred Rendering**
62
+
- Be ready for efficient lighting and post-processing effects without coupling your render logic to the update loop.
63
+
- Be ready for networked games with client-side prediction and server reconciliation without coupling your game logic to the rendering.
0 commit comments