Commit graph

158 commits

Author SHA1 Message Date
Erik Ogenvik
2eeab96efa Separate BBox property from Density property. 2018-12-16 20:40:48 +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
800d6f3d2c Put operations in separate directory. 2018-10-30 20:12:45 +01:00
Erik Ogenvik
f87233cd53 Clean up code. 2018-10-30 19:35:57 +01:00
Erik Ogenvik
92f44c0df2 Fixed issue with admin property.
Needs to be is_admin to not collide with "admin" type.
2018-10-06 13:42:06 +02:00
Erik Ogenvik
d3e45c6d27 Register both usaged and _usages. 2018-09-08 21:50:53 +02:00
Erik Ogenvik
599095bfd4 Improve handling of visibility for types. 2018-08-19 17:15:30 +02:00
Erik Ogenvik
7e064963c6 Remove Plant and replace it with scripts. 2018-08-19 00:00:46 +02:00
Erik Ogenvik
bc6d15ee74 Remove outfit property.
This is now handled by the AttachmentsProperty.
2018-08-14 22:05:51 +02:00
Erik Ogenvik
127793e8a2 Implement an "attachments" property.
This is put on entities that can have other entities attached to them.
With this property both "right_hand_wield" and "outfit" are deprecated.
2018-08-14 21:32:06 +02:00
Erik Ogenvik
c771163071 Started moving minds code into Minds property. 2018-08-07 20:33:51 +02:00
Erik Ogenvik
f895054d68 Make scripts private. 2018-08-04 18:01:20 +02:00
Erik Ogenvik
3b19555fd7 Don't use hyphens in property names. 2018-07-30 13:35:51 +02:00
Erik Ogenvik
712fd7a741 Introduce protected and private properties.
This is defined by the naming of the property.
Properties that starts with "__" are private. Only visible to the
simulation and admins.
Properties that starts with "_" are protected. Like private but also
visible to the owning entity.
All other are public.
2018-07-30 10:24:33 +02:00
Erik Ogenvik
8842d65e08 Implement cool downs. 2018-07-29 23:20:42 +02:00
Erik Ogenvik
9e30b1c91a Refactor how items are used.
Still work to do though.
2018-07-13 17:11:23 +02:00
Erik Ogenvik
0ca22bcf68 Specify scripts for entity as property.
This allows multiple scripts to be used. In addition it allows for
entity with specific scripts.
2018-07-04 19:20:24 +02:00
Erik Ogenvik
beafd38e63 Scale plants, using the "maxscale" prop.
Instead of having different properties for max size and max mass we now
only use a "max scale" property, and we only change the size of the
plant by altering the scale.
2018-06-29 12:26:08 +02:00
Erik Ogenvik
746bf181a9 Added scale property.
This is now the preferred way to change the size of any entity, instead
of editing the bounding box. The "scale" property is either uniform if
only one value is present, or in all dimensions if all three values are
present.
2018-06-28 23:09:35 +02:00
Erik Ogenvik
e4db1b0311 Added checks for reachability.
This is meant to replace the simple distance calculations in rules for
determining whether an entity can be reached or not.
2018-06-24 23:50:54 +02:00
Erik Ogenvik
008490331b Made planted_on behaviour more sane. 2018-05-23 22:54:40 +02:00
Erik Ogenvik
56ac4c47be Fixed issues with planted_on.
The property "planted_on_desired" can be used to tell an entity that it
should try to plant itself on a specific entity before it performs the
general planting tests.
This can be used to for example force planted entities to share a space
(such as multiple rocks being clustered when planted on the ground).
2018-05-20 23:26:08 +02:00
Erik Ogenvik
664988645e Make all properties define type and optional name. 2018-04-27 23:12:15 +02:00
Erik Ogenvik
d7900bebfb Added property for perception of sights.
Instead of having it determined by sending looks ops.
It's a float value since there's a possibility to apply is as a factor
of the default view distance.
2018-04-25 20:15:28 +02:00
Erik Ogenvik
f09675cec6 Use "planted" for floating entities.
Entities that are "planted" on bodies of water are floating.
This does away with the "floating" mode.

