Commit graph

45 commits

Author SHA1 Message Date
Erik Ogenvik
97a09ae6b0 Conversion to Python 3 through 2to3. 2018-05-07 11:15:26 +02:00
Erik Ogenvik
13314ff026 Convert Python scripts to left coords. 2018-02-06 13:45:10 +01:00
Erik Ogenvik
7127d39f13 More work on moving to left hand coord system. 2018-02-06 13:45:10 +01:00
Erik Ogenvik
0286bcd47d Replace "parents" with "parent". 2017-07-24 15:05:18 +02:00
Erik Ogenvik
d8eeb05c3d Revert include optimize for Python files.
CLion wasn't as good at optimizing Python as it was at optimizing C++.

This reverts commit 7aaa9b9ba7.
2017-05-28 16:32:17 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Alistair Riddoch
531e4f512d Update all scripts to use atlas.Oplist 2009-05-21 16:34:27 +01:00
Al Riddoch
47d30d418b 2008-01-05 Al Riddoch <alriddoch@googlemail.com>
* rulesets/acorn/world/objects/animals/Deer.py,
	  rulesets/acorn/world/objects/animals/Pig.py,
	  rulesets/acorn/world/objects/outdoor/Campfire.py,
	  rulesets/acorn/world/objects/plants/Tree.py,
	  rulesets/acorn/world/objects/tools/Cleaver.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/mason/world/objects/animals/Deer.py,
	  rulesets/mason/world/objects/animals/Pig.py,
	  rulesets/mason/world/objects/clothing/Garment.py,
	  rulesets/mason/world/objects/elements/Fire.py,
	  rulesets/mason/world/objects/outdoor/Campfire.py,
	  rulesets/mason/world/objects/tools/Bow.py,
	  rulesets/mason/world/objects/tools/Bucksaw.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/tools/Tinderbox.py,
	  rulesets/mason/world/objects/tools/Torch.py,
	  rulesets/mason/world/objects/tools/Trowel.py,
	  rulesets/mason/world/tasks/Bisect.py,
	  rulesets/mason/world/tasks/Combat.py,
	  rulesets/mason/world/tasks/Cultivate.py,
	  rulesets/mason/world/tasks/Delve.py,
	  rulesets/mason/world/tasks/Dig.py,
	  rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Reap.py,
	  rulesets/mason/world/tasks/Sharpen.py,
	  rulesets/mason/world/tasks/Slaughter.py,
	  rulesets/mason/world/tasks/Slice.py,
	  rulesets/mason/world/tasks/Trailblaze.py,
	  rulesets/werewolf/world/objects/tools/Gallows.py:
	  Remove code that accesses the world attribute on Entity,
	  replacing where necessary with server.world.
