Commit graph

72 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
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
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
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Alistair Riddoch
f941a56bc6 Fix unused file 2012-05-14 11:50:26 +01:00
Alistair Riddoch
7f41ba0688 I am sure git makes total sense. TO ALIENS! 2009-04-09 12:52:37 +01:00
Alistair Riddoch
a429b728d4 What the hell is going on with these Ids 2009-03-24 15:17:36 +00:00
Alistair Riddoch
8e521d8928 Update all the Ids 2009-03-24 15:09:42 +00:00
Alistair Riddoch
ea0a36f4aa Remove AI client code that never worked. 2009-03-22 20:16:20 +00:00
Alistair Riddoch
d4995dd10c Use scripts/check_header_guards.sh to correct the header guards on many files. 2009-03-22 19:23:13 +00:00
Alistair Riddoch
b25d743fbc Remove all the cvsignore files. 2009-03-20 01:54:35 +00:00
Al Riddoch
9a56dac06c 2006-10-26 Al Riddoch <alriddoch@zepler.org>
* Add RCS Id keywords to every file, for better version tracking.
2006-10-26 00:48:00 +00:00