Commit graph

22 commits

Author SHA1 Message Date
Al Riddoch
2ccfaadef3 2001-04-14 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>
2001-04-16 16:26:44 +00:00
Al Riddoch
488f35b52f * Complete re-write of python script interface to allow other
script types to be cleanly dropped in.

	* Re-work on server and communication related classes to use
	  references where they are apropriate. Code is now much more
	  robust.

	* Huge cleanup of header files removing redundant includes.

	* server/WorldRouter.h: Removed is_object_deleted because it
	  is broken and not used.

	* server/Connection.h: Removed unused disconnect() methods.

	* rulesets/Entity.*: Added new in game base class from which
	  all mind and object classes are derived. This removes
	  clutter of Thing class from mind classes.

	* aiclient/*: Progress with creating AI client for mind handling.

	* common/globals.*: Moved some globals out of server specific files.

	* rulesets/Makefile.am: Separated rulesets code into 3 almost stand
	  alone packages; entities, mind and python interface code.


Acorn may well not work now, but I would apreciate it if people could
test the code on their setups. Lots of code has changed, and almost
everything is now cleaner.

Al Riddoch  <alriddoch@zepler.org>
2001-04-10 19:05:14 +00:00
Al Riddoch
291621d9e8 * watchdog/*.c: Corrected C++ style comments in c code.
* */*: Fixed mistake in copyright statement.

	* tools/cypasswd.cpp: Fixed usage message.

	* tools/cycmd.cpp: Added tools for sending administrative commands
	  to server.

	* server/server.cpp: Send terminate instruction to metaserver on
	  server shutdown.

Al Riddoch (alriddoch@zepler.org)
2001-03-16 11:38:14 +00:00
Al Riddoch
3a5e4e56c0 * Changed oplist to use std::vector. Recoded and re-optimised use
of oplist to take advantage of vector's best performance.

	* Modified OP_SWITCH macros to improve speed, and made it inlinable.

	* Cleaned up python interface code to improve compile and link time.

	* Moved custom operation definitions in one header file per class
	  to improve modularity and compile time.

	* Modified boundingbox handling so it now uses size and median.

	* Added collision check and inbox member function to Vector3D class.

	* Added collision prediction and checking to Location and Vector3D
	  classes.

	* Added collision prediction into MovementInfo class.

	* Modified Thing::operator[] so that static attributes can be handled
	  and added Thing::set() which must be used to modify attributes.

	* Added collision resolution so characters can no longer walk through
	  each other.

	* Moved weight attribute to being static attribute of Thing, so it
	  can be much more easily handled in movement code.

Al
2001-02-26 14:41:10 +00:00
Al Riddoch
e7eb28366c * all file: Added copyright statement
Al
2001-01-26 16:38:23 +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
b1a1db69d3 * Major attack on the more fiddly memory leaks. The only noticable
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
2000-12-08 11:40:32 +00:00
Al Riddoch
21b18875f6 * Started working on sorting out memory leaks.
* Implemented python function to deal with not being able to check
	  type of python objects implemented in C.

	* Added method to thing for extracting location data from a
	  Message::Object

	* More work on python references to improve leakage.

	* Added flag so that python Operation object can own
	  the operation they point to, and thus delete it in dealloc().

	* Implemented find_by_location() and find_by_type() as required in
	  MemMap, and corresponding python interface.

	* Put in temporary work around to deal with the fact that a mind
	  does not know its name. Currently the mind is not able to
	  discover any of its bodies attributes, and I am not sure how
	  to solve this.

	* Fixed Location and Vector3D so they use operator bool() to detect
	  whether they are set.

	* Fixed bugs in getting parent from Location in python which caused
	  segfaults.

	* Imported all the basic ruleset entity python scripts.


Goals now work to some extent, though nothing moves around still. The main
priority is to work out how minds inherit the attributes of their
bodies, and keep them up to date. aloril?

Al
2000-12-04 20:08:21 +00:00
Al Riddoch
4b0b328c92 * Debugged set_kw() and confirmed that it does work.
* Added python API support for self.world.

