Skip to content

Dune 2 – The Maker – 4J – Devlog – Harvester – Part 2

by stefanhendriks on August 5th, 2017

If you want to have harvesting logic like C&C or Dune 2 has, you have to break it down into various steps. All these steps make it quite a lot of work. Lets just give you an example.

– You need something to build a refinery
– You need logic, when a refinery is placed a harvester is spawned
– The harvester needs to be able to move (unit movement)
– The harvester needs to be aware that is able to mine spice, and when it is on a spice field it should do so
– When the harvester can no longer mine the field, but it is not filled up yet, it should look further for other nearby spice fields/tiles
– These steps repeat until the harvester is full
– When the harvester is full:
– Look for a nearby (free, unoccupied) refinery. If no free refinery can be found, go to the most nearby refinery that is not free and wait there.
– When a free refinery is found go there.
– “enter” the refinery (ie, you need to circumvent any logic here that normally would block the harvester from driving through the refinery).
– after entering the refinery, start unloading spice + give credits to player
– when harvester is done unloading, respawn/repeat from step 2 of this list

So, this is just a rough description. There are edge cases everywhere we did not touch.

So far bits and pieces have been developed. Like movement of units, harvesting spice fields (but not unloading). “Entering” structures. All pieces for a bigger puzzle.

I’m happy to let you know that a first rough version works of the above list, and I made a short video about it!

  1. Bruno permalink

    Looking good! 😀

Comments are closed.