diff -u -r freeciv-old/common/map.h freeciv/common/map.h --- freeciv-old/common/map.h Sat Jan 30 12:32:50 1999 +++ freeciv/common/map.h Sat Feb 6 09:53:31 1999 @@ -170,9 +170,9 @@ #define MAP_MIN_MOUNTAINS 10 #define MAP_MAX_MOUNTAINS 100 -#define MAP_DEFAULT_HUTS 50 +#define MAP_DEFAULT_HUTS 25 #define MAP_MIN_HUTS 0 -#define MAP_MAX_HUTS 500 +#define MAP_MAX_HUTS 250 #define MAP_DEFAULT_WIDTH 80 #define MAP_MIN_WIDTH 40 diff -u -r freeciv-old/server/mapgen.c freeciv/server/mapgen.c --- freeciv-old/server/mapgen.c Sat Feb 6 10:31:57 1999 +++ freeciv/server/mapgen.c Sat Feb 6 10:21:56 1999 @@ -35,7 +35,6 @@ int *height_map; int maxval=0; -int forests=0; /************************************************************************** Just a wrapper function off the height_map, returns the height at x,y @@ -74,6 +73,7 @@ int x,y; int mount; int j; + for (j=0;j<10;j++) { mount=0; for (y=0;ymap.ysize*42/100 && y50) map_set_terrain(x, y, T_JUNGLE); else map_set_terrain(x, y, T_FOREST); - if (abs(full_map(x, y)-height)5) make_forest(x-1,y, height, diff-5); - if (myrand(10)>5) make_forest(x,y-1, height, diff-5); - if (myrand(10)>5) make_forest(x+1,y, height, diff-5); - if (myrand(10)>5) make_forest(x,y+1, height, diff-5); - } forests++; + if (abs(full_map(x, y)-height)5) forests+=make_forest(x-1,y, height, diff-5); + if (myrand(10)>5) forests+=make_forest(x,y-1, height, diff-5); + if (myrand(10)>5) forests+=make_forest(x+1,y, height, diff-5); + if (myrand(10)>5) forests+=make_forest(x,y+1, height, diff-5); + } } + return forests; } /************************************************************************** @@ -179,18 +165,20 @@ { int x,y; int forestsize=25; + int forests=0; + forestsize=(map.xsize*map.ysize*map.forestsize)/1000; - do { + do { x=myrand(map.xsize); y=myrand(map.ysize); if (map_get_terrain(x, y)==T_GRASSLAND) { - make_forest(x,y, full_map(x, y), 25); + forests+=make_forest(x,y, full_map(x, y), 25); } if (myrand(100)>75) { y=(myrand(map.ysize*2/10))+map.ysize*4/10; x=myrand(map.xsize); if (map_get_terrain(x, y)==T_GRASSLAND) { - make_forest(x,y, full_map(x, y), 25); + forests+=make_forest(x,y, full_map(x, y), 25); } } } while (forests1000) return; @@ -213,19 +203,48 @@ x=myrand(map.xsize); if (map_get_terrain(x, y)==T_GRASSLAND && full_map(x, y)<(maxval*60)/100) { map_set_terrain(x, y, T_SWAMP); - if (myrand(10)>5 && map_get_terrain(x-1, y)!=T_OCEAN) + i++; + if (myrand(10)>5 && map_get_terrain(x-1, y)!=T_OCEAN) { map_set_terrain(x-1,y, T_SWAMP); - if (myrand(10)>5 && map_get_terrain(x+1, y)!=T_OCEAN) + i++; + } + if (myrand(10)>5 && map_get_terrain(x+1, y)!=T_OCEAN) { map_set_terrain(x+1,y, T_SWAMP); - if (myrand(10)>5 && map_get_terrain(x, y-1)!=T_OCEAN) + i++; + } + if (myrand(10)>5 && map_get_terrain(x, y-1)!=T_OCEAN) { map_set_terrain(x,y-1, T_SWAMP); - if (myrand(10)>5 && map_get_terrain(x, y+1)!=T_OCEAN) + i++; + } + if (myrand(10)>5 && map_get_terrain(x, y+1)!=T_OCEAN) { map_set_terrain(x, y+1, T_SWAMP); - i++; + i++; + } } } } +/************************************************************************** + recursively generate deserts, i use the heights of the map, to make the + desert unregulary shaped, diff is the recursion stopper, and will be reduced + more if desert wants to grow in the y direction, so we end up with + "wide" deserts. +**************************************************************************/ +int make_desert(int x, int y, int height, int diff) +{ + int deserts=0; + + if (abs(full_map(x, y)-height)