Skip to content

Commit 61848cf

Browse files
committed
#17: Improved maps/hierarchy.adoc.
1 parent 41252d2 commit 61848cf

9 files changed

Lines changed: 71 additions & 9 deletions

File tree

File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": 1,
3+
"width": 20,
4+
"height": 10,
5+
"used_terrain_types": [
6+
"Low Mountain",
7+
"Hill",
8+
"Plain",
9+
"Medium Mountain",
10+
"High Mountain"
11+
],
12+
"terrain_type_map": [
13+
"0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2",
14+
"0,0,3,3,0,0,0,1,1,0,0,0,0,1,1,1,1,2,2,2",
15+
"1,0,3,3,3,3,3,0,0,0,0,0,0,0,0,0,1,2,2,2",
16+
"1,0,0,3,4,3,3,4,4,3,3,3,3,3,2,0,1,1,2,2",
17+
"1,1,0,3,4,4,4,4,3,3,0,0,0,3,3,0,0,1,2,2",
18+
"2,1,0,3,3,3,3,3,0,0,0,1,0,0,3,0,0,1,2,2",
19+
"2,1,0,0,0,0,0,0,0,1,1,1,1,0,3,0,1,1,2,2",
20+
"2,1,1,1,1,1,1,1,1,1,2,2,1,0,3,0,1,2,2,2",
21+
"2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,1,2,2,2",
22+
"2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,2,2,2"
23+
]
24+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": 1,
3+
"width": 20,
4+
"height": 10,
5+
"used_terrain_types": [
6+
"Hill",
7+
"Low Mountain",
8+
"Plain",
9+
"Shallow Ocean",
10+
"Ocean",
11+
"Medium Mountain",
12+
"High Mountain",
13+
"Deep Ocean"
14+
],
15+
"terrain_type_map": [
16+
"0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,2,3,4",
17+
"0,1,1,5,5,5,5,5,1,1,1,1,1,1,1,0,2,3,3,4",
18+
"0,1,5,5,6,6,5,5,5,5,1,1,0,0,0,0,2,3,4,4",
19+
"0,1,5,5,6,6,6,5,5,1,1,0,0,0,2,2,3,3,4,4",
20+
"0,1,1,5,6,6,5,5,1,1,1,0,0,2,2,2,3,4,4,4",
21+
"0,0,1,5,5,5,5,1,1,0,0,0,0,2,2,2,3,4,4,7",
22+
"0,0,1,1,1,1,1,1,0,0,2,0,0,2,2,3,3,4,4,7",
23+
"2,0,0,0,0,0,0,0,0,0,2,2,2,2,3,3,4,4,7,7",
24+
"2,2,2,2,2,0,0,0,2,2,2,2,2,3,3,4,4,4,7,7",
25+
"2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,4,4,7,7,7"
26+
]
27+
}

FantasyWorldSimulation/data/terrain-types.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"blue": 0.5
88
},
99
"base_elevation": 10,
10-
"elevation_variation": 5
10+
"elevation_variation": 5,
11+
"hill_noise": 10
1112
},
1213
{
1314
"name": "Hill",
@@ -65,7 +66,8 @@
6566
"blue": 1.0
6667
},
6768
"base_elevation": -50,
68-
"elevation_variation": 5
69+
"elevation_variation": 5,
70+
"hill_noise": 10
6971
},
7072
{
7173
"name": "Ocean",
@@ -76,7 +78,8 @@
7678
"blue": 1.0
7779
},
7880
"base_elevation": -100,
79-
"elevation_variation": 10
81+
"elevation_variation": 10,
82+
"hill_noise": 20
8083
},
8184
{
8285
"name": "Deep Ocean",
@@ -87,6 +90,7 @@
8790
"blue": 0.75
8891
},
8992
"base_elevation": -150,
90-
"elevation_variation": 10
93+
"elevation_variation": 10,
94+
"hill_noise": 50
9195
}
9296
]
60.2 KB
Loading
10.3 KB
Loading

FantasyWorldSimulation/docs/docu/maps/hierarchy.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ An abstract representation of a region.
1818
Individual objects like a building or a tree are abstracted away as Forests or Settlements,
1919
unless they are important enough.
2020

21+
.Sketch Map of test3.json
2122
image::sketch-map.png[Sketch Map]
2223

2324
==== Region Map
2425
A more detailed representation of a region that is generated from a <<Sketch Map>>.
2526
Individual objects like a building or a tree are represented by individual but abstract objects.
2627

28+
.Region Map of test3.json
29+
image::region-map.jpg[Region Map]
30+
2731
.Comparison of the Sketch & Region map
2832
[%header,cols=3*]
2933
|===

FantasyWorldSimulation/src/jfws/features/elevation/ElevationColorSelector.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ public String getName() {
1515
public Color select(T cell) {
1616
double elevation = cell.getElevation();
1717

18-
if(elevation < MIN_ELEVATION || elevation > MAX_ELEVATION) {
19-
return Color.PINK;
18+
if(elevation < MIN_ELEVATION) {
19+
return Color.DARKBLUE;
20+
}
21+
else if(elevation > MAX_ELEVATION) {
22+
return Color.WHITE;
2023
}
2124
else if(elevation < DEFAULT_ELEVATION) {
2225
return interpolate(elevation, MIN_ELEVATION, DEFAULT_ELEVATION - 1, Color.DARKBLUE, Color.CYAN);
@@ -32,4 +35,4 @@ private Color interpolate(double elevation, double min, double max, Color start,
3235
double factor = (elevation - min) / (max - min);
3336
return start.interpolate(end, factor);
3437
}
35-
}
38+
}

FantasyWorldSimulation/test/jfws/features/elevation/ElevationColorSelectorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ public void testGetName() {
3232

3333
@Test
3434
public void testTooLow() {
35-
assertColor(ElevationCell.MIN_ELEVATION - 100, Color.PINK);
35+
assertColor(ElevationCell.MIN_ELEVATION - 100, Color.DARKBLUE);
3636
}
3737

3838
@Test
3939
public void testTooHigh() {
40-
assertColor(ElevationCell.MAX_ELEVATION + 100, Color.PINK);
40+
assertColor(ElevationCell.MAX_ELEVATION + 100, Color.WHITE);
4141
}
4242

4343
@Test

0 commit comments

Comments
 (0)