Skip to content

Custom map

Alexander edited this page Jun 7, 2020 · 10 revisions

Once you start the game, you're allowed to either choose auto-generated map (that will create beautiful dungeons) or choose your own map. But how to create a custom map? Here is the tutorial.

The .mapfile format

This is a simple plain-text format, so you can event edit the map by yourself!

The map consist of two basic parts. Map is a rectangular with fixed amount of rows and unlimited amount of columns. So on the first line you should specify integer amount of columns (in range from 0 to 2147483647).

Let it will be 12 in our case. It will be a tiny map.

Contents of `my_map.mapfile` now:
12

Then you have to describe a map itself. Feel free to be as creative as you wish!

You can use the following symbols as building blocks:

Symbol Title Description
# Wall Walls may be destroyed by fireball, but it is a the most common type of obstacle
- Grass Empty space on map. Player and all other actors may walk here
~ Water It is also empty space like grass, however when player walks in water, he loses half of his speed
p Player This is a spawn point for a player. When you load this map, die or restart, player will spawn exactly at this position. When there is 0 or more than one spawn position, behavior is undefined
z Zombie Spawn position for zombie
s Slime Spawn position for slime
Bedrock Obstacle that cannot be broken. All unused space will be filled with bedrock

Let's build some map!

Example contents of my_map.mapfile:
12
############
#----------#
#----#######
#----#
#----#######
#----------#
############


############
#----------#
#-~~--######
#-~~--#
#-~~--######
#----------#
############

############
#----------#
########---#
     #---#
########---#
#----------#
########---#
     #---#
########---#
#----------#
############

#####
#---#
#---########
#p---------#
#---########
#---#
#####

############
#----------#
#----------#
#-###--###-#
#-# #--# #-#
#-# #--# #-#
#-# #--# #-#
### #### ###

#####
#---#
#---########
#----------#
#---########
#---#
#####

Let's see, how this map looks like in game: image

Clone this wiki locally