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: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>, Raahul Kumar <raahul_da_man@xxxxxxxxx>, "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Safe paths for triremes etc. (PR#1007)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Thu, 15 Nov 2001 17:42:35 +0000 (GMT)

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

Attachment: warmap7_part1v1.diff
Description: warmap7_part1v1.diff


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