Commit graph

18 commits

Author SHA1 Message Date
Erik Ogenvik
7895d1b0aa Reload minds when python code changes.
All thoughts are first persisted and then restored.
2018-05-01 22:23:31 +02:00
Erik Ogenvik
7ae19d5038 Use Singleton base class.
I.e. make sure that all objects have a defined life time. This requires
that we actually set up and tear down the singletons.
2018-04-25 20:15:29 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +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
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
b9d87ca9d7 Renamed class to more suitable name. 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
02df25772f Try to reconnect if disconnected. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
0347c257b8 Handle possession without blocking. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
4bac387a04 Use canonical method. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
10684226b4 Handle entities being destroyed and remove minds. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
faf8b0ea2d Alter to use one single connection.
Let the possession client and all of the AI clients use one single
connection. This makes it a bit simpler than having each mind use a
separate account and connection.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
0daa0909c5 Fix incorrect op handling in MindClient. 2015-05-24 11:25:06 +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