| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Adding Map Overlays

This version was saved 5 years, 10 months ago View current version     Page history
Saved by James Koppel
on June 10, 2018 at 2:43:19 pm
 

 

 

 

Tile masks

 

Overlays take up many tiles. They can be single tiles, like heroes, or they can be complicated shapes, like mountain ranges. Some of these tiles block the hero. And, for interactive objects like mines or windmills, usually only 1 or 2 tiles is the "main" tile where the hero can actually interact.

 

These different kinds of tiles are represented by the tile masks. A tile mask is an 8x6 grid of 1s and 0s, saying which tiles of an overlay have certain attributes. Each overlay has 6 tile masks.

 

To see these masks in action, simply open the editor and turn on "Show Grid." When you place a map object, you'll see e . For example, here's one of the largest overlays, the Warlock castle.

 

 

You can see four kinds of highlighted cells:

 

  • Black denotes the shadow cells. These cells are passable to the hero, and may overlap other objects. They may even extend off the edge of the map.
  • Green denotes the "covered non-obstructed" tiles. These tiles are passable to the hero and map overlap other objects, but may not be placed off the edge of the map.
  • Brown denotes the "normal" intersected tiles. They are not passable to the hero. Whether they can overlap other objects is complicated, and we haven't yet figured out all the details.
  • And finally, orange denotes the interaction point(s). This is considered the "main" cell of the overlay, and is usually where the hero actually interacts with the object.  This is also the tile where you can edit the object with the Cell Details tool.

 

 

As an example of these ideas in actions, here is the minimum island that you can place the Warlock castle on. 

 

 

 

In the XML, all tile masks are represented by an 8x6 grid of 1's and 0's. For example:

        <tiles>
            00000000
            00000100
            00011111
            00011111
            00011111
            00000000
        </tiles>

 

 

Special Treatment of Map Objects

 

There is code throughout the map editor that gives special treatment to certain object types, and sometimes even to specific overlay indices. Here is an incomplete list:

 

  • Towns, heroes, signs, events, sphinxes, and spell scrolls all have extra information associated with them called the "map extra," which can be edited using the Cell Details tool. The code for initializing these is in the PlaceOverlay function. See the reverse-engineered code.
  • Castles/towns are actually 4 overlays: the castle/town itself, the two flags, and the terrain-specific mound they sit on. These will all be given the same "overlay link," so that they will be deleted as a unit with the Erase tool. The code for placing these extra overlays is in PlaceOverlay.
  • There is a special exception that Alchemist Labs cannot be placed on the top row of the map. The code that handles this is in ValidOverlayPlacement.

Comments (0)

You don't have permission to comment on this page.