• This repository has been archived on 19/Jun/2022
  • Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    Nim
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A game engine optimized for making cool games fast.

A game engine written in Nim, optimized for making cool games fast. Made for convenience while coding and better performance than all-in-one solutions like Godot.

Note: As of June 2021, I'm not longer actively working on rapid. Please fork the repository if you want to keep the project alive.

Goals

  • Be easy to understand,
  • Have a rich set of flexible APIs,
  • Compile all C libraries statically to avoid dependency hell/linker errors,
  • Make game development a fun task for everyone.

Features

  • rapid/graphics
    • Almost stateless graphics context API – the only state you ever have to worry about is the shape buffer
      • Supports text rendering using FreeType
      • Has a built-in polyline renderer for drawing wires, graphs, etc.
    • Post-processing effects with HDR rendering support
    • Built in texture packer
  • rapid/game
    • Fixed timestep game loop
    • Fixed-size and infinite-size tilemaps
  • rapid/ec
  • rapid/physics
    • chipmunk – General-purpose physics engine, using Chipmunk2D
    • simple – Simple and fast AABB-based physics engine
  • rapid/input
    • Simplified input event distribution using procs like mouseButtonJustPressed + callback support
  • rapid/math
    • Common math utilities for vector math, axis-aligned bounding boxes, interpolation, and type-safe units
  • rapid/ui – Fidget-style UI framework for games and applications

Coming soon

  • rapid/audio – Sound mixer with real-time effect support

Installing

Note that the new version of rapid (2020) is still under development, so you will have to install a specific commit from the master branch. The current release version is not supported anymore.

To install rapid, use the following command:

$ nimble install "rapid@#3e831cb"  # change the commit hash to the latest commit

In your .nimble file:

requires "rapid#3e831cb"

Pinning to a specific commit rather than #head is recommended, because #head doesn't name a specific point in development. This means that two different packages may end up requiring #head, and the #head that's installed locally may not match the #head that's required by the package. Thanks nimble, you're the best.

Linux

On Linux, the development headers for the following libraries must be installed:

  • for rapid/graphics:
    • GL
    • X11
    • Xrandr
    • Xxf86vm
    • Xi
    • Xcursor
    • Xinerama

Debian and Ubuntu

sudo apt install \
  libgl-dev libx11-dev libxrandr-dev libxxf86vm-dev libxi-dev libxcursor-dev \
  libxinerama-dev

Fedora

sudo dnf install \
  mesa-libGL-devel libX11-devel libXrandr-devel libXxf86vm-devel \
  libXinerama-devel libXi-devel libXcursor-devel

openSUSE

sudo zypper in \
  Mesa-libGL-devel libX11-devel libXrandr-devel libXxf86vm-devel \
  libXinerama-devel libXi-devel libXcursor-devel

Examples

For examples, look in the tests directory.

Tips

  • Draw in batches whenever possible. This reduces the amount of time the CPU has to spend sending draw calls to the GPU, making your game run better. In general, whenever you have some object that doesn't change often, prefer an aglet Mesh rather than rapid's Graphics.
  • Compile your game with --opt:speed. Nim's rather primitive stack trace system can slow programs down by quite a bit, so compiling with speed optimizations enabled can be quite important to maintain playable performance. Though if your game's so CPU-heavy that it becomes unplayable without --opt:speed, you're doing something wrong. Go fix your code.

Contributing

When contributing code, please follow the coding style guidelines.

Super Secret Messages hidden in plain sight

A message to Araq

Fast incremental compilation when

More Repositories

1

lintplus

An improved linting plugin for the lite text editor.
Lua
58
star
2

hayago

Embeddable scripting language for Nim. Work in progress.
Nim
52
star
3

pan

puny animator – create motion graphics using Lua
Nim
37
star
4

datarray

Struct-of-arrays style data structure that emulates array-of-structs access
Nim
36
star
5

euwren

High-level Wren wrapper for Nim
Nim
35
star
6

aglet

A safe, high-level, optimized OpenGL wrapper and context manager.
Nim
29
star
7

netcanv

A lightweight app for real-time online collaborative painting.
Rust
27
star
8

processing-monokai-theme

The Monokai theme from Sublime Text remade for the PDE.
21
star
9

memrecall

This future is war. Go back in time to fix it all.
Nim
20
star
10

rdgui

A modular GUI toolkit for rapid
Nim
10
star
11

pibench2

A dead-simple, multi-threaded performance benchmark.
Nim
9
star
12

nadio

Experimental digital audio workstation with a keyboard-focused user interface
Nim
8
star
13

pomod

pomod is a dead-simple Pomodoro timer for Polybar.
Nim
8
star
14

delight

An engine-agnostic library for computing 2D raycasted lights.
Nim
7
star
15

smugdancer

Smug dance as a Service
Rust
4
star
16

vectorscope

Rather simple vectorscope for JACK/Pipewire
Rust
4
star
17

planet-overgamma

my arch nemesis; a game about crashing on an unknown planet and using automation to survive
Lua
4
star
18

treehouse

A place on the Internet I call home
Rust
2
star
19

lite-xl-config

My Lite XL configuration
Lua
2
star
20

szmelc-player

A video player for your terminal that generates a standalone executable that plays your video.
Rust
2
star
21

spamality

An arcade shooter for Open Jam 2018
Lua
2
star
22

lava-lamp-rs

lava_lamp.nim, remade in Rust
Rust
2
star
23

powerbf

A superb brainfuck interpreter
Brainfuck
2
star
24

microbf

A small, optimizing Brainfuck interpreter
C
1
star
25

fizzerb

Physically-based reverb
Rust
1
star
26

synth

Synthesizer
C
1
star
27

retrove

A super-simple low resolution canvas scaling library for LÖVE.
Lua
1
star
28

dispatchers

Benchmarking different ways of implementing VM opcode dispatch
Rust
1
star
29

softgl

Software-rendered 3D graphics
Rust
1
star
30

shitchat

shitty netcat chat
Nim
1
star
31

paws

A very simple, bring-your-own-backend UI layout library built for quick prototyping.
Rust
1
star
32

animations

Animations for my YouTube channel, using pan
Lua
1
star
33

liquidev

1
star
34

mesadump

because dumping vram into pngs and sound is something we all need in our lives
Nim
1
star