Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2002:
[freeciv-ai] (PR#2477) Improved Auto-Explore
Home

[freeciv-ai] (PR#2477) Improved Auto-Explore

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: cameron@xxxxxxxxxx
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] (PR#2477) Improved Auto-Explore
From: "Guest via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 3 Dec 2002 09:20:54 -0800
Reply-to: rt@xxxxxxxxxxxxxx

[rfalke - Tue Dec  3 14:44:15 2002]:


> > +      map_get_terrain(x, y - 1) == T_OCEAN) ||
> > +     (y + 1 < map.ysize && map_get_known(x, y + 1, pplayer) &&
> > +      map_get_terrain(x, y + 1) == T_OCEAN)) {
> > +    /* we can tell by the border if there's land there. */
> 
> Please use adjc_iterate and DIR_IS_CARDINAL.

OK, done.

> > +    if(map_get_terrain(x,y) == T_OCEAN) {
> > +      return 0x80;
> > +    } else {
> > +      return 0;
> > +    }
> > +  }
> 
> It looks like you referring in this construct here to the kludge we
> use in the client to draw correctly the ocean squares.

Right. That information is available to the human player, so the
auto-explore should be permitted to use it too.

> > +          sum -= 4;
> > +        }
> > +      }
> > +    }
> > +  } square_iterate_end;
> 
> How did you calibrated these values? 64 + 4*4+4*2 = 88 and 64 -
> (4*4+4*2) = 40. Shouldn't these values be nearer 0 and 128?

Since cardinally adjacent tiles already give a guaranteed value, this
was wrong. Now I add or subtract 10% confidence for each diagonal tile
that is or isn't ocean.

> Can you scale them to 100 and call them percent?

Done. Together this means that if all diagonals are ocean, we return 90,
and if all are land, we return 10. Unknown gives 50.

> > +    /* relative value of staying near known ocean and land */
> > +    int klandscore = 2;
> > +    int koceanscore = 25;
> 
> What is k?

It was 'known', but I renamed it to that, so it's clearer now. Basically
we assign a certain benefit to exploring tiles we expect to be
ocean/land, and another benefit to staying close to tiles we know to be
ocean/land.

> Please make a set of values and then assign in if
> (sailing){...}else{...} the final values. This temp usage is just
> ugly.

Yeah, that was ugly. OK, now I have constants for the benefit of being
the same or different type of land (ocean or land), and assign these
benefits to land and water by looking at what unit type we are.

Attachment: explorer5.diff
Description: explorer5.diff


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