Debrief/Statement


I don’t like this theme. Mainly because I just don’t feel inspired by it at all.  I went back and forth with a few ideas, eventually settled with this one which takes on the theme quite literally. The final outcome is still somewhat a departure from what I originally had in mind. Let me explain.

I thought of a prototype that simulates growing plants with day-night cycle implemented, plants typically grow at night. It would be broken down to 1) pixelated plant that grows automatically, 2) a day-night cycle, 3)an input that allows the player to jump ahead in/speed up time, thus make the plant grows faster.

I started off with the day-night cycle, the skybox’s sun’s rotation is linked with the directional light so I didn’t need to do anything with that. Typically the easiest way is to just animate the rotation of the directional light and everything would follow through, but I figured if I want the day night cycle to interact with the plant the rotation of the sun should be controlled by code. It wasn’t particularly difficult, so I had that handled. I was going to also mess with the actual lighting and the color of the skybox in the scene so it would actually look like the evening when it’s “night”, but at this point I was still unsure how I’ll actually make it work in terms of controlling the rate the plant is growing at, so I decided to put it aside first and figure out the plant.

With the plant part, I make some square sprites in Aseprite in different shades of brown, green and red. Then I thought to myself “this idiot forgot Unity has 2d squares.” Well, I already made them so I’m going to use them (to be honest this part barely took any time but I was just a little annoyed). The tricky thing was measuring the width of these sprites in an Unity scene in terms of their positions as well as in relation to the camera size. The point is that the plant grows via spawning new sprites and they have to be connected to one another, also not grow out of what the camera can see.

I programmed it that there will only be a certain number of brown sprites (dirt and branch), after all the brown sprites are generated, then the green ones, and then red. I wanted that the different color sprites can only grow in a certain way so the end result would resemble a plant more, but I decided not to do that so the result can be more random. Could be interesting, I thought to myself. One important thing is that sprites of the same color cannot grow on top of one another otherwise it would  just be a waste of sprites, at the same time they cannot be spawned outside of the screen. To deal with the former I basically feed the spawned sprite’s positions to an array and then whenever the sequence is run it checks if the new position already exists in the array, if so then it fails and runs again without spawning anything. I set the constraints but quickly run into the problem that sometimes the sprites can form a loop and close in on themselves so the spawning sequence would just stuck. To deal with this I used an Integer to record the number of times a sequence has failed between two successful sequences, every time the sequence is run it adds 1 to the Int, and every time it runs successfully the Int is reset to 0, basically whenever the sequence has failed more than 4 times, it performs an override and spawns a sprite regardless of whether it is on top of an already existing sprite or not.

After this stage I implemented 3 sliders so the player can control how many colors of sprites they want. As well as a button to reset the spawns.

I felt like I wanted the prototype to do more things so I gave each sprite prefab a piano note  that plays once when it’s initiated,  hoping that it can play some kind of “music”. The result is kind of chaotic, I’m thinking how I would improve is to give each prefab an array of sounds and it randomly chooses one and play once when initiated.

In the end I realized I wouldn’t know how to implement the day night cycle anymore since the generation/plant growing is no longer time-based, so that mechanic is now abandoned, except the rotating sun, which you can still see in the background.

To reflect on this project, I think a problem I have is that I didn’t start with a whole vision so I had to come up with things as I went, at the same time I wasn’t really confident nor interested with the ideas I had in mind so that kind of stops me from further exploring them. Maybe next time I should look away from something that’s concept-based and just make something more traditional like an FPS or platformer.

Files

Grower.zip 28 MB
Feb 07, 2023

Get Grower

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.