Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] (PR#4034) External Map Generator
Home

[Freeciv-Dev] (PR#4034) External Map Generator

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#4034) External Map Generator
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sat, 19 Apr 2003 11:13:29 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Creating a ticket for the subject.

Here is a digest of relevant info.

Raimar Falke wrote:
=======================================================================
Pluggable map generators: what interface to choose? Possible
are:
 - compiled in (server/mapgen_tectonic.)
 - loaded at runtime (mapgen_tectonic.so)
 - seperate executable (mapget_tectonic)

The first one is easiest but not really pluggable since you have patch
the code. The second one is not much better in this respect. The last
one is nice but you now have interface problems. How it gets the
parameters (size, players, ...) and how is the data returned? It
should not be required that binary needs to like some freeciv code to
read the parameters and write the generated map. This way you can also
code the generator in perl, python or java. I think an easy format
based on common/registry would be nice. For both input and output.
======================================================================

Ross Wetmore has a patch (actually 2, attached) to essentially implement 
the third approach.  

Here is what he writes:
======================================================================
There were two versions, dif_00 contains the code to do a full
reread of the savegame which I never really got to work as the
game load is embedded and not really modular. But one could
presumably change it to longjmp back up to the start once it
had a savegame to read, if working through the details got too
cumbersome. Reading the full game in means you could use this
as a game selector as well as just a map generator.

The second dif_01 just reads in the new map generation stuff.
There are potential sanity checks that should be done here to
make sure the map read back corresponds to the right game. It
works fine using the standalone mapgenerator that was also in
the drop.
========================================================================

Information exchange with the external generator is done via savegame
(every savegame contains all generator parameters and the map).  While
this I think is the most elegant and easy-to-implement approach, it makes
actually writing the external generators a hard task.

Ross has an answer to this too, as he possesses an example of such 
external map generator.  Unfortunately, I seem to have lost some necessary 
parts of this example.  Ross, can you resend the whole thing again, 
please, this time to RT, so that it doesn't depend on the irresponsible 
members of the community like myself.

Judging by what I still have, though, it seems that Ross' code is much 
ahead of the rest of Freeciv, as it seems to handle general topology.

G.

Attachment: mapgen.zip
Description: mapgen.zip


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