Commit graph

141 commits

Author SHA1 Message Date
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
Erik Ogenvik
219d847bfd Added a "plantable" property.
This describes how entities should behave when they are put in the "planted"
specifically how they should be oriented and adjusted in vertical position.
2016-06-26 19:03:19 +02:00
Erik Ogenvik
e343477341 Fixed incorrect type specified. 2016-06-26 13:18:56 +02:00
Erik Ogenvik
10de08034b Implmented proof of concept limbo property.
When a player controlled entity is deleted, and the player currently
isn't controlling it, it's placed in limbo. When the player once more
connects and start controlling it, the entity is respawned.
This prevents the world from being littered by inactive player
characters.
2014-09-18 21:45:35 +02:00
Erik Ogenvik
b171410b05 Let the domain be specified by a property.
This means that we only attach domains to entities that have the
"domain" property. The "land" entity type for example.
2014-09-15 21:11:35 +02:00
Erik Ogenvik
8b9224b9ad Remove default root "terrain" property.
Since we now allow this to be placed on other entities.
2014-09-09 20:46:30 +02:00
Erik Ogenvik
aedf724d65 Added property for setting the "default" entity.
This is useful for those cases where the root entity isn't the default
one; i.e. the one into which entities by default should be created.
2014-09-09 20:46:30 +02:00
Erik Ogenvik
edc5fd604b Added property for respawning entity.
The "respawning" property makes an entity respawn instead of being
deleted. It intercepts the Delete op and instead of deleting the entity
it moves it to the specified spawn point.
A typical use case of this is to place the property on any user
controlled entity, thus making sure that it's never deleted and istead
respawned when killed or defeated.
2013-11-16 21:05:45 +01:00
Erik Ogenvik
2195fec02e Added an immortal property.
This intercepts Delete operations and ignores them, thus making an
entity "immortal".
2013-11-16 13:13:52 +01:00
Erik Ogenvik
419b4d0342 Added "spawner" property.
When an entity has this property it acts a an spawner entity. At an
interval it checks if there are enough of the specified entities
available, and if not it spawn new ones. This allows for some better
gameplay mechanics.
2013-10-03 13:42:54 +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
Erik Ogenvik
640473d22c Install properties.
It's imperative that all properties are installed here; else the system
will end up in an invalid state whenever data is restored as a result of
a restart (since any missing property then will default to a core
property class.
2013-06-02 00:00:37 +02:00
Erik Hjortsberg
a6ec64e6b6 Added "suspended" property, suspending the world.
In the future this property might be available on all entities.
2013-03-31 20:51:21 +02:00
Alistair Riddoch
58acb15154 Use new template for properties, and rename some
Properties must now be strictly in the same namespace as other definitions,
so I had to rename a few.
2013-03-01 21:52:09 +00:00
Alistair Riddoch
2ec1979045 Fix a typo 2013-02-22 23:48:52 +00:00
Alistair Riddoch
5e877ad95c Add concise template for internal properties 2013-02-22 23:46:49 +00:00
Alistair Riddoch
d1dc73aa00 Use a more concise template for base types 2013-02-22 23:34:51 +00:00
Alistair Riddoch
52ba15e9ad Fix test error, making installFactory work 2013-02-22 15:51:32 +00:00