2008-01-05 00:40:32 +00:00
Al Riddoch
ddfed59ec8 2007-06-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove the messy import hooks that make
	  inherited rulesets work, but screw up module reloading.

	* rulesets/acorn/mind/SkelMind.py,
	  rulesets/acorn/world/objects/Weather.py,
	  rulesets/acorn/world/objects/animals/Crab.py,
	  rulesets/acorn/world/objects/animals/Deer.py,
	  rulesets/acorn/world/objects/animals/Pig.py,
	  rulesets/acorn/world/objects/animals/Squirrel.py,
	  rulesets/acorn/world/objects/animals/Wolf.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse1.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse2.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse3.py,
	  rulesets/acorn/world/objects/buildings/FarmStand.py,
	  rulesets/acorn/world/objects/buildings/FishShop.py,
	  rulesets/acorn/world/objects/buildings/House1.py,
	  rulesets/acorn/world/objects/buildings/House2.py,
	  rulesets/acorn/world/objects/buildings/House3.py,
	  rulesets/acorn/world/objects/buildings/House4.py,
	  rulesets/acorn/world/objects/buildings/House5.py,
	  rulesets/acorn/world/objects/buildings/Inn1.py,
	  rulesets/acorn/world/objects/buildings/Inn2.py,
	  rulesets/acorn/world/objects/buildings/ItemShop.py,
	  rulesets/acorn/world/objects/buildings/Mansion.py,
	  rulesets/acorn/world/objects/buildings/MetalShop.py,
	  rulesets/acorn/world/objects/buildings/Ruin.py,
	  rulesets/acorn/world/objects/buildings/Shack.py,
	  rulesets/acorn/world/objects/buildings/Stall.py,
	  rulesets/acorn/world/objects/buildings/Sty.py,
	  rulesets/acorn/world/objects/buildings/VacantShop1e.py,
	  rulesets/acorn/world/objects/buildings/VacantShop1w.py,
	  rulesets/acorn/world/objects/buildings/VacantShop2.py,
	  rulesets/acorn/world/objects/outdoor/Campfire.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/acorn/world/objects/tools/Cleaver.py,
	  rulesets/acorn/world/objects/undead/Arm.py,
	  rulesets/acorn/world/objects/undead/Pelvis.py,
	  rulesets/acorn/world/objects/undead/Ribcage.py,
	  rulesets/acorn/world/objects/undead/Shin.py,
	  rulesets/acorn/world/objects/undead/Skull.py,
	  rulesets/acorn/world/objects/undead/Thigh.py,
	  rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/world/objects/Pile.py,
	  rulesets/basic/world/objects/animals/Animal.py,
	  rulesets/basic/world/objects/buildings/House.py,
	  rulesets/basic/world/objects/buildings/StoneHouse.py,
	  rulesets/basic/world/objects/elements/Fire.py,
	  rulesets/basic/world/objects/plants/Tree.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/mason/world/objects/Pile.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/buildings/House.py,
	  rulesets/mason/world/objects/buildings/House3.py,
	  rulesets/mason/world/objects/buildings/StoneHouse.py,
	  rulesets/mason/world/objects/clothing/Garment.py,
	  rulesets/mason/world/objects/elements/Fire.py,
	  rulesets/mason/world/objects/outdoor/Campfire.py,
	  rulesets/mason/world/objects/outdoor/Gravestone.py,
	  rulesets/mason/world/objects/plants/Fir.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/Axe.py,
	  rulesets/mason/world/objects/tools/Bow.py,
	  rulesets/mason/world/objects/tools/Bucksaw.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/tools/Pickaxe.py,
	  rulesets/mason/world/objects/tools/Rope.py,
	  rulesets/mason/world/objects/tools/Scythe.py,
	  rulesets/mason/world/objects/tools/Shovel.py,
	  rulesets/mason/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/tools/Tinderbox.py,
	  rulesets/mason/world/objects/tools/Torch.py,
	  rulesets/mason/world/objects/tools/Trowel.py,
	  rulesets/mason/world/objects/undead/Skeleton.py,
	  rulesets/mason/world/tasks/Bisect.py,
	  rulesets/mason/world/tasks/Combat.py,
	  rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Sharpen.py,
	  rulesets/mason/world/tasks/Slice.py,
	  rulesets/mason/define_world.py:
	  Convert rulesets over to inheriting from the Thing class in
	  the new non ruleset specific location.

	* rulesets/basic/mind/goals/animal/domestic.py: Add file missing from
	  previous commit.
2007-06-19 12:36:42 +00:00
Al Riddoch
e3806759eb 2005-10-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Report a warning when action ops are sent
	  from client or mind code.

	* rulesets/Py_Location.cpp: Allow invalid vectors to be used
	  to set attributes on Location.

	* rulesets/acorn/world/objects/undead/Skeleton.py,
	  rulesets/mason/world/objects/undead/Skeleton.py: Remove action
	  ops replacing them with setting MODE of skeleton to
	  collapsed.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/common/misc_goal.py: Use Imaginary ops
	  rather than Action for emotes.
2005-10-20 14:34:01 +00:00
Al Riddoch
edc9d66023 2005-04-10 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-04-11 00:54:15 +00:00
Al Riddoch
62412887cf 2005-01-25 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-01-25 23:50:57 +00:00
Al Riddoch
7fc11bbf84 2004-11-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/acorn/mind/PigMind.py,
	  rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/mason/define_world.py,
	  rulesets/mason/mind/PigMind.py: Re-write all code that uses
	  get_xyz() to use the code for calculating relative distance
	  vector.
