All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
* physics/Vector3D.h, physics/Vector3D.cpp: Move a bunch of inline
functions in the header to be non-inline in the body. Use
the forward declaraions in wfmath/const.h instead of having to
include the full headers.
* rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.h,
rulesets/Py_Point3D.h, rulesets/Py_Vector3D.h: Include wfmath
headers as required.
* rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h:
Change the movement API so update Location is const when passed to
generateMove.
* common/PropertyManager.h, rulesets/Movement.h,
rulesets/Pedestrian.cpp, server/EntityFactory.h, server/Peer.cpp,
server/Peer.h, server/PersistantThingFactory.h, server/Player.cpp:
Fill out some more doc comments, and add some more FIXME notes.
* rulesets/Movement.h: Add method to check if a target position has
been specified.
* rulesets/Character.cpp: Don't return a tick for movement if no
target is specified, as the old movement object has no further
role to play.
* rulesets/Movement.h, rulesets/Movement.cpp,
rulesets/Pedestrian.h, rulesets/Pedestrian.cpp: When processing
a move operation, if its going to cause an immediate collision,
set the velocity to 0.
* configure.ac: Increment version.
* rulesets/Movement.h, rulesets/Movement.cpp: Add a flag to indicate
if movement has been diverted by a collision.
* rulesets/Pedestrian.cpp: Use flag to ensure that entities moving
towards a target position that are diverted by a collision
don't just snap to their original destination. When collision errors
are detected, don't mess the entities position up by changing it.
* tests/Makefile.am: Fix broken tests.
* rulesets/Pedestrian.cpp, rulesets/Movement.h, rulesets/Movement.cpp:
Store the time of the last collision, and if the next one occurs
almost immediatly, stop the movement. This eliminates the judder
which used to occur in some nasty collision scenarios.
* rulesets/Task.h: Make irrelevant() virtual so that each task
class is responsible for doing most of its cleanup.
* rulesets/Movement.h: Make updateNeeded() public so other code
can determine if a character is moving.
* rulesets/Character.h, rulesets/Character.cpp: Add a stamina property.
Add clearTask() used to clear the current running task. Check
if tasks are irrelevant immediatly after setup, or after each
tick, and remove if they are.
* rulesets/Combat.h: Add irrelevant() implementation, and a static
variable defining stamina level below which combat cannot occur.
* rulesets/Combat.cpp: Switch to stamina as the base stat for
combat. Implement checking stamina at setup to ensure
both combatants are fit to fight, and each tick to determine if
someone has lost.
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp: Get rid of m_collAxis as it was unused.
Add velocity to the interface of getTickAddition to avoid using
the redundant m_velocity member of Movement. Fix calculation
of velocity magnitude in new movement code. Correctly set
velocity to zero when movement reaches its target.
* rulesets/Character.cpp: Add alternative movement processing
code based on the new mathods in Pedestrian.
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Pedestrian.cpp:
Add a return value to getUpdatedLocation to indicate whether an
update was necessary or not.
* rulesets/Character.cpp: Add some notes on how this code could be
adapted to Use the new Movement code.
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Pedestrian.cpp:
Add a new method to the movement interface which determines the
updated location of an entity when movement needs to be handled.
* rulesets/Character.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp: Rename some variables to make the code
more comprehensible.
* 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.
* 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.
* rulesets/Movement.h, rulesets/Pedestrian.h: Update movement
interface to reflect the different jobs done by genMoveOperation().
* rulesets/Movement.cpp: Fix badly named argument.
* rulesets/Pedestrian.cpp: Shift code around a little to ensure
it is clear that genMoveUpdate() only produces an op if one
is necessary, but genMoveOperation() should always return
one.
* rulesets/Character.cpp: Get rid of confusing logic now
That we know genMoveOperation() never returns NULL.
* physics/Collision.cpp: Modify collision behavoir so we only
detect collisions in the future, while still detecting
collisions that are in progress. Add debugging and some
FIXMEs.
* rulesets/Movement.h, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp: Switch to using new collision
code.
* rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp, rulesets/Pedestrian.h: Make movement
classes a little more generic by removing references
to character.
* server/EntityFactory.cpp, rulesets/Python_API.h,
rulesets/Python_API.cpp, rulesets/PythonThingScript.h,
rulesets/PythonThingScript.cpp, rulesets/PythonMindScript.cpp,
rulesets/Py_World.cpp, rulesets/Py_Thing.h, rulesets/Py_Thing.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Location.cpp, rulesets/Movement.h,
rulesets/MemMap_methods.h, rulesets/MemMap.h, rulesets/MemMap.cpp,
rulesets/Entity.cpp, rulesets/BaseMind.cpp,
client/Py_CreatorClient.cpp:
Rename all references from thing to entity, as thing is
no longer the base class for IG entities.
* rulesets/World.h, rulesets/World.cpp, rulesets/Thing.h,
rulesets/Structure.h, rulesets/Stackable.h, rulesets/Stackable.cpp,
rulesets/Plant.h, rulesets/Plant.cpp, rulesets/Missile.h,
rulesets/Line.h, rulesets/Line.cpp, rulesets/Food.h,
rulesets/Food.cpp, rulesets/Creator.h, rulesets/Character.h,
rulesets/Character.cpp, rulesets/Area.h, rulesets/Area.cpp:
Add a typedef for the parent class of all entity classes.
* rulesets/Plant.h, rulesets/Plant.cpp:
Add in code to fully integrate hardcoded attributes.
* tools/cyloadrules.cpp, server/server.cpp,
aiclient/ClientConnection.cpp, client/ClientConnection.cpp,
common/inheritance.h: Use const iterators and references
whenever possible.
* client/CommClient.cpp, client/CreatorClient.cpp,
client/ObserverClient.cpp, client/Py_CreatorClient.cpp,
common/BaseEntity.cpp, common/BaseEntity.h,
common/types.h, rulesets/Area.cpp, rulesets/BaseMind.cpp,
rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Food.cpp, rulesets/Line.cpp,
rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
server/CommServer.cpp, server/Connection.cpp,
server/EntityFactory.cpp, server/Lobby.cpp,
server/Persistance.cpp, server/Player.cpp,
server/ServerRouting.cpp, server/WorldRouter.cpp:
Switch to using Fragment as name for Atlas::Message::Object,
to avoid name clashes on Object.
* common/BaseEntity.h: Make BaseEntity inherit from SigC::Object,
so signals and callbacks can be used, and add destroyed
signal.
* common/accountbase.h, physics/BBox.h, physics/Quaternion.h,
physics/Vector3D.h, rulesets/MemMap_methods.h,
rulesets/Movement.cpp, rulesets/Plant.h,
rulesets/Py_Operation.cpp, rulesets/PythonMindScript.cpp,
rulesets/PythonThingScript.cpp, rulesets/Script.cpp,
common/inheritance.cpp: Cleaned up Atlas::Message::Object
use, and excessive use of "using ...".
* rulesets/Movement.h, rulesets/Pedestrian.h:
Use forward declarations rather than including Move.h
* server/Account.cpp, server/Account.h, server/Connection.cpp,
server/Connection.h: Use destroyed signal to ensure references
to in game entities are removed when those entities are
destroyed. Ensure Connection is only destroyed once.
* ALL: Cleaned up headers into correct order.
* common/log.h, common/log.cpp: Write some logging code which
handles message of different types using syslog or standard
error, depending on whether we are running as a daemon.
* ALL: Switched to using log() for all output.
* rulesets/Character.cpp, rulesets/Movement.cpp, rulesets/Movement.h:
Tweaked movement code to cut down on redundant ticks when movement
has reached destination. Fixed bug where character jumped if it
walked into a building.
* rulesets/Pedestrian.cpp: Modified collision resolution so that
movement does not slow down if it is deflected.
* 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.
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>
rulesets/Movement.h, rulesets/MemMap.h, physics/Vector3D.h,
modules/WorldTime.h, modules/Location.h, modules/DateTime.h,
common/Generic.h, common/BaseWorld.h: Ensure that single argument
constructors are explicit, so we don't get any naughty implicit
type conversion going on.
* server/CommClient.h: Added an operation dump feature for debugging.
Al Riddoch <alriddoch@zepler.org>
atlas object inheritance tree.
* server/Connection.cpp: Added code to allow client to query
atlas object inheritance using get ops.
* example/client/InheritanceClient.*: Added example client which
queries the inheritance tree of the server.
* rulesets/MemMap.h, rulesets/Py_Map.cpp: Made hooks lists private,
and added methods to access them.
* server/Account.cpp, server/Lobby.h: Added correct handling of OOG
look ops when looking at own characters, other accounts, or the
lobby.
* server/ServerRouting.h: Added function to generate serial numbers
for operations.
* server/WorldRouter.cpp: Assign genuine serial number to all
in game operations as they are pulled off the queue.
* Cleaned up header file multiple inclusion checks for uniqueness,
and made sure of ISO compliant use of std::string.
Al Riddoch <alriddoch@zepler.org>
* acorn.vconf: Added in new building classes which set up
wall objects for collision purposes. Building now seem to
work.
* common/database.cpp, common/database.h, common/globals.cpp,
common/globals.h, rulesets/Python_API.cpp, server/server.cpp,
watchdog/control.c, watchdog/watchdog.c: Implemented
correct way of getting installation directories from
autoconf.
* rulesets/Movement.h, rulesets/Movement.cpp, rulesets/Pedestrian.h,
rulesets/Pedestrian.cpp: Fixed collisions with the solid
wall of a structure.
* rulesets/Thing.cpp: Modified setup operation so that a sight
of create operation is always generated even if setup is
overloaded.
* Many fixes from Anders Petersson to get the build working under
debian.
Al Riddoch <alriddoch@zepler.org>
all have the name Operation but are now called MoveOperation,
according to the type of operation they handle.
* modules/DateTime.cpp, modules/DataTime.h: Filled in functionality,
allowing initialisation and updating from a time values in seconds.
* modules/Location.h: Modified collision detection code so no
checking is done between two moving objects.
* rulesets/BaseMind.h, rulesets/BaseMind.cpp, rulesets/Entity.h,
rulesets/Entity.cpp: Removed virtual getMap() method and replaced
with a fixed method in BaseMind only. Added time member veriable
to BaseMind so each mind keeps track of time by itself.
* rulesets/Python_API.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h:
Added specific python interface for mind objects, because if
increasing differences in the way this must be handled.
* rulesets/Character.h, rulesets/Character.cpp: Added isAlive flag
which is cleared if the character is dead. If this flag is cleared,
operations are no longer sent to the mind.
* rulesets/Movement.h, rulesets/Movement.cpp, rulesets/Pedestrian.h,
rulesets/Pedestrian.cpp: Cleaned up the code, made members more
distinctive, and make interface more general.
* rulesets/Py_Thing.cpp: Removed features used to support mind.
* rulesets/Py_WorldTime.cpp: Added support for comparison of
time with strings, to establish whether it matches descriptions
of time.
* rulesets/Python_API.cpp: Modified creating of scripts so mind
scripts use a slightly different interface from entity scripts,
to support the fact that a mind handles its own timekeeping,
has a memory map, and has no access to the world.
* server/WorldTime.cpp, server/WorldTime.h: Brought WorldTime into
the build. Used to track details of the time. Added support for
checking time descriptions such as "midday", "summer" against
DateTime.
Al Riddoch <alriddoch@zepler.org>
* Substantial re-work of object model. Moved many attributes out
of BaseEntity class. Changed WoldRouter so it now handles
objects in terms of Entity, rather than BaseEntity.
* Code cleanups, including removing reduntant includes, and
getting rid of C style comments.
* Fixed the way attributes are handled in Set operations and
when merging from an Atlas::Message::Object. This fixed
problem with setting gender of characters.
* rulesets/Pedestrian.*, rulesets/Movement.*: Re-named
Movement variables to make them clearer. Added in
separate handling for collisions from moving to
target position. Modified collision handling so
objects can slide next to each other.
* rulesets/Thing.cpp, rulesets/Character.cpp: Cleaned up and
rationalised movement code. Much shorter, faster and
more compact than before.
* Made better use of iterators throughout, eliminating unnecessary
lookups, and copying of data.
* Moved all virtual functions out of header files, making
less work for the linker.
* Made more use of const references to avoid the need to copy
data before being able to inspect it.
Al Riddoch <alriddoch@zepler.org>