-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional nesting in mapgen - by overmap neighbor adjacency #22131
Merged
kevingranade
merged 5 commits into
CleverRaven:master
from
Coolthulhu:conditional-nesting
Nov 5, 2017
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6b62072
Refactor mapgen to include mapgendata
Coolthulhu 7d92d65
Edit swamp_shack as an example of new mapgen
Coolthulhu ea49b4c
Cleaner example
Coolthulhu 23c16e3
Rename nested:entries to nested:chunks
Coolthulhu 8aeb353
Fix compilation
Coolthulhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
[ | ||
{ | ||
"type": "palette", | ||
"id": "swamp_background", | ||
"furniture": { | ||
"i": "f_cattails" | ||
}, | ||
"terrain": { | ||
" ": [ "t_swater_dp", "t_swater_sh", "t_swater_sh", "t_dirt", "t_dirt", "t_dirt", "t_dirt", "t_grass", "t_grass", "t_grass", "t_grass", "t_grass", "t_grass", "t_underbrush", "t_tree", "t_tree_young" ], | ||
"i": "t_water_sh" | ||
} | ||
}, | ||
{ | ||
"type": "mapgen", | ||
"method": "json", | ||
|
@@ -7,30 +18,33 @@ | |
"object": { | ||
"fill_ter": "t_floor", | ||
"rows": [ | ||
" i ", | ||
" i i i i ", | ||
" i i i i ii ", | ||
" i i ii ", | ||
" i ii i ", | ||
" i i i ", | ||
" i ii ", | ||
"ii i -----------iii ", | ||
"i i -CSn.....d- i ", | ||
" i -....---+-- ", | ||
" i i [email protected] ", | ||
" [email protected] i ", | ||
" i i -bbTc-s.ss- i ", | ||
" i i ---o---+--- ", | ||
" i i i=V,,^,,,,, i ", | ||
" i ,,,,,,,,X= i ", | ||
" i ,=&&,xxXX=i i ", | ||
" ii i ========= i ", | ||
" i i i ii", | ||
" i i i i", | ||
" i i i ii ", | ||
" ii i i i i ", | ||
" i ii i i i ", | ||
" i i " | ||
" ", | ||
" ", | ||
" ", | ||
" ", | ||
" ", | ||
" ", | ||
" ", | ||
" ----------- ", | ||
" -CSn.....d- ", | ||
" -....---+-- ", | ||
" [email protected] ", | ||
" [email protected] ", | ||
" -bbTc-s.ss- ", | ||
" ---o---+--- ", | ||
" =V,,^,,,,, ", | ||
" ,,,,,,,,X= ", | ||
" ,=&&,xxXX= ", | ||
" ========= ", | ||
" ", | ||
" ", | ||
" ", | ||
" ", | ||
" ", | ||
" " | ||
], | ||
"palettes": [ | ||
"swamp_background" | ||
], | ||
"mapping": { | ||
"B": { | ||
|
@@ -83,7 +97,6 @@ | |
} | ||
}, | ||
"terrain": { | ||
" ": [ "t_swater_dp", "t_swater_sh", "t_swater_sh", "t_dirt", "t_dirt", "t_dirt", "t_dirt", "t_grass", "t_grass", "t_grass", "t_grass", "t_grass", "t_grass", "t_underbrush", "t_tree", "t_tree_young" ], | ||
"&": "t_dirt", | ||
"+": "t_door_c", | ||
",": [ "t_dirt", "t_dirt", "t_dirt", "t_dirt", "t_dirt", "t_dirt", "t_grass" ], | ||
|
@@ -93,7 +106,6 @@ | |
"V": "t_dirt", | ||
"X": "t_dirt", | ||
"^": "t_dirt", | ||
"i": [ "t_swater_dp", "t_swater_sh", "t_swater_sh", "t_dirt", "t_dirt", "t_dirt", "t_grass", "t_grass", "t_grass", "t_underbrush" ], | ||
"o": "t_window_domestic", | ||
"x": "t_dirt" | ||
}, | ||
|
@@ -112,11 +124,36 @@ | |
"b": "f_makeshift_bed", | ||
"c": "f_chair", | ||
"d": "f_rack", | ||
"i": [ "f_null", "f_null", "f_null", "f_null", "f_null", "f_null", "f_null", "f_cattails", "f_cattails", "f_cattails", "f_cattails" ], | ||
"n": "f_counter", | ||
"s": "f_counter", | ||
"x": "f_crate_o" | ||
} | ||
}, | ||
"place_nested": [ | ||
{ "chunks": [ "cattail", "null" ], "x": [ 0, 6 ], "y": [ 0, 6 ], "neighbors": { "north": "forest_water" } }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 7, 17 ], "y": [ 0, 6 ], "neighbors": { "north": "forest_water" }, "repeat": 4 }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 18, 23 ], "y": [ 0, 6 ], "neighbors": { "north": "forest_water" } }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 18, 23 ], "y": [ 0, 6 ], "neighbors": { "east": "forest_water" } }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 18, 23 ], "y": [ 7, 17 ], "neighbors": { "east": "forest_water" }, "repeat": 4 }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 18, 23 ], "y": [ 18, 23 ], "neighbors": { "east": "forest_water" } }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 0, 6 ], "y": [ 18, 23 ], "neighbors": { "south": "forest_water" } }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 7, 17 ], "y": [ 18, 23 ], "neighbors": { "south": "forest_water" }, "repeat": 4 }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 18, 23 ], "y": [ 18, 23 ], "neighbors": { "south": "forest_water" } }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 0, 6 ], "y": [ 0, 6 ], "neighbors": { "west": "forest_water" } }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 0, 6 ], "y": [ 7, 17 ], "neighbors": { "west": "forest_water" }, "repeat": 4 }, | ||
{ "chunks": [ "cattail", "null" ], "x": [ 0, 6 ], "y": [ 18, 23 ], "neighbors": { "west": "forest_water" } } | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "mapgen", | ||
"method": "json", | ||
"nested_mapgen_id": "cattail", | ||
"object": { | ||
"rows": [ "i" ], | ||
"palettes": [ | ||
"swamp_background" | ||
], | ||
"mapgensize": [ 1, 1 ] | ||
} | ||
}, | ||
{ | ||
|
@@ -152,6 +189,9 @@ | |
" ;;;;;;;;;;;", | ||
" ;;;;;;;;;;" | ||
], | ||
"palettes": [ | ||
"swamp_background" | ||
], | ||
"mapping": { | ||
"B": { | ||
"items": [ | ||
|
@@ -227,7 +267,6 @@ | |
} | ||
}, | ||
"terrain": { | ||
" ": [ "t_swater_dp", "t_swater_sh", "t_swater_sh", "t_dirt", "t_dirt", "t_dirt", "t_dirt", "t_grass", "t_grass", "t_grass", "t_grass", "t_grass", "t_grass", "t_underbrush", "t_tree", "t_tree_young" ], | ||
"#": "t_dirtmound", | ||
"&": "t_dirt", | ||
"+": "t_door_c", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the null mean in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the null is rolled, nothing is nested. They have equal weights. So 50% chance for cattail.
This is to pad the chances a bit, to make it somewhat more like the surrounding forest. Doing this whole "x rolls for cattail, 50% chance" makes it more like the math in forest cattail placement than just rolling "1 to 4 cattails" and placing those.