Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: Safe paths for triremes etc. (PR#1007)
Home

[Freeciv-Dev] Re: Safe paths for triremes etc. (PR#1007)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Safe paths for triremes etc. (PR#1007)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Sat, 17 Nov 2001 16:33:05 +0000 (GMT)

 --- Raahul Kumar <raahul_da_man@xxxxxxxxx> wrote: > 
> --- Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> wrote:
> 
> > this is correct thinking.
> > it should be done (as part of palyer_ai struct, for example)
> > the only thing is that if not allowed to see under fog, AI will play
> even
> > weaker...
> > but this is a completely different project and if you want to do it I
> > will give you all possible assistance (like checking and testing and
> > discussing).
> >
> 
> Not a chance! It's far too much work, of the most boring kind, tracking
> down various places in the warmap where the AI ignores fog-of-war. I am

True, true.  But, if done step by step, it can be more interesting ;)
1. introduce the variable ai_sees_all
2. then people who are changing goto code (like me) can add the
corresponding checks.

> currently on another project though where I could use some help. It's
> to do with movement code, I'm going to replace movecosts of 3 with 30.
> Same for all other movement costs, multiply by 10. 

Oh, you are going to run into all sorts of trouble ;)
But presumably you want to make it possible for railroad to take 1/10 of
a move point.  A worthy cause I must say.

> > this is not generating, it's cleaning up before generating.
> > it should not be neccessary, if for some reason it causes weird
> > behaviour, it is a bug.  I remember checking it by comparing
> savegames
> > for autogames, they were identical. 
> > 
> 
> No I am not disagreeing with the change. I was just wondering why it
> was there
> in the first place. 

Something historical I presume.  Goes back beyond 1.7.2
In these times people believed in variable names like a,b,c,d...

> Nicely done. One small step for the AI, a giant leap for the warmap
> code. 

If warmap code leaps further than others it's because it is standing on
the shoulders of giants.

> -    if (warmap.warunit == punit && !warmap.cost[punit->x][punit->y])
> +    /* If the previous warmap was for the same unit and it's still 
> +     * correct (warmap.cost[x][y] == 0), reuse it. */
> +    if (warmap.warunit == punit && 
> +     (is_sailing_unit(punit) ? !warmap.seacost[punit->x][punit->y] :
> +      !warmap.cost[punit->x][punit->y]))
>        return;
>        
> Air units are missing.  So far this code only seems to deal with
> land and sea. I think that air units have no use for the city warmap.
> In fact, I'm not sure that sea units have much use for it either.
> The city warmap seems to be useful only for land units.

No warmaps for air units.  It is extremely difficult to do warmap with
refueling points: if a fighter can reach a point (x,y) in 1st turn with 1
move left or in 2nd turn with 6 moves left, which one would you record
down in the warmap? 

>  if (ptile->special&S_ROAD) d[k] += 10; /* in case we change directions
> */
>        if (ptile->special&S_RAILROAD) d[k] += 10; /* next turn, roads
> are nice
> */
>  
>  What do you think of instead
>  
>  if ((ptile->special&S_ROAD) || (ptile->special&S_RAILROAD)) d[k] +=
> 10;

I think it is good.  But it is in find_a_direction....

Thanks for your time,
G.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and 
Music Charts
http://uk.my.yahoo.com


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