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

    8/05/14 - 20:41

    Something lurking under the sand ...

    So, those pesky harvesters have had an easy time.  They mine, they can’t get damaged as nothing in the game does damage.  So I decided that tonight’s dev time would be dedicated to ending their serene existence.  There is something monstrous lurking under the sands – sensitive to the vibrations the harvester make when they are harvesting the orange from the sand.  It moves swiftly and quietly through the desert, the only sign of its passing is trickling cascade of sand on the surface.  It will approach a harvester, biding it’s time, and then, without warning :

    It will attack !

     

     

     

    Actually, no it won’t at the moment, as I ran out of dev time tonight – d’oh.  So those harvesters are spared for another day.  This is a giant worm that lurks under the sand.  Actually, this is one of the smaller ones, it will just slam into the side of harvesters and cause them damage.  Enough attacks will eventually destroy a harvester, causing it to spill it’s stored load all over the desert sands.  The larger ones will have a slightly more interesting attack.  This attack will be a lot more fatal 😉

    I tried several ways to get the worm moving and looking worm like.  Originally I had each of the sections following the other ones center point and ignored collisions.  Which was fine as long as the worm went in a straight line, but if it decided to go back on itself, all the sections of the worm would end up traveling as one – which just looked pretty lame.  I tried turning collisions on each section of the worm, and that ended up with bits of worm being randomly teleported all over the map, which again wasn’t much help – and wasn’t as amusing to watch as I just made it sound.

    In the end I went with giving each section of the worm a movement history.  When head of the worm is spawned it records it’s position in its history log and then moves.  Every time the head moves, an entry is created detailing its location in the history log.  After it has moved once, it spawns a body section, and tells this body section to use the heads movement history to determine it’s path.  The body section records its position and moves to the first point in the heads movement history.

    Now the head spawns a second body section at the point where it was first spawned, and moves one step recording its route.  It tells this body section to follow the first body section.  All the body sections are instances of the same entity, so all the above happens to both body sections.  A third body section is spawned and told to follow the second.  And volia, after a few more frames, you have a nice worm living in the sand.

    Not quite sure I’m 100% happy with the looks of it, diagonal movement looks a bit dorky, I may smooth that our some what, so it is less apparent its just a bunch of moving squares.

    lamentconfig
    Share

    Your Reply


    %d bloggers like this: