Project information

  • Technology: Unity
  • Genre: Arcade
  • Year: 2021
  • ETD: 1 month




Penguins Need Ox!gen and how the game was supposed to be about something else (game design process)

I’ve always had a passion for procedural graphics, so for my final thesis, almost 8 years ago, I decided to study fractals. But in the beginning I was always limiting myself to 2D graphics, almost like I was afraid of the 3rd dimension, like I actually had to render by hand every pixel in space. But when I started to study Unity, things became a lot easier. And it felt like I had just made an incredible scientific discovery. There was this other dimension of space I was no longer afraid. It only made sense I transposed my fractal trees to this newfound experience.

An excuse to use fractals

The project was initially designed to showcase the growth of fractals trees, which would add an easy diversity and a natural randomness to the environment of the game. Moreover, considering the multitude of configurations it would have easily created a setup that was out of this world.

Therefore, I started with the simple question of “what are fractal trees good at doing?”. And the answer was “they grow”. I needed to create a setup where the player would grow trees. “How?”, “By watering them”, I answered myself.

Then came a new idea: each tree has its own set of rules and configurations made possible with only just a few variations. For the player to advance in the game, they would have to plant more and more trees. To plant trees, they would need a seed – a physical, tangible seed.

Then, the trees that have grown past a certain level would give the player those seeds, and each individual seed would contain slight changes in the formulas of the original, as every generation of trees evolves, maybe even based on the changes in the environment – see Darwin. Of course, it did not really happen like that.

Oxygen and its antagonist

There has to be a point in planting and growing trees for the experience to be an enjoyable game. Otherwise, it would be just a simulation software, and that was not the point of this project. Trees are very good at oxygen, and in the world, we have this problem called “pollution”. Here is born the idea of the hero, and its antagonist, the villain – because what story would that be where we have no forces of evil to fight.

The idea would have been expanded to a multiplayer pvp game, where one player struggles to build the forest, while the other builds a city that generates pollution. The complexity to implement something like that probably brings back the fears I had with the 3rd dimension. One day, it could be a good idea, but beyond the scope of this project. The city had to be simulated by AI. There is no mention of any city in the game. It’s just an abstract concept as the player’s only concern is to combat the pollution, wherever it may come from. The only indicators are progress bars that indicate and compare the levels of oxygen and pollution, all being added to result in the level of clean air.

As I am a fan of exponential growth, which would undoubtedly create a sense of urgency and disappointment in the player after a couple of minutes of game time, the growth for both the trees and the imaginary city were designed to expand abruptly. The game went haywire after the first tests, and the balance between the two was even more so. Even a change of 0.2 units as an exponential factor would give or take minutes of game time from a single stage. And each level, would predictably end up with a similar score of 400. The best solution I found was to randomize the growth of pollution as best I could.

But would that even make the system variable enough at the end? Given that after a large amount of random numbers, the most likely average up to the same number? The challenge stayed the same, however – a minor change of 0.2 and the player would not see even one tree grown to its max level. Maybe I should have just tested a linear growth gameplay.

Oxygen and pollution are the two influencing factors that grow indefinitely, and another challenge was to find a way to display them to the player. A simple bar that starts from 1 and has the max value of 1000 would not work – it gives little to no information at lower values, and the total amount can surpass the current max value. The bars had to be dynamic. They would have to grow as the current level of oxygen and pollution grows withing the game, but at the same time remain at a constant pixel size, as we do not have infinite amount of screen.

But would it be weird for the player? The bars suddenly have a big skip, and show a lower level of total, not being obvious they are there just to compare how much oxygen you have to how much pollution. And the total amount of clean air? Should there be a correlation to that? The published version still has the numbers generated in the background next to those bars, but that is not information the player would have to see in a fine-tuned game.

Where does it grow

The next important challenge was giving the player the most optimal environment to plant the trees. Allow the player to plant trees everywhere, and it would eventually turn into a 1 by 1 meter of ground with 100 trees, giving the player little to no challenge as to growing them. Creating a sectioned grid through the entire level would have provided some limitations, but would still not provide a real challenge or create much of a strategy.

I decided the best approach was to create some specific designated spots for the player to plant trees in. He would be given 3 such spots at the start of the level, and as time increased more would spawn. There are a total of 20 such spots on the entire map, mostly focused in the center. The positions were carefully chosen to provide the challenge and diversity required to build strategy, but also make some spots not immediately noticeable.

The terrain itself sets up the user for success or failure. A plain terrain, with no variations would make give the player a quick overview of the game, allowing him to act immediately. But adding some hills and mountains adds yet another layer of challenge. The player does not have direct visual contact with all the trees, he has to move around, investigate and find out where he needs to act.

