# List of hard-coded mapgen functions to be moved to JSON

**URL:** <https://discourse.cataclysmdda.org/t/list-of-hard-coded-mapgen-functions-to-be-moved-to-json/14736>\
**Category:** The Lab\
**Created:** [January 4, 2018, 11:42pm UTC](https://discourse.cataclysmdda.org/t/list-of-hard-coded-mapgen-functions-to-be-moved-to-json/14736 "2018-01-04T23:42:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [January 4, 2018, 11:42pm UTC](https://discourse.cataclysmdda.org/t/list-of-hard-coded-mapgen-functions-to-be-moved-to-json/14736/1 "2018-01-04T23:42:08Z")

</div>

There are a lot of hardcoded mapgen functions still in the code which should be moved out of CPP to JSON (or LUA):

- multiple functions in [mapgen\_function.cpp](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/mapgen_functions.cpp);
- H-U-U-U-U-U-G-E `map::draw` function in [mapgen.cpp](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/mapgen.cpp).

This issue is aimed to track what functions are left to be jsonized.

_Randomization can be implemented in LUA right now, but it is not an option for non-LUA builds._

### Merged (as of 2018-02-04):

- `bank` - [#21823](https://github.com/CleverRaven/Cataclysm-DDA/pull/21823) (_some randomness was dropped_);
- `lmoe` - [#21822](https://github.com/CleverRaven/Cataclysm-DDA/pull/21822);
- `radio_tower` - [#21834](https://github.com/CleverRaven/Cataclysm-DDA/pull/21834) (_some randomness was dropped_);
- `sub_station` - [#21836](https://github.com/CleverRaven/Cataclysm-DDA/pull/21836) (_some randomness was dropped_);
- `church_gothic` - [#21217](https://github.com/CleverRaven/Cataclysm-DDA/pull/21217);
- `church_new_england` - [#21217](https://github.com/CleverRaven/Cataclysm-DDA/pull/21217);
- `office_doctor` - [#21217](https://github.com/CleverRaven/Cataclysm-DDA/pull/21217);
- `prison` - [#21211](https://github.com/CleverRaven/Cataclysm-DDA/pull/21211);
- `hospital`, `hospital_entrance` - [#22543](https://github.com/CleverRaven/Cataclysm-DDA/pull/22543).

### To be merged (as of 2018-02-04):

- `fema`, `fema_entrance` - [#22366](https://github.com/CleverRaven/Cataclysm-DDA/pull/22366) (_added as mod for easy testing, subsequently need changes to cpp, also need to be mainlined if overmap terrains are used as start locations and/or in quest chains_);
- `megastore`, `megastore_entrance` - [#22366](https://github.com/CleverRaven/Cataclysm-DDA/pull/22366) (_added as mod for easy testing, subsequently need changes to cpp, also need to be mainlined if overmap terrains are used as start locations and/or in quest chains_);
- `silo`, `silo_finale` - [#22366](https://github.com/CleverRaven/Cataclysm-DDA/pull/22366) (_added as mod for easy testing, subsequently need changes to cpp, also need to be mainlined if overmap terrains are used as start locations and/or in quest chains_);
- `shelter_under` - [#22878](https://github.com/CleverRaven/Cataclysm-DDA/pull/22878).

### Not ready (_possibly_ need randomization in JSON):

- `haz_sar`, `haz_sar_b1`, `haz_sar_entrance`, `haz_sar_entrance_b1`;
- `mansion`, `mansion_entrance`;
- `office_tower_1`, `office_tower_1_entrance`, `office_tower_b`, `office_tower_b_entrance`;
- `outpost`;
- `parking_lot`;
- `police`;
- `sewage_treatment`, `sewage_treatment_hub`, `sewage_treatment_under`;
- `spiral`, `spiral_hub`;
- `station_radio`;
- `temple`, `temple_finale`, `temple_stairs`;
- `toxic_dump`.

### Not ready (_most certainly_ need randomization in JSON)

- `mil_surplus`;
- `pawn`;
- `s_gas`;
- `s_pharm`;
- `s_sports`.

### Should be left in code (and probably need rework):

#### Ant-related:

- `anthill`, `ants_curved`, `ants_end`, `ants_food`, `ants_four_way`, `ants_larvae`, `ants_queen`, `ants_straight`, `ants_tee`.

#### Basement and houses:

- `basement_generic_layout`, `basement_junk`, `basement_spiders`, `house_generic_big_livingroom`, `house_generic_boxy`, `house_generic_center_hallway`.

#### Fungal:

- `fungal_bloom`, `fungal_flowers`, `fungal_tower`.

#### Lab:

- `ice_lab`, `ice_lab_core`, `ice_lab_finale`, `ice_lab_stairs`, `lab`, `lab_core`, `lab_finale`, `lab_stairs`.

#### Mine:

- `mine`, `mine_down`, `mine_entrance`, `mine_finale`, `mine_shaft`.

#### River:

- `river_center`, `river_curved_not`, `river_curved`, `river_straight`.

#### Road:

- `bridge`, `highway`, `road_curved`, `road_end`, `road_four_way`, `road_straight`, `road_tee`, `rock`.

#### Sewer:

- `sewer_curved`, `sewer_end`, `sewer_four_way`, `sewer_straight`, `sewer_tee`.

#### Spider:

- `spider_pit`, `spider_pit_under`.

#### Subway:

- `subway_curved`, `subway_end`, `subway_four_way`, `subway_station`, `subway_straight`, `subway_tee`.

#### Triffid:

- `triffid_finale`, `triffid_roots`.

#### Other

- `crater`, `dirtlot`, `field`, `forest`, `hive`, `null`, `open_air`, `cave_rat`, `cave`, `cavern`, `empty_rock`, `hellmouth`, `rift`, `slimepit_down`.

* * *

This topic is continuation of:

> <https://github.com/CleverRaven/Cataclysm-DDA/issues/21824>

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [January 4, 2018, 11:57pm UTC](https://discourse.cataclysmdda.org/t/list-of-hard-coded-mapgen-functions-to-be-moved-to-json/14736/2 "2018-01-04T23:57:38Z")

</div>

# Useful links:

> <https://github.com/CleverRaven/Cataclysm-DDA/issues/19376>

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/21900>

[https://discourse.cataclysmdda.org/t/14353](https://discourse.cataclysmdda.org/t/14353)

[https://discourse.cataclysmdda.org/t/13515](https://discourse.cataclysmdda.org/t/13515)
