Logo Mibo

Mibo: A Functional Game Framework for F#

NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.

Following that spirit, Mibo keeps it lean: no editors, no pipelines, no wizards. Just F# and the Elmish loop, with a handful of conveniences to get out of your way and let you enjoy the craft.

Mibo is a lightweight, functional game framework built on a backend-agnostic core with pluggable rendering backends. It ships two supported program runtimes; pick per project, share everything below them:

Both encourage pure game logic and predictable state management, and both let you choose the graphics backend that fits your target platform.

The Mibo packages

Mibo is split into four packages so your game logic stays portable while the rendering backend stays swappable:

Mibo.Core          ← the shared core (Program builders for both runtimes, Cmd/Sub,
                     System pipeline, GameTime, IRenderer, GameContext,
                     IInput/IInputMapper contracts, IAssetCache, HeadlessProgram,
                     AdaptiveProgram/AdaptiveHeadless, Layout/Layout3D)
Mibo.Adaptive      ← the incremental-computation library powering the adaptive
                     runtime (cval/aval, cset/cmap/clist + views), usable standalone
Mibo.Raylib        ← the raylib backend (hosts: RaylibGame, AdaptiveRaylibGame; GLSL shaders)
Mibo.MonoGame      ← the MonoGame backend (hosts: MiboGame, AdaptiveMonoGameGame; HLSL .fx shaders)

cval/aval and friends are the adaptive containers; the Adaptive docs introduce them.

The guiding rule: if it is a contract that the Program builder, a runtime host, the headless runner, or portable user code needs, it lives in Mibo.Core. Backend-specific implementations and any type that leaks a backend handle stay in the backend.

Backend

MVU host

Adaptive host

Shaders

Best for

Mibo.Raylib

RaylibGame<'Model,'Msg>

AdaptiveRaylibGame<'Frame>

GLSL

Cross-platform Desktop OpenGL; lean, no content pipeline

Mibo.MonoGame

MiboGame<'Model,'Msg>

AdaptiveMonoGameGame<'Frame>

HLSL (.fx → .mgfx)

Windows Desktop DirectX 11, plus OpenGL cross-platform via MonoGame

Both backends ship the same rendering surface: a 2D batch renderer and a 3D Forward PBR pipeline with a shadow atlas, post-processing, and built-in shaders. (PBR is physically based rendering; the shadow atlas is a single texture holding all shadow maps.) So the same fluent view code drives both backends.

Getting Started

To get started, you need the dotnet SDK installed. The Mibo.Templates package includes MVU starters (mibo-2d/mibo-3d for raylib, mibo-mg-2d/mibo-mg-3d for MonoGame) and adaptive starters with an -adaptive suffix (mibo-2d-adaptive, mibo-mg-3d-adaptive, …). The MonoGame templates each ship a shared library plus thin clients for DesktopGL/OpenGL, DesktopVK/Vulkan, and WindowsDX12/DirectX 12:

dotnet new install Mibo.Templates
dotnet new mibo-2d -o MyGame            # MVU runtime
dotnet new mibo-2d-adaptive -o MyGame   # adaptive runtime
cd MyGame
dotnet run

A minimal program looks the same regardless of backend; only the host type and the package reference change:

open Mibo.Elmish

let configureWindow (cfg: GameConfig) =
    { cfg with Width = 1280; Height = 720; Title = "My Game" }

let createRenderer () = Renderer2D.create view

let program =
  Program.mkProgram init update
  |> Program.withConfig configureWindow
  |> Program.withRenderer createRenderer

// raylib:
let game = new RaylibGame<Model, Msg>(program)
game.Run()

// MonoGame:
// let game = new MiboGame<Model, Msg>(program)
// game.Run()

You can then start building your game using any of the following:

Samples

The samples developed for the initial Raylib version and the new MonoGame Samples are stored in their own repository. Mibo.Samples is the place to visit.

NOTE: the v1 (raylib-only) docs are archived; reachable from this link, not from the sidebar.

You'll find examples of

2D:

3D:

Why Mibo?

Traditional game engines often rely heavily on complex object hierarchies, vendor specific tooling and no specific architecture guidance. Mibo offers an alternative:

Built on

Mibo is built on top of:

Type something to start searching.