Creating an Alchemy Sim in Unity
Alchemy sims are quite a common game and they are a nice and simple concept that blossoms into a complex and detailed experience. The type of Alchemy sim I made an attempt to emulate is similar to games such as Little Alchemy , where the player begins with 4 base elements in their collection. The player combines the items to create new things to combine and create with. The number of items in the collection grows exponentially over time and the item types can become very detailed and extensive.
I thought it would be fun to put one together and specifically have the Unity project read the data from a txt file, just for a nice detail. I was excited to make multiple layers of items, and quickly realized how much organization is actually required for this game!
For this project, I mainly wanted to focus on the organization and readability of the code. The mechanics themselves are quite repetitive and the most important element is the data list and storage of progress. It's a super simple outer look with no art and a really simple layout:
The cylinder in the middle is the "beaker" for the combinations and the elements to the left are air, earth, fire, and water (top to bottom). When the player clicks on an element, it is added to the beaker combination and will combine with whatever the player clicks next.
There is also a super basic menu at the top of the screen, allowing the player to spawn in the base items or new items that they have already created:
I really just wanted to focus on getting the data read from the txt file and allowing a theoretical designer to input data that is read in automatically. This is what the txt file looks like in the current state. It's not super clean, but with the limited time of the project, I just wanted something easy to parse:
The data is the name, the "layer" of the item
[0 = base item], the combo required to create it, and the color of the material
The things that required the most attention were the pieces I didn't really think about at first. Where should the spawned item go? How can I efficiently keep track of items already created and ones undiscovered? How can I make a menu that works well enough for this project? Why did I make this in 3D space because that was evidently a bad idea for this project? There were a lot of steps that I had to spend more time on than expected. Or at least if I didn't want to brute force the code into behaving. I ended up only doing the first layer (items made from the base items) due to time and wanting to focus on at least getting foundations established.
Overall, I'm pretty happy with where it ended up. It's at a state where it can definitely be expanded upon further and that sits well with me.