Metal Refining At Last


So... it's been a minute since I've done one of these. That's because the alloy creation mechanic I've been talking about so much has been an absolute pain to try and implement. Seriously, I thought this was going to be just one new small thing I would add real quick, and it has very much been a whole new section of the game getting added. Needless to say, I am way off my timeline. So I'd like to share what I have gotten done, what a new, and more appropriate timeline hopefully will be, and my thoughts on the project as a whole. This post may get a little technical, but that's because the mechanic I've gotten in place is really exciting to me, so bear with me if I nerd out on it a little bit.

Okay, so what the heck happened with this alloy creation mechanic? Well, the biggest thing is I hit a very serious wall that I could not figure out how to get around. The primary issue was the crucible. This item is so versatile that I could not figure out how to manage everything I wanted it to do. You can put almost any item in the game into it, then I have to show that data in the forge so the player knows if the contents are melted, then you can pour the molten metal into either an ingot or a pommel. That is the base functionality that I was working with. For this new system, I need to track if the player adds two ingots, to allow reactions to occur after melting. Then for each metal, track their data during the reacting process, and then do some pretty hefty calculations to see what the resulting metal is. It took me days to figure out how to add this, and I kept going back and forth between what functionality I wanted in the crucible, and what functionality I wanted in the metals. Finally, I settled on creating a reaction class that I could feed the metal data into, and would manage all the calculations for a reaction for me. Then, the crucible can just check once the reaction is completed and calculate the results after.

So how does this work? What came out of this? Well, currently if you put two ingots into a crucible, it will be marked as redactable. Then, once the metals are molten, some math is done to see what range there is for reacting. As the player, you then have to find that range and keep the metals in the range for a given amount of time. The reaction class I mentioned keeps a running statistic of the variance of the temperature from each metal's ideal reaction temperature during the reaction. After the reaction is done, that data is then passed to each metal to increase their quality, and then averaged for the final resulting metal. Currently, this only works with similar metals, like 2 copper or 2 iron. You cannot mix metals yet. (That's the second half that needs to be built) But, with this now working, I had to do a soft overhaul of the metal class. If you tried the prototype I built, you would notice that the quality of the blade never changed. Now, by reacting two of the same metal, you can refine that metal to increase its quality.

Now for the next question, what is quality and why do I care? This is honestly where I've been the most excited with development currently. Increasing the quality of a metal increases all of its base stats and can shift the nature of the metal as I wish. It also adjusts the metal's coloring to be more vibrant and look cleaner, which is a really fun touch in my opinion. So that soft overhaul of the metal class I mentioned allows me to set not just the stats of the metal, but also how every stat will change as the quality goes up. This is awesome because I can really play with how a metal feels as you refine it, making it not just a number that changes and adjusts value, but you have to completely relearn that metal. Of course I also have the option to not change any stat and keep it the same, so the granular control over it is exactly what I was looking for.

Now, one issue that was there was if I know how to refine a metal once, what is to stop me from just refining it over and over until I have a super metal that will sell for all the moneys. (Honestly, being someone who cheeses games really helps with game dev) As you increase the quality of the metal, the reaction range also decreases, making it harder and harder to hit that temperature. Also, the quality increase is a bell curve around the ideal temperature, so even if you do hit the temperature range, you may not be as accurate as is needed for that increase. This means the quality you can get is highly dependent on your skill, but there will also be a natural cap that players will not be able to go past. It's simple but it works, and it allows me to keep all the other stat increases higher to reward the player if they can get a higher quality metal.

All of this is currently implemented and working, but in my mind this mechanic is not finished until I can get alloys of different kinds of metals added to the game. That is the next big step, and it comes in two parts. Firstly is the alloy class, and secondly is the scrap class. The alloy class needs to have some level of recursion to it, that is to say I cannot just make a class that takes two metals as its parents, because what if those metals are alloys as well? I need to make a class that can keep track of all of the composite materials, and do the math to determine the kind of metal it is. This means if you want a 25% copper, 50% iron, and 25% tungsten alloy, you can easily do that through either making a copper-tungsten alloy and combining it with iron, or making a copper-iron alloy and a tungsten-iron alloy and combining those two. Because the composites will be the same, I would like these two alloys to be the same. This is currently the next big piece that I have to figure out. How do I manage all the stats of all the composite metals to create a single metal?

After I figure out that, I really need a scrap metal class. This is for the alloy mixtures that the player does not figure out how to react. There could easily be a rough soft-lock of having an unreacted alloy in your crucible, and you cannot empty the crucible because you haven't made an alloy yet. Well, that's where the scrap class comes in. It stores all the composite metals and data separately, and the base stats of the scrap class are super low. So you can't really make a ton of money off of it (though you can still sell it if you want), but you can always add it back to your crucible to try and find that reaction zone later. This also makes it so the player can have project alloys they have stored where they may be working on an alloy for a longer period of time rather than expecting to immediately figure it out.

And this brings us to one last issue. That is how do I calculate the range for two different metals. Originally, I was just going to take the overlap of the two metal ranges. However, say you have two different high quality metals. Because their ranges are going to be so narrow, there will probably not be any overlap. This is an issue for two reasons because firstly, I would like all metals to be able to be combined with each other, and because the player doesn't know the ranges of the metals, they can easily make scraps with no reaction range, wasting lots of money on useless experimentation. This is not what I want, so the other idea is to take the average of the ranges and shorten them somehow based on the increase in quality. This will ensure every metal will react with every other one, but I also want making alloys to be harder than refining, so I will have to play with things to make sure that is still the case.

Whew, that was a lot. Hopefully this gives a bit of a better picture of why this mechanic has taken so long. There's a lot of design decision that need to be made and figuring out how everything works is a challenge. But I'm hoping I'm on the downhill slope of this mechanic and that it will add a lot of depth once it is done. Because it has taken so long, I think I've changed my mind and want to release another prototype after it is done so people can playtest it. I really think this mechanic is going to add a lot to the game and I want to see the player response for it. However, even after I finish implementing the mechanic, I still need to add a lot of feedback so the player knows what is going on. So I'm going to try and give myself until the end of the month to get everything done.

After that, I will hopefully be able to finally shift my attention towards shop management, another large mechanic I would really like to be a core part of the game. I honestly am not sure how long that will take me, but hopefully I will not hit nearly as many walls as I have hit for this mechanic. However, after that I will release another prototype, then shift my focus onto filling out the game with progression, perhaps story, tutorials, tons more data for the player, and a lot of polish for the game. At that time I will hopefully get a proper timeline for all that stuff but for now it is all speculative.

Currently, I feel the project as a whole is going well. I have a lot to learn and the game needs a lot of work, but seeing these mechanics begin to come together is getting me really excited for the project. I think hitting this wall originally caused me to lose a little interest in the project, but now that I've made some progress I think I'll be able to get back onto some heavier development. I'm really wanting to make this a solid release at the end of the year, which I know is ambitious, but I really feel the potential in this game. Anyways, I'll see yall next week. Hope you enjoyed the update and if you haven't tried the demo, feel free to check it out.

Get Blessings Of The Forge

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.