InGame Tilemap Editing - Part 8: Using Rule Tiles / AutoTiling - Unity Tutorial

Опубликовано: 05 Февраль 2022
на канале: Velvary
3,290
76

In this episode I will show you how easy you can integrate rule tiles (autotiling) into the existing code. But to make it even better there are some changes that need to be made.

-- ABOUT THIS SERIES:
In this tutorial series you will learn how you can create an ingame UI where your players can draw on a grid. We are going to use Unitys Tilemaps and there will be a lot of coding involved. You'll learn how you can add the UI with clickable buttons, how to show a preview where an item would be placed and of course you can place it. It will then be drawn onto a tilemap.


Part 1: I explained the basic setup and by the end you can place items with a simple click. We will also use Unitys New Input System for the input handling. The UI will be created by hand but automated in another part of the series.

Part 2: will explained how you can create rectangles and lines via click and hold events, also done with the new Input System. We will assign those drawing styles to the categories the items belongs to, so that for example a wall will be always drawable as a line.

Part 3: To combine items like a floor and a vase on top you need several tilemaps. In part three of the series we expand the code to support different tilemaps for different categories we draw. The tilemaps will be generated during game start and therefore help you with easy maintainability. I will group the tilemap creation by category, so for every category it is possible to create an own tilemap. This can be adjusted as you wish by just usign the tutorial as an foundation.

Part 4: shows you how to automate the UI. With a little bit more code and configuration your drawing buttons will spawn on game start. So you can easily expand the drawable objects without the need to add more annoying UI things.

Part 5: Deleting tiles with a "Tooling Feature" which will handle custom code for different use cases.

Part 6: You will learn methods how to restrict tile placement based on different criteria like environment or placed tiles on other tilemaps. This will prevent e.g. placement inside water or also placing e.g. walls on top of items.

Part 7: We will create an option for keeping a build history in memory. With an undo and a redo function we will be able to iterate through this history.

Part 8: Integrating Rule Tiles (AutoTiling) into the existing functionality.
=========

💻 CODE: https://github.com/MichelleFuchs/InGa...
💬 DISCORD:   / discord  
❤ SUPPORT ME:   / velvary  

🎮 PLAY MY GAMES: https://velvary.itch.io/
🦜 TWITTER:   / velvary1  


💡 ...MORE TUTORIALS:    / velvarygames  

=========

Timestamps:
00:00​ - Intro
01:13 - Installing the Package
01:31​ - Creating a Rule Tile
02:19 - The Finished Rule Tile
02:​42 - Creating a BuildingObject
03:10 - Fixing the UI Error
05:08 - Testing the Functionality
05:22 - The Problem To Solve
06:30 - Upcoming: Next Episode
06:53 - Thank you for watching :)