Room Tetris Post mortem (Priliminary)

Ah... The new Ludum dare crawled in so unexpectedly. :smile:

I didn't even finish the slaughter this time round. But I was eager to take part. I even had an idea to make a livestream sort of with Theme announcement. (Unfortunately the stream died at the announcement time as my OBS seem to have a thing with opening new browser windows while streaming...)

When I originally saw the theme I thought of a concept of a hosting service tycoon game where you have to manage a company that provides hosting service for videos or other content. Basically you have to maintain some servers making sure they don't run out of disk space, or bandwidth, and don't die taking all the user data with them. And them the server themselves take up room in your "office" you you eventually run out of srver slots and need to expand the office.

And to get this all running I had an idea to have a... kind of real world simulation under the hood, where the game would actually spawn and track entities, like ContentCreators, and viewers, have them like or dislike each other, ragequit or trend... (Yes, I attempted to dig into ECS...) but when on Sunday Morning I finally had a prototype with two entities running alongside each other, they would... not drop the game FPS as they were handled in separate threads, but they would have had cycles of a few seconds, meaning the simulation would not be accurate enough.

And on top of this I realized that the player does not have any agency over how those entities interact, making all this hard work... basically produce the same result any RNG would... So I rage-ditched this idea and started working on a new one.

The "little" problem was the fact that there were only circa 14 hours left to compo deadline. So I buckled up and started working.

A new concept was born pretty quickly. Putting a lot of stuff into a room. So I opened MsPaint and started blocking this idea out. I drew a contour of a room, and added a couple of windows in it. This brought up a question - how do we use those windows in a game? And to answer this a concept was born to restrict placement of items so windows are not blocked. Then I drew a path across the room, connecting the windows and the door, and decided to declare it unblockable as well. And the rest of the space was broken int a set of tetris-like blocks.

After looking at this allocation for a bit I decided to make sure all items are touching the path. Rearranged some blocks to make this condition true and this is how the game concept was born.

Programming wise the game turned out to be pretty simple. I didn't create a tile table in memory, instead the tiles were game objects in world space. The items had a set of control spots that ray-traced straight down to check if there is a tile, and if so - is it occupied.

The items themselves were also not spawned at runtime (though it may seem so). They were actually created in the gameworld, and are onlu enabled as objects when you pickthem from the list. (And it is actually the list items a that are spawned at runtime. Basically every item on Start creates a list item, and hides itself. This was an uncomfortably coding-light approach for me to take. But I really had no time to spare. So I threw together what was working and ran with it.

They I went to creating 3D assets. And over the past few attempts I can really tell that I am getting a hang of it. :smile: Not only was I able to create some graphical assets that were... kind of solid, but I also managed to texture them. Nothing fancy like normal texturing I tied for MazeCrawler, but there were a few handpainted textures, and one generated texture of wood I used for... basically everything.

The first big assed was the room, and UV unwrapping of it was... a nightmare to be honest. And when afer having the asset created in blender initially I found out that I managed to not save the texture image, I felt... kind of relieved that the UV maps were intact. However when I threw the room into the scene, I realized that you are supposed to see something through the windows and the door. The windows were easy - just a big green plane to emulate the grass did the trick. Door was a bit trickier though. But the solution gave itself away pretty easily. I just cloned the doo, rotated it 180 degrees, and slapped it door to door so you could see through the door another room. :smile:

Then I started making items. I started with a couple big ones like the Fridge, and Wardrobe. Then made a pile of boxes as one mesh... and realized that I am not going to do the unwrapping for them if I am to make the game on time... though the time was running really short by that time. Instead I opted out to make a single box (barrel, cardboard box, and a plank) as separate items with shapes simple enough to unwrap. Then bade blender generate a wooden texture for me, then used texture paint to make portions of this generated texture lighter or darker, and started unwrapping all items onto one texture atlas. This way I had only a few materials used for all items on the scene. (5 to be exact). Ans slightly adjusting the positions of UVs of different sides of the box, and their scales, helped to up the variety of wooden patterns. So definitelly this is a tick to remember for future.

And then I looked at the split of the tetris blocks, and started creating piles of objects to fill them in. I started by setting up quite a few unique ones, but then ended up just duplicating some of them 2 or 3 times. Not because I was running out of time (by that point I was 2 hours overdue for Compo anyway) but because I was getting sleepy, and I had to go to work on monday.

Summary:

Well... No music or sounds again. Which is getting a pretty bad trend for me now. Next time I might even start by making some sounds, and center the game around them... ((Though this is probably a very bad idea...))

However the game turned out to be... not solid. It is still mssing some important bits. For example I wanted to show a "Waifu picture" with a speech ballon commenting on your actions, but... just didn't have enough time to draw the portrait, or program conditions for them to appear. The UI is also only unity basic. And the screen width optimisation is... nowhere to be found. I only hope that people will not try to play it on a screen too narrow for it to be playable. :smile:

But I am rally proud of myself for basically making a game in just under 20 hours. Yes I got a bit exhausted by this, and getting yourself into a corner to them heroically get out of it is usually not considered something to be proud of, but I did manage to fend off the temptation to give up and not finish a game.

Anyway, I hope you enjoyed reading it an maybe even found something useful of it.