2004-11-17 15:26:34 +00:00
Al Riddoch
750205b29f 2004-07-21 Al Riddoch <alriddoch@zepler.org>
* rulesets/BaseMind.cpp, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/Py_Map.cpp: Modify python API so it passes in time
	  to map.update and map.get. Use time elapsed to decide if something
	  is ready for removal. Newly created entities are now less likely
	  to get removed before they are verified.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/humanoid/mason.py,
	  rulesets/acorn/mind/SkelMind.py, rulesets/mason/mind/SkelMind.py:
	  Update python code to new API.
2004-07-21 23:52:58 +00:00
Al Riddoch
4c39bc2ecd 2002-07-25 Al Riddoch <alriddoch@zepler.org>
* 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.
2002-07-26 16:47:39 +00:00
Michael Koch
050f8c6e2d fix typo: alcahol => alcohol 2002-06-12 10:33:46 +00:00
Al Riddoch
716cb0f8de 2002-04-25 Al Riddoch <alriddoch@zepler.org>
* 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.
2002-04-26 08:08:48 +00:00
Al Riddoch
4293ff663f * Fixed build files for debian, and converted bbox in define_world.py
to new format.

Al Riddoch  <alriddoch@zepler.org>
2001-12-10 11:36:47 +00:00
Al Riddoch
2246ef2f4a * common/database.h, common/database.cpp: Cleaned up header so
it no longer requires db3 headers, and reimplemented support
	  for debian.

	* tools/cycmd.cpp: Fixed to work with new database headers.

Al Riddoch  <alriddoch@zepler.org>
2001-12-06 16:16:50 +00:00
Al Riddoch
b0847f8a49 Updated bboxes to new format in Acorn entities 2001-11-30 12:10:30 +00:00
Al Riddoch
dee412c0a0 * client/CharacterClient.cpp: Removed commented out code.
* client/CreatorClient.cpp: Fixed processing the response
	  to a create operation, and cleaned up debugging output.

	* client/ObjserverClient.cpp, client/ObserverClient.h,
	  client/client.cpp: Added setup method, which which handles
	  connecting, negotiation, logging in and creating character.

	* client/Py_CreatorClient.cpp: Added check if make() failed.

	* rulesets/Python_API.cpp: Fixed setting the import hooks
	  list properlly to include the ruleset list in use, instead
	  of hardcoding it.

	* rulesets/acorn/define_world.py: Copied define_world.py script
	  from client directory for Acorn.

	* rulesets/basic/editor.py: Modified to be used from C++ core.

	* rulesets/basic/mind/goals/__init__.py,
	  rulesets/basic/mind/goals/humanoid/werewolf.py:
	  Added in goals file to contain goals related to werewolf.

	* rulesets/basic/mind/panlingua/interlinguish.py:
	  Added in vote and execute verbs for werewolf.

	* rulesets/werewolf: Added in new ruleset for werewolf.

