Submissions from 2015-08-01 to 2015-08-02 (2 total)

Bug fixes

A submission for Make games. 189

Fixed the bugs from yesterday, and added some temp graphics over the reachable tiles. Movement is pretty solid right now!

A submission for Make games. 189

I have finished integrating a scene partitioning scheme into my level editing workflow. On a separate layer of the map, you simply draw rectangles. The rectangles are loaded into the map as separate sections, and path edges are created between any rectangles that are touching. I don't have hierarchical pathfinding set up yet, but to test that this is working, I have configured the agents to, on maps that HAVE partitions, pathfind ONLY using the partitions, ignoring the tile layer. The algorithm is, for every section on the path between the start and end sections, walk to the center point of the section. For the last section, just walk to the destination point (which should be in there somewhere and accessible from the previous section). It should work pretty well, except I'm finding my agents are getting stuck in weird places - the generated path is fine, but following it is messed up. I'm pretty sure this is an unrelated bug - perhaps the walking doesn't work well if the destination point is too far away.

I've thought a bit about how to do it, and realized adding hierarchial should not be too difficult - I already have hierarchial logic in the behavior tree. I just would add a node above the point to point which goes through each section in a section path. Current logic looks like this:

*generate path
 *for point in path
  *go to next point

New logic will look something like this:

*generate section path
 *for section
  *generate path to next section
   *for point
    *go to next point

The tricky bit is encoding which tiles are actually in the section to constrict the search, and which tiles to aim for when heading to the next section. Going from center to center is fine for my experiment, but in the real thing that's insufficient. Sections should be able to contain walls, and they will need to pathfind around those walls when they reach the section. I need to pick the tile on the EDGE of the section that is closest to us. Sigh math.