[crossfire] Moving server towards a modularized system?
Mark Wedel
mwedel at sonic.net
Mon Jan 16 15:48:42 CST 2006
Sorry, in the initial post I presumed it would be python, but a C plugin seems
like a reasonable idea. For one thing, I can't imagine a C plugin ever not
being able to be installed (unlike python where people could be lacking the
libraries)
That said, trying to figure out what is optional or not is difficult. I'd
venture to say a lot of people would say the random maps really are not optional
(or if those are optional, what else is optional, like shops, monsters, etc)
I'd think that if there is a C plugin, aside from the different passing in of
the values, and using appropriate callbacks for functions instead of calling
them directly, it could access the function data directly? Eg, it should need to
do a plugin callback to set the dam of an object, it could just set ob->dam?
That said, the plugin itself won't fix all the ills.
To do that, more radical changes are needed in the basic functions as is, and
that will break things.
For example, it was brought up the idea of meteor swarms and/or swimming.
Doing those in plugins don't really fix anything.
The basic problem here is that insert_ob_in_map() does a lot more than just
puts the object on the map and links it up. It checks for move_on/move_off
flags. It checks for merging. It checks if the object glows, and thus updates
lighting, checks to see if it blocks movement/line of sight.
It is those things which make a consistent behavior difficult (and also what
causes meteor swarm to slow down the server).
To be redesigned, insert_ob_in_map should just do only that. The functions
that call it should make the other checks (can we merge with something on this
space? should we check move_on status, etc). But making those type of changes
is likely to result in breakage in various places (insert_ob_in_map is called in
146 places for example). Although, perhaps at a first pass, a new flag like
INS_OBJ_ONLY_AND_DONT_DO_ANYTHING_ELSE could be added (ok, maybe a littler
shorter, but you get the point).
all that said, I do think it is fair to discuss other work to be done - if you
have limited resources, it makes sense to discuss where those resources go. Yet
at the same time, given this is a volunteer project, one can't really force
anyone to do anything.
More information about the crossfire
mailing list