Al Riddoch  <alriddoch@zepler.org>
2001-08-19 18:37:38 +00:00
Al Riddoch
2fd239e63c * tools/cycmd.cpp: Ensure that login op is flushed after it is sent.
* server/Player.cpp: Arg order of std::string.compare() is
	  incompatable between recent libstdc++ versions. Switch
	  back to old version, still in most common use.

	* rulesets/Thing.cpp: Set refno on ops handled in game.

	* rulesets/Python_API.cpp: Modify Entity() python constructor
	  so that commonly used attributes from old atlas are translated
	  to their modern equivalents.

	* rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp: Differentiate
	  between previously identical error messages in several places.

	* rulesets/Py_Object.cpp: Rework conversion of python dict to
	  Atlas map to be more efficient and clean.

	* rulesets/Py_Location.cpp: Rework setting of vector parts of
	  location so that it can accept vectors from python in more
	  formats, including lists and tuples.

	* rulesets/Creator.h, rulesets/Character.h, common/BaseEntity.h:
	  Re-order virtual methods declarations to fit a convention.

	* common/stringstream.h: Hardcode use of local stringstream class,
	  as the version provided with older libstdc++ seems to be broken.

	* common/database.cpp: Use the common header to pick the right
	  stringstream implementation.

	* common/BaseWorld.cpp, server/Persistance.cpp: Removed unused
	  stringstream include.

	* rulesets/Creator.cpp: Added extra debug output.

	* client/define_world.h, client/define_world.cpp, client/CommClient.h:
	  Use CreatorClient to store Creators mind, instead of BaseMind.

	* client/client.cpp,
	  client/ObserverClient.h, client/ObserverClient.cpp,
	  client/CreatorClient.h, client/CommClient.h, client/CommClient.cpp:
	  Modify method names to fit capitalisation conventions.

	* client/CreatorClient.cpp: Implement creation of in-game entities,
	  using creator entity.

	* client/CommClient.cpp: Added correct client side monitoring of
	  creator entity.

	* client/ClientConnection.h, client/ClientConnection.cpp: Added
	  pending method to establish if ops are in the queue. Switched send()
	  method so we only send ops. Add setting of serialno of sent
	  ops, starting with an offset of 512.

	* client/CharacterClient.h: Removed unused member, opFound.

	* client/CharacterClient.cpp: Debugged sendAndWait() method.

Al Riddoch  <alriddoch@zepler.org>
2001-08-16 17:39:42 +00:00
Al Riddoch
72740adfb9 * server/server.cpp: Cleaned up loading of config files, so that
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>
2001-07-12 16:10:41 +00:00
Al Riddoch
09c353b894 * rulesets/acorn/world/objects/plants/seeds/Seed.py,
rulesets/acorn/world/objects/plants/seeds/Apple.py,
	  rulesets/acorn/world/objects/plants/Tree.py,
	  rulesets/acorn/world/objects/plants/AppleTree.py:
	  Adjusted the weight and therefor the nutritional value of
	  apples and acorns. Reduced the number dropped by trees to
	  improve game performance.

Al Riddoch  <alriddoch@zepler.org>
2001-06-19 14:42:16 +00:00
Al Riddoch
2b8cfb28f8 * rulesets/acorn/world/objects/plants/Tree.py,
rulesets/acorn/world/objects/plants/Oak.py,
	  rulesets/acorn/world/objects/plants/AppleTree.py:
	  Modified tree code so mode is set to fruit if they are carrying
	  any fruit.

	 * Added xml entity maps for agrilan.

Al Riddoch  <alriddoch@zepler.org>
2001-06-18 18:40:12 +00:00
Al Riddoch
ddeee51f1b * tools/cydbload.cpp: Modified database loader so it can
load multiple maps and merge them into the database.

	* rulesets/acorn/world/objects/buildings/FarmHouse2.py: Fix typo
	  in the class name.

	* acorn.vconf, rulesets/acorn/world/objects/buildings/Stall.py:
	  Added proper support for market stalls.

Al Riddoch  <alriddoch@zepler.org>
2001-06-17 18:30:14 +00:00
Al Riddoch
494bde65b5 *** empty log message *** 2001-06-16 23:05:18 +00:00
Al Riddoch
8bea85cdfc * Fixed up build files to install in a conformant way.
* 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>
2001-06-16 14:19:00 +00:00
Al Riddoch
e091bfd8f8 * server/Admin.cpp: Modified database loading code so it picks up
the object parent correctly instead of looking for a type attribute.

	* server/server.cpp: Made metaserver address a config file option.

	* common/database.h: Put in compiler error if code is built without
	  database support.

	* common/BaseEntity.cpp: Switched over to using stamp instead of seq
	  as the attribute used to check whether entity needs to be
	  updated.

	* Used action operation throughout python code to denote performing
	  an action, as differentiated from setting mode.

	* rulesets/skills: Added the beginnings of a skill system.

	* example/client: Fixed Atlas-C++ 0.5 example client so it
	  compiles again.

	* README: Wrote a README file

