Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Tile Editor

A topic by Ada18980 created Jun 25, 2024 Views: 566
Viewing posts 1 to 1
(2 edits)

There is a map editor available in debug mode. The purpose of it is to allow me to easily make tiles that are used in worldgen. You can use it too though, if you’d like to make custom tiles in your mod.

The tiles you make won’t be visible ingame unless you hit Commit Editor Tiles. This is to keep your mistakes from crashing the game. If you want to reset your editors tile database with the builtin one, simply refresh the page and click Reset Tile Database.

In order to make them appear ingame from a mod, you can copy the individual tile (using “copy tile to clipboard” in the editor) and add them to the main array:

KDMapTilesList.MyTile = `{"name":"HallCross","Labels":{},"w":1,"h":1,"primInd":"udlr","index":{"1,1":"udlr"},"flexEdge":{},"flexEdgeSuper":{},"scale":7,"category":"urban","weight":10,"grid":"1110111\n1111111\n1111111\n0111110\n1111111\n1111111\n1111111\n","POI":[],"Keyring":[],"Jail":[{"x":28,"y":10,"type":"furniture","radius":1},{"x":29,"y":10,"type":"furniture","radius":1},{"x":41,"y":20,"type":"furniture","radius":1},{"x":11,"y":18,"type":"jail","radius":1}],"Tiles":{},"effectTiles":{},"Skin":{},"inaccessible":[{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"l","dir2":"r"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"l","dir2":"u"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"l","dir2":"d"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"r","dir2":"l"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"r","dir2":"u"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"r","dir2":"d"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"u","dir2":"l"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"u","dir2":"r"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"u","dir2":"d"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"d","dir2":"l"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"d","dir2":"r"},{"indX1":1,"indY1":1,"indX2":1,"indY2":1,"dir1":"d","dir2":"u"}],"tags":["urban"],"forbidTags":[],"requireTags":[],"indexTags":[],"maxTags":[],"bonusTags":[],"multTags":[],"notTags":[]}`

Basics

The basic format of world generation is as follows:

  1. Create a maze (using Primm’s algorithm)
  2. Convert the maze into a list of ‘indices’. An ‘index’ is basically a description for what type of entrances a tile has. Each junction in the maze becomes an index, and it is added to an array.

Other map types (like the ancient vault, bandit hideout, etc) use a different map generation algorithm, but this is the basic one.

The ‘tile index’ selector lets you choose which sides of the tile have entrances on them. The game uses this to fit the tiles together to stitch the maze together. It’s very important as otherwise there would be no guarantee the map is possible to traverse.  image.png 3) For each index, the map generator tries to find an appropriate tile that matches the index. For example, for an ‘up + down’ index it will look thru the tiles that have an up-down index, which are mostly vertical hallways.

  1. The game places those selected tiles on the map, then moves to a random new index to start the process anew.

Note: There are two new things you can tick on each index:

-Flex: The entrances on this tile dont need to match the maze generator so long as 1) The destination tile of the entrance is already accessible by a different route and 2) The map tile you are making has found at least one valid entrance

-Open Border: This is for tiles where all four corners are accessible. It skips check #1 of the flex feature, but doesn’t do anything if the index is not flex

Available tilesets (as of this writing)

tmp - lost temple ore - orerry jng - jungle tmb - tomb grv - graveyard cat - catacombs lib - library cry - crystal cave bel - bellows DemonTransition - Edge of Reality shoppe - starting shop shrine - perk room cst - caldera/grotto vault - ancient vault (5.3 only)

You can use this feature to see how the tile would look in different regions

Updating your editor database

The map editor keeps a different database from the game’s internal database, so you may need to refresh it after a game update.

To merge new official map tiles into your editor after a game update:

  1. Copy your current tile array to back them up. Best to save them in a text file in case your computer crashes
  2. Reset your tile database. This will pull the game’s hardcoded stuff to your editor. Note that this will NOT work if you have already clicked Commit. Also, it will overwrite everything, so make sure it’s backed up
  3. Click Merge From Clipboard to merge the tiles you copied in (1) back into the database
  4. Save any tile

This will basically return your tiles to the most up-to-date slate then overwrite them with tiles from your previous editor setup to add back tiles you made yourself

image.png