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

Allow a specified rotation when placing a nested map #37459

Closed
I-am-Erk opened this issue Jan 28, 2020 · 4 comments
Closed

Allow a specified rotation when placing a nested map #37459

I-am-Erk opened this issue Jan 28, 2020 · 4 comments
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display (P3 - Medium) Medium (normal) priority stale Closed for lack of activity, but still valid.

Comments

@I-am-Erk
Copy link
Member

I-am-Erk commented Jan 28, 2020

Is your feature request related to a problem? Please describe.

When I'm designing a map that uses nested mapgen chunks, I often need to rotate them to face a different direction. This leads to a huge amount of duplicated work as I create "north", "south", "east" and "west" versions of a map. For example, in my + shaped lab map, I need to make four different versions of every large lab map to go in each of the 'wings'. This is a huge PITA and a massive waste of line counts.

Describe the solution you'd like
Allow me to specify rotation when I place the item, using the syntax "rotation": x where x is 0, 1, 2, or 3.
0: No rotation compared to nested mapgen file definition.
1: 90 degree CW rotation
2: 180 degree rotation
3: 270 degree rotation (90 degree CCW)

EG:
The following would place the beautiful_submap at point N, rotated 90 degrees CW.

"nested": {
  "N": { "chunks": [ "beautiful_submap" ], "rotation": 1 }
}

The following would place the gorgeous_submap and allow it to randomly spawn at either rotation 0 (no rotation), rotation 2 (180 degree rotation), or rotation 3 (270 degree rotation.

"place_nested": [
        { "chunks": [ "gorgeous_submap" ], "x": 3, "y": 10, "chance": 75, "rotation": [ 0, 2, 3 ] }
],

Describe alternatives you've considered

I would also love a way to horizontally or vertically mirror maps, but that gets into some order of operations stuff.

Additional context

I can't bring myself to finish my new lab floorplan until this is done, it's just too much repetition of the same design over and over.

@I-am-Erk I-am-Erk added <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` labels Jan 28, 2020
@scorpion451
Copy link

scorpion451 commented Jan 29, 2020

Where in the code does the nested generation stuff live? I think I know a fairly simple and lightweight way to do this (including the mirroring) from my own procedural generation experiments, but I'd need to see the code to figure out how to plug it in. (Ideally, this function would go between reading in the template and passing that to the generator)

Short version is that you don't change the array, just how you read it in.

@I-am-Erk
Copy link
Member Author

I-am-Erk commented Feb 1, 2020

There is already an ability to rotate maps in mapgen, we basically just need to call that. Unfortunately I have no idea where that is. @ralreegorganon is probably the biggest expert there.

@stale
Copy link

stale bot commented Mar 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Mar 2, 2020
@stale
Copy link

stale bot commented Apr 1, 2020

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

@stale stale bot closed this as completed Apr 1, 2020
@I-am-Erk I-am-Erk added the (P3 - Medium) Medium (normal) priority label Apr 1, 2020
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 [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display (P3 - Medium) Medium (normal) priority stale Closed for lack of activity, but still valid.
Projects
None yet
Development

No branches or pull requests

2 participants