Posted September 25, 2024 by Goutamraj
The environment represents the entire map.
I needed a map system that could track every point within it—where each point had its own position and unique identification. As players moved through this map, I wanted to trace their paths. Additionally, I aimed to implement various gameplay-related features, such as creating trail boundaries, performing territory filling using algorithms like flood fill, and keeping track of cell ownership.
In my research, I discovered the concept of grids. By creating a grid-based map, I could assign a Cell class to each grid cell. This Cell class allowed me to store relevant data for each individual cell. Furthermore, this approach facilitated communication between the client and server: whenever a cell’s data was updated, I could transfer that information seamlessly through the cloud.
Resource Followed:
Grid System in Unity (Thanks to "Code Monkey" )