Al
2000-12-03 16:56:10 +00:00
Al Riddoch
907455c4c8 * Added more required functionality to base python Thing class
so that operation manipulations can now work.

	* Implemented getting of object name to python/C API, and added
	  methods for differentiating between op and object.

	* Implemented on-the-fly de-coding of operations, from operation
	  arguuments in python/C API. This will be obsolete once Atlas-C++
	  does full decode later.

	* Implemented get and setattr for Message Object from
	  python. Attributes are stored both in Object, and in supplementary
	  python dictionary for non Atlas compatable attributes.

	* Implemented copy() method for Python/C Location class.

Al
2000-11-30 12:51:59 +00:00
Al Riddoch
ece4c15d3d * Added in debug function for python code.
* Fixed coersion of non-oplist types for addition.

	* Implemented getting attributes from Message::Object maps
	  from python.

It now crashes in the interlinguish code. Closer and closer.

Al
2000-11-29 18:02:01 +00:00
Al Riddoch
222786df66 * Added support for decoding Sound operations in BaseMind.
* Added Talk operation throughout operation handling code.

	* Added basic WorldTime class together with python wrapper.
	  Can fill in functionality as required.

	* Put debugging back in cos I still need it.

Python mind code now gets talk ops. Some tweaking still to go.
2000-11-29 15:19:36 +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
Al Riddoch
7a4b45a702 * Fixed and changes to code so that operations created in python
mind code are delivered as required.

Only 6 days until I promised I would have this stuff working. Lets see how
whether I can keep my promises.
Al
2000-11-26 19:58:36 +00:00
Al Riddoch
e156a2b6f1 * Disabled some of the excessive debugging messages.
* Implemented getting and setting of to and from in operations
	  using map to lookup what the mind knows about the entities
	  in question. This involved adding an extra field to the
	  RootOperationObject structure to store to and from entities.

	* Sorted out base_init() python member so __init__() of all
	  classes in inheritance tree are called.

	* Started work on set_kw() replacement.

	* Added python module finding mechanism which is required to deal
	  with rulesets correctly. I am not convinced this works.

Al
2000-11-24 01:41:06 +00:00
Al Riddoch
b295f6f1ec * Added oplist python interface, and implemented returning of
operations from python code.

Al
2000-11-23 14:32:00 +00:00
Al Riddoch
5409647d65 * Added some more python interface classes. There is now enough code
here to start importing real mind code from cyphesis-py.

With a little bit of tweaking, I have now got the NPCMind code to import,
though it will almost certainly crash once you start trying to run
any methods.
2000-11-20 20:28:08 +00:00
Al Riddoch
c72c97b351 * Filled in BaseMind functionality so it now keeps memory map up to date. Added necessary features to Python/C++ interface
for sight operations to be passed onto python code after processing
	  in C++. Added new type of op switch to deal with operations
	  in the argument of a sight/sound operation.

	* Added features to Opeation python interface for args to be
	  accessed as if operation is a sequence object.

	* Implemented python API for C++ memory map class.

	* Added utility function which uses code borrowed from Atlas-C++
	  to convert a Message::Object into something from the Objects
	  code.

Al
2000-11-19 20:18:24 +00:00
Al Riddoch
f2928e6310 * Moved some of BaseMind functionality in a python class and
added the necessary interface code.

	* Initial port of MemMap class from python to C++, together with
	  python interface. Hopefully maintenance of MemMap can be kept
	  in C++ for speed if possible.

Al
2000-11-19 00:02:29 +00:00
Al Riddoch
24bd5394fb * Sorted out error handling from python code, and no-longer treat
no method as an error.

	* Got python interface code to the point that python classes can now
	  access the C++ attributes of a Thing.

	* Split the python interface code into separate files depending
	  on the type of C++ class the code relates to.

Al
2000-11-17 00:18:32 +00:00
Al Riddoch
af3f4366f6 * Added code for standard Get/Set methods for operations.
Eventually this functionality will be moved into getattr
	  and setattr methods.

	* Added code for a Thing object which wrappers a C++ Thing * pointer.

Al
2000-11-16 16:35:03 +00:00
Al Riddoch
6bb82c3197 * Added more Python/C API code. Basic framework now exists for
creating and manipulating Operations in the python code.

Al
2000-11-14 15:52:10 +00:00