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: Kind-of, sort-of improved facility_worth function


>I have completed a (hopefully) better facility_worth function that can
>consider what the facilities do when deciding how valuable they are.
>This function looks at the facility's defensive abilities (for city
>walls), production abilities (for granary, factory), growth abilities
>(for aqueduct, sewer system), and repair abilities (for barracks).
>However, the balance between the different types of facilities is
>haphazard at best, and if it is to work well at all, it really should be
>split into several functions, one for each type of facility.  That would
>require plan_improve to be re-written, but unless doing so would
>interfere with anyone's long-term plans, I think that it should be
>re-written.

This looks fine. Obviously, it has to be tested with different games. But I
suppose you are already doing that.

One thing I noticed about production is that you only consider
um_occ_mult_production. There is also um_occ_add_production. Moreover, we
have uu_occ_add_maxcells and uu_occ_mult_maxcells which allows the unit to
use more cells than its size number. These are perhaps even more valuable.

When it comes to the build code, I certainly agree that we can improve how
it handles facilities. However, first it must be simplified and unified. As
I mentioned in an earlier mail, plan_improve isn't used for building by
advanced units; they use auto_pick_new_build_task instead. And for
non-advanced units, PLAN_IMPROVING is completely meaningless with respect
to building - it is only used for material collection and tech development
in the "time" game. So enabling (or improving) the facility building code
that I wrote once in plan_improve won't make a difference as long as there
is no code in mplayer_decide_plan or elsewhere that analyzes the tactical
situation, decides that it is time for this particular unit to build
facilites rather than defenders or whatever, and sets PLAN_IMPROVING
accordingly. Something similar to what auto_pick_new_plan does in the
advanced unit build code. If I remember correctly, this is why the facility
building code in plan_improve was commented out. It serves no purpose
without support elsewhere in the ai.

Right now, u_facility_worth (and facility building in general) is supported
only for advanced (acp-independent) units. So this is where you should test
your new function. I am sure it would make a significant difference in
those games.

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]