Skip to content
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

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

Closed
ZhilkinSerg opened this issue Sep 9, 2017 · 10 comments

Comments

5 participants
@ZhilkinSerg
Copy link
Contributor

commented Sep 9, 2017

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

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-01-05):

  • bank - #21823 (some randomness was dropped);
  • lmoe - #21822;
  • radio_tower - #21834 (some randomness was dropped);
  • sub_station - #21836 (some randomness was dropped);
  • church_gothic - #21217;
  • church_new_england - #21217;
  • office_doctor - #21217;
  • prison - #21211;
  • hospital, hospital_entrance - #22543.

To be merged (as of 2018-01-05):

  • fema, fema_entrance - #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 (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 (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).

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;
  • shelter_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.

Further progress tracking is moved to https://discourse.cataclysmdda.org/t/14736.

@ZhilkinSerg ZhilkinSerg changed the title List of mapgen function to be moved to JSON List of hard-coded mapgen functions to be moved to JSON Sep 9, 2017

@vache

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2017

fema, fema_entrance;
hospital, hospital_entrance;
mansion, mansion_entrance;
megastore, megastore_entrance

These all make heavy use of randomization as implemented now. It will be next to impossible to duplicate their current functionality in JSON.

outpost;

I'm assuming this is the military outpost, in which case, it also uses a lot of random layouts, though it often generates very poorly and a more static layout is probably more desirable.

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2017

I could help with the randomization, but I'd need to know how should the interface look like to be usable.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2017

I could help with the randomization, but I'd need to know how should the interface look like to be usable.

Thanks. Can you talk @kevingranade out of axing LUA? ;)

Seriously, that is the only way to keep random stuff in its current state when moving it out of hardcode. If you look through the hardcoded mapgen code most of random stuff is:

  • select some random point;
  • draw some rooms with random dimensions;
  • put windows, doors and in random location inside of generated room.

It is very easy to transfer most of such code from cpp to lua (actually I did it for several buldings and can say it was pretty easy). It will be very awkward to have it implemented in json: we need to implement several functions in JSON which are already in LUA (a more powerful tool), so why bothering with reimplementation?

Also lua is very good for post-processing of generated buildings: @vache wanted to implement such modifications in #7892 and actually I would like to either revive this PR or move it to dda-lua.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2017

These all make heavy use of randomization as implemented now. It will be next to impossible to duplicate their current functionality in JSON.

There was very good approach for random layouts of overmap specials in Mansion Upgrade Project.

I believe we can use it for hospital, megastore, mansion, fema and similar multi-tile facilities. We probably don't even need any extra code - only some work with json maps to make tile connect properly.

@vache

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2017

It should be possible to easily recreate a lot of the random aspects, at least of the FEMA camp and mansion by simply using alternate omts in the special definitions for them. So, instead of following the fema_entrance/fema pattern, follow the school_1_1, school_1_2, school_1_3 etc. pattern, and having multiple mapgens for each of the _1_1, _1_2 variants, and just ensuring that the linkages to adjacent overmaps always line up.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2017

It should be possible to easily recreate a lot of the random aspects, at least of the FEMA camp and mansion by simply using alternate omts in the special definitions for them. So, instead of following the fema_entrance/fema pattern, follow the school_1_1, school_1_2, school_1_3 etc. pattern, and having multiple mapgens for each of the _1_1, _1_2 variants, and just ensuring that the linkages to adjacent overmaps always line up.

Yes, the only issue here is editing maps to fix linking to adjacent tiles.

@vache

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2017

Also lua is very good for post-processing of generated buildings: @vache wanted to implement such modifications in #7892 and actually I would like to either revive this PR or move it to dda-lua.

I tried to rez that branch a little while back and never really made any major progress with it, my notes on it are still up though, vache#15

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jan 3, 2018

No recent progress, and issue scope is over-large.
Please track this kind of thing in a wiki or forum post.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor Author

commented Jan 3, 2018

No recent progress, and issue scope is over-large.

May I disagree with the first statement? There are two huge PRs waiting to be merged: #22366 and #22543. The latter is just two weeks old.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor Author

commented Jan 4, 2018

Please track this kind of thing in a wiki or forum post.

Moved progress tracking to https://discourse.cataclysmdda.org/t/14736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.