Thursday, March 15, 2012

The Slow, Good Way

Once again, I've decided to substitute long-term measures for short-term ones in my ongoing level layout work.  I had been able to get pretty far by cannibalizing the pathfinding code, but my preferred design has always been to run A* on the graph described by the level grid.  Several months back I took a crack at this and found it difficult to make hay out of BGL's astar_search; I'm feeling more practiced now, though, and hence more ambitious.

Fortunately, too.  With an infinite grid, this graph can only be represented implicitly; fortunately, BGL once again has the answer.  User-defined graph classes can be designed conforming to the family of concepts used to specify BGL's algorithmic interfaces, and such classes can be designed to represent implicit graphs (even infinite ones).

I'll be wanting this level detail graph stuff later on for many other purposes anyway, so once again it seems worthwhile to take the time and do it, though it's another pesky impediment to my visible progress.  Speaking of worthwhile investments, I've finally spent the chunk of time to set up a testing framework, so I should be able to keep things less chaotic going forward.

I expect it'll be a minute before screenshot time comes again, but I sure hope to be able to show off some dead-on perfect hallways by the end of it.  Wish me luck.

No comments:

Post a Comment