I was also able to clean up the sliver triangles from the paths between covers. Simple angle checking of each corner.
Okay finally weekend, I can get back to game dev stuff xP Decided to clean up my "forest" randomization. Wanted my trees randomly placed but sort of evenly spaced. Found a nice VariablePoissonSampler github repo that allowed me to also use a noise texture to control the density of the trees =)
Happy to see my husband so into writing again tho <3 He's cooking something good =3
Bleh. Work taking the time energy to work on the game -.-
The path requires finding a 'goal' cover, the closest cover to a point. To avoid checking thousands of covers I decided to split the world to a spatial grid. It gets the covers from 9 closest cells to the point (red X) and checks only those to find the closest one (green circle).
Was able to repurpose some old A* Star pathfinding code code for movement from cover to cover. Took a bit of fiddling since it was originally used for grid based node layout with fixed amount of neighbouring nodes. I want the monster to avoid long moves in the open so gotta tweak the heuristics l8r
Birdonomy, the practise of arranging, regulating and mapping of birds 🤔
To get the monster to move from cover to cover (tree in this case), I know I needed to link the covers together somehow. After some researching into triangulation I ended up choosing delaunay triangulation to create the links. I found a nice Unity package called Delaunator to do this.