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.
Currently in early development. See changelog.json for version details.
Play lastest (semi-) stable version here.
- Randomly generated maps
- Survival and exploration
- Base-building and resource-management
- Items, equipment and environmental hazards
- Technologies that slowly unlock new aspects of the game
Main features still missing: story and role-playing elements, gods, magic & the ending.
The project uses jQuery, Require.js, and Ash.js and is structured into entities, components and systems.
There are four types of entities: the player, the tribe, sectors and levels. The player entity has a position, items, stats and so on. The tribe entity stores general game status things like unlocked upgrades. Sectors and levels represent the structure and status of the game world.
All actual game data is stored in various Components of these entities and the game save simply consists of selected components.
Everything that the player can do in the game - mainly button clicks - are "player actions". Each action has a name, costs, requirements and so on defined in the PlayerActionConstants. The PlayerActionFunctions class contains a function for each action and handles their results. Various helper classes take care of checking those requirements, deducting costs, unifying random encounters etc.
User input is detected and mapped to PlayerActions by UIFunctions.
At the start of a new game, a seed value is assigned. The world is randomly generated based on this seed and only the seed needs to be saved between sessions.
(Sample level structure)
The WorldCreator generates from the seed value
- Basic structure of the world (ground level, surface level, sector locations and passages between levels)
- World texture (sector features like building density and environmental hazards)
- Resources (locations where the player can find supplies and workshops)
- Locales (special locations that can be scouted once for rewards such as blueprints)
- Enemies (locations and types of enemies that appear in some sectors)
The main constraints for the world creator to keep the game fair and balanced is that all sectors are accessible (there is enough water/food scattered across the level) and that enemy and environmental hazard difficulty increases proportionally to available equipment.
The basic unit for balancing the world creator is the Level Ordinal. Level 13 where the player always starts is ordinal 1, Level 12 is 2, and so on all the way to the Ground Level. Level 14 is Ground Level + 1 and so on until Surface Level. For some values, Camp Ordinal is used instead.
The game consists of several systems but here are some important ones:
- GameManager starts and loads the game and creates entities.
- Various UIOutSystems update the UI.
- SaveSystem saves the game state periodically by simply saving certain components that have been marked with the SaveComponent.
- PlayerPositionSystem keeps track of the current sector and level the player is in.
If you want to report bugs or suggest new features please check the contributing guidelines first.
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: