Devlog #2 - Loading Saved Rooms
Got rooms to save from rando runs and load into the hub! (and a menu to select which room to load)
Quick rundown of how I'm doing this -
When the generator creates a rando run, it places each room and all of its relevant room data (room template, doors, collision, instances, etc) into a grid. When I want to save, I grab the room data from the grid based on the players position. Once I get to the hub, I allow the player to choose which of their saved rooms to attach and load the data in an empty spot next to the hub!
I likely won't end up attaching rooms to the hub like this in the final version because it feels clunky. The hub should feel like a separate, safe place for the player to decompress. I also won't allow the player to farm these saved rooms indefinitely. They'll have some sort of cost / reset condition. It'd be annoying to build and for the player to track which rooms have been reset individually. (I can represent it on the map or some deactivated state when you walk into it, but I'd rather it be for all rooms.) If the saved dungeon is ready, then you can battle through it. No tracking needed.
Another reason for this is scope. Instead, I'll allow the player to dump these saved rooms into a dungeon generator that will create a dungeon for you from your saved rooms. It'll be much cheaper than building an entire "dungeon maker" and the UI needed for it.
If I use a saved run generator, I won't be able to use room templates for doors anymore. If a player saves 6 rooms, all with only left doors on the left, I need to solve for that. Do I create a bunch of empty rooms/hallways between them to connect them? That sounds lame.
Instead, I'll need to change door sprites and collision through code.
I'll still use create templates of layouts for populating the room, but I'll need most of them not to block a single door. Eventually, I'll start giving the layouts rules like "horizontal", "vertical", "cannot have a right door", etc. That way, if the generator needs a room with a door on the right, it won't choose a layout with rocks/unbreakable walls blocking the right door.
Next steps:
1. Allow the generator to create doors and collision - step away from using room templates for sprites/collision.
2. Instead of attaching rooms to the hub, let the generator shuffle and create a dungeon from those saved rooms.
Thanks for reading! Would love to hear your thoughts ^^
Follow on twitch for Craft Realms dev streams.
Follow on twitter for updates, game dev, and art.
- Tapsteady
Project CraftRealms
Status | In development |
Author | tapsteady |
More posts
- Devlog #3 - Moving away from templates for room layoutsAug 08, 2024
- Devlog #1 - I'm making a rogue-lite!Jul 23, 2024
Leave a comment
Log in with itch.io to leave a comment.