[Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution,
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief. |
From: |
"Marcelo Burda" <mburda@xxxxxxxxx> |
Date: |
Thu, 23 Sep 2004 14:44:09 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10201 >
Le jeu 23/09/2004 à 01:00, Mateusz Stefek a écrit :
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10201 >
>
> > [mburda - Wed Sep 22 15:37:10 2004]:
> This i getting really messy!
Generator code is not very simple.
> 1) It's quite hard to remember all places where heightmap, tmap, placed
> and characteristics should be created or freed.
? maybe you not understand the logic of it!
in latest code placed map is used very simplest way. this is creaated at
begin of any "main" methode and destroided at end.( make_rivers,
make_terrains, make_huts) exept for gen 2-4, but this was has to be
rewrited.
about other the logic is in 3 steps
1st step) load or create height_map
2d step) form height_map and colatitude create and initialize
characteristics.
(now height maps in no more needed)
3) from these (load)/created characteristics place best terrains, rivers
and spetials( not well done a this time, some terrains are placed one at
one others by littles groups,)
> Could you change them to local variables?
i can encapsulate height maps but this not change any, get_height() is
not more clear than height_map[].
> I imagine height map as a class with one public attribute:
> int* height_map
> and with methods:
> hmap_init
> hmap_free_data
> hmap_get_shore_level
> hmap_get_mountains_level
> hamp_normalize_poles
> hmap_renormalize_poles
> hmap_make_random_hmap
> hmap_make_pseudofractal1_map
>
yep.
> The same with other maps.
?
For Characteristics there is a inizialize set of methodes.(to be called
in this order (exept for generator 2-4)
create_characteristics();
characteristics_initialize_shores();
characteristics_initialize_extra_polar_land();
characteristics_initialize_temperature(TRUE);
characteristics_initialize_relief();
characteristics_initialize_wetness(river_pct);
and 2 methode to ask
is_characteristic
count_characteristic_near
the characteristics_initialize_xxx can be hiddend in
create_characteristics() if wanted but i think more nice to see its,
spetially as characteristics_initialize_extra_polar_land() is a hack for
terrains set to be handled by mapgen.c.
and
characteristics_initialize_temperature(TRUE); is used by the old gen 2-4
code. what is still in mapgen.c and need to be called spetially.
You are right use characteristics in gen 2-4 is a mess!
> 2) Move functions into proper files
> For example: terrain_is_too_high should be in height_map
> probably renamed hmap_terrain_is_to_high
ok for renaming it, but this function is a helper function of relief
code, it is not general but part of initialize_relief then it as static
near this.
> 3) Why place terrain takes 3 characteristic_types? Can not it take their
> sum?
No this broken all logic. why do a sum!?!?!?!
> --
> mateusz
>
TODO tune these characteristic code and rewrite make_terrains in a
simplest way.
TODO rewrite or do a alternative for fair generators 2-4
after this 2 todo code will become very nice now this is a mess, i
think.
Marcelo
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief.,
Marcelo Burda <=
- [Freeciv-Dev] (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Mateusz Stefek, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Marcelo Burda, 2004/09/24
- [Freeciv-Dev] (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Marcelo Burda, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Mike Kaufman, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Marcelo Burda, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Per I. Mathisen, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Marcelo Burda, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Jason Short, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Marcelo Burda, 2004/09/24
- [Freeciv-Dev] Re: (PR#10201) PATCH: generator characteristics evolution, best handled temperature and relief., Marcelo Burda, 2004/09/24
|
|