Files
wicked-quest/levels
2025-07-05 07:41:23 -04:00
..

Creating Custom Levels for Wicked Quest

Want to add your own levels? It's pretty simple! Every level is a JSON file, and you can create as many as you want.

Getting Started

  1. Make a directory under levels/ with your level pack name: levels/My Cool Levels/

  2. Start with 1.json in your new directory. Each level after that is numbered in order: 2.json, 3.json, etc.

Basic Level Structure

Every level needs these things:

{
    "level_id": 1,
    "name": "My Level",
    "description": "Set the scene for your level.",
    "locked": false,
    "player_start": {
        "x": 0,
        "y": 0
    },
    "boundaries": {
        "left": 0,
        "right": 200
    },
    "ambience": "Graveyard Blitz.ogg",
    "footstep_sound": "footstep_stone"
}

If you set locked to true, the player may not leave the level until all enemies have been defeated. Drop custom ambience files, e.g. music or creepy sound track in sounds/ambience. Add custom footstep sounds into the sounds directory.

Adding Objects

All objects go in an "objects" list. Here are some examples of what you can add:

Object Positioning

Objects can be positioned using either:

  • "x": 15 - Single position for objects like coffins, graves, catapults
  • "x_range": [10, 20] - Range for objects that span multiple positions like bone dust collections, enemy patrol areas, or hazards

The y coordinate determines the vertical layer:

  • y: 0 - Ground level (enemies, graves, catapults)
  • y: 3 - Elevated level (bone dust, coffins)
  • y: 12 - High level (skull storms)

Bone Dust

{
    "x_range": [5, 8],
    "y": 3,
    "sound": "bone_dust",
    "collectible": true,
    "static": true
}

The static property means objects don't move - they stay in their fixed positions. Static objects like bone dust and graves remain stationary, while enemies without this property can move and patrol.

Coffins

{
    "x": 15,
    "y": 3,
    "sound": "coffin",
    "type": "coffin",
    "item": "extra_life"
}

Items are optional, can be extra_life, hand_of_glory, jack_o_lantern, or anything from graves.

Graves

{
    "x": 35,
    "y": 0,
    "type": "grave",
    "sound": "grave",
    "static": true,
    "zombie_spawn_chance": 20,
    "item": "shin_bone"
}

Zombie spawn chance is 0-100, higher means more zombies. Item is also optional, can be shin_bone, guts, or any item from coffin.

Enemies

{
    "x_range": [20, 35],  // patrol or hunting range
    "y": 0,
    "enemy_type": "goblin",
    "health": 4,
    "damage": 2,
    "attack_range": 1.5,
    "attack_pattern": {
        "type": "hunter",
        "turn_threshold": 5
    }
}

Attacks can be "hunter" or "patrol". The "patrol" option does not use the "turn_threshold" option. The "turn_threshold" option is how quickly the hunting enemy will turn around to attack the player. Hunters will leave their area to pursue the player once he has entered the enemy's range.

Special Enemy Behaviors

Enemies can have special behaviors regardless of their type. Here are some examples:

incorporeal Goblin
{
    "x_range": [400, 415],
    "y": 0,
    "enemy_type": "goblin",
    "health": 30,
    "damage": 2,
    "attack_range": 1,
    "has_vulnerability": true,
    "is_vulnerable": false,
    "vulnerability_duration": 1000,
    "invulnerability_duration": 5000,
    "speed_multiplier": 0.8,
    "attack_cooldown": 1200,
    "attack_pattern": {
        "type": "hunter",
        "turn_threshold": 2
    }
}
Spawning Other Enemies (like revenants)

You can mix and match these behaviors. For an example of a witch who spawns black cats, see "Wicked Quest/13.json"

Sound Requirements for Special Behaviors

When adding special behaviors to enemies, you'll need corresponding sound files:

For vulnerability system:

  • enemy_is_vulnerable.ogg - Sound when enemy becomes vulnerable

For spawning behavior:

  • enemy_spawn.ogg (optional) - Sound when spawning new enemies

Tips for Custom Enemies

  • Balance special behaviors carefully
  • Test enemy combinations thoroughly
  • Consider providing audio cues for special behaviors
  • Remember faster enemies should generally do less damage
  • Vulnerability systems work best with higher health values
  • Spawning enemies should have lower health to compensate

Hazards

Skull Storm

{
    "x_range": [40, 60],
    "y": 12,
    "type": "skull_storm",
    "damage": 4,
    "maximum_skulls": 2,
    "frequency": {
        "min": 1,
        "max": 4
    }
}

The maximum setting is how many skulls can be falling at once. Frequence is the number of seconds that can expire before the next skull falls.

Catapult

{
    "x": 55,
    "y": 0,
    "type": "catapult",
    "fire_interval": 4000,  // milliseconds between shots
    "range": 25
}

Spider Web

{
    "type": "spider_web",
    "x": 15,
    "y": 0
}

Grasping Hands

{
    "x_range": [40, 60],
    "y": 0,
    "type": "grasping_hands",
    "delay": 1000,
    "crumble_speed": 0.065
}

The ground crumbles beneath the player as undead hands reach up. The delay is in milliseconds before crumbling starts, and crumble_speed controls how fast the crumbling catches up to the player.

Creating New Enemies

Want to add a new enemy type? You'll need two sound files in the sounds directory:

  • enemy.ogg - The sound the enemy makes while alive
  • enemy_dies.ogg - The death sound

For example, to add a werewolf enemy:

  • Add werewolf.ogg and werewolf_dies.ogg to the sounds directory
  • Use "werewolf" as the enemy_type in your level file

Tips

  • Add at least 33 bone dust per level
  • Space out hazards to give players a chance
  • Enemy health:
    • Regular enemies: 4-6 HP
    • Mini-bosses: 8 HP
    • Bosses: 40+ HP
  • Lock boss levels with "locked": true
  • Test your levels thoroughly!

Check out the Wicked Quest levels for more examples.