The game engine has hardcoded content mixed with world seed overrides. This creates:
- Constant "skip if customOnly" checks scattered everywhere
- Lane towers, creeps, structures spawning even when disabled
- Custom worlds fighting against default behavior instead of defining their own
The game engine should be a blank canvas. ALL content comes from world seeds:
- No hardcoded lanes, towers, creeps, structures
- Default gameplay is just another world seed (
default-world.json) - Custom worlds define 100% of their content
- Engine only renders what the seed specifies
Goal: Make customOnly: true actually work by preventing ALL hardcoded spawning
- Add master guard at game initialization that checks
WORLD_SYSTEMS - Create
CONTENT_SYSTEMSobject that tracks what should spawn - Guard ALL spawning functions:
spawnInitialLaneTowers()initCreepWaveSystem()spawnShip()createBarracks()spawnPlatforms()generateProps()(trees, rocks)initializeLaneSupport()
- Ensure custom objects spawn AFTER all cleanup passes
- Test Nexus Plaza shows ONLY fountain
Goal: Move all hardcoded content to default-world.json
{
"worldId": "default-world",
"config": {
"name": "Procedural World",
"biome": "Terra"
},
"systems": {
"mobs": true,
"creeps": true,
"towerDefense": true,
"creepWaves": true,
"ship": true,
"trees": true,
"rocks": true,
"water": true
},
"lanes": {
"top": {
"color": "#00ff00",
"waypoints": [...],
"towers": {
"robot": [{ "segment": 0, "offset": 0.2 }, ...],
"hostile": [{ "segment": 5, "offset": 0.7 }, ...]
}
},
"mid": { ... },
"bot": { ... }
},
"creepWaves": {
"interval": 30000,
"types": ["basic", "fast", "tank"],
"scaling": { "healthPerWave": 1.1, "countPerWave": 1 }
},
"structures": {
"ship": { "position": { "x": 0, "y": 5, "z": 0 } },
"barracks": [...],
"spawnPlatforms": [...]
},
"terrain": {
"heightScale": 1.0,
"water": true,
"props": { "treeDensity": 0.04, "rockDensity": 0.04 }
}
}- Create
default-world.jsonwith current hardcoded values - Create lane schema in world seeds
- Create creep wave schema in world seeds
- Create structure placement schema
- Load default seed when no custom seed is active
Goal: Engine reads ALL content from active world seed
┌─────────────────────────────────────────────────────────┐
│ GAME ENGINE │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Renderer │ │ Physics │ │ Input │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │
│ ┌──────────▼──────────┐ │
│ │ WORLD LOADER │ │
│ │ (reads seed JSON) │ │
│ └──────────┬──────────┘ │
│ │ │
│ ┌────────────────────┼────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────┐ ┌──────────┐ ┌─────────┐ │
│ │Terrain│ │Structures│ │Entities │ │
│ │Spawner│ │ Spawner │ │ Spawner │ │
│ └──────┘ └──────────┘ └─────────┘ │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────┐
│ WORLD SEED │
│ (JSON config) │
│ │
│ - terrain config │
│ - custom objects │
│ - lanes (optional) │
│ - waves (optional) │
│ - structures │
│ - agents/NPCs │
│ - lore/secrets │
└─────────────────────┘
- Create
WorldLoaderclass that parses seed and spawns content - Move lane definitions from code to seed
- Move creep wave logic to read from seed
- Move structure spawning to read from seed
- Move prop generation to read from seed
- Remove all hardcoded content from main game loop
Goal: Define complete schema for world customization
{
"config": {
"name": "string",
"biome": "Terra|Desert|Ice|Volcanic|Alien|Ocean",
"gravity": 1.0,
"timeOfDay": 0.5,
"timeFrozen": false,
"maxPlayers": 20,
"pvpEnabled": false
}
}{
"systems": {
"mobs": true,
"creeps": true,
"towerDefense": true,
"creepWaves": true,
"combat": true,
"building": true,
"resources": true,
"customOnly": false
}
}{
"terrain": {
"seed": "string",
"heightScale": 1.0,
"flattenAll": false,
"noWater": false,
"baseHeight": 2,
"props": {
"trees": true,
"rocks": true,
"treeDensity": 0.04,
"rockDensity": 0.04
}
}
}{
"visuals": {
"skyColor": "#87CEEB",
"fogColor": "#ffffff",
"fogDensity": 0.01,
"ambientColor": "#404040",
"ambientIntensity": 0.6,
"sunColor": "#ffffff",
"sunIntensity": 1.0
}
}{
"customObjects": [
{
"type": "cylinder|sphere|box|cone|torus|plane|light-point|light-spot",
"position": { "x": 0, "y": 0, "z": 0 },
"rotation": { "x": 0, "y": 0, "z": 0 },
"scale": { "x": 1, "y": 1, "z": 1 },
"color": "#ffffff",
"emissive": "#000000",
"emissiveIntensity": 0,
"opacity": 1.0,
"metalness": 0.1,
"roughness": 0.5
}
]
}{
"lanes": {
"top": {
"enabled": true,
"color": "#00ff00",
"waypoints": [
{ "x": -100, "z": -80 },
{ "x": 100, "z": -80 }
],
"towers": {
"teamA": [{ "segment": 0, "offset": 0.2, "type": "basic" }],
"teamB": [{ "segment": 5, "offset": 0.7, "type": "basic" }]
}
}
}
}{
"creepWaves": {
"enabled": true,
"interval": 30000,
"waves": [
{ "count": 5, "type": "basic", "lane": "all" },
{ "count": 3, "type": "fast", "lane": "mid" }
],
"scaling": {
"healthMultiplier": 1.1,
"countIncrease": 1
}
}
}{
"agents": [
{
"name": "The Greeter",
"position": { "x": 10, "y": 2, "z": 10 },
"personality": "friendly",
"dialogue": ["Welcome, traveler!", "This is the Nexus Plaza."],
"appearance": { "color": "#gold", "scale": 1.2 }
}
]
}Goal: Visual editor for creating world seeds
- 3D preview of world
- All config options with visual controls
- Drag-and-drop custom object placement
- Lane editor with waypoint drawing
- Import/export JSON
- Template presets (Flat Plaza, Tower Defense, Mars Desert, etc.)
- Validation before export
- GitHub sharing instructions
- Add master
WORLD_SYSTEMSguard to all spawners - Fix custom object spawning
- Test Nexus Plaza
- Create
default-world.json - Move lane definitions to seed
- Move tower positions to seed
- Move creep wave config to seed
- Create
WorldLoaderclass - Refactor spawners to read from seed
- Remove hardcoded content
- Create HTML tool
- Add 3D preview
- Add all editors
- Test full workflow
- Nexus Plaza loads with ONLY the fountain (no towers, no lanes, no creeps)
- Crimson Wastes loads with Mars terrain (no water, red sky)
- Default world loads with full tower defense gameplay
- Planet Builder can create and export valid world seeds
- Exported seeds load correctly in game