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.
The entity chooses a direction and heads to the first unexplored location, when arrived, it looks for a second one. Enemy territory is not chosen, but the unit will pass through it to the other side.
There are still some cases in which this fails however:
- When the entityposition is unreachablee (e.g. on the other side of a sea), the unit keeps trying to walk to it. So probably the pathfinder distance oughtSo a check needs to be usadded instead of actual distancef the position is reachable.
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. How?