Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: Cleaning up gotohand.c
Home

[Freeciv-Dev] Re: Cleaning up gotohand.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Cleaning up gotohand.c
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Sep 2001 09:27:06 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Sep 18, 2001 at 10:49:39PM +0100, Gregory Berkolaiko wrote:
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > On Tue, Sep 18, 2001 at 01:28:41PM +0100, Gregory Berkolaiko wrote:
> > > 
> > >   warmap_initialize(...);
> > >   while (warmap_next_position(&x, &y)) {
> > >     ...
> > >     if (evaluate_position(x,y)) 
> > >       warmap_process_position(x,y);
> > >     if (found_someplace_to_go(x,y))
> > >       break;
> > >   }
> > 
> > Can you describe what the methods in your small sample do? Especially
> > warmap_next_position.
> 
> Very briefly (since I do not have the methods yet):
> warmap_next_position(&x, &y) returns locations in order of increasing
> distance from origin.  it's a wraper for get_from_queue actually.

I don't feel good to open such "internal" behavior/data structure. To
me it looks like you have no plan what you in the surrounding
code. What is a certain tile is better even it is more far away?

If I look at the structe of the SMA it is more like:
 - generate warmap
 - for every position reachable
   - compute a score/fitness based in the distance and the tile at the
     target position
 - choose best target position

> evaluate_position is whatever you wish to put there (like
> is_coastline(x,y) -- useful for triremes)
> found_someplace_to_go(x,y) is the same.
> 
> warmap_process_position(x,y) does the main thing of the warmap
> generation: looks around x,y for places to go next, stuffs them into the
> queue etc.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "That's fundamental game play!  My main enemy is *ALWAYS* fighting 
  a 4-front war.  I make sure of it!"
    -- Tony Stuckey, freeciv-dev


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