Commit graph

85 commits

Author SHA1 Message Date
Erik Ogenvik
f1785bd9b9 Reload python modules all at once.
To prevent inconsistencies when multiple file changes.
2018-05-10 01:15:35 +02:00
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
12cf9827e0 Nicer debug output. 2018-05-01 19:51:48 +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
cdafec3944 Improve logging of new minds. 2018-03-04 22:34:11 +01:00
Erik Ogenvik
e9e9240f5a Include headers in CMake files.
So IDEs pick them up.
2018-02-06 13:45:11 +01:00
Erik Ogenvik
eb2bb200e5 Clean up and remove unused structs. 2017-07-25 23:40:39 +02:00
Erik Ogenvik
4d530e25e4 Move domain property Entity.
And rename and fixup smaller things.
2017-07-25 23:40:39 +02:00
Erik Ogenvik
0286bcd47d Replace "parents" with "parent". 2017-07-24 15:05:18 +02:00
Erik Ogenvik
b40c613a78 Improve handling of broadcasts.
Use the domains for determining broadcasts.
2017-06-24 21:47:43 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Erik Ogenvik
1e6611fd58 Remove autotools. 2016-12-22 14:39:37 +01:00
Erik Ogenvik
98c7eb66c8 Convert to cmake. 2016-12-22 14:39:36 +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
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
37bcfbd4db Handle Atlas API changes. 2016-03-18 20:07:23 +01:00
Erik Ogenvik
d3b9d1788b Use Atlas 0.7. 2015-06-04 21:41:27 +02:00
Erik Ogenvik
84bee5a8d1 Added comment. 2015-06-01 22:35:08 +02:00
Erik Ogenvik
a147b501d2 Handle older versions of gcc. 2015-05-27 22:33:36 +02:00
Erik Ogenvik
56caaaeee9 Persist thoughts to server at regular interval.
Every 30 seconds the thoughts are persisted to the server, by sending a
Think op which wraps a Set op with the name of "persistthoughts".

An improvement to this would be to only send these ops when the thoughts
actually have changed.
2015-05-26 22:28:14 +02:00
Erik Ogenvik
140d124028 Removed excessive logging. 2015-05-24 12:52:37 +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
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
f9bfd991cd Fixes after merge. 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
2627236e36 Remove references to skstream. 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
3eedbe366b Prefer nullptr for expressiveness. 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
0347c257b8 Handle possession without blocking. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
b2b6418682 Disable debug by default. 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
6b55383125 Keep a reference to the mind entity.
That way we'll make sure that it won't be destroyed while we have a
reference.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
932392ef09 Removed account handling code.
As we're reusing the account managed by the PossessionClient.
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
d6b04f7989 Ignore dis- and appearence ops for account. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
a6d3bef031 Correctly handle initial sight of own entity. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
a77778bbc8 Make sure ops to mind are handled correctly. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
ba67a71a39 Set refno on outgoing ops with serialno. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
8139af72ba Let the AI process handle ticks.
The server should never send Tick operations to the clients; these are
only to be used for world simulation (i.e. things growing, movement
etc.). Any mind code should be handled by the AI process itself, with
the amount of computation being done totally at its discretion.
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
6081c1948f Move op debug output to ClientConnection. 2015-05-24 11:25:06 +02:00