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

RoomSpawner mask #33110

Merged
merged 16 commits into from
Feb 12, 2025
Merged

Conversation

TheShuEd
Copy link
Member

@TheShuEd TheShuEd commented Nov 1, 2024

About the PR

Add tilemask for room spawning.
In the room prototype, you can specify a tile that will be ignored when transferred to the actual game. This is EXTREMELY useful for procedural generation:

right now, in the game all rooms have clear square dimensions, and are copied in their entirety. If we want to have irregularly shaped rooms, we have to do a terrible thing: stitch environment elements into the room itself. As it is done now on VGroid:

image

this has the disadvantage that these rooms cannot be reused, for example in generation with a different kind of stone and floor.

What I did: I added the ability to specify a tile mask that will be ignored

image

and now these rooms fit perfectly into any biome or asteroid:

image

I also removed the restriction that room spawners can only spawn rooms of 1 size. Now they can spawn rooms of any size, although the restriction can be rewritten through prototypes.

Breaking changes

RoomFillComponent ClearExisting field now true by default. This means that all rooms from RoomFillComponent now by default erase all entities underneath them.

[DataField]
public bool ClearExisting = true;

DungeonSystem.Rooms.cs GetRoomPrototype function changed from
public DungeonRoomPrototype? GetRoomPrototype(Vector2i size, Random random, EntityWhitelist? whitelist = null)
to
public DungeonRoomPrototype? GetRoomPrototype(Random random, EntityWhitelist? whitelist = null, Vector2i? size = null)
this function now does not limit the rooms it spawns to a certain default size.

Requirements

@github-actions github-actions bot added the Changes: Map Changes: Might require knowledge of mapping. label Nov 1, 2024
@dvir001
Copy link
Contributor

dvir001 commented Nov 1, 2024

Game changer

@SlamBamActionman SlamBamActionman added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Nov 14, 2024
@github-actions github-actions bot added the size/XL Denotes a PR that changes 5000+ lines. label Nov 17, 2024
@ScarKy0 ScarKy0 added P1: High Priority: Higher priority than other items, but isn't an emergency. T: New Feature Type: New feature or content, or extending existing content D2: Medium Difficulty: A good amount of codebase knowledge required. S: Needs Review Status: Requires additional reviews before being fully accepted A: Mapping Area: Maps, or tools used for mapping A: Core Tech Area: Underlying core tech for the game and the Github repository. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Nov 19, 2024
@github-actions github-actions bot added size/L Denotes a PR that changes 1000-4999 lines. and removed size/XL Denotes a PR that changes 5000+ lines. labels Feb 3, 2025
@TheShuEd TheShuEd added the S: Approved Status: Reviewed and approved by at least one maintainer; a PR may require another approval. label Feb 3, 2025
Content.Server/Procedural/DungeonSystem.Rooms.cs Outdated Show resolved Hide resolved
Content.Server/Procedural/RoomFillComponent.cs Outdated Show resolved Hide resolved
Content.Server/Procedural/DungeonSystem.Rooms.cs Outdated Show resolved Hide resolved
@metalgearsloth metalgearsloth added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted labels Feb 10, 2025
@TheShuEd TheShuEd removed the S: Awaiting Changes Status: Changes are required before another review can happen label Feb 10, 2025
@TheShuEd TheShuEd merged commit 47cb8a0 into space-wizards:master Feb 12, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Core Tech Area: Underlying core tech for the game and the Github repository. A: Mapping Area: Maps, or tools used for mapping Changes: Map Changes: Might require knowledge of mapping. D2: Medium Difficulty: A good amount of codebase knowledge required. P1: High Priority: Higher priority than other items, but isn't an emergency. S: Approved Status: Reviewed and approved by at least one maintainer; a PR may require another approval. size/L Denotes a PR that changes 1000-4999 lines. T: New Feature Type: New feature or content, or extending existing content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants