Sunday, July 31, 2011

Added pausing, a help menu to remember all the hotkeys, and right click to give you info.
For future reference, previous optimization of pathfinding was writing and using a binary heap for the openList. Did a little more optimization by checking if the movement endpoint is actually walkable or not.
Optimized pathfinding a little, but it's still a little slow. Might look into threading later but for now I think I have to use my old pathfinding for long distances and a* only for the short one.

Time to start on the fun part, combat!

Thursday, July 28, 2011

good a* pathfinding implemented for the player's regular movement and move-to-dig.
Need to expand this to move-to-build and the ai, and add flood-fill passable terrain map for both ai and player to make sure game doesn't wait forever while calculating a* to inaccessible areas.

Saturday, July 23, 2011

Perfected mapgen a little.
I think I'm going to make a 200 by 200 map as an overworld, and take chunks of it (probably 5x5) and derive 200x200 maps from those as actual working maps to play on. The current mapgen is pretty good for an overworld, and it's easy enough to adjust for the smaller pieces. This is mostly due to too much stuff that needs to be checked and drawn for maps larger than 200x200.

Bad pathing is definite starting to become a problem. Deer can't maneuver through the map very well now.

Still need to learn perlin well.

timber's been added, and similarly trees.

I think pathing needs to be fully resolved before I'll move on to combat, so this may take a while because I need to slog through a*.
About the month-long pause, got bored/busy with real life:

So, got lazy and implemented perlin noise from:

resulting in this decent looking map generation:


Some issues I need to think about:
  • my fillermoving (not true A* apparently) pathfinding still isn't robust enough, probably I need to really implement A*
  • how large the map needs to be: current 200x200 map with about 10,000 rock walls is a little laggy, but not too bad. I shudder to think what a 1000x1000 map with multiple AI and dwarves would play like though.
  • what the map actually represents. Is it 1 dwarf per dwarf tile? If so, this map gen varies a little too hard and needs to be stretched
  • actually learning the perlinNoise stuff implemented all the way through: I know enough of the basics but I'd like know it well enough to be able to tune it completely to my preferences/code it from scratch
things I need to start doing:
  • adding combat
  • adding more items (just rocks and grass right now)
  • adding more craftables/buildings (just doors right now)
I feel somewhat satisfied with the mapgen and the fact that I still come back to this and not be lost looking through my code. I'll probably be working on this a lot harder after this weekend.