Wednesday, September 15, 2010

05 - 3000

Oh yeah, it is digging time!

Well with a video capturing my efforts for posterity, I think I am officially past the "guy doing stuff in paint and pretending to be a programer" phase. Am I right?

In the above video I start with a barely visible command to harvest a bush. Then the fun parts starts. I am designating some areas for digging. A nice fractal pattern should do for starters. Areas are marked with the right mouse button presses and by dragging the mouse. Nice and intuitive. I'll keep such an interface. The first thing you right click will determine the action for your selection when you release a mouse button. Clicking on a wall? Well, probably you want to designate it for digging. Clicking on a designation for digging? Remove the designation.

While I am drawing along, nothing is happening. The game is not paused. The pause button is not implemented yet. In the future you are going to want to pause when designing something more complex because the clock is ticking away, but for simple actions you won't have to pause. The dwarves are not working because the areas designated are not accessible. Once I designate a corridor that will connect these areas to the outside, one single dwarf begins working. As soon as other points are accessible, other dwarfs start working. Eventually all of them are busy chipping away.

The algorithms involved are not yet perfect but they do a fine job and I am not going to improve them yet. I actually like the little peculiarities in movement and scheduling. Dwarves consume huge quantities of alcohol. They should choose strange work patterns in consequence.

Also time passage is not accurate yet. Digging is almost instant. With time, I'll figure out the durations so everything feels right and is also challenging.

Uploading to YouTube was pretty simple. But I have a crap capture program. Not only did it manage to extend the duration of my capture, but it saved almost 800 MiB on disk. I had some fun uploading for 40 minutes.

So why the tile of the post? Because I have exactly 3000 lines of code. I did not try to achieve this round number for this post, but I guess it must be a sign.

With a minimum of features, it is time to implement saving and loading of games. I don't want to have to start all over every time I boot up DwarvesH.

Statistics S10:
3000 lines of code in 23 files
94,9 KiB (including 23,3 KiB image data)

No comments:

Post a Comment