This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: check_extract_action


>I think the check_extract_action should be changed from (with varible
>names changed :-) ):

I think what you propose both for the check_extract_action and
do_extract_action is logical. However, have you checked what the extraction
code actually is used for? That's the first thing I do before I start to
hack some part of xconq. The best way to do that is to search the lib files
to see what games use the feature and for what.

I just did a search for "acp-to-extract" since I was not sure what this
code is being used for. It turns out that only one game in the whole
library uses the extraction code: an experimental module called ancient.g.
The game is quite different from most other xconq modules. It's hard to
tell how it's supposed to work since the game is not yet playable, but I
think it's an attempt to emulate Age of Empires. These independent units
that you can extract (I thought this was really weird, which is why I
started to look into the whole thing) are berry bushes that you send out
your villagers to harvest, just as in AoE. That this stuff is still
experimental is evident from the fact that the word "villager" is
hard-coded into the ai code for extraction (need_this_type_to_collect in
ai.c).

So what can we learn from this? The good news is that since this code is
not used in a working game you are free to modify it as you wish. The bad
news is that since this code is not used in a working game  there is no way
to test your modifications. Unless, of course, you are willing to complete
ancient.g. Which may not be such a bad idea :-). As I pointed out a few
weeks ago, kernel hacking and game writing go hand in hand. You hack the
kernel because you need a new feature in the game that you are writing.

One thing more that you may want to check is how the ai code deals with
extraction. How will it react if a partial extraction is executed, as you
suggest, which returns less than the amount desired? Is the ai code smart
enough to realize that less will need to be extracted next turn? Or will it
just continue forever trying to extract the full amount, and failing each
time? (BTW, the ai code for handling berry bushes seems to be this
non-building PLAN_IMPROVING that Lincoln and I were discussing a few days
ago).

Anyway, I have one comment on the extraction code. I think you may want to
use the for_all_stack_with_occs macro instead of just for_all_stack. Berry
bushes are of course unlikely to have occupants (except for aphids), but
consider the case of an city containing a granary!

Hans

Hans Ronne

hronne@pp.sbbs.se



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]