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: Up next: facility_worth?


>I realized that the facility_worth is seriously deficient in its basic
>design. Some of the things that it needs to consider when looking at a
>facility are:

[snip]

>These considerations do not always overlap nicely, especially when
>weighing defense vs. production, and so I think that the facility_worth
>function needs to be split into at lease four functions for four
>different types of facilities:
>
>defensive_facility_worth (e.g. city walls)
>productive_facility_worth (e.g. factory or granary)
>growth_facility_worth (e.g. aqueduct)
>repair_facility_worth (e.g. barracks or Ring of Regeneration)

[snip]

>These changes would make it possible to re-write the "Improving" plan so
>that it could make an intelligent choice when trying to improve a unit.
>Would this be worth a try?

My long range plan for the AI is to move all building code to a new
PLAN_BUILD and consolidate it there. I think this would simplify things
enormously and solve many problems. For several reasons, I don't like the
current solution where cities are assigned offensive or defensive plans
etc. and then try to build accordingly. As for PLAN_IMPROVE, my original
intent was that it would deal with things like terrain improvement and
perhaps also tech development rather than with building.

That being said, we could definitely use a better facility_worth function.
I agree with your analysis of the problem. It is indeed difficult to
compare the relative worths of effects on growth, defense, production etc.
However, this comparison needs to be done somewhere, if not in
facility_worth, then in the AI build code. Several distinct facility worth
functions might be helpful, but only when supported in the build code. For
the time being, I think we should go for a single improved facility_worth
that considers at least the most important stuff. This would be (in order
of importance):

1. Growth of the unit.
2. Its defense.
3. Its production.
4. Everything else.

Crude weights could be assigned accordingly.

Because it is difficult to consider all possible facility properties in all
games, and since their usefulness may vary from game to game, I think there
is another solution that we should include, and that is for the game
designer to assign these numbers.

Accordingly, the function should start by checking if facility_worth(u)
already is set to a non-zero number. If it is, we just leave it alone. I
think in general that the game designer can make a much better guess as to
the usefulness of different facilities than any worth function that we
could come up with.

BTW, designer-assigned values is something we should support also in the
other worth functions. As it now stands, they will sometimes produce absurd
results, which could be manually adjusted this way. One example is the AI's
inclination to use nuclear missiles for exploration. This could be fixed by
also factoring the effective lifetime of a unit into the explorer worth.
However, there are many other examples like that.

Taking this one step further, I think that unit worth numbers also could be
assigned in a side-specific way, by making them part of the doctrines. That
way, we could tailor what kind of units different sides would prefer to
build.

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]