Skip to content

What is Griff

Griff is a game engine for game jams. It’s a 2D-first engine and editor (built so 3D can follow), written in C#. It aims to be the shortest path from an idea to something people can play by Sunday night, with an editor that just works.

Most engines make you stop the game to change it, lose your changes when play mode ends, and break undo in creative ways. Griff is built around a few promises:

  • The game keeps running while you change it. Save a C# script and every instance of it is swapped in the running game within a moment. Public properties carry over, and the game doesn’t restart. A compile error leaves the last good version running and points at the exact line.
  • Breakpoints that cost nothing, stepping, and pausing where a script throws. Click beside a line of a script and the game pauses when it gets there, in the middle of its frame, with the values in scope to look into. Step over, into and out a line at a time, across scripts and on into the next frame, or Continue from that line. Set one while the game runs: nothing is rebuilt or restarted. A script that throws stops the game the same way, at the line that threw, and rewind goes back to just before the step it threw in, to watch it happen again.
  • Rewind. While playing, Griff keeps the last 20 seconds. Pause, drag the timeline back to just before the bug, tweak something, and resume from there. It keeps up with big scenes too: a scene of twenty thousand things plays in the editor at 60 frames a second, recorded ten times a second.
  • The same game on every machine. The game moves in steps of a sixtieth of a second whatever the screen’s frame rate (or as many a second as Game → Step Rate says), and the screen is drawn between the last two steps, so it’s smooth on a 144 Hz screen and plays the same on a 30 Hz one: the same input gives the same result anywhere. Everything is drawn between steps, not just where things are: particles, trails, rain, fades and flashes, match-3 gems sliding and falling and falling-block pieces dropping, bars filling, lights flickering, the camera’s zoom and shake, a first-person view’s look up and down and its weapon’s kick, debug shapes, and scripts’ own drawing too. Slow motion, hit stop, rewind and network games all go by the steps.
  • Undo covers everything. Every change goes through one undo history. That includes the history surviving a script reload: undo still targets the rebuilt components.
  • Play mode can’t hurt your work. Play runs on a copy of the scene. Inspect and tweak the live game freely; Stop puts everything back. Found the perfect jump height while playing? Keep Play Changes (Ctrl+K) copies the selected entity’s live values into your scene.
  • A crash costs nothing. Unsaved scenes are written to a recovery copy every 20 seconds and offered back next time you open them.
  • Readable files. Scenes are small, stable JSON ("position": [1.5, -2, 0]) that diff and merge cleanly in git. A deleted or renamed script never destroys data; its values are kept and come back with it. Renamed components and properties keep their values too ([FormerName]), a component can version its data with steps that upgrade older scenes as they load, and values a component doesn’t know (from a newer version) are kept rather than dropped.
  • Batteries included. Sprites and sprite-sheet animation with named clips, tilemaps you paint right in the Scene view with a brush, rectangles and paint-bucket fills, from as many tilesets as you like, square, isometric or hex (isometric ones walked over, top-down or a diamond at a time, and walled in by their solid diamonds; hex ones stepped over a hexagon at a time, six ways, with chasers, crates, turns and tactics on them, and walled in by their solid hexagons), in layers that each collide their own way (with autotiles that fit themselves to their neighbors, and slopes to run up and down), pathfinding around their walls, players that run, jump, wall-jump, dash and climb ladders, move top-down or step tile by tile with no code, crates to push (or, on a grid, to shove a cell at a time onto goals, Sokoban style, with undo and restart), match-3 boards where gems swapped into a line clear, fall and refill in chains (scoring, with a move limit and goals that win or lose the level), falling-block boards where pieces of four slide, turn and drop, full rows clear and every few rows it all speeds up, springs, crumbling ledges, platforms you drop through, particles, prefabs (edited on their own in tabs of their own; saving one updates every placed copy, in every scene, and each copy keeps what it changed), timers, coroutines, tweens with easing, messages between scripts (or to one board of two), triggers that make anything do anything with no code when a message arrives (fire a cannon on a match, end the turn on the beat), outputs anything can read (a text showing whose turn it is, a bar filling with a board’s score, a counter that opens the door at ten coins, a wire from the dungeon floor), flags that doors, switches, spawners and panels can need, systems of your own that run every frame in the phase you choose (and a late update once everything has moved), text in your own fonts or the free pixel, sans, serif and mono fonts that ship with Griff (picked from a font picker that previews each in its own face), 2D physics with boxes, circles, polygons (their points dragged in the Scene view or traced round a sprite, concave ones split into convex pieces by themselves), bounce, triggers, bodies that rotate (spinning, tipping over and knocked about, as an option per body, and stacked into towers, pyramids and jumbled heaps that stand still, asleep, until something knocks them down; balls roll, spin into their bounces and come to rest), hinges with limits and motors (wheels, doors, flippers, windmills), ropes that hang, sag, swing, wrap round corners and snap (to hang things on, tie together, and climb and swing on), welded contraptions that turn as one body, collision layers, raycasts, moving platforms that follow a path, wall checks and coyote time, a follow camera that stays inside the level, rooms the camera slides between, darkness lit by flickering torches and lanterns that cast shadows, rain, snow, falling leaves and rising embers with lightning storms, screen effects (old-TV scanlines and curved glass, chunky pixels, a handheld’s four greens, vignettes, color grading), parallax backgrounds, top-down depth sorting, camera shake, screen flashes, slow motion, health with hit flashes and invincibility, health bars, damage on touch, checkpoints and respawning, enemies that patrol or chase (around walls too, or tile by tile on a grid), swords and other close-up attacks for players and enemies, turrets and guns, doors and teleporters, dialogue with signs and characters (choices that branch the talk, flags it remembers from one run to the next, and the speaker’s name and portrait over what they say), levers, pressure plates and buttons that open gates and bring out bridges, keys, locked doors and an inventory, drag and drop with the mouse or a controller (cards, puzzle pieces and inventory slots that snap into place and say when every one is filled, a cursor moved with the stick, or a character who carries things about), turn-based play where sides take turns while the rest of the game runs on (turn timers, actions to spend and an End Turn button, with no code), or roguelike style on a grid, where everything moves when the player moves and bumping into a monster hits it, tactics on a grid, where you pick a unit, see how far it can walk and hit, and send it to fight, physics puzzlers with a slingshot to pull back and let go (a dotted line showing where the shot will go, the camera following it) and blocks of wood, glass and stone that crack as they’re hit and break into pieces, pinball with flippers, bumpers, kickers, a plunger, drop targets, lanes, a drain with a ball save and a tilt, in levels won with one to three stars, fighting games’ hitboxes and hurtboxes on every frame of an animation (a punch that lands only while the fist is out, once a swing, with damage, knockback and hitstun, and a head that takes more) and fighters whose moves are written in numpad notation (quarter circles, dragon punches and charges read as they face, over startup, active and recovery frames, buffered, cancelling into each other for combos, and blocked high or low for chip damage), card games with decks that shuffle and deal, hands that fan out, and cards played by dragging them onto the table by its rules (and kept secret from the other players in a network game), dungeons of rooms and corridors made from a seed, floor after floor, point-and-click adventures (a character who walks where you click or tap, round the furniture and along the floor’s shape, shrinking into the distance, and hotspots that show their name under the pointer and answer a look or a use with a line, an action, a flag or a conversation), animated tiles, afterimage trails, hit stop, pickups and score counters that need no code, spawners and lifetimes, typewriter dialogue text, debug drawing, save data, tables of game data (items, spells, enemies, level curves) edited like a spreadsheet, with formulas, columns generated from curves and charts, copied and pasted with Excel and Google Sheets, read by scripts and set on enemies and the rest with no code, and balanced by simulating each class against each enemy thousands of times by the game’s own rules (seeded, across all the cores, a matrix of who beats whom and sweeps that show dead levels), input with named actions you set up in a Controls window and players can rebind (and keep), jump buffering, twin-stick aiming, rumble and name entry, a Sprite Painter for pixel-art sprites, animation frames and tilesets, a Clip Editor that previews an animation’s clips playing, picks their frames off the sprite sheet and draws each frame’s hitboxes and hurtboxes, and a Sound Maker for retro sound effects and looping music right in the editor, sound and music with volume settings, sounds at any pitch, sounds that come from where things are, looping sounds in the level, music that crossfades, a beat clock that keeps time with the music as it’s heard (beat and bar messages, things that bop on the beat, and spawners, turrets, platforms and switches that step to it), menus and HUDs with buttons, sliders, toggles and choices that work with the mouse, keyboard or a controller, pause menus and panels that need no code, button prompts that switch between keyboard and controller, a controls screen players rebind from, options that are remembered, stretchable nine-slice panels, screen-pinned text, fades, wipes and irises between scenes, real-time strategy with units you select and order about, workers that gather gold and wood and put up buildings, barracks that train armies, towers, fog of war, a minimap and a computer opponent, first-person shooters whose levels you paint top-down and play standing in them (textured walls, mouse look, guns with ammo, enemies and pickups that face you, sliding doors), block worlds made from a seed to dig up and build in (caves, ores, trees, sand that falls, a hotbar, crafting at workbenches and furnaces, torch-lit darkness underground, worlds kept between runs, and digging in first person too), contraptions built while the game runs (grab, throw and freeze props, spawn them, weld and rope them together, undo) wired up with buttons, sensors, logic gates, clocks, counters, lamps, displays and thrusters, multiplayer for every kind of game (host or join over the local network or the internet, or run a dedicated server; each player moves their own character at once while the host runs the rest, and Griff’s components work for every player, from platformers and shooters to strategy, block worlds and big worlds that only send each player what’s near them), and Platformer, Top-down, Isometric, Arcade, Strategy, Shooter, Sandbox, Contraption, Multiplayer, Puzzle, Match-3, Falling Blocks, Roguelike, Tactics, Physics and Pinball templates that are playable (and audible) from the first second, and a BunnyMark benchmark that finds how many bouncing bunnies a computer keeps up at 60 fps (a hundred thousand and more: a big scene’s frame is built, and a crowd of scripts runs, across all the computer’s cores), then holds them and times every frame, and a Profiler panel that graphs how long each frame of the game playing in the editor takes (its steps, building and drawing), shows what each kind of script, each step of the frame and each kind of thing drawn costs and the garbage each makes, and counts its entities and components.
  • One click to ship. Build Game produces a single .exe that carries everything, .NET included, so players install nothing. Build Small Game makes a 4 MB .exe for players who have the .NET Desktop Runtime.

Every template is playable (and audible) from the first second: Platformer, Top-down, Isometric, Arcade, Strategy, Shooter, Sandbox, Contraption, Multiplayer, Puzzle, Match-3, Falling Blocks, Roguelike, Tactics, RPG Stats, Cards, Adventure, Visual Novel, Physics, Fighter, Pinball and Rhythm, and a BunnyMark benchmark.

Griff is open source under the MIT License.