All tree code is now handle by Plant.cpp. However, this file is kept as
reference (it's of course still in Git, but people tend to never look
for it there if it's removed).
* rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/buildings/StoneHouse.py,
rulesets/basic/world/objects/buildings/__init__.py,
rulesets/basic/world/objects/elements/Fire.py,
rulesets/basic/world/objects/elements/__init__.py,
rulesets/basic/world/objects/tools/Axe.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/tools/Pickaxe.py,
rulesets/basic/world/objects/tools/Scythe.py,
rulesets/basic/world/objects/tools/Shovel.py,
rulesets/basic/world/objects/tools/Sword.py,
rulesets/basic/world/objects/tools/__init__.py:
Remove files that are no longer used from here, and have
been duplicated in the mason ruleset.
* rulesets/mason/world/tasks/Logging.py: Implement logging entirely
in the task, instead of relying on functionality in the plant
class.
* rulesets/Py_Quaternion.cpp: Implement rotation method as in the
the wfmath class, as required for Logging.
* rulesets/Plant.cpp: Add an error message if the old plant
functionality gets called.
* rulesets/basic/world/objects/tools/Axe.py: Add an error message
noting that this method should not be called.
* rulesets/Thing.h, rulesets/Thing.cpp, rulesets/Plant.h,
rulesets/Plant.cpp: Remove SetupOperation from Thing
and implement in Plant, as not all entities need a starting
tick, but plants do.
* rulesets/basic/world/objects/elements/Fire.py,
rulesets/mason/world/objects/Weather.py: Add setup_operation
handlers as these scripts require ticks.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/world/objects/Thing.py: Move some functionality
from the Thing base class into NPCMind, leaving minimal
functionality in the base class making it suitable as an interface
for all scripts.
* rulesets/basic/world/objects/Thing.py: Get rid of redundant kw
arg to constructor, move op_dict initialisation to cinit()
and remove base_init completely as its only required to handle
the C++ constructor behavoir which we no longer need.
* rulesets/basic/mind/NPCMind.py: Get rid of redundant args to
to mind, and call cinit to handle connection to C++ core directly
now that base_init is gone.
* rulesets/basic/world/objects/Thing.py: Remove self.attributes
from the base class for all python scripts.
* rulesets/mason/world/objects/Weather.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/animals/Animal.py,
data/basic.xml, data/mason.xml: Don't use set_kw to handle default
attributes, and add the to the .xml rules files.
* rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/buildings/StoneHouse.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/tools/Sword.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/mason/world/objects/animals/Pig.py,
rulesets/mason/world/objects/outdoor/Campfire.py,
rulesets/mason/world/objects/outdoor/Gravestone.py,
rulesets/mason/world/objects/plants/seeds/Acorn.py,
rulesets/mason/world/objects/plants/seeds/Apple.py,
rulesets/mason/world/objects/plants/seeds/Fircone.py,
rulesets/mason/world/objects/plants/seeds/Seed.py,
rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/undead/Skeleton.py,
rulesets/werewolf/world/objects/characters/Villager.py,
rulesets/werewolf/world/objects/tools/Gallows.py:
Don't import set_kw from misc, as its now obsolete and unused.
* rulesets/basic/mind/goals/common/common.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/mind/goals/humanoid/build_home.py,
rulesets/basic/world/probability.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/mason/define_world.py, rulesets/mason/mind/SkelMind.py,
rulesets/mason/world/objects/Weather.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/mason/world/objects/animals/Pig.py,
rulesets/mason/world/objects/outdoor/Gravestone.py,
rulesets/mason/world/objects/plants/seeds/Seed.py,
rulesets/mason/world/objects/undead/Skeleton.py,
rulesets/werewolf/define_world.py:
Switch to importing random and fall back to deprecated whrandom
on older python versions.
* data/basic.xml: Added operations "disperse" and "extinguish".
Set up "disperse" as the default operation for the pile.
* rulesets/basic/world/objects/Pile.py: The operation "disperse"
will call the "extinguish" operation on the target. Maybe it is
advisable to add an assertion if the target is indeed a fire.
* server/WorldRouter.cpp: Fix a problem where entities contained by
other entities had their height adjusted incorrectly.
* rulesets/basic/world/objects/elements/Fire.py: Allow fires to be
moved.
* rulesets/Python_API.cpp: Add constructor for BBox.
* data/mason.xml: Add a torch. Add burn_speed attributes to a
bunch more entity classes.
* rulesets/mason/world/objects/tools/Torch.py: Script for torch.
* rulesets/mason/world/objects/tools/Tinderbox.py: Change strength
of initial fire spark to 0.05.
* common/operations.cpp: Fix nourish op, which got broken when mow
was added.
* data/basic.xml: Add a default bbox for lumber, giving it a more
apropriate size.
* rulesets/Py_World.cpp: Add a compare implementation so that
` scripts can check entities to see if they are the world.
* rulesets/basic/world/objects/elements/Fire.py: Tune the
changes which occur in fire as it burns.
* rulesets/mason/world/objects/tools/Rope.py: Correct the syntax
of stub functions.
* rulesets/basic/world/objects/buildings/StoneHouse.py: Fix the import
statements.
* rulesets/basic/world/objects/buildings/House.py: Fix import for
physics module.
* rulesets/basic/mind/goals/common/misc_goal.py: Fix typo in
cut_something.
* server/ScriptFactory.cpp, server/ScriptFactory.h: New factory
class for handling python scripts for entities much more
efficiently, and provide a means where they can be re-imorted
at an apropriate time.
* server/PersistantThingFactory.h,
server/PersistantThingFactory.cpp: Make PersistantThingFactory
copy constructor protected, to ensure its not used accidentally.
Replace strings for storing python script data with a pointer
to a factory for creating scripts.
* server/EntityFactory.cpp: Use the new ScriptFactory mechnism
for creating scripts attached to entities. Improve variable
names a little.
* rulesets/Python_API.cpp: Re-write the code for extracting operation
subscriptions from python classes so its now more efficient and
picks up methods from base classes.
* rulesets/basic/mind/BaseMind.py, rulesets/basic/mind/NPCMind.py,
rulesets/basic/world/objects/Thing.py: Rename some methods
which have match the signature of operation handlers.
* data/mason.xml: Type for bundles of grass.
* rulesets/World.cpp: Implement resource gathering for all the
currently supported resource types.
* rulesets/basic/world/objects/Pile.py: Fix so Pile inherits from
Thing correctly.
* common/Dig.h, common/Mow.h, common/custom.cpp, common/operations.cpp:
Add new Dig and Mow operations, for handling resource gathering.
* rulesets/basic/world/objects/tools/Shovel.py,
rulesets/basic/world/objects/tools/Scythe.py,
data/basic.xml: Add new scythe and shovel for gathering resources
from the terrain.
* rulesets/basic/world/objects/tools/Pickaxe.py,
common/Delve.h: Fix the comments.
* rulesets/World.cpp, rulesets/World.h: Move code for determining
terrain surface type into a method of its own. Implement handlers
for Dig and Mow ops.
* common/custom.cpp, common/Delve.h,
common/operations.cpp, common/operations.h:
Add new delve operation for digging with a pickaxe.
* data/basic.xml, rulesets/basic/world/objects/tools/Pickaxe.py:
Add new pickaxe entity which emits a Delve operation when
used.
* rulesets/Character.cpp: Fix a bug where a segfault occured
if an operation was requested by a tool that was unknown to
to the core server code. Instead an error message is emitted.
* rulesets/World.cpp: Subscribe world terrain to delve ops.
* rulesets/Py_Operation.cpp, rulesets/Py_Optime.cpp,
rulesets/Py_Optime.h rulesets/Python_API.cpp:
Remove the Optime class from the API and force scripts to use
setFutureSeconds() to modify operation dispatch time.
* rulesets/acorn/world/objects/Weather.py,
rulesets/acorn/world/objects/plants/Tree.py,
rulesets/acorn/world/objects/plants/seeds/Acorn.py,
rulesets/acorn/world/objects/plants/seeds/Apple.py,
rulesets/acorn/world/objects/plants/seeds/Seed.py,
rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/world/objects/animals/Animal.py,
rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/elements/Fire.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/mason/world/objects/Weather.py,
rulesets/mason/world/objects/plants/seeds/Acorn.py,
rulesets/mason/world/objects/plants/seeds/Apple.py,
rulesets/mason/world/objects/plants/seeds/Fircone.py,
rulesets/mason/world/objects/plants/seeds/Seed.py:
Fix up all the python scripts to use setFutureSeconds on
ops instead of time.sadd.
* data/werewolf.xml,
rulesets/mason/world/objects/plants/seeds/Apple.py,
rulesets/werewolf/world/objects/characters/Villager.py,
rulesets/werewolf/world/objects/tools/Gallows.py:
Remove some more obsolete constructors.
* data/basic.xml: Clean out a load of obsolete classes and scripts.
* rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/buildings/StoneHouse.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/tools/Sword.py,
rulesets/mason/world/objects/plants/seeds/Seed.py,
rulesets/mason/world/objects/undead/Skeleton.py:
Remove obsolete constructors, and don't inherit from
obsolete scripts.
* rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/basic/world/objects/tools/Axe.py:
Remove obsolete commented out code, and useless constructors
from some scripts.
* data/mason.xml: Remove obsolete scripts for some entities
which don't do anything.
* rulesets/Plant.h, rulesets/Plant.cpp: Add handler for chop so
we can chop down vegetation.
* rulesets/basic/world/objects/tools/Axe.py: Modify Axe to comply
with new tool use mechanism.
* rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/mason/define_world.py: Update butcher goals to use tool
use mechanism.
* rulesets/Python_API.cpp: Ensure entities created from Python
have an objtype.
* rulesets/werewolf/world/objects/tools/Gallows.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/basic/mind/goals/common/misc_goal.py:
Fix bugs initialising Location ensuring the second
arg is a Point3D, not a Vector3D for position.
Fixes pig purchasing.
* rulesets/basic/mind/goals/humanoid/mason.py:
Fix the velocity check for escaping pigs.
* rulesets/Py_Point3D.cpp: Fix Point3D subtraction operator to
allow subtraction of both Point and Vector. Fixes pig merchant
goal for keeping pigs.
* server/WorldRouter.cpp: Clean up a special case for TO="all" on
ops, which we now disallow. Remove a verbose tests for NULL
pointers in the world dictionary and replace with a simple assert.
* 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.
* server/Account.cpp, server/Connection.cpp: Get rid of
character existance check on login, as dead ones are now handled
using SigC signals.
* rulesets/Entity.h, rulesets/Entity.cpp, rulesets/Py_World.cpp:
Remove pointless deleted flag, as the only time its true is when
the object has been deleted, and accessing would cause a segfault.
* tools/cycmd.cpp, client/CommClient.h, client/CommClient.cpp: Fixed
up client code so it does not rely on username being the same as
account id.
* tools/cycmd.cpp: Added look and logout commands to administrate
users logged in.
* server/server.cpp: Fixed metaserver code so it only sends
termination packet if metaserver functionality is enabled.
* server/Connection.h, server/Connection.cpp, server/CommServer.cpp,
server/CommClient.h, server/Account.cpp: Fix logouts so they
do cause the client connection to be closed.
* Finished switch from Fire operation to Burn.
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Character.cpp,
rulesets/Character.h, rulesets/Thing.cpp, rulesets/Food.cpp:
Renamed weight member as mass, and use this name in Atlas,
as this is a better convention, and has already been adopted in
stage.
* Switched python code to using mass instead of weight, as it is
a more accurate term.
* common/globals.cpp, common/globals.h, tools/cyloadrules.cpp:
Put admin modifiable config in etc instead of share directory.
* Don't build cycmd if readline is not available. Untested, and
probably nasty.
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>
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>
added animations.
* server/Player.cpp: Added checks which allow player to be any of
the currently available characters.
Al Riddoch <alriddoch@zepler.org>
location object to python wrappers.
* rulesets/Character.cpp: Added initialisation of bounding box
median for characters.
* modules/DateTime.*: Added configurability to date so that
each period of time has definable number of divisions. Default
is as per real world calendar restricted to 30 day months.
* Added Fire operation handling to Thing class, so that any entity
with a burn_speed attribute will burn.
* Added Food C++ base class, which implements cooking.
* Altered the semantics of the Eat/Fire/Nourish operations so
multiple arguments are no longer required. from is used to
determine the other entity involved.
* Added the beginnings of an astronomy system, but not yet used
anywhere.
* Added appearance handling to BaseMind and Memory.
* Added sequence no to all entities, which is incremented each time
a move or set operation is received. sequence no "seq" is included
in args of Appearance operations.
* Moved functionality from Animal python base class into Character
C++ base class. This much improves the performance of modelling
animals, and means that player characters, and NPCs get hungry and
need to eat. Reduced the speed at which animals consume energy
so they don't starve quite as quickly.
* Added collision prediction functions that handle both entities
having velocity.
* Added combine functionality to Stackable. Divide comes next.
Once functional, this will become the base class for any items
which will commonly be used as stacks.
Al
* modules/Location.h: Added inRange() method which can be used
to check whether location, including bounding box, is within
given range of a given location. Changed parent member
variable to ref to fit with Atlas spec. Changed all code
related to using the term ref instead of parent so
that there is no confusion between ref for coordinates
and parent in the Atlas hierarchy.
* rulesets/Thing.cpp: Added code to move operation to check
what entities come into and out of range when entity moves.
Appearance and Disappearance operations are sent to the
moving entity with a list of the relevant entities as their
argument.
* server/WorldRouter.h/cpp: Added overloaded Look operation
handler which applies range constraints to the contains
attribute before returning.
* common/BaseEntity.h, rulesets/Thing.h, rulesets/Character.h:
Added handling of Appearance and Disappearance operations.
* server/WorldRouter.cpp: Added primitive check to broadcast
operations to avoid delivering broadcast operation to
entities out of range.
* Removed world.get_object() use from server python code, as
its use is not required.
* server/WorldRouter.h: Implemented fetching of floating point time
from the OS so movement is much smoother.
Al
* Removed map from Thing, and put it into basmind. Re-wrote
script_Operation for thing so it now looks things up in world
dictionary rather than in local map. This removes a memory leak.
This is Acorn 0.3 server release candidate 1. There is one known issue
which must be solved before Acorn 0.3, but everything else should work.
Al
* Tweaked the way Look operations are handled when sent from mind, so
an argument is not required if to is set.
* Made some performance enhancements.
* Implemented nourish operation.
* Modifed move_me() goal so it sets face direction.
* Fixed memory leak in MemMap.
* Implemented fully deleting of entities.
* Cleaned up and tweaked python scripts so eating acorns now works.
* Implemented hooks in MemMap for python scripts.
This is the work I got done over the Christmas break. Acorn now works
with a couple of minor glitches.
Al
from config files. Global ruleset should indicate top level ruleset
which can depend on a list of other rulesets.
* Sorted out installation directories. Cyphesis will now need to be
installed before it can be run.
* Cleaned up a load more python scripts for more Acorn stuff.
* Added getting x y and z from Vector3D.
* Made acorn the default ruleset.
Al
off using debug flags.
* Added halt_time, which is number of seconds server should run before
it exits.
* Cleaned a bunch if the remaining memory leaks.
* Cleaned up the way time is handled.
* More tweaks to Python code and API to get Acorn working.
* Inlined some methods into the class definitions, for performance.
* Updated movement code to sort out setting mode properlly, and
deal with stuttering NPC movement.
This is quite a big commit, and most of Acorn now works. Performance seems
to be good too.
leak now is copied Location objects in the python interface code.
* Added hook into the time code so the server can be set to exit
after a given number of seconds. This is required for LeakTracer
to generate its report.
Al
clag the server up and are not correct behavoir.
* Minor fixes/python tweaks.
* Slight change to ordering of ops in the queue, so more recently
created ops with the same time stamp come of the queue after
older ops.
* Implemented contains attribute so newly created objects are added
to their parents contains list, and when objects are move, they are
transfered from old parents to new parents contains list.
Lots more stuff is now happening in the world, though I can't see what it is
because things don't show up in uclient now that broadcast Look doesn't
work. It is also clear that I need to seriously attack the memory leak situation
now.
Al
* Removed some unused code.
* Tweaked some python scripts so they import correctly.
* Added in_game flag to BaseEntity so it is possible to tell
if an object is in game.
* Increased the number of operations handled by Message()
* Added handling for initialisation of location.parent using me
in mind code.
* Added is_object_delete() functionality to python interface to world
object.
* Added handling for converting Tuple into Message::Object, and then
ensured that non-basic python types don't get stored as attributes
of a Message::Object.
Many more improvements to goal behavoir. Guard now patrols correctly,
and butcher tries to by a cleaver, because he fails to notice he already
has one.
Al
* More python code tweaks to work with modifications to interface.
* Modified code which gets Thing attributes from Message::Object
so it can use any object dictionary to look up parent object.
* Fixed handling of Thing's static type attribute.
* Modified creation of operations from python to eliminate
some strange segfaults.
* Re-wrote and fixed Entity creation from python.
* Implemented dictlist.remove_value for removing things from inventory.
* Implemented Vector3D arithmetic and methods from python.
* Implemented as_entity() and get_xyz() methods for Thing from
python.
* Commented out deletion of operations from python OperationObject
dealloc() function as it was causing segfaults. There is a problem
somewhere with ownership not being cleared, but I can't find it.
* Implemented conversion of Python Operation and Oplist objects
to Message::Object.
* Fixed MemMap so that attributes of Things are accuratly updated.
* Fixed it so that look ops from mind are broadcast rather than sent
to world. This may have to be reverted.
* Tweaked autoconf to make it cleaner and work better. Still needs
alot of work.
A simple test of some goals now works! The lych goals worked to some
extent and no-longer gives python errors. Only a few more things are
required before Acorn can run, at which point I will release 0.1
for testing.
Al
log.
* Added in lots of deletes to sort memory leaks.
* More python tweaks.
* Implemented status attributes of thing.
* Re-wrote some code which needlessly creates objects in the
free store.
Very nearly all works now.
TODO:
Tidy some of the rest of the leak handling, including all of the stuff
to deal with connections going down.
Sort out how mind gets its attributes set and updated.
Sort out iritating python error in init of Vector3D
delete oplists in OplistObjects. The pointers are never passed back.
Al