- Home /
The question is answered, right answer was accepted
Find bounds of random generation
Hi,
Basically, I'm trying to make a system that will adjust my astar pathfinding grid graph to match the bounds of a random room layout generation. I've figured out how to adjust the height and width of this grid graph during runtime, but I've been struggling to find a way how to adjust these values to match the height and width of this room generation.
For example, in the image below, the graph should adjust to fit the highest point, lowest point, farthest right, and farthest left points.
My makeshift solution has been to create a massive grid graph, to fit all kinds of generations (see in image 2), but this is very inefficient and has been causing some issues in my game. In short, I'm just really not sure how to go about tackling this issue, so any help would be massively appreciated.
Image 1: https://gyazo.com/d58fc362981e45a7c33ca8af9c5d4919
Image 2: https://gyazo.com/1850e17a34e1f954f79ac53d9920c871
[preview of external content removed for GDPR compliance as it was including 3rd party cookies]
What is your current code so far? Tilemap has a cellBounds property that you can change, have you tried it yet?
Im sorry i can't provide a solution but i can't help but notice that this game is actually BenBonk's slimekeep. If you indeed are ben bonk (which is very likely since the assets used in the game are not publicly available i guess), i think i can give you a welcome from the community here
Just like @Long2904 said, we'd be able to help you if you can be a bit more detailed about what you want and what have you tried so far to achieve it (aka the script in this case)
Hey guys, I actually managed to figure it out using an alternative method. But I really appreciate the help :)
im glad you figured it out and appropriately closed the question. But, It'd be better if you could share a rough solution as an answer for future visitors, also all the best with the game.