nroutasuo / level13

Incremental browser text adventure
Apache License 2.0
197 stars 66 forks source link
ash entity-framework game incremental-game text-based-game

Level 13

Level 13 is an text-based incremental science fiction browser adventure where the player must survive in a dark, decayed City, (re-)discover old and new technologies, and rebuild a civilization that has collapsed.

The game is in active development. It is a personal side project but has also received some fixes from the community along the way. Bug reports and feedback are very welcome, but please check the contributing guidelines first.

Quick Links

Game Overview

Features

Code Overview

The project uses jQuery, Require.js, and Ash.js and is structured according to an entity system framework into entities, components and systems.

Branches

Entities and Components

All game data is stored in various Components that are attached to entities such as the player or a sector. Entities are simply containers for Components. The EntityCreator gives a good overview of what kind of entities have what kind of components.

Systems

Various independent Systems use and change data on Components and make stuff happen in the game. They generate resources, update movement options, resolve fights and so on. Each area of the UI is taken care of by its own UI system.

Player Actions

Everything that the player can do in the game - mainly button clicks - are called "player actions". Each action has an associated name, costs, requirements, cooldown and so on. The PlayerActionFunctions class contains a function for each action and handles their results. Various helpers take care of checking requirements, deducting costs, unifying random encounters and so on.

World Creator

At the start of a new game, a seed value is assigned to the game. The World Creator generates a unique world based on this seed and only the seed needs to be saved between sessions.

samplelevel2 samplelevel3

(Sample level structure)

The world is generated in roughly the following steps:

Two important units for balancing the world are the camp ordinal and the level ordinal. Level 13 where the player always starts has level ordinal 1 and camp ordinal 1.

Other games

Level 13 is heavily inspired by A Dark Room. Other great text-based and / or incremental games that the game owes much inspiration to include: