Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: warmap patch and gotohand
Home

[Freeciv-Dev] Re: warmap patch and gotohand

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: warmap patch and gotohand
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Fri, 5 May 2000 15:10:16 +0200

On Fri, 05 May 2000, Nicolas BRUNEL wrote:
> > Well, thats the trick I guess. if you wanted to have a warmap of a
> > seaunit and a land unit at the same time, you would generate the warmap
> > for them one at a time. So you would
> > generate_warmap(seaunit)
> > generate_warmap((landunit)
> 
>    Yes, that's the trick. Eachtime, seacost and cost warmap are
> generated. I wanted in init_warmap, to init_warmap to initialize them both
> and withdraw the call of init_warmap from really_generate_warmap. The only
> problem was to initialize [orig_x][orig_y], I need to add extralines in 
> really_generate_warmap and find_shortest_path. I didn't succeed in making 
> init_warmap doing all the initialization of the warmap.
> 
>    May be it is possible to only clean the warmap. Each time a set of
> nodes if generated. Warmap.cost or seacost is modified only for the
> coordonates of node. Is it enough to reset the cost/seacost to 255 for the
> nodes in the stack ?
> 
> Bye,

Yes, I would think that would work. That would mean considerable less
nodes were reset for land maps, though I think so much of the seamap
would have to be reset that, given the libc must be fairly efficient, it
would probably take longer to run through the stack, than memset'ing.

Have you checked how big a part of the total time of a goto/warmap
generation memset takes? If it is only a small fraction I think we should
leave it as it is and don't introduce new possible errors

-Thue



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