Commit graph

53 commits

Author SHA1 Message Date
Erik Ogenvik
8af43d151e Refactor mind code to throttle ops sent to server.
To make it more predictable.
2021-08-05 19:17:29 +02:00
Erik Ogenvik
69ecb0ac44 Added limits to processing move ticks. 2021-08-03 17:47:35 +02:00
Erik Ogenvik
5e287405a4 Remove unused code. 2021-08-03 12:09:30 +02:00
Erik Ogenvik
7f6fa5c707 Remove ops queue in CommAsioClient.
Any such queuing should instead be handled in the Link which receives the operations.
2021-08-02 01:21:18 +02:00
Erik Ogenvik
cebdde1734 Refactored how entities move themselves.
An entity is now mainly moved by setting the "_propel" and "_direction" properties.
These will then be applies on the next physics tick.
This moves away from the system where entities move themselves by issuing Move ops.
2021-07-22 23:19:51 +02:00
Erik Ogenvik
fc88157578 Formatting. 2021-07-22 22:55:50 +02:00
Erik Ogenvik
6f0580e347 Print distance with less fractions. 2021-07-08 23:22:47 +02:00
Erik Ogenvik
3c8ef3a178 Update AI to handle lack of Location on LocatedEntity. 2021-06-27 16:27:10 +02:00
Erik Ogenvik
a40cad95ea Removed Location from LocatedEntity.
Since not all entities have physical location, which is more and more true
now that we have domains. Entities that are placed in non-physical domains don't have
any location data.
This also makes it easier to streamline the sending of properties, since we only need
to send the properties that actually have changed.
In addition, this helps with removing circular references, since the "m_parent" field no longer
is a Ref.
2021-06-18 22:44:30 +02:00
Erik Ogenvik
80ae36d511 Improve on combat.
NPCs will now stop any attacking task if the target isn't available.
2020-08-30 00:22:28 +02:00
Erik Ogenvik
e55116a43e Signal when players are defeated.
This is needed to allow AI to know when a player has been "killed".
When this happens they should clear any grudge they have with that player.
2020-08-29 18:56:50 +02:00
Erik Ogenvik
977e8326f0 Remove extra logging. 2020-07-15 00:36:22 +02:00
Erik Ogenvik
192da589ed Added "grazing" to cow and chicken.
This allows them to graze the land.
2020-07-14 22:46:22 +02:00
Erik Ogenvik
fd173f34e5 Record "_origin" as property on entity.
Otherwise it would be re-calculated each time the entity mind was recreated.
2020-07-12 13:04:37 +02:00
Erik Ogenvik
ff61b2495c Aim arrows at the middle part of the target entity.
Still need to make adjustments for hitting things farther away, with
bullet/arrow drop etc.
2020-07-08 00:18:23 +02:00
Erik Ogenvik
c21123fbdd Remove excess logging. 2020-07-08 00:02:13 +02:00
Erik Ogenvik
f834514083 Remove code for ownership.
Ownership needs to be handled through other means, such as specific properties.
2020-07-07 22:26:13 +02:00
Erik Ogenvik
af372d777f Fixed set_to on wrong op. 2020-07-07 21:48:37 +02:00
Erik Ogenvik
c98eff77be Remove extra logging. 2020-07-05 01:39:00 +02:00
Erik Ogenvik
d9419b5185 Use Steering for pursuit. 2020-07-04 22:20:12 +02:00
Erik Ogenvik
0e82d89b86 Removed extra logging. 2020-06-28 21:48:22 +02:00
Erik Ogenvik
20905e167e Include more possible actions in unarmed combat. 2020-06-28 21:47:54 +02:00
Erik Ogenvik
20a7946a17 Remove extra class. 2020-06-28 13:36:22 +02:00
Erik Ogenvik
6c77769876 Added delayed and one shot goals.
This allows the welcome goal to be delayed.
2020-06-28 13:21:04 +02:00
Erik Ogenvik
81881d655a Python formatting. 2020-06-26 23:32:56 +02:00
Erik Ogenvik
634a67f0d4 Refactor how entity appearance is handled in AI scripts.
We now allow goals to receive entity appearance calls through having a method called
"entity_appears". The entity is guaranteed to be fully resolved (which is required to
allow us to filter checks).
2020-06-26 17:53:54 +02:00
Erik Ogenvik
4017d661ac Remove extra comma. 2020-06-26 13:21:12 +02:00
Erik Ogenvik
9a8ab9fa18 Remove obsolete interlinguish stuff. 2020-06-26 13:20:52 +02:00
Erik Ogenvik
b6cbfc6abe Remove "time" check from goals.
This can be done in "fulfilled" for specific goals instead.
2020-06-26 00:00:47 +02:00
Erik Ogenvik
20db99aa7a Make code easier to follow. 2020-06-25 23:39:55 +02:00
Erik Ogenvik
fae8e2a96f Rename and fix incorrect reference to "unaware_tiles_count". 2020-01-20 23:49:18 +01:00
Erik Ogenvik
0b1565e1db Fixed that path_result is in steering now. 2020-01-20 23:44:10 +01:00
Erik Ogenvik
cc3f160482 Fixed issue with ranged combat. 2020-01-20 19:37:50 +01:00
Erik Ogenvik
f167549cb2 Improve on movement. 2020-01-19 23:25:06 +01:00
Erik Ogenvik
3d6e8c16fc Improve Gather goal to check for amount. 2020-01-17 20:31:42 +01:00
Erik Ogenvik
29febe18f4 Improve combat.
We now check if we have any bow we can use. Added the Condition goal to allow for
separate goal paths.
2020-01-12 15:32:34 +01:00
Erik Ogenvik
dcf30a77f4 Conform to PEP8. 2020-01-11 23:10:11 +01:00
Erik Ogenvik
258b55a974 Use standard Entity Ref. 2020-01-11 19:06:43 +01:00
Erik Ogenvik
1d86dc32c0 Make fighting entity equip shield if there is any. 2020-01-08 22:10:52 +01:00
Erik Ogenvik
a9495057ac Formatting. 2020-01-08 17:36:39 +01:00
Erik Ogenvik
667eef7c2c Improve combat behaviour.
Entities will now stop any melee tasks if there are no enemies to hit.
2020-01-08 15:21:30 +01:00
Erik Ogenvik
e478a1169f Fixed incorrect lookup of attacker. 2020-01-07 20:38:48 +01:00
Erik Ogenvik
98d52ca309 Fixed tests. 2020-01-06 21:23:56 +01:00
Erik Ogenvik
99cca6d305 Expose method from Steering checking if at location.
It's important that the Mind code uses the same kind of checks as the Steering.
Otherwise there's a risk that the Mind code thinks we're not at the destination while
the steering code thinks so.
2020-01-06 16:58:10 +01:00
Erik Ogenvik
3e95e81c11 Make Python conform to PEP8. 2020-01-05 11:11:44 +01:00
Erik Ogenvik
2a007d2881 Use upper case for Python classes. 2020-01-05 00:54:53 +01:00
Erik Ogenvik
f2cff3a43c Use optional to handle locations without common ancestor. 2020-01-05 00:21:02 +01:00
Erik Ogenvik
7c780c55b7 Clear up Python code. 2020-01-04 22:42:26 +01:00
Erik Ogenvik
30fb0ff6e2 Tidy up Python code. 2019-11-29 10:48:53 +01:00
Erik Ogenvik
95855efed0 Specify imports better. 2019-11-28 16:57:28 +01:00