Commit graph

124 commits

Author SHA1 Message Date
Erik Ogenvik
5b282419be Finalize conversion to Python 3. 2018-05-07 11:15:26 +02:00
Erik Ogenvik
97a09ae6b0 Conversion to Python 3 through 2to3. 2018-05-07 11:15:26 +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
b509f08597 Fixed incorrect orientation. 2018-02-11 21:12:47 +01:00
Erik Ogenvik
13314ff026 Convert Python scripts to left coords. 2018-02-06 13:45:10 +01:00
Erik Ogenvik
7127d39f13 More work on moving to left hand coord system. 2018-02-06 13:45:10 +01:00
Erik Ogenvik
6c2ceee884 Check that parent exists. 2017-09-05 23:08:22 +02:00
Erik Ogenvik
253fd3747d Provide a fallback vector. 2017-09-05 22:57:40 +02:00
Erik Ogenvik
d8eeb05c3d Revert include optimize for Python files.
CLion wasn't as good at optimizing Python as it was at optimizing C++.

This reverts commit 7aaa9b9ba7.
2017-05-28 16:32:17 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Olek Wojnar
9e1b3b92c3 Fix typos
Courtesy of lintian
2016-09-06 22:29:36 -04:00
Erik Ogenvik
eed786758e Better log output with entity's name. 2016-06-08 21:46:37 +02:00
Erik Ogenvik
326c2f6667 Handle subgoals being None. 2016-06-08 21:46:37 +02:00
Erik Ogenvik
9570196ffb Don't send Looks for Unseen operations.
Since we'll then enter into infinite loops.
2016-03-20 22:48:28 +01:00
Erik Ogenvik
5ece4d27e8 Improved error output. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
7c2ab63fca Dial down logging. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
b683fb3464 Allow for inspection of the path.
Authoring clients can send a Think op, wrapping a Get op with a "path"
attribute to get information about the path. The mind code will then
send back a list of points for the path.
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
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
519d353c22 Mark thinkning ticks as such. 2015-05-24 13:29:42 +02:00
Erik Ogenvik
5c5fca2d24 Rewrote how minds are interacted with.
Instead of using separate Commune and Think goals depending on
whether we're querying for or setting thoughts we now instead solely use
the Think op. This op wraps another op, which is then used to determine
what to do. The ops that are supported are: Set, Get, Delete and Look

