Devlog #3 - Moving away from templates for room layouts


Hey! Room templates worked. They helped me build rando runs quickly without worrying about tiles. But... I mentioned in Devlog #2, room layouts as templates will end up creating more work later rather than saving me. I'd like to create templates for what populates the rooms too. (I need a name for this - fill template? yeah!)

The room templates looked like this, each with a different arrangement of doors.



If I kept both (room layouts and fills) as templates, it'd be a mess of combining the two and creating rules for each. I'd rather the code create the doors and collision and have full control over what gets placed where using fill templates. It needs to be purposeful and I need to control the possibilities. I could make this procedural too, but it'd be a lot more work to control positioning of enemy spawns like don't be near doors, don't be near the player, don't be too close to each other, while still spawning in different and interesting patterns.

I can still randomize what spawns in each position and simply not spawn an enemy that's close to a door the player is coming in from.


I'm using 1 room template now of a completely closed room. This is what first implementation looked like w/no doors or collision.


Then had the code draw the doors, no collision. As a test, I'm adding collision through mb_left only to tiles that aren't floor tiles.


Now that that's working, I'll have it run through and add collision while it's generating the rooms, like it is for the doors.

NEXT STEPS!
1. This was all set up in Saved runs as a test. I'll need to go back and make this work for rando runs too.
2. I need to give the player a way to delete saved rooms to cycle new ones (and start populating them).
3. Maybe player and enemy combat.

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

Leave a comment

Log in with itch.io to leave a comment.