× MGG Bundle Popout
GameDev Market logo

GUI > HUD

Asset image

Description

Object placement systems that snaps to 2D TileMap grids in Godot 4 and follows defined build rules to determine whether placement is valid.

Video Tutorials & Project Updates

Tutorials Playlist

Project updates playlist

What this plugin does

 

  • Creates a visual way of letting players choose where to place Godot scene objects into the game world with a visual preview and grid targeting tools.
  • The targeting system snaps to the TileMap grid which means objects being placed will snap onto those grid positions.
  • Lets you define the rules for when and how an object can be placed into the game world. Before an object can be placed, it must meet each building rule's requirements. You can also define your own rules by inheriting from the BuildRule base class.
  • Provides optional base inventory (ItemContainer) class that can be used with the include SpendMaterialsRule for subtracting material resources from a user's inventory. A generic spending rule is also included if you want to write your own inventory class.
  • A full working demo you can use as reference or base for your own game scenes. Feel free to reuse any UI components used in the demo.

What game types does this plugin work with?

  • Top Down 2D Godot Games where levels are built with TileMaps
  • NEW: Metroidvania / Sidescrolling Games made with TileMaps
  • Works with all collision shape 2Ds and collision polygon 2Ds for generating placement collision shapes against the grid

I intend to get it working with side scrolling / platformer perspective games shortly after initial release of the plugin.

You can read more about the details of using this plugin in the project readme file or watch my video tutorials (highly recommended)

How to Use

  1. Download and add the .zip contents to your project in the directory addons/GridBuilding.
  2. Turn on the plugin in Project Settings -> Plugins tab.
  3. Add a GridTargetingSystem node to your main gameplay scene, either in the editor scene hierarchy or by instantiating the object
  4. Add a BuildingSystem node to your main gameplay scene, either in the editor scene hierarchy or by instantiating the object
  5. Add the grid_positioner.tscn scene to your node 2d game world parent. This should be the parent node where your game tilemap is a child of.
  6. Assign external dependencies to each system under the External Dependencies property group. You can do this either in the inspector or as your level nodes for targeting objects like the build system user (likely the main player character) through code.
  7. To trigger build mode, you call set_buildable_preview on the BuildingSystem. You need to define a placeable resource file which holds the settings for placing a scene object into the game.
  8. To make the system place the object into the game world, press the action(s) defined in the BuildingSystem for object placement. You set these up in the Godot project settings and then add the string names of those actions in the BuildingSystem inspector. By default ui_accept is used which you could test by pressing ENTER in a new project.
  9. To limit where and when a placeable scene can be instantiated, you must use BuildRules. Add rules you want to include for all placeables to the BuildingSystem and placeable object specific rules to each placeable resource file. You can read more below about build rules and what the default rules do.
  10. For tile collision indicators, you can start with the provided templates. Right click them to create an inherited scene and save it your own project. You can assign a different template scene to the rules that require them (NoCollisionsRule and ValidPlacementTileRule) to have different settings for each one. An indicator needs to have the mask layer of the collision object you want to create indicators for on the tilemap grid during building. So an indicator with mask 11 will find objects with collision layer 11 and create indicators for it. Only one indicator will be created for each grid position so be sure your indicator masks and target shapes don't conflict.
Report asset

Media

Author Details

ChrisTutorials's profile image

Active Since: July 2017

Published Products: 5

Followers: 0

Reviews

This asset has not received any reviews yet.

You must be logged in and have bought this asset to leave a review.

Comments

To leave a comment, please log in
Be the first to leave a comment.

Licence Info

Great news! All assets on GameDev Market come with our standard Pro Licence.

Whereas some asset stores have multiple licence versions, we believe having only one licence keeps things as simple as possible for our users, so that you can keep on doing what you love without any doubts over where and how you can use your assets.


At a glance, here are some of the key points from the licence:


 You can:

  • Make changes to any asset bought/downloaded
  • Use the assets and any Derivative Works in Media Products, whether commercial or non-commercial, with no restriction on the number of projects

 You cannot:

  • Use the asset or Derivative Works in a logo, trademark or service mark
  • Sell, share or redistribute the asset or Derivative Works outside of the Media Product
  • Allow the user of the Media Product to extract the asset or Derivative Works and use them outside of the relevant Media Product.
  • Use assets bought on GDM to create NFTs

You can check out the full Pro Licence here.

Grid Building Plugin for Godot 4

Handcrafted by ChrisTutorials

$30.00

(VAT may apply)

Please login/signup to add this product to your wishlist.

Technical Details

Name Value
Version 2.1
Last updated August 15, 2023
Included formats gdscript
Created in Godot
File size 149.36 KB
Changelog N/A
Vector
Layered
Sprite

*You will receive an email once per week when any Followed Creators list new assets

Share & Earn

Log in and Share this asset and your Alliance link will be included, meaning you will earn money back on any sales/purchases made by new members joining through your link! See the Referral Guide for more details.

More assets from ChrisTutorials


GameDev Market logo

GameDev Market is a marketplace for high quality, affordable game assets handcrafted by talented creators from all around the world.

GameDev Network Limited is registered in England & Wales (08951892). Registered office: Baltic Co-Working Space, 12 Jordan Street, Liverpool, UK. L1 0BP. ICO registered (ZA122213).

© 2024 GameDev Network Limited. All rights reserved.