Again, my passion for procedural graphics made me try some procedural terrains at first. The pros would be that the player would play a different stage every time, giving replayability value to the game. The cons… finding an algorithm that actually works efficiently, draws correct textures, and creates the mountain range around the map so the player is constrained within the bounds of the world. While testing several implementations, I realized I would need a lot more study to figure out and conceive such an algorithm myself. The final decision was going with a static terrain, build from Unity’s tools, with colliders around the map.

Finally, the last challenge with the trees was giving the player the seeds to plant. The nice snowman acts an indicator for the initial seeds. Giving them random locations within the map would unavoidably create frustration among the players as they would get lost trying to find a way to even start the game. Will they figure out the snowman is important, though? I’m counting on the players curiosity for that and the fact the character looks directly at it when the game begins.

While he starts with 3 seeds, it is barely enough to make an entire forest. When a tree reaches level 3, it will start spawning more. The higher the level, the faster it will spawn the seeds. Spawning too many seeds however, would end up looking like a mess. That’s why I also limited the number of seeds on the ground to max 3 for each tree. Being next to the tree, those seeds should not give the player much challenge into finding and picking them up.

A quick thought about interaction

Probably the most important aspect of the game, controlling the character around the given environment, was initially designed to be completely different. A FPS style cursor with a ray casting algorithm was tested only to end up breaking the game and making it frustrating. The camera was limited within the bounds of the 3rd person perspective, while the player would sit next to a seed, not being able to pick it up as it was too close.

The better approach was creating a spere collider, which was triggered and detected all the pickable items that were in its range. Yet another decision, was to attach the trigger to the camera position, which was moved with the mouse, or to the actual character, moved with the keyboard. Attaching it to the camera would give more freedom to look around and interact with items. But it only makes sense to interact with the items the character is directly looking at, making them selectable with a subtle, but visible effect.

What about the trees? How would the player know which level was each tree, which trees to water, and which trees would be close to dying? That would require a more visible indicator, the only effect I saw suitable was a sphere of light placed above the ground where the tree is planted.

The sphere effect changes colors from blue to red, blue to mean “just ready to water” and red to mean “I have not been watered in so long, I will dry out”. The higher the level, the trees require more water and dry out faster. Another layer to call the player to urgency in the later stages of the level, which will penalize the player by shrinking the tree if not watered on time and reducing the amount of oxygen produced.

As for the level of the tree, I did not find that information critically relevant to the player, so I decided to leave it out.

Atmosphere

One of the important aspects for the game was, at least for me, to give the player a certain sense of urgency and despair, a feeling that his world is falling apart and he needs to act quickly. It starts with the “almost-blood” red skybox, with a bright sun that gives a ray of hope. The skybox is partially hidden by purple-black clouds which even cover the bright setting sun, and the falling black particles would resemble nothing more than the ashes of a polluted environment.

The global illumination was configured to match the sun as closely as possible, with similar shades of red that give the skybox a continuity. The hard shadows add upon the dramatism of the scene, and come in direct contrast with the very bright areas of the map. As the trees grow, the shadows in the forest start contributing to the same dramatic effect, as the player gets closer to the inevitably polluted end.

Another atmospheric challenge was highlighting the sharpness of the sun in contrast with the dying world. For the main menu, you can see a more cinematic camera, decorated in the style of a panoramic movie, which highlights portions of the sky with a dramatically lit penguin. In the end of the game, a more important thing to highlight was the player’s creation – a camera showing how all the trees have grown through the forest. For more effect, different changing cameras could highlight different portions of the map, while some of them could be rotating and moving.

Final thoughts

While everything else had a reason to be there, there is still the question of what a penguin is doing trying to plant trees, in a mountain range, probably at the north pole, trees that probably live in another environment.

The penguin was initially a random choice. But if you need a reason, I can probably find one. How about – “pollution leads to global heating, which leads to ice melting, which leads to a penguin trying to save its home”. If it sounds plausible enough, it probably is. But again, it’s a game – it’s not meant to be a simulation of reality.

Speaking about simulations – once I tested the game with a tree model, it all seemed like it beautifully fell into place. Adding fractal trees would definitely have changed the look of the game completely. However, the time and effort spent on simulation procedural trees did not begin to compensate for the added value to the game. I liked the final product as it was, and did not consider it needed those additions. I wonder, would it even be noticeable by the player? Maybe I’ll deal with those in my next “scientific research” project.

Finally, to make everything seem more natural and add a layer of variability, just randomize everything- the growth of the trees, their size, spawn of the seeds, spawn of the fertile ground, and growth of the pollution in time and in exponential factors!