Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2002:
[freeciv-ai] Re: [Freeciv-Dev] autoattack
Home

[freeciv-ai] Re: [Freeciv-Dev] autoattack

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: Freeciv AI development <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: [Freeciv-Dev] autoattack
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Mon, 2 Sep 2002 17:24:29 +0100 (BST)

On Mon, 2 Sep 2002, Per I. Mathisen wrote:

> On Mon, 2 Sep 2002, Gregory Berkolaiko wrote:
> > It's crap, yeah and AI doesn't use it but it should and it could be made
> > better when we have path finding (and it wouldn't be a CPU killer then).
> 
> It already uses path finding.

I mean proper path-finding with sensible horizon.

> > Now speaking about the AI, I think there should be two major attack modes,
> > invasion and autoattack (preventive defence).Idiotic junk like f_s_t_k
> > and k_s_w should die instead.
> 
> I agree.
> 
> Take a look at this patch. It cleans up the military attack function and
> introduces a new one, ai_military_rampage(), which wraps findvictim.
> Previously, a lot of code didn't loop findvictim, so that they would only
> attack one adjacent unit. Now this happens automatically. We could improve
> this further, to make it use path finding to do ranged attacks as well
> (max range: as far as we can move, this is a one turn horizon function).

I especially like this:

-  int id;
+  int id = punit->id;

-  id = punit->id;
+  assert(punit);

:)))

Anyway, it seems to make sense.  It will probably break a lot of things 
but then we hunt em down.

> Then fstk can be replaced by code which only cares about invasions - doing
> them and dealing with them.

Yep.

G.




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