Grid Building Plugin 1.0 Release
Grid Building Plugin for Godot 4 » Devlog
Got the system to the point that I am happy with having an initial release. This will be an ongoing project that I want to add extra features too so please give feedback so I can make it even better.
What's Available in the First Release
- Building System - When set with a placeable resource, triggers a preview mode where you can see where your new scene objects can be placed onto. Uses GridTileIndicators to show collisions for each individual tilemap space. After calling the build action in game, attempts to place a copy of your preview object into the game world. To validate this, the system uses build rules to check each requirement for placing the scene object into the game world.
- Grid Targeting System which keeps track of which tile your mouse is pointing at and adjusts the positioner node and hover indicator graphics over where you are trying to interact with on the TileMap
- Placeable - A resource for defining an object that can be placed into the game world. The building system works by picking a placeable resource through set_building_placeable(placeable) to show a preview of the object being placed into the game world and ultimately to place a copy of it's PackedScene into the game world. Notably - each placeable can also define BuildRules on a placeable by placeable basis so if you want spending 100 of a resource to be a requirement for building, you can set that there
- BuildingRule - Base class for creating placement rules for building objects into the game world. When added to either a placeable or the BuildingSystem itself (as a universal rule), an object will be stopped from placement if it does not meet all BuildingRule requirements. In the demo, the build log is a handy way to see which rules failed out (it receives the data through signals)
Currently Available BuildingRules (You can always inherit the base class and make custom rules!)
- NoCollisionsRule - When placing an object into the scene, checks that no CollisionTileIndicators collide the existing tilemap and game objects under neath each indicator. It does this through individual shape casts on the space they occupy.
- SpendMaterialsRule - Requires the removal of a number of specified resources that inherits from BaseItem for placement. The rule uses the user property of the BuildingSystem to locate the ItemContainer which holds the supposed resources.
- SpendMaterialsRule-Generic - Requires the removal of specified resources a node on the user object. The node must implement certain inventory management methods to be used with the generic rule. A resource that contains the type of resource and the count must also be defined (this is an BaseItemStack in the default spend materials rule). See the SpendMaterialsRule-Generic.gd for documentation. The advantage is you can use your own inventory system rather than the classes provided in the GridBuilding/Inventory directory. The disadvantage is in the inspector, you will be assigning generic resources for the item stack implementation and resources spend which is more user error prone. A 3rd option would be to implement your own SpendMaterialsRule that uses the class_name from your own inventory system if your project calls for it.
- WithinTilemapBoundsRule - All TileCollisionIndicators must be cast over tilemap tiles that have valid tile data. A tile that has no tiles is considered off the grid and invalid.
What's Next?
- I want to add a building rule that will check adjacent tiles for walls or ground for Platformer / Side-Scrolling games. Since those games work on the same tilemap but a different perspective, it should make a good fit for this system.
- Currently the system official supports square tiles, but I will take a look into supporting other tile patterns as well.
- If you have an idea, leave a comment! Thanks
Files
GridBuilding-1.0.zip 141 kB
Jul 29, 2023
Get Grid Building Plugin for Godot 4
Buy Now$40.00 USD or more
Grid Building Plugin for Godot 4
Place Anything with Rotate, Flip, Stacking, and Drag Build
Status | In development |
Category | Assets |
Author | Chris' Tutorials |
Tags | 2D, City Builder, Godot, godot4, Metroidvania, Side Scroller, Tilemap, Top-Down, User Interface (UI) |
More posts
- 4.1.0 Manipulate with Move & Demolish Modes89 days ago
- Upcoming Grid Builder Updates for Godot 4.3Aug 18, 2024
- 4.0.3 Compatibility Fix for Godot 4.2.2Jun 09, 2024
- 4.0.2 Small Enhancements & Bug FixesJun 09, 2024
- 4.0.1 File Path HotfixJun 07, 2024
- 4.0.0 - Shared BuildingState, Save / Load HelperJun 07, 2024
- 3.2.2 Bug FixesMar 06, 2024
- 3.2.1 - Input Mapping UpdatesJan 27, 2024
- 3.2.0 - Isometric Tilemap SupportJan 20, 2024
Leave a comment
Log in with itch.io to leave a comment.