Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2003:
[freeciv-ai] (PR#4137) Auto-Explore with new path-finding
Home

[freeciv-ai] (PR#4137) Auto-Explore with new path-finding

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [freeciv-ai] (PR#4137) Auto-Explore with new path-finding
From: "Cameron Morland" <cameron@xxxxxxxxxx>
Date: Sat, 3 May 2003 18:28:33 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[glip - Sat May  3 20:16:47 2003]:
> 1. It took me awhile to remember why you multiply by 100 in
> BEST_NORMAL_TILE.  A comment would be helpful here ("TER_SCORE is
> given
> per 1% of certainty about the terrain").

Done.

> 2. Same place, I think
> #define BEST_NORMAL_TILE  \
>  (100 * MAX_NEW_TILES * DIFF_TER_SCORE +\
>   100 * (VISION_TILES-MAX_NEW_TILES) * KNOWN_DIFF_TER_SCORE)
>                      ^^^^^^^^^^^^^^^

<Grind, grind, grind>. Right.

> 3. A bad thing about these defines is that they are not constants:
> they
> depend on vision_range.  I don't know what to do about it though...
> Maybe
> set vision_range to 1 ?

It should be much faster that way; I made it clear in the comments what
it "should" be, in case we want to make vision_range > 1 be much more
common at some point in the future.

> 4. Remove the TODO in the comment ;)

Done.

> 5. put the #include together with other includes, at the top of the
> files.
> Raimar wrote something about ordering includes too...

Done.

> 6. To do the early breaking, you multiply the BEST_POSSIBLE_SCORE by
> the
> dist factor.  Which means you do a pow every step.  I would instead
> calculate the furthest dist we are prepared to go each time we update
> most_desireable.  That would be logarithm.
> 
> 7. What is this check doing there?
> +    if (punit->moves_left == 0) {
> +      /* We can't move on anymore. */
> +      return TRUE;
> +    }
> +  } simple_unit_path_iterator_end;

Nothing at all, it'll never be true. It's left over from some of the
code I copied & pasted.
 
> 8. Please put a TODO "read the path off the map we made".
> +    /* Go there! */
> +    if (!ai_unit_goto(punit, best_x, best_y)) {
> +      return FALSE;
> +    }

Done.

> Some comments on PF use:
> 
> 9. The PF should respect ZoC and avoid unknown using a proper TB-
> callback.
> It might also want to try to walk _past_ unknown, so a nice EC-
> callback
> can be used here.
> 
> If you are unsure of the PF and how to use it, I will do the PF-
> related
> changes.

I don't really understand the PF code; you're welcome to do it if you
like. It would be best to rank paths instead of tiles; most of the
pre-existing scoring code should probably be reusable.

Attachment: pf_explorer2.diff
Description: pf_explorer2.diff


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