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.
* common/const.h: Remove obsolete config option to disable
range checks and calculations.
* client/ObserverClient.cpp, rulesets/Movement.cpp,
server/Admin.cpp, tools/AdminClient.h, tools/cycmd.cpp:
Remove const.h from files which no longer require it.
* rulesets/Python_API.cpp: Remove python bindings for obsolete
constants.
* rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp:
Remove obsolete rotten code for handling sight without ranges.
* tests/consttest.cpp: Remove tests for removed constants.
* rulesets/Movement.cpp: Ensure collision position is invalidated
once a collision isn't done.
* rulesets/Pedestrian.cpp: Add some assert checks. Ensure that
m_updatedPos is always valid. Add a check for a race condition
where a collision is predicted, and the tick that should trigger
it occurs, but another move request arrives from the client
before the update Move op has been applied to the entity.
* rulesets/Movement.cpp: Reset stored positions more efficiently.
* rulesets/Pedestrian.cpp: Improve error reporting when a bad
collision occurs. Reset the coordinates, so that character does
not teleport to origin when a strange collision happens.
* 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/Movement.cpp: Reset the collision LOC change flag before
running the check.
* rulesets/Pedestrian.cpp: Improve debug reporting of collision
errors.
* 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.
* 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.
* rulesets/Movement.cpp: Add an assert check to ensure collision
code is working ok.
* physics/Collision.cpp: Fix a bug where emergence from a container
was incorrectly predicted because the final emerging corner was
mispredicted.
* 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/Character.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp: Rename some variables to make the code
more comprehensible.
* 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.
* 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/Python_API.cpp: Use the Generic operation class for ops
with no hard coded type.
* rulesets/Movement.cpp: Make the time periods used when checking
collisions dependent on the standard tick time.
* physics/Collision.cpp: Sort out a weird floating pointe problem
with emergence test. Now works. Remove debug output.
* tests/emergencetest.cpp: Implement a suitable minimal set of tests.
* rulesets/Movement.cpp: Switch to using the new code.
* common/const.cpp, common/const.h, common/random.h,
physics/BBox.h, physics/Collision.cpp, physics/Collision.h,
physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.h,
rulesets/Movement.cpp, rulesets/Plant.cpp, rulesets/Python_API.cpp,
tests/collisiontest.cpp: Update variables relating to geometry
from double to float as this is the type used internall by
WFMath.
* physics/Vector3D.cpp, physics/Quaternion.cpp, physics/Quaternion.h:
Remove legacy code.
* server/CommPSQLSocket.cpp: Reformatting.
* rulesets/Movement.cpp: Add valid checks when comparing velocity.
* rulesets/Character.cpp: Remove code which ignore pos if it is
the same as current.
* 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/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.
* common/globals.cpp: Only persist this sessions command line
options if the user is overriding the installation directory.
* cyphesis.vconf, client/Py_CreatorClient.cpp,
client/Py_CreatorClient.h, client/client.cpp:
Add client functionality to allow diferent scripts to be run to
perform different functions on the server.
* client/CharacterClient.cpp: Add debug option.
* rulesets/Character.h: Make mind operation functions virtual,
so they can be overridden.
* common/BaseWorld.h, server/WorldRouter.cpp,
server/WorldRouter.h: Add server functions to search for
entities by name or type.
* rulesets/Creator.h, rulesets/Creator.cpp: Allow creator to
specify a look without an id to search for entities with
a given name or type.
* client/CreatorClient.cpp, client/CreatorClient.h,
client/ObserverClient.cpp, client/ObserverClient.h,
client/Py_CreatorClient.cpp, rulesets/basic/editor.py,
rulesets/mason/define_world.py:
Add support for looking for entities in the world by name or
type from client script, so client scripts can modify existing
world.
* rulesets/Entity.cpp, rulesets/Movement.cpp,
rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
rulesets/Py_Oplist.cpp, rulesets/Python_API.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp,
rulesets/World.cpp, server/Account.cpp,
server/CommServer.cpp, server/Connection.cpp,
server/Player.cpp, server/ServerRouting.cpp,
server/server.cpp, tools/cycmd.cpp,
tools/cywatchdog.cpp: Code formatting cleanups.
* rulesets/basic/world/objects/tools/Bow.py: Fix up bow so it now
fires correctly.
* 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.
* server/WorldRouter.h, server/WorldRouter.cpp, common/BaseWorld.h,
rulesets/Creator.cpp, rulesets/World.cpp: Removed unused and
unnecessary code from BaseWorld class, and move some stuff into
the WorldRouter where it belongs.
* rulesets/Character.cpp: Fixed a bug in the way ops from the
mind are handled which caused a segfault.
* rulesets/Character.h, rulesets/Creator.h: Made some functions
which are never overridden non-virtual for speed.
* rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h:
Cleaned up the memmap code to get rid of inefficiency, and badly
written code.
* rulesets/Movement.cpp: Code formatting cleanup.
* server/Routing.h: Remove old commented out code.
* 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.
* 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.
* rulesets/Movement.cpp, rulesets/Pedestrian.cpp: Hardened collision
code to try and catch the bug simon is seeing. Fixed some slight
bugs and inefficiencies in the process.
* 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.
* server/WorldRouter.h, server/WorldRouter.cpp, rulesets/Thing.cpp,
rulesets/Entity.h, rulesets/Entity.cpp, common/types.h,
common/BaseWorld.h: Switched to using sets instead of lists
for contains, and other data structore for performance.
* rulesets/Line.cpp: Added debugging.
* rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h:
Switch to using vectors instead of lists for performance.