Rez is an open-source game engine for making choice-based HTML games.
My target audience is me: someone frustrated building with Twine and comfortable in Javascript. I had been using Twine+Snowman but… Twine wasn’t really doing very much for me.
Rez uses a mostly declarative syntax. Here is a player @actor
:
@actor player {
name: "The adventurer"
description: "A bold adventurer"
class: :m
container_id: #player_inventory
fought_boss: false
initiative: 2
strength: 8
toughness: 6
fighting: 8
dodge: 0
wounds: 0
mana: 0
gold: 0
kills: 0
xp: 0
spells: []
class_name: ^v{this.class == "m" ? "Mage" : this.class == "r" ? "Rogue" : "Fighter"}
weapon: ^p{
const weapon_id = $player.container.getItemForSlot("weapon_slot");
return $(weapon_id);
}
on_start: (player) => {
player.container.setItemForSlot("weapon_slot", "dagger");
}
}
And here is a @card
(roughly equivalent to a passage in Twine):
@card monster_dies {
bindings: {monster: `scene.monster}
content: ```
<div class="box">
${monster.name} is dead! <a data-event="card" data-target="loot_the_room">Loot the room</a>.
</div>
```
on_start: (card) => {
$player.xp += card.scene.monster.xp;
$("location").monster_id = "";
}
}
Inline Javascript functions are used for dynamic behaviours (e.g. the on_start
event) and the built-in template expression language for dynamic content (e.g. ${monster.name}
).
Rez has a scene/card layout system that is simple but exceptionally powerful, with a template expression system including dynamic content. It uses Bulma CSS for styling.
Rez has support for inventories & items, factions & relationships, NPC actors, plots, customised event handling, and more.
I’m not much of a one for self-promotion but I’m proud of Rez and what it can do at this point. It’s come along way in the 2 years that I’ve been working on it on-and-off. It’s gotten to the point I can make progress on my own games.
So I’m calling out v1.1 because, while there are still rough edges, it’s ready enough and good enough that I think other authors could make use of it. I’d love to see what people can create with it.
Here are the major changes since the last public release (v0.9) in Nov 2022:
- Switched from
begin
/end
to{}
for block scopes - Throwing out Handlebars.js in favour of the built-in Template Expression system.
- Throwing out Markdown in favour of writing plain HTML
- Bi-directional data binding from HTML form elements to object attributes
- Automatic creation of JS object properties from game element attributes
- Expressive dynamic attribute system
- Extensive improvements to documentation
- Events all driven from
<a data-event="..."></a>
so simple but powerful! @system
s now take part in processing events- Fixed stack layout for running dialogue/events
- Embeds Tracery for grammars
- Added probability tables for procgen
- Working inventory system
Here’s the Hello World of Rez (source).
My test game is a dungeon crawler (source). It’s just a sliver of a game at the moment, a few rooms strung together, but I’ve been using it to incrementally test Rez’s basic functionality.
I would be really pleased to find even a couple of authors who would try Rez. Even reading the documentation and giving me some feedback would be helpful.