-
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
Parametric mapgen part 1: global random terrain selection #48529
Merged
Conversation
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
actual-nh
added
0.F Feature Freeze
[C++]
Changes (can be) made in C++. Previously named `Code`
Map / Mapgen
Overmap, Mapgen, Map extras, Map display
<Enhancement / Feature>
New features, or enhancements on existing
labels
Apr 15, 2021
jbytheway
force-pushed
the
parametric_mapgen
branch
from
April 16, 2021 00:02
53f70e7
to
e8a3dfe
Compare
Docs written. Marking ready for review. |
jbytheway
force-pushed
the
parametric_mapgen
branch
from
April 19, 2021 19:17
fa5e03a
to
05eeffd
Compare
actual-nh
reviewed
Apr 20, 2021
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.
Minor grammar/style fixes.
jbytheway
requested review from
BrettDong,
Fris0uman,
I-am-Erk,
John-Candlebury,
Maleclypse and
Mom-Bun
as code owners
April 20, 2021 06:58
ZhilkinSerg
force-pushed
the
0.F-dev
branch
2 times, most recently
from
April 20, 2021 07:49
592543e
to
54a4e7f
Compare
actual-nh
removed request for
John-Candlebury,
BrettDong,
KorGgenT,
Fris0uman,
Mom-Bun,
I-am-Erk and
Maleclypse
April 20, 2021 13:48
jbytheway
force-pushed
the
parametric_mapgen
branch
from
April 20, 2021 13:48
a81de00
to
fee777c
Compare
ZhilkinSerg
force-pushed
the
0.F-dev
branch
2 times, most recently
from
May 28, 2021 11:01
1e56e04
to
d80906b
Compare
ZhilkinSerg
force-pushed
the
0.F-dev
branch
3 times, most recently
from
June 14, 2021 15:06
ac1984a
to
c8f13cf
Compare
jbytheway
force-pushed
the
parametric_mapgen
branch
from
June 21, 2021 11:12
fee777c
to
68b6c1a
Compare
Rebased on latest |
This was referenced Jun 21, 2021
Closed
jbytheway
force-pushed
the
parametric_mapgen
branch
from
June 22, 2021 00:41
68b6c1a
to
ea4fed5
Compare
jbytheway
force-pushed
the
parametric_mapgen
branch
from
July 4, 2021 12:15
ea4fed5
to
ce2d41f
Compare
jbytheway
force-pushed
the
parametric_mapgen
branch
2 times, most recently
from
July 7, 2021 01:38
66f7865
to
44bc39f
Compare
This is a generic function for loading a weighted_list from json that can be used to reduce code duplication and ensure json consistency.
This function had no definition and no callers.
This is an initial implementation of parameters for mapgen, which currently has those parameters act more like variables than parameters. Essentially all it currently permits is to choose a terrain at random and use that in a palette. Thus choosing a thing at random which applies to an entire map, rather than choosing at random on a per-tile basis. This is the first step towards true parameters for mapgen; hence the currently-misleading name.
Co-authored-by: actual-nh <[email protected]>
jbytheway
force-pushed
the
parametric_mapgen
branch
from
July 7, 2021 12:08
44bc39f
to
43d7426
Compare
This was referenced Aug 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
<Enhancement / Feature>
New features, or enhancements on existing
Map / Mapgen
Overmap, Mapgen, Map extras, Map display
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.
Summary
Infrastructure "New mapgen feature: maps can now select a terrain from a distribution and use that throughout the map"
Purpose of change
Interesting variable mapgen requires randomness. We currently have a fair amount of flexibility using nested mapgen that can allow for interesting variation, but it is difficult to use this to make large-scale changes to all of a map.
In particular, suppose you want to make a house layout which can use one of two different floor terrains, but is consistent throughout the house. Currently that would be possible using nested mapgen, but it would be tricky and nonintuitive. Also, nested mapgen can't extend over multiple OMTs.
Describe the solution
Add a new feature whereby a random choice can be made one time for the whole map, and the chosen value used as often as desired.
Currently this is a minimal proof of concept:
I plan to lift all of these limitations in future PRs.
Apply this new feature in one map as an example: the crack house roof now chooses between three different roof terrain options.
Opening as draft because I still want to write documentation.Docs now written.Describe alternatives you've considered
Doing a more complete version for the initial PR.
Testing
Unit tests. Game data loads. Spawning the crack house generates suitable randomization, as seen in this screenshot:
Additional context