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: One colonizing improvement down...


>I just eliminated the need for a global "ai-advanced-unit-separation"
>variable by allowing the colonizer plan to decide if it's too close by
>considering its distance from the other advanced unit(s).
>
>However, I couldn't figure out how the colonizer decides what to build,
>and so couldn't factor that in.  I did manage a workaround, however, by
>making the desired separation equal to twice the reach of the other unit
>in question.  It really should be the sum of the two unit's reaches.  So
>which variable stores the unit to be built, and in which function does
>it reside?  Will I have to re-prototype the good_cell_to_colonize
>function so that it receives the unit to be built as an argument?

u2 = unit->plan->maingoal->args[0]

gives you the unit type to be built. If you want to hack
good_cell_to_colonize to take that into consideration, you must pass a
pointer to the colonizer (*unit) in its args. The current version of the
function is an attempt to generalize the question about what is a good cell
to colonize, with no specific reference to the unit being built. The reason
for this is that I was planning for the ability to upgrade advanced units
(village->town->city) when I wrote the code. It then makes sense to
consider all possible advanced unit types (which good_cell_to_colonize
does) and not just the one built initially.

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]