Commit graph

19 commits

Author SHA1 Message Date
Erik Ogenvik
8c82a87601 Reset result when stopping steering. 2016-06-08 21:46:37 +02:00
Erik Ogenvik
6bfc446d6d Fixed null check. 2016-05-22 21:55:09 +02:00
Erik Ogenvik
53a729c941 Added null checks. 2016-05-15 23:40:32 +02:00
Erik Ogenvik
374a691735 Allow destination to be set to another entity.
This only works for entities that share the same domain.
It also allows for entities to follow other entities.
2016-04-03 21:25:39 +02:00
Erik Ogenvik
ad1076fb7e Always update path each update.
This to counter issues where the avatar walks back to a waypoint
it should have passed.
We need to keep a track on how this affects performance though.
2016-03-20 20:20:26 +01:00
Erik Ogenvik
f7d736b898 Use horizontal radius of entity to check arrival. 2016-03-20 18:49:31 +01:00
Erik Ogenvik
69f92e944b Handle Atlas API changes. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
49f8ff9e1b Only update area if current tile isn't aware. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
fa4eb7bb0b Limit too long distances.
If the character wants to travel too far, we shouldn't try to map the whole
path straight away. Instead we'll cut down on the lenght, and increase the
acceptable radius.
This works since the AI will issue a new destination on its next Tick.
2016-03-19 23:05:13 +01:00
Erik Ogenvik
e76e0fc7ad Skip movement goals that are unreachable.
A goal is considered to be unreachable when all tiles in the awareness area
have been mapped, and no path still could be found.
2016-03-19 23:05:13 +01:00
Erik Ogenvik
d5dd3e595c Don't count own entity when avoiding. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
af3ce5ab07 Decrease load slightly. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
8888543b56 Schedule new steering soon if avoiding. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
c1d0bf48c5 Improved querying of paths. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
4adb908571 Handle bbox changes and better prediction.
We'll schedule the next move tick to when we expect us to arrive at the
next waypoint.
2016-03-19 23:05:13 +01:00
Erik Ogenvik
4690483750 Improve debug logging. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
14354137a7 Hooked up steering to the move_me goal. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
7b0d30680c Setup steering.
The setup is that steering is handled separately from the normal mind
ticks. At a closer interval (0.2 seconds currently) steering will be
evaluated.
2016-03-19 23:05:13 +01:00
Erik Ogenvik
514d0812a0 Added basic awareness for navigation.
"Awareness" refers to an entity's view of the surrounding world with
regards to how the entity could navigate. We use Recast/Detour to build
a navmesh for the entity.

However, since each world can have many NPCs, each one with their own
mind, we don't want to keep a complete navmesh for each single mind.
This will quickly become expensive. Therefore we want to share
awarenesses between multiple entities of the same type. So, for example,
all fishes handled by the same ai client will share one single awareness
of the world.
This to some degree involves some cheating, since AI minds now might get
knowledge of the world they otherwise wouldn't have. We consider this to
not be such a big issue. If this is unacceptable for some worlds these
should then disable awareness sharing and take the resource hit.
2016-03-19 23:05:13 +01:00