Slimes and Sandwiches by Nick Rafalski

Click to play in browser!
Game Background
Avoid those slimes and eat those sandwiches! Explore this procedurally-generated abandoned mine that's overrun by blobular beasts! Find the key that unlocks the ladder to the next level! Get as deep as you can!
How to play
- Use WSAD to move around
- Use Mouse to look left/right
- Use Left Shift to dash, but beware, it will take some of your hp!
Tools:
- Unity
- Paint.NET
- Audacity
About the development
I easily spent the most time on the procedural generation system. This is a GIF of it in action:

The algorithm goes like this: * Generate 10 randomly sized rectangles, and add 2D physics components to them (colliders and rigidbodies) * Let the physics engine sort them out until they are all sleeping * Slightly adjust their sizes/positions to the nearest integer value (for easier tile-based generation later) * Start with a random room, and flood-fill connecting rooms to create the totally connected graph of rooms * * If necessary, remove rooms that aren't connected to the main graph. This happens with 1 room in the bottom-right of the GIF. * Compute a minimum-spanning-tree in order to figure out the fewest number of connections needed to connect all the rooms * * Remove connections that aren't on the MST. These would be good in a bigger dungeon to add alternative ways to explore, but if you add them to too small a dungeon, there isn't much need to back-track, which makes it feel less "explorey" to me. They also reduce the number of leaf-nodes, which are necessary for the next steps. * Identify leaf nodes in the MST. These are any room with only 1 connection. * Randomly select 1 leaf node to be the starting room. This has nothing to do with random room that started the flood-fill. * Find the furthest leaf-node from the starting room (by straight-line distance; not a perfect measure) to be the finishing room. * If there is at least 1 more leaf-node that's not the start or finish, put a key in it, and lock the finish room.
Overall, I'm pretty happy with it. Early on, I wasn't using the flood-fill approach to determine valid connections before computing the MST. Instead, I was connecting all rooms to all other rooms that they could reach, and pruning any rooms that had zero neighbors. This almost works, but can result in having 2 or more distinct groups of rooms, that have no connections between them (like "islands"). The MST computation would hang while trying to find a way to connect the distinct islands. An interesting side-effect of using the flood-fill approach is that, sometimes, you can get a very tiny map. Say you have an island of 8 connected rooms, and another island of 2 connected rooms. When I randomly choose a starting point for the flood-fill, it's perfectly valid to choose the 2-room island. The 8 room island will be pruned before the MST is computed, and the resulting level will have 1 starting room, 1 goal, no key, and no other rooms. Thinking out loud, I could add another step to keep track of the islands, determine their sizes, and choose the largest one. That would be some more work, but is definitely doable.
| Link | https://nostyleguy.itch.io/ld48 |
| Link | https://nostyleguy.itch.io/ld48 |
| Original URL | https://ldjam.com/events/ludum-dare/48/slimes-and-sandwiches |
Ratings
| Overall | 528th | 3.355⭐ | 33🧑⚖️ |
| Fun | 599th | 3.081⭐ | 33🧑⚖️ |
| Innovation | 501th | 3.117⭐ | 32🧑⚖️ |
| Theme | 547th | 3.419⭐ | 33🧑⚖️ |
| Graphics | 490th | 3.387⭐ | 33🧑⚖️ |
| Audio | 485th | 3.067⭐ | 32🧑⚖️ |
| Humor | 305th | 2.839⭐ | 30🧑⚖️ |
| Mood | 444th | 3.259⭐ | 31🧑⚖️ |
| Given | 28🗳️ | 36🗨️ |
My biggest gripe is the controls. They seem really weird somehow, like it's hard to get your player to go where you want... but overall, very cute. Like a miniature Doom.
None the less, you've made a hell of a thing in 48 hours! Great job!
p.s. I quite enjoyed the sound effects.
I liked that you went for a pacifist dungeon crawler but I would of liked to have another tool other than the dash to navigate the slimes. Maybe dropping something draws the slimes over too it and gives you a chance to escape?
Overall I would say it's pretty satisfying to play this game. Those slimes however... moving through walls... they give you no time to rest!
That sandwich sound effect is amazing :laughing:
I think it's my favorite bit of the game. How did you make it?
Great entry!
@phobos001 You are very right about the aesthetic being quite confusing. I spent far too long on the code and not nearly enough making sure the game actually presented well. Thanks for playing and the feedback :)
@ianthebee You're hired as my next marketing person! That's exactly what I was going for. Thanks for playing!
@fussenkuh Killing the slimes was in the original scope of work, but got cut when it was already 2PM Sunday before I even had the concept of a slime in the game. I actually had them as pushable at first (only because that's the way the dynamic rigidbody component comes out of the box). It was fun to push them, but it was way too unpredictable. Sometimes they'd fly off the map, other times they'd barely move. Instead of taking the time to finely tune the physics settings, I just made them triggers. I agree that would have been more fun though. Thanks for the feedback!
@paroxysmal You area totally right in your criticisms. I wanted to address the "slimes right by the door" thing, and had a plan for it, but just ran out of time. Thanks for playing :)
@nodice Thanks for the feedback! I too wanted to give you a better way to avoid the slimes. The original scope included being able to kill them with weapons you pick up, but I didn't budget my time well enough for that. Dropping something that they are attracted to is a great suggestion though. It would have been less work than a full blown weapon system, and fit the 'pacifist' theme better. Thanks for playing!
@deadmanjw @gnaro Thanks for all the kind words :) You made my day!
@yulotomorrow Thanks for recognizing the difficulty in creating this game that looks pretty bland on the surface! Honestly, I knew when I started that the genre was probably a poor choice for a 48 hour jam. I knew the final product would lack any real content or polish. I'm still happy I made a functional game though. Thanks for the kind words :)
@secret-magic-404 That was exactly the vibe I was going for! The sandwich sound was just a recording of me pretending to eat something (a bit dramatically). I usually get about 90% of my sound effects from my own mouth lol! Thanks for the feedback :)
@sacredbacon Wow thanks for all the kind words, and thanks for playing :)
It was very deflating to search 90% of the rooms and realize the key was way in the other direction! Not much you can do about that really. I suppose if you reached a dead end, you could give them 2 or 3 sandwiches to have made it worth their while lol.
I really liked your gif and explanation. I wouldn't have thought to use a bit of physics to provide the randomness. That's a super cool idea, and technically is quite fast to implement from scratch compared to a standard one (at least the first step). Thanks for sharing!
Great job!
The graphics were fitting and nostalgic. Well done! As has already been said, some variety in the environment could aid with navigation.
Nice audio to add to the mood, too. I like the atmospheric dripping.
It's also great to see a mouse sensitivity slider included!