* common/const.h: Add a second const for the non-squared default
box size for visibility calculations.
* modules/Location.cpp: Initialise cached box size members with
defaults from consts.
* rulesets/basic/mind/goals/common/move.py: Don't remove focus
knowledge about item just because it has been picked up. This
fixes eating acorns.
* rulesets/basic/mind/goals/common/misc_goal.py: Remove focus knowledge
when something is eaten.
* modules/Location.h, modules/Location.cpp: Add members to store
box diagonal size and bounding radius.
* tests/Locationtest.cpp: Test that the diagonal size and bounding
radius are updated correctly.
* modules/Location.h, modules/Location.cpp: Add methods to modify
bbox, and to report if it has been modifed so that cached values
can be computed.
* common/Property.h, common/Property_impl.h: Add a new type of
Property which emits a signal when modified.
* rulesets/EntityProperties.cpp, rulesets/Entity.cpp: Implement
signal Property and use it for bbox, so linking its signal
to Location so that the necessary values can be computed after
modification.
* rulesets/Character.cpp: Re-order code so that its not necessary
to lookup an entity that is to be moved unless we already know
its not the current entity.
* rulesets/Character.cpp: Implement destination based movement when
the target position is specified with a different LOC to the
current LOC of the character.
* modules/Location.cpp: Document the functions used to determine
relative distance vectors.
* modules/Location.cpp, modules/Location.h:
Add const accessors for location data, in preparation for
adding cached collision data which must be updated every
time data is modified.
* physics/Collision.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/EntityFactory.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer_impl.h,
server/WorldRouter.cpp, tests/Locationtest.cpp:
Use the const accessors whenver reading data from Location.
* modules/Location.cpp: Fix a bug where POS was being corrupted
whenever velocity was supposed to be set.
* rulesets/basic/mind/goals/humanoid/mason.py: Convert ID to entity
before checking location.
* rulesets/mason/mind/PigMind.py: Convert ID to entity before
passing location to another function.
* modules/Location.h, modules/Location.cpp: Remove handling of
LOC attribute from readFromEntity() as every use of this function
has differen requirements.
* rulesets/MemMap.cpp: Implement setting LOC so that the minimum
of lookups in the world dictionary are required.
* server/EntityFactory.cpp: Implement setting LOC in a much simpler
way, as its always uninitialised at this point.
* client/BaseClient.cpp: Add a note that LOC is currently unhandled,
as there is nothing sane to do with it.
* modules/Location.cpp, modules/Location.h: Add a new method to
read location data from an Atlas Entity.
* rulesets/MemMap.cpp, server/EntityFactory.cpp, client/BaseClient.cpp:
Switch to using new function rather than Entity::getLocation.
* rulesets/Entity.h, rulesets/Entity_getLocation.h: Remove obsolete
getLocation method.
* modules/Location.cpp, modules/Location.h, rulesets/Python_API.cpp:
Implement a function for determining the horizontal distance
between two locations neglecting height difference, as for
locations on the terrain it is not relevant.
* rulesets/basic/mind/goals/common/move.py: Improve the coding of
the move_me_to_it goal, so distance determination is more effective.
Make distance independant of height.
Relax distances at which character is concidered to have arrived at
its destination.
* rulesets/basic/mind/Goal.py: Modify goal so that it understands
that a subgoal can be unfulfilled, but still not need to take any
action.
* modules/Location.cpp, modules/Location.h: Rejig flags on Location
so that there is one to indicate contents should be checked for
collision, and one to indicate contents is not a collision volume.
* rulesets/Movement.cpp: Modify collision code to check if an
entity is supposed to be checked for collisions.
* rulesets/Structure.cpp: Tweak the flag set on structures to
correctly show that their contents should be checked for collision.
* data/mason.xml: Make ploughed field into an area, and sort
out its bbox to be the right size.
* cyphesis.spec.in: Ensure rpm spec correctly obsoletes the old
mason and service rpms.
* modules/Location.cpp: Get rid of accidentally commited change
that screws up orientation.
* rulesets/Character.cpp: Provide more info about ops which
have TO set incorrectly.
* rulesets/MemMap.cpp: Don't set TO on look ops from memory.
* rulesets/basic/mind/NPCMind.py: Don't set TO on tick ops
from the mind.
* rulesets/Character.cpp: Add notes, and a check to ensure that
ops from the mind don't have TO set.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/humanoid/mason.py: Don't set TO or FROM
on goals from the mind.
* common/Property.cpp: Add required type checks to property set
methods.
* modules/Location.cpp: Don't send LOC attribute when the
pointer is NULL.
* rulesets/EntityProperties.cpp: Add a Property specialisation
for list of IDs.
* rulesets/MemMap.cpp: Fix the memory code to use the correct
PARENTS attribute rather than type, which is not an Atlas
attribute.
* tests/IGEntityExerciser.h: Add debugging output to attribute
checks.
* modules/Location.cpp: Ensure that orientation is not used
when its invalid.
* rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp: Assert that the
return value of getXyz() is valid.
* rulesets/mason/define_world.py: Add a test function to add
a deer and a chicken.
* modules/Location.cpp, modules/Location.h: Add new function for
usefully calculating the distance vector of another entity.
* tests/distancetest.cpp: Update test to check new distance
function.
* rulesets/Python_API.cpp: Make the new distance vector function
available to python rather than the relative postion function.
* rulesets/basic/mind/Knowledge.py, rulesets/basic/mind/NPCMind.py:
Ensure that Knowledge really does handle arbitrary triples.
* rulesets/basic/mind/goals/common/misc_goal.py: Add new version
of transaction goal for transactions for hirelings.
* rulesets/basic/mind/goals/humanoid/transaction.py: Complete
the implementation of the trigger goal for hirelings.
* rulesets/mason/define_world.py: Move the mercenaries closer to
origin for debugging.
* modules/Location.cpp, physics/Collision.cpp, rulesets/Character.cpp,
rulesets/Entity.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp: Make sure orientation is not used if it
is not valid.
* modules/Location.cpp, modules/Location.h: Improve algorithm
of distance function to handle corner cases, and add a second
interface so that both scalar distance and relative position
can be found.
* tests/distancetest.cpp: Update tests to test for cases where
distance to or from an entity directly below.
* modules/Location.cpp, modules/Location.h: Add new improved
function to measure the distance between two entities.
* tests/distancetest.cpp: New test for new distance measuring
function.
* server/WorldRouter.cpp: Fixe debug output to work with new
pos type.
* modules/Location.cpp: Fix one of the transforms, so distance
calculation works again.
* physics/Vector3D.h, physics/Vector3D.cpp, modules/Location.h,
modules/Location.cpp: Convert to using WFMath::Point instead of
WFMath::Vector for position.
* physics/Collision.h, physics/Collision.cpp: Update collision code
to use new pos type.
* rulesets/Py_Point3D.h, rulesets/Py_Point3D.cpp: New python
wrappers for WFMath::Point.
* rulesets/Py_Location.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Python_API.cpp:
Update python wrappers to take into account new pos type.
Ensure that only apropriate functionality is available for
point and vector.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/Line.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/EntityFactory.cpp, server/WorldRouter.cpp,
server/WorldRouter.h: Update the rest of the code for new pos
type, converting all places where entity parenting is changed
to use WFMath toParentCoords() and toLocalCoords() methods,
so that orientation is handled correctly.
* tests/transformtest.cpp: New test to ensure that toParentCoords()
and toLocalCoords() perform as expected.
* tests/Creatortest.cpp, tests/Locationtest.cpp, tests/Worldtest.cpp,
tests/collisiontest.cpp, tests/emergencetest.cpp:
Update the rest of the tests.
* modules/Location.cpp, physics/Collision.cpp, physics/Collision.h,
physics/Vector3D.h: Move recently developed collision code into
module of its own, and give functions a new name.
* tests/collisiontest.cpp: Update test accordingly.
* physics/Vector3D.h: Clean up collision code, and add work in
progress on function to predict collision between point and
plane.
* modules/Location.cpp: Clean up methods and placeholder for new
oriented box prediction code.
* server/Lobby.cpp: Add some debugging messages.
* server/CommServer.cpp: Tweak select loop so that closed connections
are cleaned up as soon as they are detected.
* rulesets/World.cpp: Make demo terrain a bit more mountainous.
* Convert entire codebase over to using Atlas-C++ 0.4.90, as
start of transition to 0.6 API.
* server/Restoration.cpp: Send restored entities a setup op, so the
AI gets initialised as if the entity had just been created.
* Clean up member variable names.
* rulesets/mason/mind/SkelMind.py: Get skeleton to recognise
settlers.
* Use " instead of < when including application headers.
* Re-work the interface between server and worldrouter objects
so that the are less tied together, and more flexible.
* modules/Location.cpp, modules/Location.h, physics/BBox.h,
physics/Vector3D.h, rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/MemMap.cpp, rulesets/Movement.cpp, rulesets/Pedestrian.cpp,
rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp,
server/Account.cpp, server/WorldRouter.cpp:
Get rid of operator bool() in vector and related classes,
so that errors are less likely to emerge in code. Make use
of Vector3D::isZero() where apropriate.
* physics/Quaternion.h: Added required comparison operators, and
get rid of operator bool, to ensure that no implicit conversion
happens where it shouldn't. Add operator required for debugging
Quaternion.
* modules/Location.cpp: Use new isValid() method instead of
relying on operator bool.
* rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h:
Fix up interface for genFaceOperation() so it works the right
way round, and orientation is not actually set until the Move
op is genuinly dispatched.
* rulesets/Character.cpp: Add clearer debugging output.
Fix up handling orientation in move ops from mind, and generate
the move ops for simple change in orientation correctly.
* server/server.cpp, rulesets/Python_API.cpp, rulesets/Line.cpp,
modules/Location.cpp, client/CreatorClient.cpp:
Removed some obsolete comments.
* server/WorldRouter.h, server/WorldRouter.cpp: Add member to
deliver operation to known entity. Make use if it to avoid
having to recurse in operation() when broadcasting. Ensure
that the container of new entities is managed from here.
* rulesets/Thing.cpp: Tell world to create new entities at the
same position as the creator if no other info is provided.
Do not attempt to handle setting up the default containership
of entity once created, as this is always handled by the
WorldRouter from now on.
* rulesets/Py_World.cpp: Implement getting time info from world.
* rulesets/Py_Location.cpp: Implement handling of the orientation
attribute from python.
* rulesets/MemMap.cpp: Update comments about unimplemented code.
* rulesets/Creator.cpp: Check for string.empty() instead of "".
* rulesets/BaseMind.cpp: Remove reference python code.
Cleanly handle and delete operations returned when savinf mind state.
* client/CharacterClient.cpp: Move delete to the right place.
* server/WorldRouter.cpp: Eliminate unnecessary call to opEnumerate()
and enhance debugging output.
* server/Player.cpp: Correct the use of string.compare() in older
versions of libstdc++.
* common/types.h: Added enumeration for other operations, not
handled by the core, but considered valid. Added new type
for storing mapping between operation parents and their
enumerated type.
* common/op_switch.h: Separate handling of operations known to
be invalid from operations which are valid, but not explicitly
added to the core.
* common/inheritance.h, common/inheritance.cpp, common/custom.cpp:
Provide global operation mapping where enumeration of operations
can be looked up. Install all types handled by the core, and
types known to be used in scripts.
* common/BaseEntity.h, common/BaseEntity.cpp: Add object specific
operation mapping where operation types each object is subscribed
to can be enumerated, and others are rejected. Add mechanism
so that objects can add to the mapping, this subscribing to
operations. This makes enumerating operations much cheaper, and
eliminates the overhead of handling ops an object has no interest
in.
* rulesets/Thing.h, rulesets/Thing.cpp: Add mechanism so scripts
can subscribe to operations.
* rulesets/Character.h, rulesets/Character.cpp:
Add subscription mechanism for ops going to and from
the mind.
* rulesets/BaseMind.h, rulesets/BaseMind.cpp:
Add subscription mechanism for sight and sound perception
operations sub operations, and provide an interface to it
for scripts.
* server/Connection.cpp, server/Admin.cpp, server/Account.cpp,
rulesets/World.cpp, rulesets/World.h, rulesets/Thing.cpp,
rulesets/Stackable.cpp, rulesets/Plant.cpp, rulesets/Food.cpp,
rulesets/Character.cpp, rulesets/BaseMind.cpp:
Add subscriptions to operations for all core base classes.
* rulesets/Python_API.cpp: When script is created, go through
methods, and subscribe to the operations which are handled by
them.
* rulesets/Character.cpp: When calculating orientation of a walking
character, assume it is standing upright.
* physics/Vector3D.h: Add versions of mag() and distance() which
omit the square root calculations, so that when their values
are only used for comparison, the expensive square root
calculations can be ommited. Add new version of collision
and range checking functions which provide the optimal
interface to the application. Add versions of methods which
modify this rather than creating a new operation to eliminate
wasted copies.
* physics/Quaternion.cpp: Make use of faster interface provided
by Vector3D.
* physics/BBox.h: Add new version of collision checking function
which provides optimal interface to the application.
* modules/Location.h, modules/Location.cpp: Add new functions
to optimally calculate the distance between any two entities.
* modules/Location.h: Re-write collision and range functions to
make much more optimal use of Vector3D, BBox and distance
functionality.
* rulesets/Py_Vector3D.cpp, rulesets/Pedestrian.cpp,
rulesets/Movement.cpp, rulesets/Entity.cpp, rulesets/Character.cpp:
Eliminate implicit copies from vector arithmetic.
* rulesets/Pedestrian.cpp, rulesets/MemMap.cpp, common/const.h:
Re-write code which uses magnitude of vectors to use the square
of the magnitude instead, as it is much cheaper to calculate.
error reporting.
* server/server.cpp: Added check to database initialisation so
that an error opening the databases is reported with explanation,
or logged as apropriate, and startup is aborted.
* phyics/Quaternion.h: Added quaternion class for represening rotation.
* modules/Location.cpp, modules/Location.h: Removed face attribute and
replaced with orientation which is a quaternion.
* rulesets/Character.cpp: Modified code which handles the direction
of movement, and how this affects the character rotation so it
now uses orientation.
* rulesets/Entity.cpp: Switch attribute checks from face to
orientation.
* rulesets/Movement.h, rulesets/Pedestrian.cpp: Modify movement
code so that orientation used instead of face.
* rulesets/Py_Location.cpp: Removed support for obsolete and
unused rotation attriute from python code.
* rulesets/Thing.cpp: Modified attriute handling to use orientation
instead of face.
Al Riddoch <alriddoch@zepler.org>
Added direct support for new format bounding boxes.
* modules/Location.cpp, modules/Location.h, physics/Vector3D.h,
rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/Movement.cpp, rulesets/Plant.cpp, rulesets/Py_Location.cpp:
Switched over to using new format bounding boxes, and re-wrote
collision code for this format, making it clearer and more
efficient at the same time.
Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp: Removed redundant includes.
* rulesets/mason/define_world.py: Drop in copy of Acorn world.
* server/WorldRouter.cpp: Removed double delete of gameWorld.
* server/server.cpp: Modified comments about segfault in Python
shutdown, as this has now been eliminated.
Al Riddoch <alriddoch@zepler.org>
* TODO: Update on important issues which allow easy DOS attacks.
* client/ClientConnection.cpp, client/ClientConnection.h:
Cleaned up unused code from ClientConnection class.
* client/client.cpp: Removed monitoring section of client
so it simply exits once the world is initialised.
* rulesets/basic/mind/goals/humanoid/werewolf.py:
Started work on dynamic goals for playing werewolf.
* rulesets/werewolf/define_world.py: Added in the mayor, who runs
werewolf games.
* common/BaseEntity.h: Made id of entity private, and implemented
accessors.
Al Riddoch <alriddoch@zepler.org>
objects.
* modules/Location.cpp: Added bounding median to attributes sent
using Atlas.
* common/BaseEntity.cpp: Always set the id on an entity.
Al Riddoch <alriddoch@zepler.org>
server/CommServer.h: Added support for server "name" which
defaults to the hostname of the server machine, but is
customisable in the config. This can be used in preference to
IP address when doing lookups with the metaserver.
* server/Lobby.h, server/ServerRouting.h, server/Account.h,
server/Account.cpp, rulesets/Stackable.h, rulesets/Stackable.cpp,
rulesets/Python_API.cpp, rulesets/Py_Object.cpp, rulesets/Plant.cpp,
rulesets/Pedestrian.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
rulesets/Character.h, rulesets/Character.cpp, common/BaseEntity.h,
common/BaseEntity.cpp: Modied asObect() and addToObject()
methods to make them more efficient.
* modules/Location.h, modules/Location.cpp: Removed old obsolete
Message::Object based addToObject() method.
* rulesets/Thing.cpp: Optimised apperance/disappearance code.
Al Riddoch <alriddoch@zepler.org>
an invalid installation is reported more clearly, and more
usefully.
* rulesets/acorn/world/objects/animals/Pig.py: Fixed creating ham in
the right place.
* rulesets/Movement.cpp: Fixed leaving containers so that if the initial collision with parnet bounding box is missed, character
does not get stuck.
* rulesets/EntityFactory.h: Cleanup code is now cleaner.
* rulesets/EntityFactory.cpp: Removed unecessary varconf dependancy
in rulesets code.
* rulesets/Character.cpp: Allow move ops from mind with no loc set.
* physics/Vector3D.h: Included check for inTime so that if entering
time is in the future, this is detected.
* modules/Location.cpp, modules/Location.h: Provided method
to add location to a map.
Al Riddoch <alriddoch@zepler.org>