Closed chrismdp closed 3 years ago
Need to tackle this before real-time experiment, as I need this in order to do both real-time and turn based gameplay
Actually: another much simpler way of doing this would be to reduce the size of the hexagons and make houses and fields take up more than one hexagon. Can then build Astar pathfinding fairly easily.
We can do square building by allowing a build across both edges of the hex: https://www.google.co.uk/search?q=hex%20grid.buildings&tbm=isch&hl=en-gb&hl=en-GB&tbs=rimg:CUjaAwVEccLAYU6kqadzVVW0&client=safari&prmd=isnv&sa=X&ved=0CBIQuIIBahcKEwiAisD_hPvrAhUAAAAAHQAAAAAQBw&biw=441&bih=650#imgrc=UOR84CLcjdqCAM
Scrap wall tile buildings - it doesn’t really work and is confusing to work with. Instead I could increase the hex size again, and have buildings take a whole hex with one of six rotations so there’s an entrance side. The rest of the hex is blocked off.
Then when pathfinding across hexes, the person always aims for the exit side which means a) people might walk side by side and b) they’ll always walk in straight lines even when pathfinding doesn't work.
Next I need to path using the sides of the hex so I'm not going over all the centers each time (which is a waste). I have this information in the navigation map, so I need to return it from the pathfinding algorithm.
After that I should do better weights on the path - trees should be twice as slow (and reduce your speed).
We are going to have to solve the pathfinding as some point. I'm thinking a navigational mesh which majors on the corners and edges of the tiles. Well trodden paths turn into dirt.