Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patc
Home

[Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patc

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch)
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Wed, 10 Oct 2001 01:03:41 -0400

At 06:29 PM 01/10/09 +0100, Gregory Berkolaiko wrote:
> --- "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx> wrote: 
>> At 05:44 PM 01/10/05 +0100, Gregory Berkolaiko wrote:
>FYI I suspect assess_defence_quadratic and assess_defence_backend are
>doing the same thing.  and there is absolutely no need to compute the
>square root in assess_defence_quadratic, it's all getting squared anyway.

Actually they give slightly different results. One is a sum of squares
and the other a quadratic, i.e. with all the cross elements. You need
the square root part for each element of the sum before squaring.

Look really carefully at the order of things/indents in the two routines.

I suspect they are both doing very little in a complicated way and there
are much better ways to capture the intended "weighting". But in general
I wouldn't touch things like that until one gets to the point of 
understanding that can fix it correctly or replace it completely. The
commented rationale may have no relationaship to why this really fixed
the subtle weight balancing problem that lead to it :-).

You might look at the settler city_desireability() code to see where
excessive complexity and detail WAS dropped/fixed in the final city size
loop. There is still a lot of code there that wasn't really changed
though, as one weight is usually as good as another for most of the
purposes it gets put to.

If you compile with debug and run with --debug 4 teeing the output to
a file, you will see some very interesting stats on what the AI is
actually doing. The settler stuff is pretty verbose, but the various
other stats might help you understand what the AI is actually doing.
Note, I commented out most of the FOW stuff to reduce pure noise.

make distclean
sh configure --enable-debug
make
server/civserver -r myRules.serv --debug 4 2>&1 | tee filldisk.out

>well, with some cooperation from Raimar I believe we can manage it.
>It won't be too fast, but we are in no hurry I hope.

There is a lot of latitude between "too much of a hurry" and 
"stagnation". Hopefully a reasonable balance might one day come 
about.

>BTW, do you have any idea what the comment
>
>/* If we have a passenger abord a ship we must be sure he can disembark
>This shouldn't be neccesary, as ZOC does not have an effect for        sea-land
>movement, but some code in aiunit.c assumes the goto work like this, so
>I will leave it for now */
>
>is be referring to?  The cargo code in find_the_shortest path is
>seriously broken but to fix it I need to know what is it expected to
>do...

The short answer is no.

My guess is that the issue is the ZOC code that blocks you from moving
into or through the sea squares surrounding a unit. It may force you 
to wake up and stop prematurely by avoiding certain squares, or cause 
some problem with the landing where again ZOC doesn't matter. By dumping 
the offending "pcargo" units overboard only the transport gets considered
in whatever it is about to execute.

>Best,
>G.
>
>____________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
>or your free @yahoo.ie address at http://mail.yahoo.ie




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