Devlog #22. Ingredients Generator and Editor

At the very beginning of the development process when the structure of game objects was still unstable, game mechanics, one way or another related to the ingredients, were being constantly updated: for example, the grinding physics system, throwing ingredients into the mortar and cauldron mechanic, etc. Due to such changes in various game systems, maintaining previously created ingredients, as well as adding new ones, would become a very time-consuming job.
Realizing all these potential problems, we decided to create an ingredient generation system that could, firstly, save us from routine and time-consuming tasks, and secondly, take care of setting up things that we might accidentally forget about.
The result of our work was an ingredient generator, in which to “assemble” the desired ingredient, you only need to specify a folder with its sprites and press a single button. The main condition for this tool to work is the correct namings for the sprites in the said folder.

The generator automatically sets up all icons and sprites of the ingredient and creates all objects that should be set up manually, such as ingredient properties, its path, garden plant, etc. All settings have default values, which are also set by the generator. All this saves hundreds of hours and allows us to focus on the most important and interesting settings.
This is what an ingredient settings looks like.

Here we can, for instance, adjust the color of the ingredient in ground state.

The color of the crushed ingredient in-game is slightly different from the color in the settings, so it's best to adjust it with the game running.

In the ingredient settings, we can also choose its type and make it either common or a teleportation one. The ingredient path itself is configured in a separate object.

An ingredient’s garden plant that grows in the Enchanted Garden is also a separate object. Only those plants that grow on the ground require a bit of adjustment. It’s needed to move the plant sprite so its underground part is below the red dot.

The red dot corresponds to the center of the spot where the plant grows from in the Enchanted Garden. On the screenshot below, you can see several plant growth spots and how they relate to the red dot in the plant object.

For each ingredient, it is necessary to set up a stack that appears when the player pulls an ingredient out of the inventory. By default, the generator creates a standard stack, which we then manually tune. And it's not as easy as it seems! It is essential to rearrange leaves, mushrooms and crystals so that they not only please the eye with their composition, but also fit into the mortar without any problems.

We also have the ground state browser. Here, the generator puts together all the sprites needed for the grinding animation of an ingredient. There is a separate sprite for each state. Each sprite has a collider to interact with the mortar, pestle, and walls of the alchemy shop. The setup of colliders is also automated: first they are generated by the Unity engine and then our generator simplifies them using the Visvalingam-Whyatt algorithm. In rare cases, colliders are adjusted manually on top of that.
This is how, for example, different ground states and colliders look for soft ingredients…


...and for crystals.

Now you know a little more about the ingredients in Potion Craft! Stay tuned and subscribe to news about the game on our Steam store page, and join our Discord so you don’t miss our new devlogs!