audinowho / PMDODump

All content generation for PMDO. BEWARE SPOILERS.
MIT License
61 stars 13 forks source link

Monster House triggered outside of room #496

Open audinowho opened 6 days ago

audinowho commented 6 days ago

This happened in Thunderstruck Pass

2024-09-04_15-43-11.zip

Its cause monster houses check a rectangle that contains the house And you entered THE RECTANGLE

The easy way to sidestep it is to make the diamond rooms not include the edges The hard way is to stencil in the exact tiles you want to trigger the house with on generation

audinowho commented 6 days ago

Proposed pull request:

https://github.com/Suguis/PMDODump/tree/monster-houses-using-room-open-locs

audinowho commented 6 days ago

https://github.com/Suguis/RogueElements/blob/b3cab9f480cd78e12ef364fb0a5064349cc8934f/RogueElements/MapGen/Rooms/RoomGen.cs#L102

we can't have this be a virtual method it has to be an abstract method and every child class has to inherit and implement it It's best practice, because it prevents people from using the library thinking that method's functional for all room types, when it's really just one but aaauugh that's gonna require you to implement it for every room... that'll put this branch in an unbuildable state for a while so you may want to take this task on last. More stuff... I think you should rename the method to IsLocDrawnOn Such that we define this method not just as the method to determine the parts that a room made walkable but the parts that the room drew on because some rooms draw water tiles, lava, etc. Then, on the usage side... since every room is now being updated to track which tiles they drew on, You should move this variable to the base class https://github.com/Suguis/RogueEssence/blob/364fc8beee52f0b95de0673b133f3d7dfa5e9ddc/RogueEssence/LevelGen/Floors/GenSteps/Rooms/RoomGenDiamond.cs#L43 Also turn it into a hashmap for faster querying And make it NonSerializable because this isn't a setting of the room gen Then, whenever you perform a draw operation in this class https://github.com/Suguis/RogueEssence/blob/364fc8beee52f0b95de0673b133f3d7dfa5e9ddc/RogueEssence/LevelGen/Floors/GenSteps/Rooms/RoomGenDiamond.cs#L62 Instead of calling both methods in succession, refactor it such that it calls one method, passing in the map, location, and room terrain. And that method shall call the two methods in succession.

Move that method to the base roomgen class, because it can then be used by every roomgen child class to replace their tile-changing operations. Thus all their tile-changing operations will automatically update their own list of which tiles they messed with. Lastly, you can make a pull request out of these branches. That makes it easier for me to comment and contribute my own changes.