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

First draft of json-augmentation of labs #24114

Merged
merged 45 commits into from Jul 16, 2018

Conversation

4 participants
@BrianLefler
Copy link
Contributor

commented Jun 27, 2018

Would love feedback on this. It adds two json map names with special treatment: lab_1side and lab_4side.

Any map which is added under those names will go into the mix to be randomly selected when creating labs. They use the standard json generation, but add on proper handling for stairs and ice_lab settings.

They are mixed in with existing content in this way:

  • lab_1side maps will be weighted alongside the 2 current 1-sided options (barracks & prisoner containment, each of which have a weight of 400).
  • lab_4side maps will be used 20% of the time.

The maps that have been created use nested submaps extensively to populate a lot of smaller rooms, similar to the existing cross and tic-tac-toe boards. But they aren't great and I'm not very good with json, so if anyone wants to make suggestions or changes, I'd love to see more. I just wanted to get the ball rollling.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2018

That is something we were all waiting for a long time - see #10958.

I will take a look asap.

@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jun 27, 2018

Cool, well the json runs alongside rather than replacing. The thought would be as content came in, a greater portion of labs could become json-driven, until it becomes almost entirely json (leaving just stairs, cold, and ant/slime adjacency effects to be handled in code). The 1sided rooms adjust naturally, the 4sided rooms require a tiny cpp change to make it more common.

I heavily used the nested json functionality to have variation--that feature's amazing and thank you I think to @Coolthulhu for doing it.

Right now it does not support rotation, seem to set traps, or allow non-square maps; all of which would make life a little easier if added and I'd like to dig into later. I put rotation settings in nested json objects right now, which should just increase the observed variation whenever it gets implemented.

@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jun 27, 2018

Ok, I have cleaned up the adjacency json to ensure walls in all 4 directions (walls north&west, remove doors south&east). It is a bit brutal in that it completely clobbers whatever's there, but it works.

I am a bit suspicious of the drop rates, which I suspect I've set a little high. Any idea if it's possible / desirable to consolidate loot generation into a palette? Then it could be reused through lab json and tweaked in one place to get the right level of loot.

