Last night after playing around with my new door, that can be opened and closed, i decided that it would be nice with some fog of war. You know that dark fog that covers unexplored areas in games.
If there are surprises behind the door then the game should be more exciting.
After giving this a though for a few minutes i came up with an idea that is as simple as it is brilliant, i wrote it a few moments ago and it works! Fog remain in place until the door is opened.
This algorithm, with some modification, could also be used for pathfinding - one of the most difficult challenges that i have faced in game making (i tried a couple of decades ago and gave up).
I could explain how it works but that is probably boring read. The source code of the game will, at some point, be available to anyone interested in finding out.
Edit:
I have completed the pathfinding algorithm now. It really rocks! My maze test map was solved in less than 1 millisecond and the route was optimal. I compared the number of steps to the route that i would take if i walked the map - and both routes had 120 steps. :)
Inga kommentarer:
Skicka en kommentar