Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2003:
[freeciv-ai] New settler code v8

[freeciv-ai] New settler code v8

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv AI development <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] New settler code v8
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Fri, 16 May 2003 12:11:58 +0000 (GMT)

On Wed, 14 May 2003, Gregory Berkolaiko wrote:
> > Yep. I split it up for readability only...
> Now it's cleaner, but still some cruft remains:

Ok, I moved/merged this around.

> Also, there is no need to initialize all result->other fields.

Doesn't hurt.

> Besides, the present code will dump core when there are no tiles available
> for the "other tile".

Good catch.

> I would actually use the true exponential ;)
> something along the lines
> = amortize(, ai->perfection * turns);

Tried this. Had to adjust some variables to fit, but turned out ok.

The even newer results:
Quick view:1  2  3  4  5
HARD      66 72 82 55 66 turns
EXP       51 47 56 49 46 turns
EXP v2    48 48 48 50 40 turns
EXP v3    51 54 50 49 41 turns

Hard to say exactly what causes these variations.

> Also (especailly on big maps), old code looks at most 13 tiles away.
> Path-finding does the whole map. Early termination is your
> responsibility!

I tried this. Shaved 1/4 off the time it took to complete the autogame.

Other changes:
  - Now check that we don't send two settlers to the found cities within
city_min_dist radius of each other.
  - Cancel a city founding mission if suddenly goto no longer is sane or
we no longer can build a city at our target site.
  - No longer penalise city center and other for crowding (I think this is
right, but it has both pros and cons). Also different crowding penalty.

That'll be my last patch this month. Now it's exam time...

  - Per

Attachment: newsettler8.diff
Description: Text document

Attachment: citymap.h
Description: Text document

Attachment: citymap.c
Description: Text document

Attachment: aisettler.h
Description: Text document

Attachment: aisettler.c
Description: Text document

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