Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9956) PATCH new rand_map_pos_condition tool for mapgen
Home

[Freeciv-Dev] (PR#9956) PATCH new rand_map_pos_condition tool for mapgen

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#9956) PATCH new rand_map_pos_condition tool for mapgen code
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Mon, 6 Sep 2004 04:15:24 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9956 >

> [mburda - Sun Sep 05 18:16:19 2004]:
> 
> The rand_map_pos_temperature is rm and a new rand_map_pos_condition is
> create
> new code search randomly pos with some good defined conditions, no
> numericals parameters!
> 
> the conditions are coded in a naive form, laters others patch will
> modifi it.
> 
> there are from 3 types, temperature, wetness and miscelaneous, later a
> condtions relief can be added
> 
> Some clean ups,indendts, assert and comments fix was included. specially
> remove_placed_map was renamed destroy_placed_map. this is not related to
> the rand_map_pos_condition code, but is ok i think.
> 
> Marcelo
> 

First of all, the word "condition" is to general. I would expect that
rand_map_pos_filtered() does the same thing as rand_map_pos_condition().

The second problem is speed. Conditions like:
((hmap((x), (y)) - hmap_shore_level) * 100 \
              <2 * map.swampsize * (hmap_mountain_level -  hmap_shore_level))
can be evaluated million times. Why don't you use integers like
min_height and max_height in rand_map_pos_condition? I know that you are
trying to avoid using constants in generator, but in this case the
integers can be evalauated by the callers of rand_map_pos_condition.

And some style issue:
please write:
if (x)
not:
if(x)
--
mateusz


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