Good resources for a turn based strategy system?

Hey all. I haven’t purchased the pro version and am contemplating doing so, but can’t figure out if it will make my goal easier or not.

I’m looking to implement a movement system similar to Divinity Original Sin. The standard rules, like movement range based on action points.

My main goals are:

  • visualizing the path before making the movement, by showing a line with the path the character will take, which would just be tied to the mouse cursor while in the “choose destination” mode, and will be limited in length by their action points.

  • non active characters must be treated as obstacles, and the actual path routes around them, so that the distance based movement accounts for it before making the move, and also would totally block narrow areas.

I’ve searched and found a lot of people asking questions similar, but they seem to mostly go unanswered. Just wanting to see if this will work out for me, and how difficult it would be to implement.

1 Like

You can calculate the path length by getting distance between the vector3 points of the path. There is also a built in method for giving the total path length. Then you would truncate the path based on distance the player can travel.

I haven’t figured out the local avoidance part yet, but I assume you can get a path that avoids dynamic obstacles.

edit
I am essentially trying to do the same thing and an issue I am having is

  • grid graphs straight vs diagonals need to be accounted for which is easy - alternative is hex grid
  • a smoothed path on a recast graph has irregular point to point distances, and finding the correct stopping point and showing the entire path is a bit tricker

Hi

You can definitely do this. You should use a grid graph to make costs predictable.
Also check out this tutorial: Utilities for turn-based games - A* Pathfinding Project and this example scene Hexagonal Turn Based - A* Pathfinding Project

The hexagonal turn based project does seem almost exactly what I want, just need to figure out a good way to visualize the possible paths with a lineRenderer or something next. I’ll just start from there and try to convert to a non-hexagonal graph, probably grid like you said. I was wanting to make it something similar to Divinity Original Sin, but I suppose it would seem like less of a grid if I use smaller node sizes. Thanks!

In a case where a units took up more space than a single node would you still advise node blocking over using a collider and rescanning the graph?

1 Like

just found out about navmesh cut and dynamic grid obstacles

1 Like