To mark that entities should by default be floating when placed in
water the boolean property "floats" has been added.
2018-03-24 17:06:02 +01:00
Erik Ogenvik
166a5aaba3 Initial work on planting entities. 2018-03-23 19:22:35 +01:00
Erik Ogenvik
380b4e21d9 Added rolling and spinning friction. 2018-03-12 18:15:20 +01:00
Erik Ogenvik
d0585e9eb8 Enabled oceans and lakes.
Through the "water_body" property. An entity which has this is a water
body. If there's a bbox the entity is a lake (bounded), otherwise it's
an ocean (infinite bounds).
2018-02-28 09:34:05 +01:00
Erik Ogenvik
c19576d694 Added property for jumping, "speed-jump".
Entities without it cannot jump.
2018-02-20 23:08:14 +01: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
0bc9450cff Standarize on double precision. 2018-02-12 09:46:30 +01:00
Erik Ogenvik
ca2abb94b5 Refactor how movement is handled and sent.
We've introduced the properties "speed-ground", "speed-water" and
"speed-flight" which specifies the top speed in m/s for each medium.

The "propel" attribute is now normalized, since it's multiplied with the
applicable top speed (depending on the medium, although currently we
only use the ground speed, TODO).
2018-02-11 23:22:20 +01:00
Erik Ogenvik
a3560c817f Use "propel" property for movement.
Clients shouldn't set the "velocity", instead setting the "propel"
property.
2018-02-11 21:15:35 +01:00
Erik Ogenvik
320480a9c4 Don't install "mode" twice. 2018-02-06 13:45:11 +01:00
Erik Ogenvik
c415630136 Remove geometryfile property.
Instead we use the "asset" type on the "geometry" property.
2018-02-06 13:45:11 +01:00
Erik Ogenvik
67549fc362 Added geometry file property.
The mesh specified in the property will be read and a "geometry" mesh
property installed on the type onto which the property is installed.
2018-02-06 13:45:11 +01:00
Erik Ogenvik
559af7781e Removed unused property. 2017-08-02 10:04:31 +02:00
Erik Ogenvik
737005b624 Added step-factor to control stepping.
It's a float property which determines how high the entity can step,
relative to its height.
2017-03-24 17:19:10 +01:00
Erik Ogenvik
b857efc836 Remove "forces" property as it didn't work. 2017-02-01 22:06:44 +01:00
Erik Ogenvik
c025cee692 Added a max size property.
When scaling plants, they are scaled using their bbox if they have a
density. The "maxsize" property limits their max size.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
3238b0b94c Let the domain handle terrain mods.
We can't just listen to Move ops, since we now let the Domain
handle movement.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
fd34c235e4 Remove "transforms" and "modespec" property.
These properties didn't work out when we moved to a physics based world.
Instead we've introduced the properties "planted-offset" and "planted-scaled-offset".
These properties takes a float and specified vertical offset for planted entities.

Likewise with "planted-rotation" which specifies a rotation applied for planted entities.
"active-rotation" keeps track of any applied rotation.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
596ffad815 Added properties for geometry and angular factor.
For now we'll only support a limited set of geometry shapes.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
137e455725 Added "density" property.
Density is in kg/m3. This property will update mass when size changes.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
da5f8f8e56 Added a friction property for physics. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
1320c836d0 Added a Propel property, describing propel force.
This is mainly the force used to propel characters forward. I.e.
walking, running and so on.
For now it's not activated, since we rely on proper physics to be
implemented first.
2016-06-26 20:17:18 +02:00
Erik Ogenvik
cb493811b3 Added "forces" property.
This property describes all external forces affecting the entity.
2016-06-26 20:17:18 +02:00
Erik Ogenvik
12a38b3d0f Added a mode specification property.
This property tells how the entity should behave when put into
different modes. Currently we only allow for specific transformations
to occur.

The mode specifications are registed in properties where "mode-" forms
a prefix, and the mode a suffix. For example, "mode-planted".
This also does away with the "plantable" property.
2016-06-26 20:17:18 +02:00
Erik Ogenvik
d5d11df11e Let "transforms" property determine pos and orient
Instead of directly setting position and orientation we've now
added a "transforms" property. This property contains zero or many
transformations. The result of these is what drives changes to an
entity's position and orientation.
By cleanly separate disrete transformations we can more easily undo
or alter them. This allows us to do things where the position or
orientation of an entity is affected by other properties, or other
entities.

The client protocol is intact. Changes to position and orientation is
still sent the same way, by specifying "pos" and "orientation". However,
these values will now not be written directly to corresponding values on
 the entity. Instead they will first be written to the "transforms" property,
with the final values being a result of combining all data in the property.
2016-06-26 19:11:15 +02:00