CBL Level - Kovak/CBL_KivyActionRPG GitHub Wiki

Screen Format: The level format for the game is a single, non-scrolling screen of square tiles.

We will support 2 resolutions or zoom levels:

  • Mode 1: 9 x 6 tiles, for a total of 54 tiles
  • Mode 2: 18 x 12 tiles, for a total of 216 tiles

This will allow mapmakers to create slightly larger scale scenes such as towns or battlefields, while allowing close up scenes for either cut-scene or similar storytelling purposes, or to just give a more intimate feel to the area. I think the smaller size will be often used for dungeons and building interiors.

In order to support all the different screen sizes and form factors, on start up of the program we need to determine:

  • total window space available - space required by UI elements

We then will determine the largest square tiles that can be fit onto the remaining screen in 18 x 12 and 9 x 6 maps. This scaling factor as well as the mode will then determine the size of all the graphic elements on screen.

Map Editor: The map editor should have 4 modes:

  • Tile Placement
  • World Object Placement
  • NPC Placement
  • Script Placement

Tile Placement: This allows the player to place tiles as selected from the available pure tiles in the loaded tile set and format the background of the level. 2 Types of Tiles:

  • Pure Tiles: These tiles contain no borders and are just an infinite pattern their names take the form of Tile-TileName
  • Border Tiles: These tiles represent the pair combinations of all the tiles in the tile set. They are named in the form of Tile-InteriorTileName-ExteriorTileName-Position The Position is given as a number 1 through 9 excluding 5, as would be appropriate for the border taking that position on a numpad with the pure tile in the middle at position 5.

If these tiles are animated an additional -framenumber will be appended to the name. After placement, the editor will determine the correct position for the tile.

Tile Collision: Tiles will be divided into a grid of 3 x 3 subspaces. This will form the basis of our path-finding system. A tile with water in the bottom left corner would then be assigned:

  • 0 0 0
  • 0 0 0
  • 1 0 0

With 1 representing the un-passable terrain

World Object Placement: This mode should allow free-form movement and scaling of the objects available in the selected world object set. Perhaps even rotation, we should see how that looks.

There should be a bake path-finding button that then determines where in the tile collision grid the objects take up space. This should probably be accomplished by assigning world-objects appropriately sized collision boxes and then checking to see which grid spaces collide with world-objects.

NPC Placement: This part will allow the placement of monsters and other non-player characters. We will probably need to create a monster editor to augment the options available here. As we grow, we will want to think about creating a way to give non-player characters schedules and paths and such: simple examples would be guards patrolling an area rather than simply standing in one spot.

Script Placement: We need a simple way for map builders to add things such as events happening on a player walking over a certain spot, this could turn into traps or ambushes or all kinds of environmental hazards. This is also where we would put the bit that determines which objects and areas take you to a different level screen.

There should probably be at least 2 methods of triggering events:

    1. Character model colliding directly with a rectangular box drawn in the script placement mode.
    1. Touching an object on screen while the character is within a certain radius of the object.