Progress progress -
Wrote up the path-generation system in faithful C#.
The algorithm will take a predefined worldspace (as a grid width and height), a path length, and will hack a path within this world-space that follows these rules:
- Right-angled turns only - no diagonals
- No path node may be adjacent to any other path node, with the exception of it's single parent and single child.
Strangely, it was more difficult to exclude diagonal turns than it was to include them.
In any case, with this algorithm completed and extensively debugged (as extensively debugged as a randomly-generated path can be) - the presentation layer was developed in Unity.
Effectively - the algorithm will provide Unity with:
- All coordinates of the walkable path
- All coordinates of nodes that border the path.
- Builds walls around the path from Prefabs (cubes in this case).
- Builds a ground for the path from Prefabs.
All in all, not a bad day of work.
No comments:
Post a Comment