Wednesday, March 30, 2011

Some progress

About time I got around to another post.

There's been quite a lot of changes since my last post. I now have a working pathfinding system and several working buildings.


I've left out the menu system as it hasn't changed.

My units are currently called dwarves because that was more fun than humans when I started but I'm sure I'll get around to refactoring that sometime. Currently a building can claim a dwarf from a pool of unemployed dwarves and once that dwarf reaches the building he will be employed. The only jobs at the moment I have are Farmer and Porter though.

Originally I made the farmers sit at their farms and plant crops, harvest etc. Then the porter would slowly make his rounds of all the buildings near the storehouse, collecting as many resources as the farms had. If it was taking too long to get to everyone, another porter would be employed by that storehouse.
This worked well but it was very boring and static, as the farmers would just sit in their farm and only one or two dwarves for every 20 or so would actually move.

So I've changed it to be more in the style of Settlers where workers are responsible for taking their produce to the storehouse and collecting what they need from there. Porters will just move stuff between storehouses.

Also paths from buildings to storehouses are now stored so there's very little expensive pathfinding going on. Dwarves use a different pathfinding method depending whether they are on paths or offroad.

I've implemented regions into my map data so getting building and pathing info is relatively quick no matter how much you add. That was done in the Hexitridecimal? method, similar to Minecraft.
However my various attempts at making the map generation more speedy haven't done very well. Currently whenever the screen shifts it calculates a whole new bitmap data for the entire screen in order to display the correct tiles. Hopefully I'll find a better method than this soon.
My current thoughts are to do some more research into generating consistent Perlin data in smaller amounts. Also thinking of storing several screen worth of data, as the user is likely to stay in one place only shifting slightly every now and then.

I've also started the port over to XNA/C# which isn't proving very difficult. Eventually I know I'll need the greater power of C# but for now I'm quite happy prototyping in flash. Hopefully no matter how complicated the game gets I'll atleast be able to have some version working online in flash.

I'm also using my own tileset now for buildings etc. My girlfriend has also started creating tiles to help. Current issues in that area are doing tile transitions to hide the square corners and having consistent, efficient rotations so that the hills look better. For that to work I need to get the same "random" rotation everytime I load that tile, which is either proving costly or difficult.
As for the artwork itself, I've started posting on Pixelation for advice, hopefully they have some great advice/examples for me to learn off.

The farms just look like normal buildings in this version as I'm in the process of adding fields.

As always, post if you read or want some specific information about anything. Or if you have advice/thoughts!

2 comments:

  1. Hey there!

    Just stumbled across your site through Google Analytics' Referring Sites (you sent me one hit! ;)

    Are you still actively developing your game? I couldn't find a download link on the site.

    Looking forward to seeing how it's shaping up!

    Ebyan "Nolithius" Alvarez-Buylla
    http://www.nolithius.com

    ReplyDelete
    Replies
    1. Can't believe it's taken me this long to notice and reply to your comment! Having a celebrity like you stop by is a big deal.
      There has actually been no progress in a long time on this game because I quit my job and took up woodworking :D
      I actually have a new site and blog over at http://www.flyingkakapo.blogspot.co.nz/
      and I'm starting up work on the old simulation game now, which is why I'm here.

      Delete