"object": {
"mapgensize": [ 24, 24 ],
"place_terrain": [
{ "ter": "t_concrete_wall", "x": 0, "y": 0 },

This comment has been minimized.

Copy link
@ZhilkinSerg

This comment has been minimized.

Copy link
@BrianLefler

BrianLefler Jun 28, 2018

Author Contributor

Cool, that is really nice except that set-line turns out to not trigger the removal of furniture when walls are placed over them, so it leaves counters etc floating in the wall. I will update the json if I can figure out how to add that feature.

This comment has been minimized.

Copy link
@AMurkin

AMurkin Jun 28, 2018

Contributor

Am i wrong that there is an error in the example of "line" in MAPGEN.md?
Example: { "point": "terrain", "id": "t_lava", "x:" 5, "y": 5, "x2": 20, "y2": 20 }

This comment has been minimized.

Copy link
@ZhilkinSerg

ZhilkinSerg Jun 28, 2018

Contributor

Yes, docs can be outdated a bit.

@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jun 29, 2018

If I have time over the next week I can separate the json out into files (24x24 floorplans, 7x7/9x9 subrooms, palettes) and add more content. I could also start migrating hardcoded content to json if people want.

Most useful for me is direction on what people want to see done here, or whether it should go in as a pull now and be added to later.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Jun 30, 2018

Most useful for me is direction on what people want to see done here, or whether it should go in as a pull now and be added to later.

Great job so far! Will try to mergetest it during weekend and give some feedback.

@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jul 4, 2018

Ok, added. It's a little unoriginal, but the operating theatre is basically a 180 rotation of the existing alien containment, with the option of a hard hack (security 6) to unlock to the autodoc room, or an easy hack (security 2) to unlock all doors and fight your way through four cyborgs.

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented Jul 4, 2018

Cool, thank you so much.

BrianLefler added some commits Jul 4, 2018

Add support for rotated lab maps, make lab autodoc rotate, improve la…
…yout.

Specifically, set cells & autodoc room as t_blue_floor to avoid getting stairs.
Update lab json to use blue floors to prevent stairs inside barracks,…
… cages, vaults.

Also fix a bug in stair generation for 1-sided lab tiles which would place stairs atop furniture (other stair generation did not do this).
Remove hardcoded barracks and human containment, plus supporting code…
…. Add json.

The hulk door-smashed version of the barracks has become a 1-in-7 chance event.
@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jul 4, 2018

The hard-coded barracks and prisoner containment areas should now be in json, with the hardcoded versions removed. This is the first time I've removed content instead of adding it, so it should be very obvious in testing.

Differences:

  • containment rooms always have zombies, instead of a 50% chance of bodies (not sure how to do that in json).
  • stairs are always outside security & floors inside security are blue.
  • there is a 1-in-7 chance of the doors being smashed in by a hulk, which will 90% of the time be still there.
  • slight differences in monster spawns (but it should be similar, json just has different levers).

Also, while I'm at it, in the barracks, shouldn't the magazine access control room have the doors reversed--so the locked door goes to the magazine and the unlocked door goes to the general barracks? I have always smashed the window in and ignored the console, which seems like a mistake by whomever originally made the map.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

Sorry, I didn't have time to look at this yet. Please inform when you think it will be ready to go and I will start testing. You could always add more changes in later PRs.

@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jul 5, 2018

Ok. I am at a great stopping point. The big hardcoded rooms for the lab have now all been converted to json. It now does have a merge conflict, should I pull from master and resolve it or is that something you want to do?

Summary of big changes a player will notice:

  • Semi-randomized json rooms, with cross, tic-tac-toe, etc layouts, and a dozen or so types of rooms (~20% of tiles).
  • Barracks and prisoner containment now have blue floors and won't have stairs go into the locked areas. 1-in-7 chance a hulk will have broken the door.
  • Barracks magazine console now needs to be hacked to get in, smashing the window won't help any more.
  • The big rooms will now rotate after being converted to json (~20% of tiles).
  • New bionic vault will appear rarely (will work out to about 1 in a 100 tiles).
@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jul 5, 2018

Ok, I have merged in master. Should be good to review and I'm not planning any additional changes at this time.

@ZhilkinSerg ZhilkinSerg self-assigned this Jul 10, 2018

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2018

Some furniture is spawned inside walls (look at those crates and tables):

image

@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2018

Yeah, I know! I couldn't figure out a clean way to avoid this but it should not be visible to the user unless they take a jackhammer and start blasting through wall. What's happening is that applying a submap with rows doesn't overwrite furniture. So there's a room w/ furniture there in the normal cross-layout, then we decide to replace it with rocks & close the door (because it borders rocks). The submap replaces the terrain w/ rocks, but not the furniture.

I think I can get rid of the furniture that by replacing the 9x9 submap with 81 individual place_terrain calls. Will do that in a few days (as part of this PR or another).

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2018

I think I can get rid of the furniture that by replacing the 9x9 submap with 81 individual place_terrain calls. Will do that in a few days (as part of this PR or another).

I guess that will be fine to fix in another PR.

@BrianLefler

This comment has been minimized.

Copy link
Contributor Author

commented Jul 13, 2018

Ok, I think the furniture floating is now fixed and I found a way to keep the json required relatively small.

@ZhilkinSerg ZhilkinSerg merged commit 9157781 into CleverRaven:master Jul 16, 2018

4 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.06%) to 23.22%
Details
gorgon-ghprb Build finished.
Details

@ZhilkinSerg ZhilkinSerg removed their assignment Jul 18, 2018

@BrianLefler BrianLefler deleted the BrianLefler:lab_json branch Jul 21, 2018

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.