Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: autosettler patch (was: Multiple patches)
Home

[Freeciv-Dev] Re: autosettler patch (was: Multiple patches)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Robert Rendell <rob@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: autosettler patch (was: Multiple patches)
From: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Date: Tue, 30 May 2000 07:39:49 -0400

At 2000/05/30 03:16 , Robert Rendell wrote:
>Jeff Mallatt wrote:
>} 
>} As far as cleaning-up, if we want to get rid of cut-and-paste code (a good
>} idea, I agree), let's *really* get rid of it.  I've attached an updated
>} patch that does this.
>
>Does this patch preserve the semantics from the original
>auto_settler_findwork()?  You've got one function,
>consider_settler_action(), which tests if newv is >= 0.  In the original,
>newv was compared with oldv rather than 0 in the first few tests (where
>extra is -1 in your patch) ... this was why I had two functions,
>consider_settler_action() and consider_settler_action_threshold().
>
>If you wanted to have it exactly the same (aside from the 'in_use' change),
>perhaps something like this would be worthwhile:
>
>consider_settler_action(...)
>{
>    int a, b=0;
>    int consider;
>
>    if (extra >= 0)
>       consider = (newv >= 0);
>    else
>       consider = (newv >= oldv);
>    if (consider) {
>    ...

Caught me!  I meant to do something like this, but it got lost during
implementation -- my mistake :(

Thanks for looking closely at this!!  :)

I've fixed this, and I'll post a patch in a little while.

>Do people ever test changes to the AI against itself, hacking the server so
>that one AI uses the new strategy and the other(s) use the old, and trying
>a few all-AI games?  I guess that would be an ideal use for client-side
>AIs, but it would be do-able in the server as a temporary playtesting
>measure.

I never have, but it's a good idea.

So good, that I had to try it.  Using a favorite regression-test save game
(saved in 4000 BC), I hacked the code so only one of the weaker civs used
the new algorithm.  Oops!  He died _sooner_ than normal.  I want to run
more tests, but may come to the conclusion that 64:32 will be better than
96:48 or 128:64.

jjm




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