Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)
Home

[Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Sun, 25 Nov 2001 21:02:29 -0500

I looked this over and didn't see any problems with it. It is pretty
straightforward cleanup with not that much potential impact.

I suggest one close ones eyes and just go with it without too much
more soul searching :-).

Cheers,
RossW
=====

At 04:12 PM 01/11/24 +0000, Gregory Berkolaiko wrote:
>I recieved favourable comments from 2 people but still no CVS inclusion
>on the horizon...  I do need this patch in to proceed with warmap
>generation split.  If there are objections please state them, if no
>objectictions, please put it in.
>
>Best,
>G.
>
>>  --- Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> wrote: 
>> > Old subject: Safe paths for triremes.
>> > 
>> > Since there were no signs that the management of the CVS is going to
>> > put
>> > my patch in immediately, I decided to update it, in the meantime. 
>> The
>> > changes from the previous patch: 
>> > 
>> > * in two places in really_generate_warmap and find_the_shortest_path
>> it
>> > is no longer assumed that RAILROAD cost is zero.  The resulting
>> > statement
>> > is ugly due to the legacy from long ago: any IGTER move costs
>> > SINGLE_MOVE
>> > on the warmap, not MOVE_COST_ROAD as it should.  I haven't got the
>> > courage to challenge this legacy yet.
>> > * Extensive variable renaming in find_a_direction.  I do really hope
>> > that
>> > it makes the code clearer although in some places it is completely
>> over
>> > my head.  Added some comments too, where I know what to say.
>> > 
>> > ! Neither of the changes affects the program flow !
>> > 
>> > The old parts of the patch are described below:
>> > 
>> >
>>
>========================================================================
>> > 
>> > As was requested about a month ago, I am splitting my warmap patch
>> into
>> > a
>> > series of smaller patches.
>> > 
>> > The first part is mostly cleanup.
>> > Below is the list of features (unfortunately there is no way to
>> comment
>> > the patch in the patch itself):
>> > 
>> > File gotohand.c:
>> > In really_generate_warmap: 
>> > * removed some comments referring to the code which is not there for
>> > years  
>> > * added some comments (editor, feel free to cut my comments short)
>> > * removed "silence compiler warning" line because there is no
>> compiler
>> > warning anymore
>> > In generate_warmap:
>> > * comments
>> > * fixed buggy check
>> >   if (warmap.warunit == punit && !warmap.cost[punit->x][punit->y])
>> > * removed initializations that do not affect anything
>> > In dir_ok:
>> > * removed dir_ok (sorry guys)
>> > In goto_zoc_ok:
>> > * as was proposed in the comment, changed the code to take into
>> account
>> > where we _really_ came from, not to guess the direction from dir_ok
>> > * changed the comment accordingly
>> > In find_a_direction:
>> > * the previous handling of trireme was pathetic.  changed it to use
>> > is_coast_seen.  NB: it does not mean that triremes are safe: if
>> > find_a_direction is given an unsafe destination it is unlikely to
>> help.
>> > =====================
>> > General remark: 
>> > AI goto has 3 levels
>> > 1. Find a destination -- generate_warmap
>> >    takes into account terrain only
>> > 2. Find routes to destination -- find_the_shortest_path
>> >    takes into account some info about enemy and ZOC
>> > 3. Choose between the routes -- find_a_direction
>> >    final level of detalisation.
>> > =====================
>> > In other places:
>> > * general cleanup of magic numbers
>> > * definition of is_coast_seen
>> > 
>> > Waiting for your comments,
>> > 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
>> > 
>> >  
>> 
>> __________________________________________________
>> 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
>
>> ATTACHMENT part 2 application/x-unknown name=warmap7_part1v2.diff
> 
>
>__________________________________________________
>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]