Tutorial: Adding A Plant to Plant Therapy


Adding A Plant to Plant Therapy

Plant Therapy is a cozy plant collecting game built in Unity. Our small team has been working on this project for over a year. Each plant takes 10 hours or more to be created and animated and added to the game. Currently we have 60 plants in the game and have plans for many more. I am sharing a brief description of the process.  

Design and Research

I maintain a spreadsheet with all the plants I want to put in the game.  This is where I keep track of descriptions, pricing, sizes, rarity, when and how they unlock in game, whether they trigger an achievement, and whether they have been added to the game. I think about the popularity of houseplants in general as well as size, texture, colors, etc. to create a wide variety of plants in the game. Frequently, I take my own photos of plants I want to draw but also use library books and internet searches for more info. All of the plants in the game are based on real plants. It was important to me not to have any made up plants because I would love to inspire people to find the same plants in real life.

Corkscrew Rush plant

I took a photo of this corkscrew rush plant at my doctor’s office. I love the textures and whimsical look. However, I decided to make a different corkscrew type plant, the Albuca Spiralis, that has clearer stems and larger corkscrew elements.  

Drawing the Plant

I draw all the artwork for the game using a combo of Procreate and Adobe Photoshop. I draw them all several times larger than they will appear in the game so that when they are resized they will maintain detail. All the plants are drawn first in Procreate and saved as a PSD file in order to maintain the layers. Each plant can have up to 6 layers, not including blooms. Then, in Photoshop I convert them to a PSB file so that the layer order will be saved when I import into Unity. PSB files can support much larger images, which is great for the detailed plants. All the other images, such as the artwork  and furniture for the apartment are saved as PNG files.

I usually have to break each plant in several layers so when they are animated I can have full range of motion on the different stems or prominent leaves. Sometimes I draw just a few leaves without stems so I can make the plant look fuller but avoid needing to animate the stems themselves.

Importing into Unity

I have a 70 plus point checklist that our programmer Randy devised for importing and animating each plant. He did all the animations at the beginning of the project and can do them much faster than me!

First, I drag the PSB file of the plant in the game. I have to change the scale of the plant to fit the game. I add a terracotta pot to the game scene and test the size there. Instead of doing it with the sizing tool, we change the pixels per unit in the PSB importer. Then I open the sprite editor and add the rigging. I also need to make sure the plant is assigned to the correct layer or it will render behind the pots.

Sprite broken into layers

Sprite layers in sprite editor in Unity

Rigging and Animation

It takes a while to get used to adding the bones, adding geometry, and then weighting the bones. Unity frequently makes the wrong assumptions about where splits should be in the geometry, so it is key to go over every point carefully and add vertices and splits as needed. It can also accidentally weight the images bizarrely so that takes some adjustments as well. If you  miss it and then begin animating, weird things will happen and you have to go back and adjust. (I am currently researching using Spine to do the animations outside of Unity and then import them in but for now I am just sticking with the basic Unity tools that work fairly well.)

Rigging screw up

The auto weighting in the sprite editor screwed up a bit and I didn't see it until I was trying to animate the plant in Unity.

I tend to add too many bones to the layers because I like to tweak and adjust every little thing. However, a little bit of movement goes a long way, especially when you can end up with 20 plants in one scene. Once the rigging is done, press apply and close the sprite editor. It’s now time to animate.

albuca spiralis with bones and rigging in Unity

Each plant has an idle, happy, and sad animation. To make things easier for importing, we duplicate an already created plant animation set and then rename and set all the animations to the new plant. Then I delete the old animations out and record new animations for the new plant. I also have to make sure the new animation controller gets connected to the new plant. The idle and sad animations loop and the happy animation will play once and revert to idle, so each one needs a different length. Remember to press the record button when you make adjustments to animations. Otherwise the work will not be saved.

Besides animating, each plant needs to have an anchor point set to where it will sit in the pot and I also need to set the various coin spawners to where I want the coins to appear in game. I also adjust whether the plant blooms, and make sure all images and animations are in the right spots in the editor.

Albuca Spiralis animation

Animation for happy

Adding to the Database

The nearly final step is to add the plant to the Plant Database so that it will show up in the plant shop in the game. This means creating a new plant ID and configuring items such as price, description, size, when available, again if it blooms, achievements associated, if any, and whether the plant needs to be in a hanging pot or maybe can only be on the ground. Also remembering to connect the prefab of the plant with the item in the database. Lots of tiny details that are easy to miss.

Testing

It’s so easy to want to skip this step and just push the add to GitHub, but it’s key to play the game in Unity and make sure the plant shows up at the appropriate time in the correct level and that the animations are working. We have hidden dev tools that are easy to unlock when play testing in unity so I can keep cycling the plants through in the shop and make sure the newest plant is installed.

Checking that the plant is working in the game.

Adding to the Game

Once I’ve tested and double checked everything is working then I can push my add through GitHub. It’s easy to forget things like deleting the pot you added to the game scene for sizing and then it will create a conflict. With three people working on the game, we have to communicate well.

Thanks for reading about adding animated plants to Plant Therapy! Look for new plants coming soon in our next update.

//Jennevieve

Get Plant Therapy

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.