Commit graph

374 commits

Author SHA1 Message Date
Erik Ogenvik
ce3d82329a Handle "extragoal". 2018-12-20 14:51:25 +01:00
Erik Ogenvik
0e2841db2a Chicken pecks by default. 2018-12-19 23:18:55 +01:00
Erik Ogenvik
373e8c4731 Automatically add "origin" location.
This is where the entity if first created. Useful for goals.
2018-12-18 23:42:55 +01:00
Erik Ogenvik
278ab64dc1 Clean up goals code. 2018-12-18 12:35:34 +01:00
Erik Ogenvik
ceb2277a8e Add the new goal as a subgoal.
This changes how the dynamic goals behave, by instead adding them as
subgoals to the dynamic goal itself.
One reason is that we want to sync the _goals property with the actual
goals.
2018-12-18 11:40:01 +01:00
Erik Ogenvik
49c071c702 Handle knowledge in "_knowledge" property.
Although this might be changed going forward. Perhaps we should store
mind data in a separate object, separated from the physical entity
instead.
2018-12-17 21:26:17 +01:00
Erik Ogenvik
df88332a09 Fixed a couple of smaller bugs. 2018-12-16 23:42:13 +01:00
Erik Ogenvik
02afb7fb73 Fixed Location imports. 2018-12-16 22:51:36 +01:00
Erik Ogenvik
48b4c5775a Removed obsolete files. 2018-11-03 20:43:34 +01:00
Erik Ogenvik
164816f646 Adapt tests to changed structure. 2018-11-03 17:17:50 +01:00
Erik Ogenvik
e85f0831b2 Restructure rule classes.
Classes under "rulesets" have been moved to "rules", and split up into
futher subdirectories matching their library. As a result we can now
better separate the python bindings, so that things that belongs to the
simulation are separeted from things that belongs to the ai.
2018-10-31 21:38:35 +01:00
Erik Ogenvik
62c644b8c5 Don't use Inheritance in mind code.
Instead use the TypeStore. This also alters how filters are used.
2018-10-21 20:40:50 +02:00
Erik Ogenvik
35677a9904 Use a simpler type store for the client.
We only use the Inheritance class for the server.
2018-10-15 22:06:53 +02:00
Erik Ogenvik
05cad0c525 Initial work on new goals handling.
The goals are defined through the "_goals" property.
2018-10-15 17:46:45 +02:00
Erik Ogenvik
a43120ab29 Conform to PEP8. 2018-10-11 23:02:05 +02:00
Erik Ogenvik
22a8288013 Conform to PEP8. 2018-10-11 22:42:59 +02:00
Erik Ogenvik
939dd93678 Adapt to changed API. 2018-10-11 22:35:00 +02:00
Erik Ogenvik
9aa1209755 Added mind callbacks for properties update.
Mainly so we can listen for the "_goals" property when it updates.
2018-10-07 20:10:27 +02:00
Erik Ogenvik
11e6ed3e42 Re-enable tasks on client. 2018-09-30 21:11:16 +02:00
Erik Ogenvik
86f4820a38 Refactor aiclient main loop.
We now use a totally boost::asio based loop. As a result the client
now plays along with other asio based components. Other clients are
broken currently though, needs to be fixed.
2018-09-25 23:30:03 +02:00
Erik Ogenvik
6459ae4818 Separate main loop code into own class.
To be shared between server and client.
2018-09-22 23:11:22 +02:00
Erik Ogenvik
139d229f80 Sync Python method names with C++. 2018-08-17 22:04:07 +02:00
Erik Ogenvik
c80336840b Further work on converting Python bindings. 2018-07-22 19:47:35 +02:00
Erik Ogenvik
3ad6d2ad8d Move all rules to "share" directory.
And load rules from the "var" directory if there are any, allowing for
over riding.
2018-05-16 11:51:48 +02:00
Erik Ogenvik
0572fd6d4a Use "props" to get properties.
Also unify LocatedEntity Python bindings.
2018-05-14 17:35:19 +02:00
Erik Ogenvik
b72aa95c94 Removed obsolete files.
We want to control behaviour through properties and move away from using
hierarchical structure.
2018-05-08 14:31:48 +02:00
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
701d1a7208 Initial work on porting to Python 3. 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
2bbbad4c58 Restructure and add "present" properties.
Also make sure that the correct geometry is used whenever possible.
2018-02-20 22:26:27 +01: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
9e87611433 Only print subgoals if there are any. 2017-09-05 23:10:23 +02: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
0286bcd47d Replace "parents" with "parent". 2017-07-24 15:05:18 +02:00
Erik Ogenvik
7f3f936308 Filter out invalid subgoals. 2017-05-28 21:51:22 +02:00
Erik Ogenvik
fdaf230281 Handle validity check correctly. 2017-05-28 21:51:04 +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
0a81e9897f Added a concept of goal "validity".
Calling "is_valid" checks whether the goal actually can be fulfilled.
If it can't be, False is returned.
By default all Goals return True unless a "validity" function is supplied
in the constructor.

For now we only use it for checking whether movement goals can be reached.
2016-06-08 22:03:59 +02:00
Erik Ogenvik
ec857b57e5 Handle movement goals not being reachable.
Though perhaps we should have a more general mechanism for querying
goals about their validity?
2016-06-08 21:46:37 +02: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
374a691735 Allow destination to be set to another entity.
This only works for entities that share the same domain.
It also allows for entities to follow other entities.
2016-04-03 21:25:39 +02:00
Erik Ogenvik
924ba32982 Added extra goals to some goals.
These are goals that can be injected to run when the parent goal
is fulfilled.
2016-03-30 22:34:44 +02:00
Erik Ogenvik
b5e7861669 Added linger and iterate goals. 2016-03-23 22:23:15 +01:00