glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Nicowar questions


From: Bradley Arsenault
Subject: Re: [glob2-devel] Nicowar questions
Date: Wed, 4 Jan 2006 16:11:16 -0800

On 1/4/06, Stéphane Magnenat <address@hidden> wrote:
> Hi,
>
> We (dizz and I) have been playing vs Nicowar. We have noticed a strange
> thing: It looks like Nicowar does not use conversion any mroe. Worst, it does
> not seem to react when conversion is activated vs him.
>
> Steph
>
> --
> http://nct.ysagoon.com
>
>
> _______________________________________________
> glob2-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/glob2-devel
>

I've actually been thinking about how to put fruit handling into my
existing system for a while now. There are, of coarse, several ways to
"control" fruits. 1) You can build an inn right next to a fruit tree
(it must be next to it or the fruit tree will dissapear behind fog of
war.). 2) You can build a tower next to the fruit tree (a little less
restrictive since towers have a larger sight line). You can also 3)
put explorers onto the fruit trees, or 4) put guard zone around the
fruit trees so that warriors come and make sight on them when their
not being used. In my personall opponion, 1 & 2 are the best options,
however, 3 & 4 would be the easiest to implement in my current system.
I'll explain why (you can safely skip the next two paragraphs, they
are long):

Nicowars DistributedConstructionManager module (which constructs
buildings) uses a relational approach to choosing where to place a
building. It calls upon a grid poll, which polls the map, devided up
into square-sections of a fixed size, and it rates each section based
on a set of factors its looking for, for example, wood, wheat, hidden
zone, almost anything can be polled for and this polling process is
fairly fast (although unlike a gradient based aproach, its difficult
to distribute the calculation). It then sorts these sections, and
rates them reletive to their partners. So exactly how much wheat or
wood or whatever becomes irrelevant, only if a section has more of the
polled data than other sections. It then compiles a final list, using
the reletive scores of each section, and sorting them, so the final
list magically "accounts" for all of the desired factors equally.

This list of zones, sorted best to worst, is passed on to a function
that goes through each zone looking for prospect of placing a building
there. To do this, i've had it create an integer map, it applies 1 to
every square that you can't build on. In the special case that the
square in question is a building, it gets the largest size of the
building (so to take into account that some buildings get bigger at
the second or third upgrade level), and then fills the imap with ones
on this size, plus some padding (right now it applies one square of
padding, as set in the header file). After its created the imap, it
gets the largest size of the building that we are trying to build, and
looks throughout the imap to see if there is a section of 0's large
enough to fit the building. If there isn't, it tries the next best
zone on the zone list, and it caches the fact that the ai can't build
in this zone (as to save computation time). If it can build in this
zone, however, it looks to see if there are any other spots in the
zone that border on more 1's, so it will naturally cramp buildings
together rather than always building in the top corner of almost empty
zones. I find this algorithm, although long and expensive, works well
to build buildings where they work best.

If you haven't already picked it up (or have skipped the last two
paragraphs), I'll now explain why this system is not suitable for the
fruit trees. Like i've said, building inns or towers near fruit trees
is only effective if their placed right next to the fruit tree. My
current system uses more of "in the area of" or "near some of"
attitudes, rather then placing buildings right next to the resource
that they need most (typical of a human). So using my existing system
will not work. And as well, it would require new algorithms to decide
if its possible to construct a building on a specific square, or
adjacent to a particular resource. Although its possible, I've been
neglacting to do it for a while, it doesn't seem all that worth if for
just fruits.

   Bradley Arsenault




reply via email to

[Prev in Thread] Current Thread [Next in Thread]