Crafting like Opus Magnum

Hey all, I am working on a 3d game but would like there to be a 2d minigame for craftin specific components. Its hard to describe but the best way to explain it is a game like Opus Magnum. I’ll do my best to explain for people who haven’t played it or don’t know what it is.

You are trying to create a product (let’s say its a mana potion for this explaination) out of materials (A and B) but they need to go through a process before they can be combined. B needs to be cooked to turn it into C which when added to A will make the Mana Potion (A + C = MP)

You have a large empty grid where “machines” can be placed down in any order and combination that you would like. The machines can be linked together to create processes, and your materials will hopefully go through the processes and you end up with your desired product. Materials will physically move from one machine to the next, with each machine affecting the material in some way.

With just the example from above, I would need 2 “loading machines” which allow you to put 1 material each into the whole process. Then 2 “moving machines” to move the materials to the next machine. In the case of material B the next machine is a “cooking machine” Then both materials are moved into a “combining machine” which produces the mana potion we want.

I’ve never done anything like this before, but I have made my own grid based inventory so I imagine it would be something like that. If anyone has amy knowledge at all on how this would be done, or a tutorial I can watch, that would be amazing!

What’s the question?
From what I can tell, seems like you want to drop two machines on a grid and link them with a conveyor belt that moves the potions through?
Or are you asking how to code the potion making process?

That is a fair point lol, I never asked any specific questions. Ok so I think I can make a grid to put machines down and remove them, that part shouldn’t be too hard. I’m not quite sure how I would move an item from 1 machine to another however.

My guess would be I need to select the machine that is to the top, right, bottom, or left of the machine on the grid. Then somehow move the item that is on the current machine to the next machine. That part I’m not quite sure how to do

You could put a Rigidbody2D component on the item and use MovePosition() towards the Transform.position of the other machine.

You would put a unique tag on the machines: Machine1 tag = Mach1 and Machine2 tag = Mach2.
on your script you would want to create a Transform mach2 variable then use FindWithTag(“Mach2”) to store its transform information. Now you set the item to move towards that tagged object’s position.

The reason I say use FindWithTag() is so you can have different machines but only one variable and the program can always find the new Mach2 everytime.

Sounds relatively easy. I haven’t done much with 2d stuff before so it sounds like its not too far from doing 3d. And going from transform to transform is a much smarter way than what I was thinking, so that actually helps a lot!

1 Like