A* Memory footprint optimization and Sound subsystem
I have started working on Sound, as Kostatus has gracefully taken over the work of melee code. In the process of doing so, I simplified the Node class originally used by A* and derived an AStarNode subclass from it. This makes the Node class useful as a base for building other more creature senses, should they become necessary.
I have revisited my originally flawed implementation of A* and made some changes to it to reduce memory footprint. The original design was a lazy quick hack. Now I am happy to say that the memory usage has been reduced by a factor of 2/3. The reason why I favor memory footprint over speed is because the in-dev WoT as it is (with my configuration) requires 35MB to run, including all the overhead of the Java VM. I don’t want to add any extra fat to that. Normal creature movement uses ~3% of my (1.4 GHz) CPU cycle. So that should be as good as it can get. Besides, the memory saving will become even more significant when the pathfinding algorithms (A*, Dijkstra) are used on bigger maps; so the little loss on CPU cycles is not too bad.
The basic framework for sound has been implemented. I’m a bit too tired to test it out now, so I will probably do it tomorrow or later in the week.
by Atholas