Think(Set): sets new thoughts and updates existing ones, if an id is
supplied.
Think(Get): get all or specific thoughts (replaces Commune)
Think(Look): inspects a specific goal
Think(Delete): deletes all or a specific thoughts (i.e. both goals and
knowledge)
2015-05-24 11:25:08 +02:00
Erik Ogenvik
690ffbbf94 Improve error logging. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
4bc649b405 Handle entity references in thoughts.
Entities are references using a format of "'$eid:...'".
For example, an entity with id 2 would be references as "'$eid:2'".
This specific pattern is handled specifically by both the importer, the
exporter and the minds themselves, allowing for entities to be properly
restored with correct minds.
2015-04-29 22:35:22 +02:00
Erik Ogenvik
a3ffe6c714 Check for validity of ops. 2015-04-20 22:29:12 +02:00
Erik Ogenvik
ec95be3adb Fixed typo. 2014-12-07 22:14:16 +01:00
Erik Ogenvik
3bfd3459b0 Author goals by id.
The way goals are authored is refactoed so that each goal gets assigned
an id. The client can then refer to this id when issuing both Think and
Commune commands. This makes it much easier for the client to properly
author the goals, independent of the "subject" they are attached to
(which is an Interlinguish construct which isn't relevant to direct goal
introspection).
2013-09-09 20:04:00 +02:00
Erik Ogenvik
ac38e7bfb7 Make sure communed thoughts are deterministic.
So that we don't get spurious differences between two different entity
dumps.
2013-09-08 23:04:04 +02:00
Erik Ogenvik
8b6ab9447f Fix possible attribute ref error. 2013-09-07 00:24:56 +02:00
Erik Ogenvik
ebb6a7d56d Fixed incorrect goal info arg handling. 2013-08-22 21:18:41 +02:00
Erik Ogenvik
d65e47c660 Use "commune" for goal info. 2013-08-22 09:54:46 +02:00
Erik Ogenvik
c46aaee933 Handle new Think op correctly. 2013-08-16 00:02:36 +02:00
Erik Ogenvik
a17839f8fe Use Think and Commune for thoughts. 2013-08-14 00:06:25 +02:00
Erik Ogenvik
e630e01ba1 Removed problematic logging code.
Which caused crashes.
2013-06-23 00:08:34 +02:00
Erik Ogenvik
fb2f073841 Print out the entity id in debug when thinking. 2013-06-01 23:17:16 +02:00
Erik Ogenvik
d2a5486c05 Also persist ownership. 2013-04-21 11:30:48 +02:00
Erik Ogenvik
479495258d Handle locations better.
It's now possible to specify parent entity as well as coordinates.
2013-04-20 22:00:03 +02:00
Erik Ogenvik
69f1008fb8 Don't send thoughts when adding knowledge.
In fact we need to refactor the interlinguish code so that knowledge
isn't set directly and instead passed to the entity through a Thought
op.
2013-04-17 21:14:11 +02:00
Erik Ogenvik
3f3f212c9c Correctly handle serializing Location. 2013-04-13 23:32:44 +02:00
Erik Ogenvik
9beee13a21 Send thoughts as "Thought" op.
Instead of wrapping it in a "Set" op. This is more idiomatic.
2013-04-13 23:25:16 +02:00
Erik Ogenvik
54b8249bd7 Make sure subject is transmitted as string.
Else we risk automatic conversions, which for example will turn tuples
into lists.
2013-04-11 23:04:26 +02:00
Erik Ogenvik
333ae7832f Be more forgiving with goal errors.
Instead of treating a goal error as something which will make the entity
inactive, we instead allow for some errors (namely three currently) to
occur before the goal is deactivated. Any other goals are however
allowed to carry on even though one goal is faulty.
We also expose this through the goal_info query functionality, allowing
for world authors to better debug faulty goals.
2013-04-07 23:20:23 +02:00
Erik Ogenvik
4807f7856b Clean up debug code and add docs. 2013-04-05 20:53:46 +02:00
Erik Ogenvik
929f964b7d Allow to query for specific goals.
One can specify both the "subject" and the "goal". If no "goal" is
specified, all goals for the "subject" will be queried. If no "subject"
is specified, all goals will be queried.
2013-04-02 22:32:52 +02:00
Erik Ogenvik
4d982173bb Allow admin client to query goals.
This is done in a way similar to how thoughts are queries. A Get op is
sent, containing a Goal_info op. The mind code is then responsible for
composing data about the goals, which is sent back to the client.
2013-04-01 22:18:40 +02:00
Erik Ogenvik
6420d0afaf Fixed issue with setting multiple goals. 2013-03-31 21:02:13 +02:00
Erik Ogenvik
d227515c43 Improve goal creation.
We'll make sure all new goals are valid before we remove the old ones.
2013-03-31 21:02:13 +02:00
Erik Ogenvik
678f439fb9 Improve settings of goals.
When a goal is set, the supplied 'object' can also be a list of strings
(i.e. a list of goals). All existing goals for the supplied subject will
be deleted. This allows for much better editing capabilities.
2013-03-31 21:02:13 +02:00
Erik Ogenvik
ea1331b601 Store knowledge of goal differently.
Goals are handled differently than other knowledge, so we need to store
it in a separate dict.
2013-03-31 21:02:13 +02:00
Erik Ogenvik
76878899ad Return all goals when asked.
The goal code is a little messy, because we can't rely on looking into
the knowledge map for them, as the knowledge will only keep one goal per
subject.
In order to fix this we instead look for the goals in either "goals" or
"trigger_goals".
2013-03-31 21:02:13 +02:00
Erik Ogenvik
ce242b7307 Avoid NPE. 2013-03-31 21:02:13 +02:00