3.2.0 - Isometric Tilemap Support


This patch introduces support for Isometric TileMaps including an isometric demo level sampling making builds in a 2D isometric game perspective. Highly recommended to check that out to see an example of it in action before adapting the system to your own project (As always there is a platformer and top down 2D demo as well)


  • Added full transform checking to RuleIndicator and CollisionShape checking. You should use PolygonShape2D instead of RectangleShape2D if you need to skew a rectangle (like the collision shape for Isometric RuleCheckIndicator).  https://github.com/godotengine/godot-docs/issues/8758
  • Added a debug option to show the generation area where RuleCheckIndicators are generated within the bounds of. Using this option can help you see exactly where the indicators are tested against for your setup.

Breaking Changes! (Minor)

  • Actions list on BuildingSystem changed from arrays of actions to single actions. There is really only a need for one action per building_system function so having them set to arrays was needlessly complicated. Changing to single string name properties resets the naming. You will need to set the names of your actions on the BuildingSystem again to your custom build, exit, rotate, flip, etc actions.

TilemapBuildingOverlay 

Draws custom tiles directly onto the tilemap when the building system is in build mode. It works by targeting an tile_set atlas, atlas coords, and optional alternative tile id to select which tile to draw over all tiles with active data during build mode. They are hidden when build mode is exited. Replacement for GridOverlayDrawerComponent (deprecated!) since this new method supports Isometric tilemaps as well.

Setup Tutorial
  1.  Add the tile you want to draw as an overlay to indicate potential builds spots.
  2.  In TileSet window, the selected atlas on the left will give you your Atlas ID.
  3.  If the atlas is bigger than a single tile, you will need to find the Atlas Coords for the desired tile as well. Do this with select on the tile you want and the Atlas Coords should be visible. For a single tile atlas, the coords should be (0,0)
  4. Assign that information here in the TileMapBuildingOverlay inspector
  5. After assigning the building system node, and signal bus like with other systems, the overlay should react whenever the building system enters build mode and show the overlay over all tiles on the Buildable Tile Map Layer that have tile data (i.e. you assigned a tile on the tilemap to that location and layer)

Advantages over GridOverlayDrawerComponent

  • This handles rotation, repositioning, or skewing of the tilemap / camera during gameplay 
  •  No need to custom code for each tile shape type on tileset, because the tilemap already handles that

Other Changes

  • Moved checks for setup from _ready() to set_buildable_preview since there may be many games where the system would load before a game level is set. This gives you a chance to call setup_for_level to set tilemap, placed_objects_parent etc before receiving warnings and errors about improper setup.
  • Added various validation checks under the hood to make sure your systems setup is valid. If setup is incorrect, more problems should be caught in warnings to the debugger log.
  • Added tile_map_changed signal to BuildingSignalBus. BuildingSystem and TileMapBuildingOverlay are hooked up to this so whenever the tilemap changes through the bus, those will update their tile_map property automatically. You can call this when changing levels or want to just change which tile_map the BuildingSystem is targeting for building.
  • Made better default build log messages for CollisionsCheckRule. This split the messages into two types, one for expected NO collisions and one for expected collision overlap depending on rule settings.

Bug Fixes

  • Fixed a bug where BuildingSystem did not call tear_down() on the PlacementValidator when being removed from the scene tree.
  • Fixed a bug where TileCheckIndicators from a previous build preview were freed at end of a frame after a new one was set. This resulted in duplicate node names for new generated Indicators if they had the same tile offset position.

Grid Builder Inventory Changes

  • Added signal emissions for changed item counts whenever the _slots array is set in the inventory.
  • Added get_item_counts_where_different(p_new, p_old) to compare two arrays of BaseItemStacks and show the new values for BaseItem type wherever it is different than the original array.

Demo Changes

  • Added Layer 10 Placement Check to No Collisions Rule so that tiles or objects with a placement check collision shape would block placement. This layer is handy in the demo for objects a character can walk through but where the building system cannot build onto.
3.2.0.a Hotfix
  • Removed default action names for rotate left/right, flip horizontal left/right. When these values are set, errors are generated. So its better that these are left blank until the user is ready to enable rotate and flip in their game.
  • Added README.md documentation for TileMapBuildingOverlay

Files

GridBuildingDevProject-3.2.0.zip 3 MB
Jan 20, 2024
grid_building-3.2.0.zip 71 kB
Jan 20, 2024
grid_building_inventory-3.2.0.zip 11 kB
Jan 20, 2024

Get Grid Building Plugin for Godot 4

Buy Now
On Sale!
10% Off
$30.00 $27.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.