top of page

Creating an Alchemy Sim in Unity

Writer: Olli Machina
Olli Machina
May 4, 2022
2 min read

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!


The Concept

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






Reflection

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.


6 Comments


myla.phan236.9
Oct 15

rophim mình mới ghé thử vì thấy bạn bè nhắc hoài, kiểu vào xem có dễ dùng không thôi. Không ngờ giao diện nhìn khá gọn, lướt một vòng là thấy ngay chỗ phim mới với mấy mục phim HD Vietsub đặt khá nổi, khỏi phải mò lâu. Mình thích cái cách họ để poster theo từng khối nên kéo xuống rất nhanh, gặp phim hợp gu thì bấm phát xem luôn, không bị rối mắt. Chất lượng thì mình chưa xem hết, nhưng thấy có ghi HD 4K nên cũng yên tâm phần hình ảnh. Nói chung lần đầu vào mà không bị “lạc” là điểm cộng, nhất là phần phân nhóm phim HD Vietsub nằm rõ trên trang.

Like

darrylvar.g.as1384
Oct 15

https://soicaulodechuan.net/ mình thấy bạn bè nhắc mấy lần nên cũng ghé thử cho biết thôi. Vào cái là thấy trang làm khá dễ nhìn, nền thoáng nên đọc không bị mỏi mắt. Mình không đào sâu nội dung lắm, chủ yếu lướt xem họ bố trí ra sao, thấy các khung thông tin chia rõ ràng nên kéo xuống vẫn không bị lạc. Có mấy đoạn họ trình bày theo kiểu bảng/cột nhìn gọn ghẽ, số liệu canh hàng thẳng nên liếc nhanh cũng hiểu đang nói phần nào. Thanh menu đặt chỗ dễ thấy nữa, bấm qua lại vài mục không phải mò. Nói chung cảm giác dùng kiểu “vào là biết đường đi” luôn, vì các block và…

Like

giecphangqua.n.h.g.h.u.n.g
Aug 27

https://keonhacai.cam/ mình thấy mấy hôm nay nhiều người nhắc nên cũng tò mò bấm vào coi thử giao diện thế nào. Mình không có ngồi soi nội dung hay chọn từng mục gì đâu, chủ yếu lướt qua xem họ sắp xếp trang ra sao cho dễ nhìn. Ấn tượng đầu là bố cục khá gọn, các phần được chia thành từng khối rõ ràng nên kéo xuống không bị “ngợp”. Menu cũng đặt chỗ dễ thấy, bấm chuyển qua lại giữa các mục khá nhanh, không phải mò mẫm nhiều. Mấy bảng thông tin hiển thị theo dạng cột nhìn sạch sẽ, chữ không quá rối nên đọc lướt vẫn nắm được ý. Nói chung mình thích kiểu trình…

Like

terrancecart.e.r.36.0.7
Aug 26

Bài của bạn ngắn gọn mà dễ hiểu thật, đọc lướt một lượt là nắm được ý, cảm ơn bạn đã chia sẻ. Mình cũng có thói quen xem thống kê XSMB hằng ngày, nhưng hồi trước cứ phải mở nhiều nơi khác nhau nên hơi mất công. Về sau mình tự gom lại để theo dõi cho tiện, kiểu lưu một chỗ để khi cần thì tra nhanh, nên mình đặt nó trên soicau247.com để khỏi phải nhớ từng nguồn. Mỗi lần muốn xem theo ngày thì chỉ cần mở ra là có số liệu, nhìn tổng quan cũng đỡ rối hơn nhiều. Nếu bạn cũng hay để ý phần đầu đuôi giống mình thì mình có lưu ở…

Like

katrinacha.vez.52.0.2
Aug 21

Bài viết đọc cuốn, mình đọc một mạch hết luôn, cảm ơn bạn đã chia sẻ. Dạo này mình cũng hay để ý mấy nền tảng giải trí trực tuyến nên có vào xem thử họ sắp xếp giao diện và chia chuyên mục thế nào, chủ yếu nhìn bố cục và cách hiển thị thông tin cho dễ theo dõi. Mình gom lại vài chỗ để tiện tra nhanh, ai cần thì ghé https://uccle.monopinion.belgium.be/profiles/Soicauxsmbpro/activity

Like
  • linkedin
  • Github
  • itch.io

©2020 by Olli Machina. Proudly created with Wix.com

bottom of page