Creating Custom Levels in CREW Wildfire
This guide explains how to create your own custom levels for the CREW Wildfire simulation. Each level is defined as a dictionary with specific parameters based on the game type.
Basic Structure
To create a custom level, add a new entry to the presets dictionary in the create_level_presets() function in build_config.py:
presets['Your_Level_Name'] = {
'game_type': 0, # Choose appropriate game type
# Add required parameters based on game type
# Add optional parameters as needed
}
Game Types
There are 6 different game types, each with its own required parameters:
| Game Type | Value | Description |
|---|---|---|
| Cut Trees | 0 | Strategic tree cutting |
| Scout Fire | 1 | Fire detection missions |
| Pick and Place | 2 | Transport firefighters |
| Contain Fire | 3 | Fire suppression missions |
| Move Civilians | 4 | Civilian rescue operations |
| Full Environment | 5 | Combined fire suppression and civilian rescue |
Required Parameters by Game Type
1. Cut Trees (game_type: 0)
{
'game_type': 0,
'map_size': int, # Size of the map (e.g., 30 for 30x30)
'lines': bool, # True for line cutting, False for sparse
'tree_count': int, # Number of trees/lines to cut
'trees_per_line': int, # Trees per line (if lines=True)
}
2. Scout Fire (game_type: 1)
{
'game_type': 1,
'map_size': int, # Size of the map
'fire_spread_frequency': int, # Frequency of fire spread
}
3. Pick and Place (game_type: 2)
4. Contain Fire (game_type: 3)
{
'game_type': 3,
'map_size': int, # Size of the map
'water': bool, # True for water use, False for only cutting
'fire_spread_frequency': int, # Frequency of fire spread
'known': bool # Whether fire location is known
}
5. Move Civilians (game_type: 4)
{
'game_type': 4,
'map_size': int, # Size of the map
'civilian_count': int, # Number of civilians
'civilian_clusters': int, # Number of civilian groups
'civilian_move_frequency': int, # Frequency of civilian movement
'known': bool # Whether civilian locations are known
}
6. Full Environment (game_type: 5)
{
'game_type': 5,
'map_size': int, # Size of the map
'fire_spread_frequency': int, # Speed of fire spread
'civilian_count': int, # Number of civilians
'civilian_clusters': int, # Number of civilian groups
'civilian_move_frequency': int, # Frequency of civilian movement
'known': bool # Whether locations are known
}
Optional Parameters
These parameters can be added to any game type:
{
'starting_firefighter_agents': int, # Default: 0
'starting_bulldozer_agents': int, # Default: 0
'starting_drone_agents': int, # Default: 0
'starting_helicopter_agents': int, # Default: 0
'vegetation_density_offset': int, # Default: 20
}
Example: Creating a Custom Level
Here's an example of creating a custom level that combines fire containment with a large map:
presets['Custom_Large_Fire_Containment'] = {
'game_type': 3,
'map_size': 200,
'water': True,
'fire_spread_frequency': 400,
'known': False,
'starting_firefighter_agents': 12,
'starting_helicopter_agents': 2,
'starting_drone_agents': 3,
'vegetation_density_offset': 25
}
Tips for Level Design
Map Size
- Small maps (30x30): Good for full observability and short tasks
- Medium maps (60x60 - 100x100): Balanced scenarios
- Large maps (200x200+): Complex scenarios requiring scouting and transportation of slower units
Agent Combinations
- Firefighters: Primary ground units
- Bulldozers: Effective for creating firebreaks
- Drones: Essential for scouting unknown locations
- Helicopters: Useful for transport and aerial operations
Difficulty Factors
known: Falserequires scouting and exploration before planning- Higher
fire_spread_frequencyincreases urgency - More
civilian_clustersmakes rescue more complex - Larger maps require better agent transportation