Steropes.Tiles

A entity based turn based role-playing game framework


Keywords
game, rogue
License
MIT
Install
Install-Package Steropes.Tiles -Version 2.1.0

Documentation

Steropes Tiles

Steropes.Tiles is a fast tile rendering pipeline for grid and tile based games. It supports both flat tile sets as well as well as isometric tile sets. This library is agnostic to how your game data is organised, as long as the data can be queried in some sort of grid format (using X,Y coordinates).

Features

  • support for various grid based rendering types
    • flat grid
    • isometric diamond grid
    • isometric staggered grid
  • rotated map rendering
  • map navigation independent of underlying rendering type
  • flexible rendering pipeline translates model data into rendering information
  • non-opinionated and clean separation between your model and the graphical representation
  • highly optimized
  • support for sprite layers and GUI integration

License

Steropes.Tiles is licensed under the MIT license.

The Steropes.Tiles.Monogame.Demo module contains tilesets from the FreeCiv project. Therefore the source code of this project is dual licensed under the MIT license (that means you can use this code freely in your own projects) and GPL 2.0 licensed (same license as FreeCiv).

All the graphics contained in that module are solely licensed under the GPL 2.0 license to comply with the intent and spirit of the FreeCiv project.

Rendering process

Steropes.Tiles assumes that maps are rendered in multiple layers. The rendering pipeline is divided into three parts:

  1. The GridPlotter marks out the visible area based on the current viewport settings. It then visits every visible tile position and hands control to the PlotOperation.

    The GridPlotter ensures that only the absolute minimum of map coordinates gets visited regardless of the size of the underlying map.

  2. The PlotOperation uses a preconfigured TileMatcher to query the rendered tiles for the given map coordinate. A tile matcher is a function in the general form of

    (x, y) => List of Tiles
    

    The library ships with a large number of standard matchers to lookup the correct tile based on the map coordinate and its neighbours. Depending on the matcher used this allows you to connect walls or roads or create smooth shorelines from the raw map data given.

    This lookup is a cacheable operation that greatly increases performance for maps that only change infrequently.

    The list of tiles returned by the matcher is handed over to a TileRenderer, along with the computed viewport coordinates for the current tile.

  3. The TileRenderer takes the tile, coordinates and possibly some context information and displays the content on the screen. The renderer translates the given tile into actual rendering operations of your underlying graphics system or game engine.

    The Steropes.Tiles.MonoGame library ships with a renderer for textured tiles for XNA/MonoGame based games.