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 entity chooses a direction and heads to the first unexplored location, when arrived, it looks for a second one. the unit keeps trying to walk to it.Enemy territory is not chosen, So probablybut the pathfinder distance unit will pass throught to be used instead of actual distance it to the other side.
Todo:There are still some cases in which this fails:
- If a target- When the position is could not be reachedunreachable (e.g. on the other side of a sea), skip that one in this and following iterations (until "order.Scout" is given again).
- Check for enemy territory and avoid that.the unit keeps trying to walk to it. So a check needs to be added if the position is reachable.
- Implement method of checking whether tile is explored instead of using GAIA-entities.- If a target is could not be reached, skip that one in this and following iterations (until "order.Scout" is given again). How?