Commit graph

7514 commits

Author SHA1 Message Date
Erik Ogenvik
79fb91f013 Try to find "python2" first.
Since more and more distros will default "python" to Python version 3.
2016-07-04 17:56:15 +02:00
Erik Ogenvik
9234b7a34b Fixed incorrect orientation for planted tubers. 2016-06-27 00:00:21 +02:00
Erik Ogenvik
423b0dfcf0 For now set velocity directly, preparing for Bullet. 2016-06-26 21:50:10 +02:00
Erik Ogenvik
2f55d5d82b Fixed various compile issues after rebase. 2016-06-26 21:50:10 +02: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
9cf67cb412 Added tests for Mode and ModeSpec properties. 2016-06-26 20:17:18 +02:00
Erik Ogenvik
1c69b3aae6 Use camel casing for tests.
This makes it much easier to find them in various editors.
2016-06-26 20:17:18 +02:00
Erik Ogenvik
d2e37de29b Provide better naming of tests.
Easier to find in IDEs.
2016-06-26 20:17:18 +02:00
Erik Ogenvik
6a5a2b2938 Fixed tests. 2016-06-26 20:17:18 +02:00
Erik Ogenvik
d8996f0500 Provide correct transforms for tubers and trees. 2016-06-26 20:17:18 +02:00
Erik Ogenvik
3d57e884cd Offset transforms when updating from Move.
The pos and orientation sent is after transformations have
been apply, so in order to set the correct entity transformation
we need to remove any external transformations from these values
first.
2016-06-26 20:17:18 +02:00
Erik Ogenvik
84923d0c39 Rotate in local space. 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
923f037b13 Introduce a separate Transforms class.
Used to hold transformation data, and serializing to Atlas.
2016-06-26 20:16:48 +02:00
Erik Ogenvik
668c6edd0c Allow properties to alter other properties.
In order for this to work, we must always issue an Update
op after a Set op, so that we can handle any updated properties too.
We also have to add a new Entity flag to handle when the location
has been dirtied, since this isn't handled by normal properties.
2016-06-26 20:16:48 +02:00
Erik Ogenvik
55d6107efc Allow Set operations from the Creator.
We should really disable random Set operations from
Characters though...
2016-06-26 20:13:31 +02:00
Erik Ogenvik
4d4cdbef23 Fixed tests after transforms property. 2016-06-26 20:13:31 +02:00
Erik Ogenvik
8cfe2ba0eb Altered signature to prevent ambiguity. 2016-06-26 20:13:31 +02:00
Erik Ogenvik
ca3588041a Affect position directly.
No need to use an external transform for this kind of
ajustment.
2016-06-26 20:13:31 +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
de4c3b9347 Allow properties to specify keys.
In almost all instances most properties will only be used
for a specific key. To make things easier and less error prone
we've introduced the trait "property_name", which when available
allows us to refer to a property only by class, and not having
to specify the key it's bound to.
2016-06-26 19:08:54 +02:00
Erik Ogenvik
8f8405e5bc Combine rotation from op with archetype.
We want to allow for archetypes with orientations, along with also
sending orientations in Create ops. To do this we need to combine
these two rotations into a final orientaton.
2016-06-26 19:08:54 +02:00
Erik Ogenvik
b4efec1524 Rotate planted carrots and turnips. 2016-06-26 19:08:54 +02:00
Erik Ogenvik
1f616c869b Fixed tests after Plantable property. 2016-06-26 19:08:54 +02:00
Erik Ogenvik
8d7a0b13f7 Added plantable info to carrots and turnips. 2016-06-26 19:08:54 +02:00
Erik Ogenvik
600d8d0a8b Any cultivated plant should be planted. 2016-06-26 19:08:54 +02:00
Erik Ogenvik
d7bf27d180 Take plantable adjustment into account.
When an entity which is "planted" is adjusted, we also look
for if there's any offset specified for the height adjustment.
2016-06-26 19:08:54 +02:00
Erik Ogenvik
b07c334594 Added planted versions of the plants. 2016-06-26 19:03:19 +02:00
Erik Ogenvik
d994de3705 Added plantable properties for the oaks. 2016-06-26 19:03:19 +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
d160211ee5 Let plants only feed if they're planted.
This introduces the new "mode" of "planted", which is
meant to be used for plants and other things that are planted in
the ground.
2016-06-26 19:02:36 +02:00
Erik Ogenvik
731383150c Improved logging and removed dead code. 2016-06-26 14:27:24 +02:00
Erik Ogenvik
c9ebbfd6c6 Added method for determining visibility.
And then use that to determine if parent locations should be shown.
2016-06-26 14:18:37 +02:00
Erik Ogenvik
4f4a204935 Turn off debug logging. 2016-06-26 14:18:18 +02:00
Erik Ogenvik
e343477341 Fixed incorrect type specified. 2016-06-26 13:18:56 +02:00
Erik Ogenvik
c981f35d0d Added integration tests for Thing.
Which currently mainly performs visibility calculation
tests.
2016-06-26 13:18:14 +02:00
Erik Ogenvik
5ab3e5e61f Made logic for distance checks more sound. 2016-06-26 13:17:32 +02:00
Erik Ogenvik
0c5794977b If any pos is invalid, dist calc can't be done. 2016-06-26 13:16:11 +02:00
Erik Ogenvik
ebefb98283 Fixed tests. 2016-06-22 20:53:43 +02:00
Erik Ogenvik
e9513169e6 Start visibility test from observer for broadcasts. 2016-06-22 17:29:27 +02:00
Erik Ogenvik
889695af07 Provide const domain accessor. 2016-06-22 17:29:27 +02:00
Erik Ogenvik
760f92f707 Alter how visibility is determined.
When checking visibility, we now use the Domains more extensively.
The base rules are:
* If an entity is a child of a domain-less entity, visiblity for the
  child is the same as for the parent.
