Commit graph

437 commits

Author SHA1 Message Date
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
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
b392f5e0de Another bit of code to prevent code from aborting if weight is not a float. 2000-12-15 16:08:44 +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
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
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
faf8b6dbca * Fixed so that we are no longer sending broadcast look ops, which
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
2000-12-07 20:38:20 +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
e6d6f7ef0d * Added new common namespace to prevent collision with math function
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
2000-12-05 14:26:04 +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
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
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
51d29b2e14 * Moved character mode calculation into MovementInfo class.
* Added new MovementInfo method which creates a movement op to
	  change the rotation of a character when no other update is needed.


I believe these two changes solve all Karstens current concerns with movement
from uclient. Movement in the new server feels very slick, and after many
hours of work I think I have got rid of most of the kinks, both those that
were in the original python code, and the ones I added when I ported it.

Al
2000-11-22 18:15:36 +00:00
Al Riddoch
971a6df68d * Bug fix that meant that updates to MemMap object caused segfault.
Al
2000-11-21 22:15:46 +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
9bc01e088f * Two small bug fixes. One stops a crash when the client tries
to move an object which does not exist, the other removes an
	  unnecessary pointer check which stopped the admin client from
	  working.

Al
2000-11-19 23:58:51 +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
68852aef21 * Cleaned up problems with mode in move operations, and dealt
with stopping when velocity is set to zero.

Movement now seems to work in uclient properlly. I have not yet been able
to test destination based movement in uclient, as uclient does not yet
implement right-click movement. Rounding errors in uclient also lead
to it sending move operations with very small velocities, which result
in the character walking on the spot. There are still some things to
be ironed out with face attribute.

Al
2000-11-15 15:17:59 +00:00
Al Riddoch
c18f5cfdce * Fixed silly typo in movement code which meant that velocity was
not being used to calculate direction when only velocity is
	  specified.

Movement is now much improved in uclient. Mode still does not work
correctly, and sight of move operation is not correctly generated when
character stops moving. Still working on it.
2000-11-15 14:32:18 +00:00
Al Riddoch
166696fab6 * Fixed setting location of newly created objects
* Fixed setting weight as float on default Thing.

	* Added more support for mode and face in movement code.

	* Cleaned up the debugging output code.

	* Fixed looking, and added support for contains attribute

Al
2000-11-10 20:41:24 +00:00
Al Riddoch
3316e1e1cb * Added more refno capabilities
* Fixed some operation instantiation bugs

	* Added full support for creator entity. Admin client can now populate
	  the world with items and NPCs.

Al
2000-11-10 03:29:00 +00:00
Al Riddoch
943aafe3c1 * Fixed movement code so that id of object to be moved is correctly
present. uclient now sees movement. Woohoo!

Al
2000-11-07 23:30:49 +00:00
Al Riddoch
35a969b267 * More movement fixed. uclient movement now works within the server,
but uclient does not like the responses it gets.

	* Fixed a bug which caused a segfault when movement stops.

Al
2000-11-07 20:26:37 +00:00
Al Riddoch
f3f1e4fd39 * More movement fixes, including lots of clearer debugging output.
Still does not seem to correctly handle moves which don't
	  specify direction.

Al
2000-11-05 16:08:17 +00:00
Al Riddoch
872056a7ce * More movement fixes. I now get almost expected behavoir
* Switched over to new Atlas location spec now that this is supported
	  by uclient.

Al
2000-11-05 00:21:38 +00:00
Al Riddoch
a8e31c364a * Improved debugging output in movement code, and fixed some critical
bugs which meant that movement was not working correctly.

Al
2000-11-04 18:44:43 +00:00
Al Riddoch
550beb9cc8 * Modified legacy location code so it is now activated by a single
#define

Al
2000-11-03 14:44:05 +00:00
Al Riddoch
3ba5e76833 * Added temporary support for old Atlas style location object
in entity to move operations. This allows uclient to work for
	  now until it moves over to the latest Atlas spec.
2000-11-02 23:47:19 +00:00
Al Riddoch
c67a08d027 * Fixed movement code which now works.
* Fixed set operation, and added attributes map to Thing.

	* Started adding Python interface code.

        * Starting changelog from initial attempt to port cyphesis into C++.
2000-10-24 12:50:22 +00:00
Al Riddoch
a9c0ec2d5b Fixed movement, so it should now work. 2000-10-22 14:07:55 +00:00
Al Riddoch
bd9aecbcfa Modified all internal operation handling functions so they now return a list
of Operations instead of just one. Debugged movement, which now works, but
does not yet stop when it reaches the destination.

Al
2000-08-31 21:48:46 +00:00
Al Riddoch
f273b17336 Thanks to karsten for sorting out my auto* issues, we can now detect where
atlas is correctly.

Implemented most of the mind<->body interaction required for Character(),
and most of the operation handling for Thing(). Entities should now be
able to do stuff in the world.

Left to do, I need to work out how to implement the set operation,
and then work out a mechanism for returning multiple operation from
a function.

Al
2000-08-30 17:49:11 +00:00
Al Riddoch
0d372a6da0 Got MovementInfo to compile, and cleaned up the code a bit more. Removed
botched attempt to add support for optimised non-string object ids.
Modified the idle routine so it now delivers all the waiting operations
rather than only one per cycle.

Al
2000-08-27 18:00:38 +00:00
Al Riddoch
d6a56f6764 The basic world model now works. Operation get routed effectively between
objects in the world, mind and external minds. You can now log in, create
a character, and witness other operations in the world through receiving
sight operations.

Al
2000-08-26 15:11:24 +00:00
Al Riddoch
8266592142 Lots more code added, and WorldRouter can now send operations around
Now adding character body and mind code so mind and body abstraction can
work and communication between client and server character entity can
work. The code is not currently in any particular state, but I have not
commited for a while, so I am doing it now for security.

Al
2000-08-25 17:51:43 +00:00