Al Riddoch  <alriddoch@zepler.org>
2001-05-06 23:51:37 +00:00
Al Riddoch
a303326964 * Changed many return statements to match convention.
* rulesets/Thing.cpp: Tweaked ranges code in movement to cut
	  down CPU time used.

	* common/BaseEntity.cpp: Re-ordered opEnumerate so that most
	  frequently used ops are detected soonest.

	* modules/WorldTime.h/.cpp: Moved WorldTime to modules directory.

Al Riddoch  <alriddoch@zepler.org>
2001-04-17 10:14:20 +00:00
Al Riddoch
ee24adafc2 New deer 2001-04-02 22:04:06 +00:00
Al Riddoch
f80c191811 * rulesets/acorn/world/objects/animals/Deer.py, acorn.vconf: Added
deer, with same basic code as pig.

	* server/server.cpp: Pass on objects which are not know by the
	  Atlas::Objects::Decoder straight to the operation handler.

	* server/Admin.*: Re-structured the way commands are handled from
	  admin client, so that apropriate operations are used instead of
	  always using Set.

	* server/Admin.cpp: Added saving world state to the database.

	* tools/cycmd.cpp: Updated to use the new admin command semantics.
	  Added save command.

	* common/persistance.*: Added interface for saving world status.

	* common/database.*: Added interface for deleting contents of database.

Al Riddoch (alriddoch@zepler.org)
2001-04-02 22:03:42 +00:00
Al Riddoch
d839c45152 * rulesets/Py_Location.cpp: Added bbox and bmedian attributes of
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
2001-03-07 11:49:43 +00:00
Al Riddoch
35d78b27a2 * Implemented beginnings of ranges code:
* 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
2001-02-19 06:13:31 +00:00
Al Riddoch
7baa6b36c6 * Fixed pig mind so it is now better able to detect "Sowee"
* 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
2001-01-02 17:50:10 +00:00
Al Riddoch
f9e8d1c832 * Fixed inheritance bug in BaseMind::operation()
* 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
2000-12-30 23:16:57 +00:00
Al Riddoch
3925000cd3 * Cleaned up auto-* stuff, and created spec file for RPMs.
Al
2000-12-17 22:21:43 +00:00
Al Riddoch
57c737a756 * Fixed error in Thing::operator[] which meant attributes could not
be accessed, and certain move operations caused an abort.

	* Removed attributes from python object which don't have attributes.

	* Added Py*_Check() macros, and used them for easier code reading.

	* Added snow attribute to weather.

	* Commented out code which makes server exit(0) after a certain time.


Al
2000-12-16 20:28:06 +00:00
Al Riddoch
83b0a8eec0 * Added in exception handler to catch if weight is not a float.
* Tweaked SkeletonMind so it now works.

Al
2000-12-15 12:02:26 +00:00
Al Riddoch
5ce54bf665 * Modifed python interface Operation() function so that it accepts
strings for to and from as well as entities.

	* Adapt python Operation() function so operations can be given as
	  arguments.

	* Add Eat, Chop, Cut and Fire operations into the main operation
	  handling functions.

	* Added code so that intelligent entities can use python mind classes
	  other than NPCMind, and added config section for specifying which.

	* Tweaked python mind code for Pig, Wolf and Skeleton so they work.

Al
2000-12-14 12:03:05 +00:00
Al Riddoch
defe46b91e * Set up rulesets processing so that everything is handled dynamically
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
2000-12-13 12:10:48 +00:00
Al Riddoch
4343c8d383 * Removed lots of extraneous debugging output, and turned the rest
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.
2000-12-11 13:06:12 +00:00
Al Riddoch
d1f2e912a0 * Added handling for removing connections.
* 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
2000-12-07 12:14:35 +00:00
Al Riddoch
1826587f9d * Fixes to worlds object list so it now contains world.
* 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
2000-12-06 18:21:35 +00:00
Al Riddoch
e635657e3f * Added in Python interface code to deal with manipulation of operation
time.

	* Made basic_tick a float, because it should be.

	* Imported all the rulesets python code from python cyphesis.

Al
2000-11-27 18:28:20 +00:00