* If an entity is a child of a domain-holding entity, visibility is
  determined by the Domain.
* Entities cannot observe things above a Domain.
* Entities can observe things below a Domain, if the Domain allows it.

These rules are not yet set in stone. We need some more time figuring out
exactly how we want visibility implemented. We're striving for a balance
between a powerful but not too complex system, with good performance.
2016-06-22 17:29:27 +02:00
Erik Ogenvik
72fc2d7923 Added an InventoryDomain for characters.
The Inventory domain is meant for all characters, i.e. those than can have
an "inventory".

It's a non physical domain, which means that entities contained in it won't
be affected by any physical constraints, or have physics applied to them.
Visibility for outside entities are by default forbidden unless an entity is
outfitted or wielded.
The idea is that other playes shouldn't see what's in the inventory of another
player, unless things are outfitted or wielded.
2016-06-22 17:29:27 +02:00
Erik Ogenvik
4f368a6fbc Let parent domain decide visibility and movement.
When visibility is determined, we always query the parent domain, and
never any ancestor domain.

The idea is to make the system more easy to follow.
2016-06-22 17:29:27 +02:00
Erik Ogenvik
eb81c7eecb Use "git describe" for buildid.
Also removed circular dependency as well as CVS leftover script.
2016-06-22 17:06:50 +02:00
Erik Ogenvik
e6f645685e Ignore warnings in tests.
When writing tests we're often sloppy, and don't care about stuff
like initialization order etc..
2016-06-22 16:58:14 +02:00
Erik Ogenvik
1e82cab4e7 Ignore autotools artifacts and build directories. 2016-06-22 16:56:08 +02:00
Erik Ogenvik
7ab1af2d0c Don't include GDB settings in Git. 2016-06-22 16:54:28 +02:00
Erik Ogenvik
5432efab1e Fixed tests. 2016-06-09 22:40:05 +02:00