This is a rather quick and dirty try to let units explore automated. Feedback is appreciated.
What is done here is that an entity which enters the INDIVIDUAL.SCOUTING-state queries all GAIA-entities around it, picks a hidden one (in SoD that is) and moves to it.
There are still some cases in which this fails however:
- When the entity is unreachable, the unit keeps trying to walk to it. So probably the pathfinder distance ought to be used instead of actual distance.
Todo:
- If a target is could not be reached, skip that one in this and following iterations (until "order.Scout" is given again).
- Check for enemy territory and avoid that.
- Implement method of checking whether tile is explored instead of using GAIA-entities.