Menu

#1094 Region exploration - region definition during map generation

Fixed_0.8.0
closed
nobody
5
2013-01-16
2008-09-25
abartels
No

NOTE: Savegame attached to
http://sourceforge.net/tracker/index.php?func=detail&aid=2128166&group_id=43225&atid=435578

2. Inconsistent land region definition
--
Viewing the already explored land, you will see that parts of the same landmass belong to either "model.region.land1" and "Maryland".

When opening the savegame in the editor, you will additionally find, up in the north, an island that is part "model.region.land1", part "Maryland" and part "Unknown Region"

2.a) When land regions are defined (during map generation, I guess), each separate landmass should belong to a separate region. An exception might be tiny (less than 5-6 tiles, perhaps?) islands separated by just one ocean square from the main land. A region should not be spread across several big islands.

2.b) One of these initial regions might be split in one or more if it would otherwise be too big.
For example, in the savegame, I'd expect a region border to be located somewhere along the lines of "Aztec River" and "Unknown River" in the north of that. This would mean that the peninsula the player started on would be its own region.
Furthermore, I'd certainly expect the landmass south of the players starting position to be named differently from the starting position itself.

Discussion

  • Kulko

    Kulko - 2008-09-25

    Looking at the current code, this seems to me more of a feature request. Right now the division is done purely geometrically by dividing the into rectangles. And then deciding if a tile is land or sea.

    That leads of course to some funny behaviours, Although setting arbiotrary straight lines as the border between regions seems to be a perfectly normal behaviour for the colonial conquest.

    But there are a few more things I find strange:

    - You can find an inland lake called pacific ocean and score the points.
    - In the orginal Americas Map I am quite sure the Pacific would have started on the east coast of mexico when this scheme would have been used.
    - Why are north and south Pacific not discoverable. In reality millions of pounds have been wasted on finding the north west passage.

    A new feature could look as follows:

    Ocean regions:
    Start at x points at the map edges and use a flood fill algorithm which is stopped by land tiles, or by the borders of the predefined rectangles. (x=6 or could be adjusted to have more regions in larger Maps if the naming problem can be solved.) Any ocean started from the western edge is a pacific region. Any ocean starting fromm the eastern edge is a atlantic ocean.

    Any water which is enclosed by land is its own lake region.

    Any water not yet part of a region is an inland sea (like the carribean). Start an random point floodfill all unregioned ocean tiles. If the size is smaller then a certain minimum continue to floodfill at the expense of existing ocean regions until minimum size is reached.

    Land regions:
    Define three variables either fixed or in relation to the total land size: (MIN_ISLAND_SIZE,MAX_ISLAND_SIZE,IDEAL_REGION_SIZE)

    Calculate islands.
    Define river regions and substract from island size.

    If island is smaller then MIN_ISLAND_SIZE (5) it will be later added to the nearest region.
    If Island is smaller then MAX_ISLAND_SIZE then the whole island is an island region.
    If the Island is larger than MAX_ISLAND_SIZE, its a continent and will have multiple regions.
    Define x random start points, where x is islandSize/IDEAL_REGION_SIZE.
    Floodfill the continent, from all points parallel, stopping at oceans, and other regions.
    If we define rivers first, they will slow the growth of regions so you will get an even more realistic feeling to the region form.
    If any resulting region is smaller than MIN_ISLAND_SIZE repeat with three new random points. If you rerolled lots times just leave it as it is.

    Add the small islands now to the nearest region (tiebreaker is smaller region)

    Discovery rules:
    Any pacific region is discoverable. If it is directly connected to the atlantic it gets 20 points, otherwise 60.
    Any lake is discoverable, nameable and worth its size in points.
    Any inland sea is discoverable, nameable and worth 10 points.
    Any land region is discoverable, nameable and worth 10 points.
    Any river is discoverable as before and is worth twice is size (if I understood the code correctly.)

     
  • abartels

    abartels - 2008-09-25

    Uhm, yes, looking at it separately from the other "issues", this definitely is a feature request. Can someone move it? :)

    Anyway, the suggestion sounds good. Add mountain ranges at the point where rivers are defined, too, and regions should look even better.

     
  • abartels

    abartels - 2008-09-27

    http://sourceforge.net/tracker2/?func=detail&aid=2130049&group_id=43225&atid=435580

    This is a patch that rearranges "TerrainGenerator.java" a bit, supposed to result in no changes to the maps created by this generator.

    Benefit of this is a separation of functions to create "ocean" and "land" (minus mountain ranges, rivers anc arctic/antarctic) regions.

     
  • abartels

    abartels - 2008-10-05

    Fixed in trunk, Revision 4428.

     
  • abartels

    abartels - 2008-10-05
    • milestone: 859987 --> Fixed_(FreeCol_0.8.0)
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB