Summary: Problems in server/generator/mapgen.c: Part 3, start
Submitted by: mss_8734
Submitted on: Sun May 19 17:34:57 2013
Severity: 3 - Normal
Priority: 5 - Normal
Assigned to: None
Discussion Lock: Any
Operating System: Any
First, the start position data one has to supply make_island() with is not
used for anything but a check that it is >= 0.
Second, there is no other way to pass any start position data except the
desired distribution method to create_start_positions; one cannot supply any
information about on which islands one wants start positions.
One can sort of overcome this by calling create_start_positions() in between
creating the islands on which one wants start positions and creating the rest,
but there is no guarantee that the right amount are placed on the different
This brings me to a couple of problems in server/generator/startpos.c:
Third, create_start_positions will change distribution method internally if it
thinks the supplied islands are the wrong number or have the wrong terrain and
still return true. This cannot be tracked by the generator which called it
without searching for the information in the log (one can make an educated
guess by keeping a list of intentions and comparing to the resulting map, but
that cannot be considered completely reliable), although a roundabout way to
affect the outcome would be to temporarily fill every tile that can have them
on islands intented for start positions with resources to make them valuable
enough; I fear without trying, however, that this would instead make them
considered good enough for more players than intended for any distribution
method other than single and all, at least as long as they are considered
Back in mapgen.c, map_fractal_generate (which is normally the only one to
call create_start_positions, once the map is otherwise finished) then uses its
own switch to try different distribution methods if the first one it tried
fails. I have no idea what the intention behind this double change is...
Fourth, create_start_positions does a qsort on its island list, so even the
roundabout way of looking at the (quite sparse, although this, at least, is
easy enough to change without risk of breaking anything) log output does not
really help much in tracking what goes where.
I can solve most, perhaps even all, of this by writing some cloned functions
to bypass the offending ones for the generator I am working on (and generic
enough to be useable by other generators - I have two more in mind myself). On
the one hand random heaps of parallel code tend to make programmes rather
bloated, but on the other hand, if I produce something functional without
mucking about in and breaking existing code someone involved in maintaining
(or perhaps even creating) the current map generators might be able to merge
those heaps into something better.
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list