Commit graph

17 commits

Author SHA1 Message Date
Erik Ogenvik
14354137a7 Hooked up steering to the move_me goal. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
86d5f30cd2 Update shared awareness when entities are changed. 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
Erik Ogenvik
84bee5a8d1 Added comment. 2015-06-01 22:35:08 +02:00
Erik Ogenvik
f5d6eaf033 Make Cyphesis spawn AI clients automatically.
By default an AI child process is spawned at startup, unless the
"aiclients" config value is set to 0.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
6f8424422b Get all entity rules first.
This is needed in order for types to work. Note that we currently can't
handle dynamically changing rules; we get all rules up front. This will
have to do for now though.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
86d9901041 Ignore destroyed entities.
Since there can be references to them in the OpQueue they can linger for
a while until they are flushed from the OpQueue, and then correctly
deleted.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
dd352ec759 Refactor ai client to use op dispatch. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
c928a800d4 Handle positive return codes.
They aren't error codes.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
e78301df20 Improve logging. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
17d507e667 Hook up interactive signals.
So that the client can be shut down normally.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
d8f83584ff Reset the possession client when disconnected.
This is the cleanest way currently. But perhaps we should try to retain
the minds and see if the thoughts can be transferred when connected
again?
This would be a future operation though.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
02df25772f Try to reconnect if disconnected. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
8d39f81f58 Create BaseMind instances to handle minds. 2015-05-24 11:25:06 +02:00
Erik Ogenvik
ac946c417c Create MindClients per mind.
I.e. the PossessionClient will spawn new MindClients for every mind that
needs controlling.
2015-05-24 11:25:06 +02:00
Erik Ogenvik
f205f3b230 React to possession requests. 2015-05-24 11:25:06 +02:00
Erik Ogenvik
f8932858fd Enable aiclient.
The idea is that the aiclient runs in a separate process and handles all
AI functionality.
This is done by having a "possession" client which recieves possession
requests from the server, and spawns new AI clients for each request.
2015-05-24 11:25:06 +02:00