From c83dde0c1e0e89091284233095622c511cca9cc5 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Mar 2024 20:24:47 +0000 Subject: [PATCH 01/10] "palettes" no longer relies on "rows" being defined --- data/json/mapgen/derelict_property.json | 27 ------------------------- src/mapgen.cpp | 5 ++--- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/data/json/mapgen/derelict_property.json b/data/json/mapgen/derelict_property.json index 3584e80e49453..9bca0c576d6b4 100644 --- a/data/json/mapgen/derelict_property.json +++ b/data/json/mapgen/derelict_property.json @@ -155,34 +155,7 @@ "type": "mapgen", "method": "json", "om_terrain": "derelict_property", - "//": "rows only defined bc otherwise palettes, needed for nest selection, throws an error", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "fallback_predecessor_mapgen": "forest", "palettes": [ "derelict_variant_parameter_palette" ], "place_nested": [ { "chunks": [ { "param": "variant", "fallback": "derelict_property_1" } ], "x": 0, "y": 0 } ] diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 5d19b21da5274..44db542c9e07a 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -4451,8 +4451,9 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) jo.read( "flags", flags_ ); // just like mapf::basic_bind("stuff",blargle("foo", etc) ), only json input and faster when applying + mapgen_palette palette = mapgen_palette::load_temp( jo, "dda", context_ ); + parameters = palette.get_parameters(); if( jo.has_array( "rows" ) ) { - mapgen_palette palette = mapgen_palette::load_temp( jo, "dda", context_ ); auto &keys_with_terrain = palette.keys_with_terrain; mapgen_palette::placing_map &format_placings = palette.format_placings; @@ -4460,8 +4461,6 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) return false; } - parameters = palette.get_parameters(); - // mandatory: mapgensize rows of mapgensize character lines, each of which must have a // matching key in "terrain", unless fill_ter is set // "rows:" [ "aaaajustlikeinmapgen.cpp", "this.must!be!exactly.24!", "and_must_match_terrain_", .... ] From cc597c35900065bd973cea85b76df5ac025279aa Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:58:36 +0000 Subject: [PATCH 02/10] Default rows instead --- src/mapgen.cpp | 139 +++++++++++++++++++++++++++---------------------- 1 file changed, 78 insertions(+), 61 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 44db542c9e07a..d0dcd687efdd3 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -4450,24 +4450,14 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) jo.read( "flags", flags_ ); - // just like mapf::basic_bind("stuff",blargle("foo", etc) ), only json input and faster when applying - mapgen_palette palette = mapgen_palette::load_temp( jo, "dda", context_ ); - parameters = palette.get_parameters(); - if( jo.has_array( "rows" ) ) { - auto &keys_with_terrain = palette.keys_with_terrain; - mapgen_palette::placing_map &format_placings = palette.format_placings; - - if( palette.keys_with_terrain.empty() && !fallback_terrain_exists ) { - return false; - } - - // mandatory: mapgensize rows of mapgensize character lines, each of which must have a - // matching key in "terrain", unless fill_ter is set - // "rows:" [ "aaaajustlikeinmapgen.cpp", "this.must!be!exactly.24!", "and_must_match_terrain_", .... ] - point expected_dim = mapgensize + m_offset; - cata_assert( expected_dim.x >= 0 ); - cata_assert( expected_dim.y >= 0 ); + // mandatory: mapgensize rows of mapgensize character lines, each of which must have a + // matching key in "terrain", unless fill_ter is set + // "rows:" [ "aaaajustlikeinmapgen.cpp", "this.must!be!exactly.24!", "and_must_match_terrain_", .... ] + point expected_dim = mapgensize + m_offset; + cata_assert( expected_dim.x >= 0 ); + cata_assert( expected_dim.y >= 0 ); + if( jo.has_array( "rows" ) ) { parray = jo.get_array( "rows" ); if( static_cast( parray.size() ) < expected_dim.y ) { parray.throw_error( string_format( "format: rows: must have at least %d rows, not %d", @@ -4478,59 +4468,86 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) string_format( "format: rows: must have %d rows, not %d; check mapgensize if applicable", total_size.y, parray.size() ) ); } - for( int c = m_offset.y; c < expected_dim.y; c++ ) { - const std::string row = parray.get_string( c ); - static std::vector row_keys; - row_keys.clear(); - row_keys.reserve( total_size.x ); - utf8_display_split_into( row, row_keys ); - if( row_keys.size() < static_cast( expected_dim.x ) ) { - parray.throw_error( - string_format( " format: row %d must have at least %d columns, not %d", - c + 1, expected_dim.x, row_keys.size() ) ); - } - if( row_keys.size() != static_cast( total_size.x ) ) { - parray.throw_error( - string_format( " format: row %d must have %d columns, not %d; check mapgensize if applicable", - c + 1, total_size.x, row_keys.size() ) ); - } - for( int i = m_offset.x; i < expected_dim.x; i++ ) { - const point p = point( i, c ) - m_offset; - const map_key key{ std::string( row_keys[i] ) }; - const auto iter_ter = keys_with_terrain.find( key ); - const auto fpi = format_placings.find( key ); - - const bool has_terrain = iter_ter != keys_with_terrain.end(); - const bool has_placing = fpi != format_placings.end(); - - if( !has_terrain && !fallback_terrain_exists ) { + } else { + // Construct default "rows" of just spaces + const std::string spaces( expected_dim.x, ' ' ); + std::string empty_row( 1, '"' ); + empty_row += spaces; + empty_row += '"'; + std::string empty_rows = "["; + for( int rown = 0; rown < expected_dim.y - 1; rown++ ) { + empty_rows += empty_row; + empty_rows += ','; + } + empty_rows += empty_row; + empty_rows += ']'; + auto empty_array_ = flexbuffer_cache::parse_buffer( empty_rows ); + parray = JsonArray( empty_array_, flexbuffer_root_from_storage( empty_array_->get_storage() ), {} ); + } + + // just like mapf::basic_bind("stuff",blargle("foo", etc) ), only json input and faster when applying + mapgen_palette palette = mapgen_palette::load_temp( jo, "dda", context_ ); + auto &keys_with_terrain = palette.keys_with_terrain; + mapgen_palette::placing_map &format_placings = palette.format_placings; + + if( palette.keys_with_terrain.empty() && !fallback_terrain_exists ) { + return false; + } + + parameters = palette.get_parameters(); + + for( int c = m_offset.y; c < expected_dim.y; c++ ) { + const std::string row = parray.get_string( c ); + static std::vector row_keys; + row_keys.clear(); + row_keys.reserve( total_size.x ); + utf8_display_split_into( row, row_keys ); + if( row_keys.size() < static_cast( expected_dim.x ) ) { + parray.throw_error( + string_format( " format: row %d must have at least %d columns, not %d", + c + 1, expected_dim.x, row_keys.size() ) ); + } + if( row_keys.size() != static_cast( total_size.x ) ) { + parray.throw_error( + string_format( " format: row %d must have %d columns, not %d; check mapgensize if applicable", + c + 1, total_size.x, row_keys.size() ) ); + } + for( int i = m_offset.x; i < expected_dim.x; i++ ) { + const point p = point( i, c ) - m_offset; + const map_key key{ std::string( row_keys[i] ) }; + const auto iter_ter = keys_with_terrain.find( key ); + const auto fpi = format_placings.find( key ); + + const bool has_terrain = iter_ter != keys_with_terrain.end(); + const bool has_placing = fpi != format_placings.end(); + + if( !has_terrain && !fallback_terrain_exists ) { + parray.string_error( + c, i + 1, + string_format( "format: rows: row %d column %d: " + "'%s' is not in 'terrain', and no 'fill_ter' is set!", + c + 1, i + 1, key.str ) ); + } + if( !has_terrain && !has_placing && key.str != " " && key.str != "." ) { + try { parray.string_error( c, i + 1, string_format( "format: rows: row %d column %d: " - "'%s' is not in 'terrain', and no 'fill_ter' is set!", + "'%s' has no terrain, furniture, or other definition", c + 1, i + 1, key.str ) ); + } catch( const JsonError &e ) { + debugmsg( "(json-error)\n%s", e.what() ); } - if( !has_terrain && !has_placing && key.str != " " && key.str != "." ) { - try { - parray.string_error( - c, i + 1, - string_format( "format: rows: row %d column %d: " - "'%s' has no terrain, furniture, or other definition", - c + 1, i + 1, key.str ) ); - } catch( const JsonError &e ) { - debugmsg( "(json-error)\n%s", e.what() ); - } - } - if( has_placing ) { - jmapgen_place where( p ); - for( auto &what : fpi->second ) { - objects.add( where, what ); - } + } + if( has_placing ) { + jmapgen_place where( p ); + for( auto &what : fpi->second ) { + objects.add( where, what ); } } } - fallback_terrain_exists = true; } + fallback_terrain_exists = true; // No fill_ter? No format? GTFO. if( !fallback_terrain_exists ) { From 0081d34a721756a4bfe154aeea6f4876fde5e8e8 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:59:29 +0000 Subject: [PATCH 03/10] Remove JSON default rows --- .../bare_bones_basecamp.json | 31 +---- .../version_1/modular_canteen_common.json | 13 +- .../version_1/primitive_farm.json | 13 +- .../version_1/primitive_garage.json | 13 +- .../version_1/modular_livestock_common.json | 13 +- .../version_1/modular_saltworks_common.json | 13 +- .../version_1/modular_storehouse_common.json | 14 +- .../version_1/modular_workshop_common.json | 13 +- data/json/mapgen/debug.json | 33 +---- data/json/mapgen/derelict_property.json | 27 ---- data/json/mapgen/dummy/dummy.json | 30 +--- data/json/mapgen/house/house05.json | 26 ---- .../lab_nested_maintenance.json | 5 - data/json/mapgen/map_extras/beehives.json | 30 +--- data/json/mapgen/map_extras/bugouts.json | 30 +--- data/json/mapgen/map_extras/clearcut.json | 30 +--- data/json/mapgen/map_extras/grave.json | 26 ---- data/json/mapgen/map_extras/house_wasp.json | 26 ---- data/json/mapgen/map_extras/mass_grave.json | 26 ---- data/json/mapgen/map_extras/portal.json | 31 ----- data/json/mapgen/map_extras/sand.json | 11 +- .../nether_monster_corpse/monster_head.json | 26 ---- .../robofaq_locs/robofac_hq_chunks.json | 4 - data/json/mapgen/rock_border.json | 30 +--- data/mods/Backrooms/overmap_terrain.json | 26 ---- .../DinoMod/mapgen/map_extras/mass_grave.json | 26 ---- .../DinoMod/mapgen/map_extras/portal.json | 78 ----------- .../map_extras/alien_flora_varieties.json | 130 ------------------ .../mapgen/map_extras/glass_and_crystal.json | 26 ---- .../mapgen/map_extras/nether_pond.json | 26 ---- .../psi_lab_surface_nested.json | 19 --- .../overmap/nether_crystal_field.json | 24 ---- data/mods/Sky_Island/island_upgrades.json | 31 +---- data/mods/Sky_Island/missions_and_mapgen.json | 29 +--- data/mods/TEST_DATA/mapgen-test.json | 10 +- .../Xedra_Evolved/mapgen/nested/vampires.json | 7 - 36 files changed, 19 insertions(+), 927 deletions(-) diff --git a/data/json/mapgen/basecamps/base/bare_bones_basecamp/bare_bones_basecamp.json b/data/json/mapgen/basecamps/base/bare_bones_basecamp/bare_bones_basecamp.json index d0813d18555aa..60d5654a90a31 100644 --- a/data/json/mapgen/basecamps/base/bare_bones_basecamp/bare_bones_basecamp.json +++ b/data/json/mapgen/basecamps/base/bare_bones_basecamp/bare_bones_basecamp.json @@ -9,35 +9,6 @@ "type": "mapgen", "update_mapgen_id": "fbbb", "method": "json", - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], - "palettes": [ "fbbb_palette" ] - } + "object": { "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "palettes": [ "fbbb_palette" ] } } ] diff --git a/data/json/mapgen/basecamps/expansion/modular_canteen/version_1/modular_canteen_common.json b/data/json/mapgen/basecamps/expansion/modular_canteen/version_1/modular_canteen_common.json index 392b78d5c1780..4339afa05ea8c 100644 --- a/data/json/mapgen/basecamps/expansion/modular_canteen/version_1/modular_canteen_common.json +++ b/data/json/mapgen/basecamps/expansion/modular_canteen/version_1/modular_canteen_common.json @@ -3,18 +3,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "fbmk_0", - "object": { - "mapgensize": [ 6, 6 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " " - ], - "palettes": [ "fbmk_common_palette" ] - } + "object": { "mapgensize": [ 6, 6 ], "palettes": [ "fbmk_common_palette" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/basecamps/expansion/modular_farm/version_1/primitive_farm.json b/data/json/mapgen/basecamps/expansion/modular_farm/version_1/primitive_farm.json index 9ebdbe28e9c06..986466babcd96 100644 --- a/data/json/mapgen/basecamps/expansion/modular_farm/version_1/primitive_farm.json +++ b/data/json/mapgen/basecamps/expansion/modular_farm/version_1/primitive_farm.json @@ -3,18 +3,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "fbmf_0", - "object": { - "mapgensize": [ 6, 6 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " " - ], - "palettes": [ "acidia_camp_palette" ] - } + "object": { "mapgensize": [ 6, 6 ], "palettes": [ "acidia_camp_palette" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/basecamps/expansion/modular_garage/version_1/primitive_garage.json b/data/json/mapgen/basecamps/expansion/modular_garage/version_1/primitive_garage.json index 6ff4e8c8712f5..f0b91b33e94c6 100644 --- a/data/json/mapgen/basecamps/expansion/modular_garage/version_1/primitive_garage.json +++ b/data/json/mapgen/basecamps/expansion/modular_garage/version_1/primitive_garage.json @@ -3,18 +3,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "fbmg_0", - "object": { - "mapgensize": [ 6, 6 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " " - ], - "palettes": [ "acidia_camp_palette" ] - } + "object": { "mapgensize": [ 6, 6 ], "palettes": [ "acidia_camp_palette" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/basecamps/expansion/modular_livestock/version_1/modular_livestock_common.json b/data/json/mapgen/basecamps/expansion/modular_livestock/version_1/modular_livestock_common.json index 88b503b37dfe8..7440276afe109 100644 --- a/data/json/mapgen/basecamps/expansion/modular_livestock/version_1/modular_livestock_common.json +++ b/data/json/mapgen/basecamps/expansion/modular_livestock/version_1/modular_livestock_common.json @@ -3,18 +3,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "fbml_0", - "object": { - "mapgensize": [ 6, 6 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " " - ], - "palettes": [ "fbml_common_palette" ] - } + "object": { "mapgensize": [ 6, 6 ], "palettes": [ "fbml_common_palette" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/basecamps/expansion/modular_saltworks/version_1/modular_saltworks_common.json b/data/json/mapgen/basecamps/expansion/modular_saltworks/version_1/modular_saltworks_common.json index a53c6cf3c9774..f4d42c740ae76 100644 --- a/data/json/mapgen/basecamps/expansion/modular_saltworks/version_1/modular_saltworks_common.json +++ b/data/json/mapgen/basecamps/expansion/modular_saltworks/version_1/modular_saltworks_common.json @@ -10,18 +10,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "fbmsw_0", - "object": { - "mapgensize": [ 6, 6 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " " - ], - "palettes": [ "fbmsw_common_palette" ] - } + "object": { "mapgensize": [ 6, 6 ], "palettes": [ "fbmsw_common_palette" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/basecamps/expansion/modular_storehouse/version_1/modular_storehouse_common.json b/data/json/mapgen/basecamps/expansion/modular_storehouse/version_1/modular_storehouse_common.json index 3b7fe2594be5c..93a394a52794e 100644 --- a/data/json/mapgen/basecamps/expansion/modular_storehouse/version_1/modular_storehouse_common.json +++ b/data/json/mapgen/basecamps/expansion/modular_storehouse/version_1/modular_storehouse_common.json @@ -3,19 +3,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "fbms_0", - "object": { - "mapgensize": [ 6, 6 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " " - ], - "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], - "palettes": [ "fbms_common_palette" ] - } + "object": { "mapgensize": [ 6, 6 ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "palettes": [ "fbms_common_palette" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/basecamps/expansion/modular_workshop/version_1/modular_workshop_common.json b/data/json/mapgen/basecamps/expansion/modular_workshop/version_1/modular_workshop_common.json index 94c7efb0305b8..6e2f81600a474 100644 --- a/data/json/mapgen/basecamps/expansion/modular_workshop/version_1/modular_workshop_common.json +++ b/data/json/mapgen/basecamps/expansion/modular_workshop/version_1/modular_workshop_common.json @@ -3,18 +3,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "fbmw_0", - "object": { - "mapgensize": [ 6, 6 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " " - ], - "palettes": [ "fbmw_common_palette" ] - } + "object": { "mapgensize": [ 6, 6 ], "palettes": [ "fbmw_common_palette" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/debug.json b/data/json/mapgen/debug.json index ee79ab754e166..c1317c8609029 100644 --- a/data/json/mapgen/debug.json +++ b/data/json/mapgen/debug.json @@ -2,37 +2,8 @@ { "type": "mapgen", "method": "json", - "om_terrain": [ "debug_itemgroup_test" ], - "object": { - "fill_ter": "t_pavement", - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "items": { " ": [ { "item": "milspec_arsenal_group_only_ammo", "chance": 100 } ] } - } + "om_terrain": "debug_itemgroup_test", + "object": { "fill_ter": "t_pavement", "items": { " ": [ { "item": "milspec_arsenal_group_only_ammo", "chance": 100 } ] } } }, { "type": "overmap_terrain", diff --git a/data/json/mapgen/derelict_property.json b/data/json/mapgen/derelict_property.json index 9bca0c576d6b4..deb3c755b4715 100644 --- a/data/json/mapgen/derelict_property.json +++ b/data/json/mapgen/derelict_property.json @@ -165,35 +165,8 @@ "type": "mapgen", "method": "json", "om_terrain": "derelict_property_roof", - "//": "rows only defined bc otherwise palettes, needed for nest selection, throws an error", "object": { "fill_ter": "t_open_air", - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "palettes": [ "derelict_variant_parameter_palette" ], "place_nested": [ { diff --git a/data/json/mapgen/dummy/dummy.json b/data/json/mapgen/dummy/dummy.json index c8aa2e6406ba7..ad494198a7f04 100644 --- a/data/json/mapgen/dummy/dummy.json +++ b/data/json/mapgen/dummy/dummy.json @@ -4,35 +4,7 @@ "method": "json", "//": "This mapgen exist only for suppressing 'No mapgen terrain exists for %s' type of errors on game start and shouldn't spawn ingame", "om_terrain": [ "unexplored" ], - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "terrain": { " ": "t_null" } - } + "object": { "terrain": { " ": "t_null" } } }, { "type": "mapgen", diff --git a/data/json/mapgen/house/house05.json b/data/json/mapgen/house/house05.json index 5591844f2dbdd..80f75b7576fca 100644 --- a/data/json/mapgen/house/house05.json +++ b/data/json/mapgen/house/house05.json @@ -135,32 +135,6 @@ "om_terrain": "house_05_basement", "object": { "fill_ter": "t_thconc_floor", - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "palettes": [ "house_05_variant_palette" ], "place_nested": [ { diff --git a/data/json/mapgen/lab/lab_modular/lab_nests_modular/lab_nested_maintenance.json b/data/json/mapgen/lab/lab_modular/lab_nests_modular/lab_nested_maintenance.json index 5ae228cb37a61..c09e1b91635bb 100644 --- a/data/json/mapgen/lab/lab_modular/lab_nests_modular/lab_nested_maintenance.json +++ b/data/json/mapgen/lab/lab_modular/lab_nests_modular/lab_nested_maintenance.json @@ -67,11 +67,6 @@ "nested_mapgen_id": "lab_maintenance_3x3_NS_open", "object": { "mapgensize": [ 3, 3 ], - "rows": [ - " ", - " ", - " " - ], "palettes": [ "lab_common_palette", "lab_maintenance_palette" ], "place_loot": [ { "group": "trash", "x": [ 1, 3 ], "y": [ 1, 3 ], "repeat": 3, "chance": 100 } ], "place_nested": [ { "chunks": [ [ "sub_fd_shock_vent", 30 ], [ "null", 70 ] ], "x": 1, "y": 1 } ] diff --git a/data/json/mapgen/map_extras/beehives.json b/data/json/mapgen/map_extras/beehives.json index 1ad8177776804..674366abf615a 100644 --- a/data/json/mapgen/map_extras/beehives.json +++ b/data/json/mapgen/map_extras/beehives.json @@ -13,34 +13,6 @@ "type": "mapgen", "method": "json", "update_mapgen_id": "mx_beehive_natural", - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "place_nested": [ { "chunks": [ [ "nested_beehive_natural", 100 ] ], "x": [ 0, 23 ], "y": [ 0, 23 ] } ] - } + "object": { "place_nested": [ { "chunks": [ [ "nested_beehive_natural", 100 ] ], "x": [ 0, 23 ], "y": [ 0, 23 ] } ] } } ] diff --git a/data/json/mapgen/map_extras/bugouts.json b/data/json/mapgen/map_extras/bugouts.json index b63dd17c7eaf1..1f8b87429c7d7 100644 --- a/data/json/mapgen/map_extras/bugouts.json +++ b/data/json/mapgen/map_extras/bugouts.json @@ -20,34 +20,6 @@ "type": "mapgen", "method": "json", "update_mapgen_id": "mx_bugout", - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "place_nested": [ { "chunks": [ [ "nested_bugout_bag", 100 ] ], "x": [ 0, 23 ], "y": [ 0, 23 ] } ] - } + "object": { "place_nested": [ { "chunks": [ [ "nested_bugout_bag", 100 ] ], "x": [ 0, 23 ], "y": [ 0, 23 ] } ] } } ] diff --git a/data/json/mapgen/map_extras/clearcut.json b/data/json/mapgen/map_extras/clearcut.json index 0e0ef92c0606a..7a92e6a731999 100644 --- a/data/json/mapgen/map_extras/clearcut.json +++ b/data/json/mapgen/map_extras/clearcut.json @@ -3,35 +3,7 @@ "type": "mapgen", "method": "json", "update_mapgen_id": "mx_clearcut", - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "ter_furn_transforms": { " ": { "transform": "clearcut" } } - } + "object": { "ter_furn_transforms": { " ": { "transform": "clearcut" } } } }, { "type": "ter_furn_transform", diff --git a/data/json/mapgen/map_extras/grave.json b/data/json/mapgen/map_extras/grave.json index b0f23a4f299ee..070762bfd2338 100644 --- a/data/json/mapgen/map_extras/grave.json +++ b/data/json/mapgen/map_extras/grave.json @@ -138,32 +138,6 @@ "method": "json", "update_mapgen_id": "mx_grave", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ [ "human_corpse", 95 ], [ "pet_corpse", 95 ], [ "grave_easter_egg", 5 ] ], diff --git a/data/json/mapgen/map_extras/house_wasp.json b/data/json/mapgen/map_extras/house_wasp.json index f518849169c32..a06368b2d9945 100644 --- a/data/json/mapgen/map_extras/house_wasp.json +++ b/data/json/mapgen/map_extras/house_wasp.json @@ -4,32 +4,6 @@ "method": "json", "update_mapgen_id": "mx_house_wasp", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "ter_furn_transforms": { " ": { "transform": "remove_door" } }, "nested": { " ": [ diff --git a/data/json/mapgen/map_extras/mass_grave.json b/data/json/mapgen/map_extras/mass_grave.json index 27d15b42dd1b2..3256cad75cc08 100644 --- a/data/json/mapgen/map_extras/mass_grave.json +++ b/data/json/mapgen/map_extras/mass_grave.json @@ -10,32 +10,6 @@ "//": "This is the 'base' mass grave, and doesn't actually contain anything. Variants are generated via the place_nested field.", "update_mapgen_id": "mx_mass_grave", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ [ "mass_grave_abandoned", 30 ], [ "mass_grave_partial", 20 ], [ "mass_grave_finished", 10 ] ], diff --git a/data/json/mapgen/map_extras/portal.json b/data/json/mapgen/map_extras/portal.json index 45616126c6540..393f0d65f677d 100644 --- a/data/json/mapgen/map_extras/portal.json +++ b/data/json/mapgen/map_extras/portal.json @@ -5,11 +5,6 @@ "nested_mapgen_id": "portal_location", "object": { "mapgensize": [ 3, 3 ], - "rows": [ - " ", - " ", - " " - ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ], "terrain": { " ": "t_region_groundcover" }, "furniture": { " ": "f_rubble_rock" }, @@ -21,32 +16,6 @@ "method": "json", "update_mapgen_id": "mx_portal", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ "portal_location" ], "x": [ 2, 20 ], "y": [ 2, 20 ] } ], "monsters": { " ": { "monster": "GROUP_NETHER_PORTAL", "chance": 1, "density": 0.0001 } } } diff --git a/data/json/mapgen/map_extras/sand.json b/data/json/mapgen/map_extras/sand.json index a265d903dae59..0cc5a30182519 100644 --- a/data/json/mapgen/map_extras/sand.json +++ b/data/json/mapgen/map_extras/sand.json @@ -3,16 +3,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "sand_patch", - "object": { - "mapgensize": [ 3, 3 ], - "rows": [ - " ", - " ", - " " - ], - "terrain": { " ": [ "t_sand", "t_null" ] }, - "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ] - } + "object": { "mapgensize": [ 3, 3 ], "terrain": { " ": [ "t_sand", "t_null" ] }, "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ] } }, { "type": "mapgen", diff --git a/data/json/mapgen/nether_monster_corpse/monster_head.json b/data/json/mapgen/nether_monster_corpse/monster_head.json index af0814b823c0f..ee3d9d73165cb 100644 --- a/data/json/mapgen/nether_monster_corpse/monster_head.json +++ b/data/json/mapgen/nether_monster_corpse/monster_head.json @@ -213,32 +213,6 @@ "om_terrain": "corpse_head", "object": { "fill_ter": "t_nm_floor_flesh", - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "palettes": [ "nether_monster_palette" ], "terrain": { " ": [ [ "t_nm_floor_flesh", 25 ], [ "t_nm_ichor_sh", 3 ] ] }, "furniture": { diff --git a/data/json/mapgen/robofaq_locs/robofac_hq_chunks.json b/data/json/mapgen/robofaq_locs/robofac_hq_chunks.json index dca7ec75deb3a..ab719f987eb7e 100644 --- a/data/json/mapgen/robofaq_locs/robofac_hq_chunks.json +++ b/data/json/mapgen/robofaq_locs/robofac_hq_chunks.json @@ -73,10 +73,6 @@ "object": { "faction_owner": [ { "id": "robofac_auxiliaries", "x": [ 0, 4 ], "y": [ 0, 4 ] } ], "mapgensize": [ 2, 2 ], - "rows": [ - " ", - " " - ], "place_npcs": [ { "class": "robofac_merc_1", "x": 1, "y": 1 } ] } }, diff --git a/data/json/mapgen/rock_border.json b/data/json/mapgen/rock_border.json index 3377ea4d15324..b92beabd289f8 100644 --- a/data/json/mapgen/rock_border.json +++ b/data/json/mapgen/rock_border.json @@ -3,34 +3,6 @@ "type": "mapgen", "method": "json", "om_terrain": [ "rock_border" ], - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "terrain": { " ": "t_rock" } - } + "object": { "terrain": { " ": "t_rock" } } } ] diff --git a/data/mods/Backrooms/overmap_terrain.json b/data/mods/Backrooms/overmap_terrain.json index 3883c28cd5751..706fd1d082dca 100644 --- a/data/mods/Backrooms/overmap_terrain.json +++ b/data/mods/Backrooms/overmap_terrain.json @@ -20,32 +20,6 @@ "om_terrain": [ "backfloorchamber" ], "object": { "fill_ter": "t_carpet_backrooms", - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ [ "mx_backrooms_whole", 100 ] ], "x": 0, "y": 0 }, { diff --git a/data/mods/DinoMod/mapgen/map_extras/mass_grave.json b/data/mods/DinoMod/mapgen/map_extras/mass_grave.json index c15d0264e5b9d..b3f8a91efc0c3 100644 --- a/data/mods/DinoMod/mapgen/map_extras/mass_grave.json +++ b/data/mods/DinoMod/mapgen/map_extras/mass_grave.json @@ -5,32 +5,6 @@ "//": "This is the 'base' mass grave, and doesn't actually contain anything. Variants are generated via the place_nested field.", "update_mapgen_id": "mx_mass_grave_dino", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ diff --git a/data/mods/DinoMod/mapgen/map_extras/portal.json b/data/mods/DinoMod/mapgen/map_extras/portal.json index fa3362dab9af5..de67f9db179ff 100644 --- a/data/mods/DinoMod/mapgen/map_extras/portal.json +++ b/data/mods/DinoMod/mapgen/map_extras/portal.json @@ -4,32 +4,6 @@ "method": "json", "update_mapgen_id": "mx_portal_dino_south_america", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ "portal_location" ], "x": [ 2, 20 ], "y": [ 2, 20 ] } ], "monsters": { " ": { "monster": "GROUP_DINOSAUR_SOUTH_AMERICA", "chance": 1, "density": 0.0001 } } } @@ -39,32 +13,6 @@ "method": "json", "update_mapgen_id": "mx_portal_dino_asia", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ "portal_location" ], "x": [ 2, 20 ], "y": [ 2, 20 ] } ], "monsters": { " ": { "monster": "GROUP_DINOSAUR_ASIA", "chance": 1, "density": 0.0001 } } } @@ -74,32 +22,6 @@ "method": "json", "update_mapgen_id": "mx_portal_dino_europe", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "place_nested": [ { "chunks": [ "portal_location" ], "x": [ 2, 20 ], "y": [ 2, 20 ] } ], "monsters": { " ": { "monster": "GROUP_DINOSAUR_EUROPE", "chance": 1, "density": 0.0001 } } } diff --git a/data/mods/MindOverMatter/mapgen/map_extras/alien_flora_varieties.json b/data/mods/MindOverMatter/mapgen/map_extras/alien_flora_varieties.json index 54f7db6d6bc20..bbcad8604f25b 100644 --- a/data/mods/MindOverMatter/mapgen/map_extras/alien_flora_varieties.json +++ b/data/mods/MindOverMatter/mapgen/map_extras/alien_flora_varieties.json @@ -4,32 +4,6 @@ "method": "json", "update_mapgen_id": "mx_alien_grass", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_nested": [ { "chunks": [ "grass_location_1" ], "x": [ 2, 13 ], "y": [ 2, 13 ] } ] } @@ -60,32 +34,6 @@ "method": "json", "update_mapgen_id": "mx_alien_grass_2", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_nested": [ { "chunks": [ "grass_location_2" ], "x": [ 2, 10 ], "y": [ 2, 10 ] } ] } @@ -119,32 +67,6 @@ "method": "json", "update_mapgen_id": "mx_alien_grass_3", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_nested": [ { "chunks": [ "grass_location_3" ], "x": [ 2, 13 ], "y": [ 2, 13 ] } ] } @@ -175,32 +97,6 @@ "method": "json", "update_mapgen_id": "mx_alien_grass_4", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_nested": [ { "chunks": [ "grass_location_4" ], "x": [ 2, 12 ], "y": [ 2, 12 ] } ] } @@ -232,32 +128,6 @@ "method": "json", "update_mapgen_id": "mx_alien_grass_5", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_nested": [ { "chunks": [ "grass_location_5" ], "x": [ 2, 10 ], "y": [ 2, 10 ] } ] } diff --git a/data/mods/MindOverMatter/mapgen/map_extras/glass_and_crystal.json b/data/mods/MindOverMatter/mapgen/map_extras/glass_and_crystal.json index 1b8ff8acd8e0a..1bb6dedd02647 100644 --- a/data/mods/MindOverMatter/mapgen/map_extras/glass_and_crystal.json +++ b/data/mods/MindOverMatter/mapgen/map_extras/glass_and_crystal.json @@ -4,32 +4,6 @@ "method": "json", "update_mapgen_id": "mx_glass_and_crystal", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_nested": [ { "chunks": [ "glass_and_crystal_chunk" ], "x": [ 2, 15 ], "y": [ 2, 15 ] } ], "monsters": { " ": { "monster": "GROUP_CRYSTAL_FIELD", "chance": 1, "density": 0.0001 } } diff --git a/data/mods/MindOverMatter/mapgen/map_extras/nether_pond.json b/data/mods/MindOverMatter/mapgen/map_extras/nether_pond.json index 85e7308a61357..be30ea6b0d1e8 100644 --- a/data/mods/MindOverMatter/mapgen/map_extras/nether_pond.json +++ b/data/mods/MindOverMatter/mapgen/map_extras/nether_pond.json @@ -4,32 +4,6 @@ "method": "json", "update_mapgen_id": "mx_nether_pond", "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_nested": [ { "chunks": [ "nether_pond_chunk" ], "x": [ 2, 11 ], "y": [ 2, 11 ] } ] } diff --git a/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json b/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json index d9255a262e98e..f4ec04aec1267 100644 --- a/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json +++ b/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json @@ -283,12 +283,6 @@ "object": { "mapgensize": [ 4, 4 ], "rotation": [ 0, 3 ], - "rows": [ - " ", - " ", - " ", - " " - ], "terrain": { " ": "t_nether_water_sh" }, "palettes": [ "lab_surface_palette" ] } @@ -1307,19 +1301,6 @@ "object": { "mapgensize": [ 11, 11 ], "rotation": [ 0, 3 ], - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], "terrain": { " ": "t_nether_water_sh", "X": "t_nether_water_sh" }, "palettes": [ "lab_surface_palette" ] } diff --git a/data/mods/MindOverMatter/overmap/nether_crystal_field.json b/data/mods/MindOverMatter/overmap/nether_crystal_field.json index 6a0f72faad39d..aa841a5fbe9b9 100644 --- a/data/mods/MindOverMatter/overmap/nether_crystal_field.json +++ b/data/mods/MindOverMatter/overmap/nether_crystal_field.json @@ -59,11 +59,6 @@ "nested_mapgen_id": "crystal_moss_or_trees_3x3", "object": { "mapgensize": [ 3, 3 ], - "rows": [ - " ", - " ", - " " - ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ], "terrain": { " ": [ [ "t_grass_alien_2", 2 ], [ "t_tree_small_alien_1", 1 ], [ "t_null", 1 ] ] } } @@ -74,11 +69,6 @@ "nested_mapgen_id": "crystal_moss_or_trees_3x3", "object": { "mapgensize": [ 3, 3 ], - "rows": [ - " ", - " ", - " " - ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ], "terrain": { " ": [ [ "t_grass_alien_3", 1 ], [ "t_moss_alien_1", 1 ], [ "t_null", 1 ] ] } } @@ -89,11 +79,6 @@ "nested_mapgen_id": "crystal_moss_or_trees_3x3", "object": { "mapgensize": [ 3, 3 ], - "rows": [ - " ", - " ", - " " - ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ], "terrain": { " ": [ [ "t_tree_small_alien_2", 1 ], [ "t_moss_alien_2", 1 ], [ "t_null", 1 ] ] } } @@ -104,11 +89,6 @@ "nested_mapgen_id": "crystal_moss_or_trees_3x3", "object": { "mapgensize": [ 3, 3 ], - "rows": [ - " ", - " ", - " " - ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ], "terrain": { " ": [ [ "t_tree_small_alien_3", 1 ], [ "t_vines_alien_1", 1 ], [ "t_null", 1 ] ] } } @@ -191,10 +171,6 @@ "weight": 1000, "object": { "mapgensize": [ 2, 2 ], - "rows": [ - " ", - " " - ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ], "furniture": { "N": [ [ "f_nether_crystal_structure", 1 ], [ "f_null", 1 ] ] }, "place_monsters": [ { "monster": "GROUP_CRYSTAL_FIELD_PSYCHOACTIVE", "x": [ 0, 1 ], "y": [ 0, 1 ], "chance": 50, "repeat": [ 1, 3 ] } ] diff --git a/data/mods/Sky_Island/island_upgrades.json b/data/mods/Sky_Island/island_upgrades.json index 4b700a14bcfd3..0074125e8c9ed 100644 --- a/data/mods/Sky_Island/island_upgrades.json +++ b/data/mods/Sky_Island/island_upgrades.json @@ -135,36 +135,7 @@ "type": "mapgen", "method": "json", "update_mapgen_id": "mx_skyisland_solidstoneoverride", - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ], - "flags": [ "NO_UNDERLYING_ROTATE", "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], - "terrain": { " ": "t_warprock" } - } + "object": { "flags": [ "NO_UNDERLYING_ROTATE", "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "terrain": { " ": "t_warprock" } } }, { "type": "mapgen", diff --git a/data/mods/Sky_Island/missions_and_mapgen.json b/data/mods/Sky_Island/missions_and_mapgen.json index adfcde8b4d4ac..873e0c37648bc 100644 --- a/data/mods/Sky_Island/missions_and_mapgen.json +++ b/data/mods/Sky_Island/missions_and_mapgen.json @@ -1085,33 +1085,6 @@ "method": "json", "update_mapgen_id": "mapgen_dummyplace", "//": "This is a stopgap. If revert_location is called without a mapgen update, the game crashes. So this is a blank map update that does nothing but still prevents the crash. To be removed if the bug gets patched.", - "object": { - "rows": [ - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " - ] - } + "object": { } } ] diff --git a/data/mods/TEST_DATA/mapgen-test.json b/data/mods/TEST_DATA/mapgen-test.json index 9a9843f3a4791..71bd1d0db5ff1 100644 --- a/data/mods/TEST_DATA/mapgen-test.json +++ b/data/mods/TEST_DATA/mapgen-test.json @@ -39,15 +39,7 @@ "type": "mapgen", "method": "json", "nested_mapgen_id": "mapgen_test_nested", - "object": { - "mapgensize": [ 2, 2 ], - "rows": [ - " ", - " " - ], - "terrain": { " ": "t_region_groundcover" }, - "furniture": { " ": "f_armchair" } - } + "object": { "mapgensize": [ 2, 2 ], "terrain": { " ": "t_region_groundcover" }, "furniture": { " ": "f_armchair" } } }, { "type": "mapgen", diff --git a/data/mods/Xedra_Evolved/mapgen/nested/vampires.json b/data/mods/Xedra_Evolved/mapgen/nested/vampires.json index 09c9508d250bc..5b3ee79b38124 100644 --- a/data/mods/Xedra_Evolved/mapgen/nested/vampires.json +++ b/data/mods/Xedra_Evolved/mapgen/nested/vampires.json @@ -44,13 +44,6 @@ "nested_mapgen_id": "5x5_corpse_pile_W", "object": { "mapgensize": [ 5, 5 ], - "rows": [ - " ", - " ", - " ", - " ", - " " - ], "palettes": [ "standard_domestic_palette" ], "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ], "place_item": [ { "item": "corpse_generic_human", "x": [ 0, 4 ], "y": [ 0, 4 ], "chance": 65 } ], From 122cba219a68fb2622398fa344186dfbc81a3cd3 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:44:37 +0000 Subject: [PATCH 04/10] Appease our clang overlords --- src/mapgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index d0dcd687efdd3..f33c93fdb9ed1 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -4481,7 +4481,7 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) } empty_rows += empty_row; empty_rows += ']'; - auto empty_array_ = flexbuffer_cache::parse_buffer( empty_rows ); + shared_flexbuffer empty_array_ = flexbuffer_cache::parse_buffer( empty_rows ); parray = JsonArray( empty_array_, flexbuffer_root_from_storage( empty_array_->get_storage() ), {} ); } From ea0c1cdedbe4853b360f2bf76595cf0981dbd0d8 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Mar 2024 23:05:49 +0000 Subject: [PATCH 05/10] Tweaks --- data/json/mapgen/dummy/dummy.json | 12 +++--------- data/json/mapgen/rock_border.json | 4 ++-- .../psi_surface_lab/psi_lab_surface_nested.json | 2 +- .../MindOverMatter/overmap/nether_crystal_field.json | 1 - 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/data/json/mapgen/dummy/dummy.json b/data/json/mapgen/dummy/dummy.json index ad494198a7f04..cb7347eeb3e08 100644 --- a/data/json/mapgen/dummy/dummy.json +++ b/data/json/mapgen/dummy/dummy.json @@ -2,15 +2,9 @@ { "type": "mapgen", "method": "json", - "//": "This mapgen exist only for suppressing 'No mapgen terrain exists for %s' type of errors on game start and shouldn't spawn ingame", - "om_terrain": [ "unexplored" ], - "object": { "terrain": { " ": "t_null" } } - }, - { - "type": "mapgen", - "om_terrain": [ "omt_obsolete" ], - "method": "json", - "//": "this mapgen is used for replacing obsoleted overmap terrain, normally it shouldn't spawn", + "//unexplored": "This mapgen exist only for suppressing 'No mapgen terrain exists for %s' type of errors on game start and shouldn't spawn ingame", + "//omt_obsolete": "This mapgen is used for replacing obsoleted overmap terrain, normally it shouldn't spawn", + "om_terrain": [ "unexplored", "omt_obsolete" ], "object": { "fill_ter": "t_nether_glass_floor" } } ] diff --git a/data/json/mapgen/rock_border.json b/data/json/mapgen/rock_border.json index b92beabd289f8..4252c8225be9d 100644 --- a/data/json/mapgen/rock_border.json +++ b/data/json/mapgen/rock_border.json @@ -2,7 +2,7 @@ { "type": "mapgen", "method": "json", - "om_terrain": [ "rock_border" ], - "object": { "terrain": { " ": "t_rock" } } + "om_terrain": "rock_border", + "object": { "fill_ter": "t_rock" } } ] diff --git a/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json b/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json index f4ec04aec1267..501e4cdd51a9b 100644 --- a/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json +++ b/data/mods/MindOverMatter/mapgen/psi_surface_lab/psi_lab_surface_nested.json @@ -1301,7 +1301,7 @@ "object": { "mapgensize": [ 11, 11 ], "rotation": [ 0, 3 ], - "terrain": { " ": "t_nether_water_sh", "X": "t_nether_water_sh" }, + "terrain": { " ": "t_nether_water_sh" }, "palettes": [ "lab_surface_palette" ] } }, diff --git a/data/mods/MindOverMatter/overmap/nether_crystal_field.json b/data/mods/MindOverMatter/overmap/nether_crystal_field.json index aa841a5fbe9b9..0271883874441 100644 --- a/data/mods/MindOverMatter/overmap/nether_crystal_field.json +++ b/data/mods/MindOverMatter/overmap/nether_crystal_field.json @@ -172,7 +172,6 @@ "object": { "mapgensize": [ 2, 2 ], "flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ], - "furniture": { "N": [ [ "f_nether_crystal_structure", 1 ], [ "f_null", 1 ] ] }, "place_monsters": [ { "monster": "GROUP_CRYSTAL_FIELD_PSYCHOACTIVE", "x": [ 0, 1 ], "y": [ 0, 1 ], "chance": 50, "repeat": [ 1, 3 ] } ] } }, From 9ea50c1c57ee4d28504e6103919c64b4e5dfab9e Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Mar 2024 23:16:09 +0000 Subject: [PATCH 06/10] Our clang overlords lied to us --- src/mapgen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index f33c93fdb9ed1..eb3638b6d8063 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -4481,8 +4481,9 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) } empty_rows += empty_row; empty_rows += ']'; - shared_flexbuffer empty_array_ = flexbuffer_cache::parse_buffer( empty_rows ); - parray = JsonArray( empty_array_, flexbuffer_root_from_storage( empty_array_->get_storage() ), {} ); + std::shared_ptr parsed_array_ptr = flexbuffer_cache::parse_buffer( empty_rows ); + parray = JsonArray( parsed_array_ptr, + flexbuffer_root_from_storage( parsed_array_ptr->get_storage() ), {} ); } // just like mapf::basic_bind("stuff",blargle("foo", etc) ), only json input and faster when applying From 83617ac185799b74c94559256e0ceb839d8cd720 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Mar 2024 23:22:06 +0000 Subject: [PATCH 07/10] Documentation --- doc/MAPGEN.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/MAPGEN.md b/doc/MAPGEN.md index ea8c278c02f7e..b614c659d82f9 100644 --- a/doc/MAPGEN.md +++ b/doc/MAPGEN.md @@ -289,7 +289,7 @@ optional. ## Fill terrain using "fill_ter" -*required if "rows" is unset* Fill with the given terrain. +Fill with the given terrain. Value: `"string"`: Valid terrain id from data/json/terrain.json @@ -297,10 +297,11 @@ Example: `"fill_ter": "t_region_groundcover"` ## ASCII map using "rows" array -*required if "fill_ter" is unset* -Nested array of 24 (or 48) strings, each 24 (or 48) characters long, where each character is defined by "terrain" and -optionally "furniture" or other entries below. +Nested array usually of 24 strings, each 24 characters long but can vary for nests (in which case between 1 and 24) +and defining multiple overmap terrains maps at once (in which case a multiple of 24), +where each character is defined by "terrain" and optionally "furniture" or other entries below. +Defaults to all spaces " " if unset. Usage: From 7634ae3c214663f39617b79af59de12a96c06d2d Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:29:41 +0100 Subject: [PATCH 08/10] KISS --- src/mapgen.cpp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index eb3638b6d8063..f4fe450e32537 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -4456,8 +4456,9 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) point expected_dim = mapgensize + m_offset; cata_assert( expected_dim.x >= 0 ); cata_assert( expected_dim.y >= 0 ); - - if( jo.has_array( "rows" ) ) { + const std::string default_row( expected_dim.x, ' ' ); + const bool default_rows = !jo.has_array( "rows" ); + if( !default_rows ) { parray = jo.get_array( "rows" ); if( static_cast( parray.size() ) < expected_dim.y ) { parray.throw_error( string_format( "format: rows: must have at least %d rows, not %d", @@ -4468,22 +4469,6 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) string_format( "format: rows: must have %d rows, not %d; check mapgensize if applicable", total_size.y, parray.size() ) ); } - } else { - // Construct default "rows" of just spaces - const std::string spaces( expected_dim.x, ' ' ); - std::string empty_row( 1, '"' ); - empty_row += spaces; - empty_row += '"'; - std::string empty_rows = "["; - for( int rown = 0; rown < expected_dim.y - 1; rown++ ) { - empty_rows += empty_row; - empty_rows += ','; - } - empty_rows += empty_row; - empty_rows += ']'; - std::shared_ptr parsed_array_ptr = flexbuffer_cache::parse_buffer( empty_rows ); - parray = JsonArray( parsed_array_ptr, - flexbuffer_root_from_storage( parsed_array_ptr->get_storage() ), {} ); } // just like mapf::basic_bind("stuff",blargle("foo", etc) ), only json input and faster when applying @@ -4498,7 +4483,7 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) parameters = palette.get_parameters(); for( int c = m_offset.y; c < expected_dim.y; c++ ) { - const std::string row = parray.get_string( c ); + const std::string row = default_rows ? default_row : parray.get_string( c ); static std::vector row_keys; row_keys.clear(); row_keys.reserve( total_size.x ); From fdc07b5cd8471466ab3134f895b664d31c690e59 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Tue, 2 Apr 2024 23:05:14 +0100 Subject: [PATCH 09/10] Updates and adds error messages Excessive amount of errors just because otherwise you get a gibberish one --- src/mapgen.cpp | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index f4fe450e32537..9aa5add039d6c 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -4489,14 +4489,22 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) row_keys.reserve( total_size.x ); utf8_display_split_into( row, row_keys ); if( row_keys.size() < static_cast( expected_dim.x ) ) { - parray.throw_error( - string_format( " format: row %d must have at least %d columns, not %d", - c + 1, expected_dim.x, row_keys.size() ) ); + if( !default_rows ) { + parray.throw_error( + string_format( "format: row %d must have at least %d columns, not %d", + c + 1, expected_dim.x, row_keys.size() ) ); + } else { + jo.throw_error( "Defaulted rows row somehow has the wrong size!" ); + } } if( row_keys.size() != static_cast( total_size.x ) ) { - parray.throw_error( - string_format( " format: row %d must have %d columns, not %d; check mapgensize if applicable", - c + 1, total_size.x, row_keys.size() ) ); + if( !default_rows ) { + parray.throw_error( + string_format( "format: row %d must have %d columns, not %d; check mapgensize if applicable", + c + 1, total_size.x, row_keys.size() ) ); + } else { + jo.throw_error( "Defaulted rows somehow used the wrong number of rows!" ); + } } for( int i = m_offset.x; i < expected_dim.x; i++ ) { const point p = point( i, c ) - m_offset; @@ -4508,19 +4516,26 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) const bool has_placing = fpi != format_placings.end(); if( !has_terrain && !fallback_terrain_exists ) { - parray.string_error( - c, i + 1, - string_format( "format: rows: row %d column %d: " - "'%s' is not in 'terrain', and no 'fill_ter' is set!", - c + 1, i + 1, key.str ) ); - } - if( !has_terrain && !has_placing && key.str != " " && key.str != "." ) { - try { + if( !default_rows ) { parray.string_error( c, i + 1, - string_format( "format: rows: row %d column %d: " - "'%s' has no terrain, furniture, or other definition", + string_format( "format: rows: row %d column %d: '%s' is not in 'terrain'," + "and no 'fill_ter', 'predecessor_mapgen' or 'fallback_predecessor_mapgen' is set!", c + 1, i + 1, key.str ) ); + } else { + jo.throw_error( "format: ' ' is not in 'terrain', and no 'fill_ter', 'predecessor_mapgen' or 'fallback_predecessor_mapgen' is set!" ); + } + } + if( !has_terrain && !has_placing && key.str != " " && key.str != "." ) { + try { + if( !default_rows ) { + parray.string_error( + c, i + 1, + string_format( "format: rows: row %d column %d: '%s' has no terrain, furniture, or other definition", + c + 1, i + 1, key.str ) ); + } else { + jo.throw_error( "Defaulted rows somehow has a non ' ' character!" ); + } } catch( const JsonError &e ) { debugmsg( "(json-error)\n%s", e.what() ); } @@ -4538,7 +4553,7 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) // No fill_ter? No format? GTFO. if( !fallback_terrain_exists ) { jo.throw_error( - "Need one of 'fill_terrain' or 'predecessor_mapgen' or 'rows' + 'terrain'" ); + "Need one of 'fill_terrain', 'predecessor_mapgen', 'fallback_predecessor_mapgen', 'terrain' or a palette providing 'terrain'." ); // TODO: write TFM. } From ca1f71f4b640dbe504cd77cfab2fcbe92e683168 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Wed, 3 Apr 2024 19:39:04 +0100 Subject: [PATCH 10/10] Less very unlikely error messages --- src/mapgen.cpp | 48 +++++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 9aa5add039d6c..7a2a4e3b25291 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -4489,22 +4489,16 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) row_keys.reserve( total_size.x ); utf8_display_split_into( row, row_keys ); if( row_keys.size() < static_cast( expected_dim.x ) ) { - if( !default_rows ) { - parray.throw_error( - string_format( "format: row %d must have at least %d columns, not %d", - c + 1, expected_dim.x, row_keys.size() ) ); - } else { - jo.throw_error( "Defaulted rows row somehow has the wrong size!" ); - } + cata_assert( !default_rows ); + parray.throw_error( + string_format( "format: row %d must have at least %d columns, not %d", + c + 1, expected_dim.x, row_keys.size() ) ); } if( row_keys.size() != static_cast( total_size.x ) ) { - if( !default_rows ) { - parray.throw_error( - string_format( "format: row %d must have %d columns, not %d; check mapgensize if applicable", - c + 1, total_size.x, row_keys.size() ) ); - } else { - jo.throw_error( "Defaulted rows somehow used the wrong number of rows!" ); - } + cata_assert( !default_rows ); + parray.throw_error( + string_format( "format: row %d must have %d columns, not %d; check mapgensize if applicable", + c + 1, total_size.x, row_keys.size() ) ); } for( int i = m_offset.x; i < expected_dim.x; i++ ) { const point p = point( i, c ) - m_offset; @@ -4516,26 +4510,18 @@ bool mapgen_function_json_base::setup_common( const JsonObject &jo ) const bool has_placing = fpi != format_placings.end(); if( !has_terrain && !fallback_terrain_exists ) { - if( !default_rows ) { - parray.string_error( - c, i + 1, - string_format( "format: rows: row %d column %d: '%s' is not in 'terrain'," - "and no 'fill_ter', 'predecessor_mapgen' or 'fallback_predecessor_mapgen' is set!", - c + 1, i + 1, key.str ) ); - } else { - jo.throw_error( "format: ' ' is not in 'terrain', and no 'fill_ter', 'predecessor_mapgen' or 'fallback_predecessor_mapgen' is set!" ); - } + cata_assert( !default_rows ); + parray.string_error( c, i + 1, + string_format( "format: rows: row %d column %d: '%s' is not in 'terrain'," + "and no 'fill_ter', 'predecessor_mapgen' or 'fallback_predecessor_mapgen' is set!", + c + 1, i + 1, key.str ) ); } if( !has_terrain && !has_placing && key.str != " " && key.str != "." ) { try { - if( !default_rows ) { - parray.string_error( - c, i + 1, - string_format( "format: rows: row %d column %d: '%s' has no terrain, furniture, or other definition", - c + 1, i + 1, key.str ) ); - } else { - jo.throw_error( "Defaulted rows somehow has a non ' ' character!" ); - } + cata_assert( !default_rows ); + parray.string_error( c, i + 1, + string_format( "format: rows: row %d column %d: '%s' has no terrain, furniture, or other definition", + c + 1, i + 1, key.str ) ); } catch( const JsonError &e ) { debugmsg( "(json-error)\n%s", e.what() ); }