So while working on the new enemies and their respective AI, I realized that the current 'pathfinding' is quite bad. Enemies just literally point themselves directly at you and charge. Not too exciting. We definitely need to get some pathfinding going on here.
Unfortunately I've never done real pathfinding before, so I nabbed Patrick Lester's wonderful article and got to work on a prototype using the splended C#+SDL.NET combination. Mix and boil for 2.5 hours -- minus some laundry-work here and there -- and voila! I was shocked at how easy it was compared to how difficult I imagined it would be. [smile]
Since we all love demos, I added a bit more user-friendliness and packaged it up for anyone who wants to toy with it. It's not boringly instantaneous; it actually step-by-step builds the path so you can see what's really going on.
You will need the .NET Framework 2.0 to run it, of course.
Left-Click: Add/remove walls.
Right-Click: Set start point.
Middle-Click: Set end point. (You need a 3-button mouse, sorry! [sad])
F: Calculate shortest path.
R: Reset map.
Download A* Pathfinding Demo
Now that I've got the concept under my belt, it's just a matter of reimplementing it in C++, and tuning it a whole bunch to work with a destructable environment. Should be interesting; both to write and test!
Maybe I'll play with flocking AI to see if I can build little sub-colonies of cells. [grin]
How are you going to "tile" your destructable landscape? I would imagine that making every pixel a tile would make the pathfinding rather expensive.