• About
  • Gallery of Images
  • Archives
  • Categories
  •   LowRezJam – Report 5

    7/05/14 - 23:12

    Search Mode Pathfindingg

    After many tears and screaming at harvesters doing idiotic things, I’ve got the search mode working.  Harvesters will now look for material to mine.  If they are near mineable material, they will move toward it and if there is nothing tasty to harvest around it, they do a long range scan ( indicated by a green flashing eye icon ).  This long range scan will take four seconds to do, and once complete the harvester will start to move toward anything they have found within their search range.  There are still a few tweaks I want to do to this system.  For instance : harvesters don’t share destinations and if they both decide that they want to head to the same pixel of harvestable material, they will constantly ram into each other trying to get to it.  Hilarious to watch, but buggy looking alas.

    The search range is determined by a variable within the harvester instance – this variable is something I want the player to be able to change at some point.  Currently the radius is about quarter of the screen, but the idea would be that as you trained up the harvester’s crews experience, they would look further and further afield – eventually locating off screen resources.

    The harvester actually performs two searches: one is a short range ( just around the harvester ) which has no time sink associated with it and then the second green icon long range search, which has the four second time associated with it.  The short range search is designed so that the harvester keeps mining the patch of material it is currently on.  I’ve added some debug code to the following gif just to give you an idea of the searches and when they happen :

     

    search_mode_dubug

     

    The dark puce square indicates a short range search, the dark blue indicates a long range search.  So the events in this gif are :

    • A harvester is spawned and does a short range search, it finds nothing and then does a long range search, it finds nothing again and a mouse click tells it to move to a new position.  The green icon indicates the search is happening gameplay wise, but the search doesn’t happen until after four seconds, hence the blue square appearing after the movement.
    • A short range search of same harvester, finding nothing ( just ) – then a long range search to find more.
    • A second harvester is spawned and does lots of short range searches and as it is surrounded by harvestable material it never needs to do a long range search.
    • The third spawned harvester does some short range searches, then gets sent to another location – harvesters don’t search while directly ordered to move by the player.  It does a short range search when it arrives at the waypoint and finds some more stuff to harvest.
    • Then back to the second harvester, showing it turning the field to dark puce 🙂

    Once I had battled with the searching, I decided to do something pointless and sand being expelled from the back of the harvester while it is mining.  The idea being that the orange harvestable material is mixed in with the sand, so the harvester sucks it all up, grabs the orange and shoots out the sand.  It has no game play use whatsoever, but I think it helps it look a bit more interesting.

    And dark puce is a colour before you complain 😛

     

     

    lamentconfig
    Share

    Your Reply


    %d bloggers like this: