______ ___ ___ _ _ ___ _
| _ \ | \/ | | | | | / (_) |
| | | |_ _ _ __ __ _ ___ ___ _ __ | . . | ___ __| | ___ | |/ / _| |_
| | | | | | | '_ \ / _` |/ _ \/ _ \| '_ \ | |\/| |/ _ \ / _` |/ _ \ | \| | __|
| |/ /| |_| | | | | (_| | __/ (_) | | | | | | | | (_) | (_| | __/ | |\ \ | |_
|___/ \__,_|_| |_|\__, |\___|\___/|_| |_| \_| |_/\___/ \__,_|\___| \_| \_/_|\__|
__/ |
|___/
Dungeon Mode Kit is a modular web-based roguelike framework designed to create multiple small game prototypes with different mechanics, all sharing common assets and core systems. This would allow me to make small embeddable games that correspond to the different topic in The Dungeon Mode Based on previous expiments— grotto roguelike, didaktik gama
Purpose: Any object with sprites and semantic attributes
class Entity {
constructor(x, y, type) {
this.x = x;
this.y = y;
this.type = type;
this.attributes = new Map();
this.sprite = null;
this.tint = 0xFFFFFF;
}
// Helper methods for attribute management
setAttribute(key, value) { this.attributes.set(key, value); }
getAttribute(key) { return this.attributes.get(key) || false; }
hasAttribute(key) { return this.attributes.has(key) && this.attributes.get(key); }
}
Base Attributes:
pushable, flammable, breakable, solidanimated, visiblePurpose: Single-tile pickupable objects
Purpose: Interactive 2-tile entities with behavior
Data-Driven AI: JSON files defining behavioral attributes
// personalities/guard.json
{
"controlled": false,
"mutiply_chance": 0.2,
"hostile": true,
"tactical": true,
"patrol_range": 5,
"vision_range": 8,
"memory_duration": 10,
"preferred_positions": ["doorway", "corner", "chokepoint"],
"behaviors": ["patrol", "guard_area", "pursue_intruders"]
etc
}
Switchable: Personalities can change during gameplay (charm effects, mind control, etc.)
Shared Behaviors: Common AI routines (pathfinding, line-of-sight, etc.) used across personalities
Layers:
Procedural Zones: Special tiles painted in Tiled that trigger generation
map.tmj in prototype foldermap.tmj exists → load authored mapmap.tmj → generate fully procedural level using ROT.jsProcess wildcard tiles → replace with ROT.js generated content:
// Wildcard maze generation
if (tileType === WILDCARD_MAZE) {
const maze = new ROT.Map.Uniform(width, height);
maze.create((x, y, value) => {
floorMap[x][y] = value === 0 ? FLOOR_TILE : null;
if (value === 1) spawnWallActor(x, y);
});
}
Each prototype is a JSON file defining complete game rules:
// prototypes/puzzle_cave/prototype.json
{
"name": "Strength Puzzle Cave",
"mechanics": {
"fog_of_war": false,
"darkness": false,
"turn_based": true,
"line_of_sight": false
},
"stats": {
"strength": {
"max": 10,
"current": 10,
"depletes_on": ["push_wall"],
"restore_items": ["strength_potion"]
},
"health": { "max": 100, "current": 100 },
"hunger": { "max": 100, "current": 100, "depletes_per_turn": 1 }
},
"inventory": { "max_items": 5 },
"available_items": ["key", "strength_potion", "lever", "food"],
"available_actors": ["wall", "pushable_wall", "door", "switch"],
"win_conditions": ["reach_exit", "activate_all_switches"],
"transitions": {
"stairs_down": "dungeon_level2",
"stairs_up": "previous_prototype"
}
}
Multi-Prototype Navigation:
Flexible Stats: Each prototype defines its own character attributes
ROT.js Components (Kept):
Custom Components:
darkness and vision-blocking attributessolid, pushable)prototypes/prototype.json with mechanics and statsmap.tmj with floor/item/actor layers + wildcardsmap.tmj for fully generated levelsmap.tmj if present