Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Map Creation

Kyle J. Kemp edited this page Nov 4, 2018 · 22 revisions

Getting Started

  1. Download the Tiled Map Editor (SPECIFICALLY VERSION 1.1.4), the source code for the game and the sprite sheets for the game.

  2. Unzip the game and spritesheets.

  3. Put the spritesheets in a folder: src/client/assets/spritesheets.

  4. Open the maps in src/content/maps in Tiled.

  5. Copy and paste an existing map to get the correct setups. You can copy and paste the src/content/maps/Template.json map into one of the folders (antania, for example) and it will be set up correctly.

  6. Did you copy the template, or an existing map? Verify that you did. If you don't, your map is not guaranteed to be usable. Do not create Tiled maps from scratch, always copy an existing map.

I'll be looking to clean up this process in the future, but this is it for now. You have to follow the exact setup above, or else something will not work correctly.

Tiled Settings

You should change these settings to ON, or you're going to have a bad time:

  • View -> Snapping -> Snap to Grid

Creating a Map

When creating a map, it should follow these constraints:

Map Structure

There must be a gutter (margin) of 4 tiles on each edge of the map (see any map for an example). Otherwise, the camera will get messed up.

Map Layers

Each map should have these map layers (in order; if you copy a map, they will be):

  1. Succorport - this is an object layer that uses only rectangle objects. The rectangle object name sets the region name in succor/teleport.
  2. BackgroundMusic - this is an object layer that uses only rectangle objects. The rectangle object name sets the BGM played in the region.
  3. RegionDescriptions - this is an object layer that uses only rectangle objects. The rectangle objects set the description for the area contained inside of it. Additionally, if there is no succorport, any succor/teleports will use the name of this RegionDescription.
  4. Spawners - this is an object layer specifically for spawners. Generally, they are restricted to the pylon sprite to prevent confusion.
  5. NPCs - this is an object layer for specific scripted NPCs. This typically includes shops, quest givers, and the like.
  6. Interactables - this is an object layer for anything interactable - doors, stairs, portals, or map event tiles.
  7. OpaqueDecor - this is an object layer for decorative things that should not be see-through-able but can be walked through. Typically, secret walls are put on this layer.
  8. DenseDecor - this is an object layer for decorative things that should also not be walk-through-able (but can be seen through). Typically, counters are put on this layer.
  9. Decor - this is an object layer for decorative things such as beds, barrels, etc.
  10. Walls - this is a layer specifically for walls. Sparingly, trees may also be placed here to make them opaque/dense.
  11. Foliage - this is a layer specifically for trees and plants.
  12. Fluids - this is a layer for water and lava only. Do not put anything else (ie, pools, fountains) on this layer.
  13. Floors - this is another visual layer on top of terrain, it has no effect other than affecting visual tile layering. Typically carpets, bone piles, etc will go on this layer.
  14. Terrain - this is the base layer and is the tile that is the general basis of your map - grass, dirt, tile, etc.

Optional Properties

Maps have optional properties that can be set:

  • maxCreatures (Controls the maximum number of creatures on the map. When set to 0, spawners will only spawn their minimal number. default: 0)
  • maxSkill (Controls the max skill you can gain skill points at for this map. default: 1)
  • region (Controls the region this map belongs to. Affects banks, lockers, regional drop tables)
  • itemExpirationHours (Controls how many hours it takes for items to decay on this map. default: 6)
  • itemGarbageCollection (Controls how many minutes it takes for item garbage collection checks to occur. default: 60)
  • maxItemsOnGround (Controls the max items on ground before decay is forced to start. default: 1000)
  • subscriberOnly (If set to true, non subscribers cannot enter the map)

Additional Objects

For some specific objects, there is additional configuration required:

Secret Walls

These must be on the "OpaqueDecor" layer, and must have the type "SecretWall".

Event Sources

Event Sources can be added to fire events when entering or exiting a tile. They can have these properties:

  • offEvent - the event name fired when leaving
  • onEvent - the event name fired when entering

Lockers

  • name needs to be set to the locker name.
  • type needs to be set to Locker.
  • lockerId needs to be set to a unique id (or non-unique, to share a locker with a previous area)

Stairs, Holes, Teleport Tiles

  • type should be set to StairsUp or StairsDown or Teleport or ClimbUp or ClimbDown or Fall
  • teleportMap should be set to the map to teleport to
  • teleportX should be set to the x position on the map to teleport to
  • teleportY should be set to the y position on the map to teleport to
  • requireHeld can be set to an item name if it's needed to get through.
  • requireQuest can be set to require a quest be started for a player (always true if the quest is completed)
  • requireQuestProgress can be set to require a key in the quest data be true (always true if the quest is completed)
  • requireQuestComplete can be set to require a quest be complete for a player
  • damagePercent can be set to a number 0..100 if the type is Fall.

Doors

  • type should be set to Door
  • requireHeld can be set to an item name if it's needed to get through.
  • requireLockpick can be set to true or false if the door can optionally be picked (required if no requireHeld is set)
  • skillRequired can be set to the thief skill required to be able to use the lockpick (Thieves only)
  • requireEventToOpen can be set to make it so the door only opens in response to events
  • lockedIfAlive can be set to a mob name to make it so the door only opens if no mobs matching the id given are alive

Drinkable Areas

  • type should be set to Fillable
  • fillEffect should reference an effect that exists
  • fillDesc should be a description of the liquid

Spawners

  • randomWalkRadius is the number of tiles in any direction from the spawner the creature will naturally walk (default: 10)
  • leashRadius is the number of tiles in any direction from the spawner the creature will chase a hostile target (default: 20)
  • respawnRate is the number of ticks (half-seconds) it takes for a creature to spawn from this spawner (default: 240)
  • initialSpawn is the number of creatures spawned immediately when the
  • script set to the script for the spawner. For lairs, it should be set to global/lair.
  • lairName set to the name of the lair creature to spawn (optional: for lairs only)

Alchemist

  • script should be set to global/alchemist
  • alchCost is the cost to combine ounces of a potion
  • alchOz is the maximum number of ounces the alchemist will combine to

Smith

  • script should be set to global/smith
  • costPerThousand is the cost per thousand of condition (avg=20000) to repair an item (default: 1)
  • repairsUpToCondition is the max condition the smith will repair to (default: 20000)

Tanner

  • script should be set to global/tanner

Peddler

  • script should be set to global/peddler
  • peddleCost should be set to a cost in gold to buy an item
  • peddleItem should be set to an item name

Banker

  • script should be set to global/banker
  • bankId should be set to the region the bank is in
  • branchId should be set to the branch the bank is (flavor text, usually set to the town name)

Other NPCs

  • script should be set to their script.

Additional Information

In addition to an actual map, I would prefer to have a document submitted that lists:

  • What quests you would like in the map
  • What items you would like in the map (and how they're obtained)
  • What monsters you would like in the map (and their abilities, general toughness, etc)

I may not copy them verbatim but I'll do my best to implement them.

Clone this wiki locally