Can a brain code a brain?
Hey, so it's been a couple of weeks, and I wanted to give a development update because things have really begun coming together. We are still hoping to have the first installment of our shop management updates released soon, and I am really excited to get these updates out for you guys to play. So, what have we been doing the last couple of weeks? Well, in this devlog I'd like to go over some of the shader work we got done (because I fear that system will never be fully completed), then go over some other minor tweaks we've been playing with, and finally I'd like to give a sneak peak into the NPC temperament system and how the NPCs are going to work. So, let's dive in!
Shaders... Always More With Shaders:
If I'm being completely honest, most of my work over the last couple of weeks has been refactoring the lighting system. If you read my previous devlogs, you'd probably know we created a custom lighting system using compute shaders for the game (which I am really excited to get polished and released to you guys). I had gotten it completely working, but almost all of the code for it was in a single script in like 3 functions. It wasn't modular at all, and trying to grow or change it at all would have been a pain.
So, what changed? Well, I started by modularizing it. This meant creating a base layer script that all of the intermediate processes could inherit from. I realized most of these shaders used the same bits of data: sunlight info, the indoors mask, and the position data of the whole shader. They also usually had some sort of passed data for each one. The windows needed a reference to all the different windows, and the directional lights needed all the light data. This meant I could hold the buffers for the "global" data in the shader manager, then pass the object references to each shader for them to manage themselves. This worked super well and really separated out the general logic from the shader specific logic. That said, it took a bit to get everything playing together comfortably, but once that was done other fixes came pretty quick.
One other thing I needed to get added was dynamic lights, or more accurately a way to update a light's data in the shader when something happens to that light. This actually was almost completely solved by the abstraction. I just added a data update method that would update an object's data on the GPU, then added a way for each light call that method if their data changed. This is really excited because instead of ominous floating ambient light areas I am now able to create lamps that the player can turn on and off when they want (which will be done before this next update). This structure is also reusable so any other light sources I add that might change frequently will be easy to add (Forge, I'm looking at you).
Another thing that was tackled was the windows. For some reason I didn't think though how I coded them originally, but they acted more like flashlights than windows. They generated their own light and had no relationship to if the sun was actually out. After much trial and error I was able to get that fixed. Windows now rely on the light of the sun to illuminate, and the ambient light doesn't vary nearly as much in the space it takes up. It really does feel like the sun rises and sets now as the windows and rooms slowly illuminate, as the day goes on. There's still a couple of bugs with the window shape casting I need to hunt down, but those will get squished sooner or later. Between the windows, lamps, and forge I hope that there will be enough light for the player, and the day/night cycle will really be felt during gameplay.
Softlock Management, Sleep Transitions, And Rhythm Game:
Other than the shaders, I have actually gotten work done on some gameplay elements. I know I can get lost in a single system, but the whole project is moving forwards, not just me learning glsl. :P One nice addition is adding proper sleep transitioning. Previously, if you slept at night you would just jump to 6am and bam, the sun is out! Well no more! Now you must lie in your bed and wait for the sweet light of the sun to slowly beam in through your windows. When you lay down, time increases dramatically until you hit 6am. At that point time will slow back to its usual pace, but you won't get up until you move. I feel this is nice because it gives the player solid control over their time, and if they change their mind and decide to work through the night, that is completely fine!
In addition to this, we finally managed out softlock!!! No more needing to restart because you spent all of your money on ore and completely forgot to get fuel! Now if you sleep until the morning, and have no money or a means of making money, some mysterious force will provide enough fuel and ore in your chest for you to get back onto your feet. Where did these resources come from? Who knows? Maybe the ghost of your grandfather? Or some secret investor banking on your success? Regardless, this means no unhappy endings. Keep practicing until you get your foundation set, then slowly grow your business! As you do you may find more clues as to who was so generous to you. :D
Okay, enough lore for this post. Let's get back to the mechanics. If you played the game, did you just spam 'F' with your hot metals until you finally folded your ingot? Well, you may not want to keep doing that in this next update. Don't worry, we didn't punish you for doing that. We just added a slight bonus to hitting the hammer in rhythm. The closer you get to dialing that rhythm in, the higher that bonus. This allows you to fold your ingots a little faster and longer as the metal cools. I played with this added for a bit and I found it really satisfying once I got the rhythm figured out, and I hope you guys do as well.
Now For The Title Of This Post:
Can a brain code a brain? Or more accurately, can I code competent NPCs? Only time will tell, and that time is this week. *cries a little inside* With most of the other parts of the game starting to really come together, I decided I'd like to get a jump start on giving our NPCs a little character. Currently they only respond based on how well you price your sword. But this game is a sandbox of player agency in crafting. Why wouldn't that extend to the shop management as well? So there's a lot that is going into these little guys, and there's been some pretty fun conversations with my team about how we want them to behave.
Let me start with what I want them to do gameplay wise. I have about 3 different things I am trying to accomplish with the common orders in the game. The primary one is to support player experimentation. I don't want the player to go days and days melting their blades down over and over because the didn't quite get THE SWORD they are trying to create. I also don't want them to be afraid of folding the ingot just one more time because it might not be right. Instead, I want them to chase that sword through a lot of trial and error until they nail it. So enter the common orders. Instead of melting down a crappy blade, sell it for a slight markup to fund your further refined experimentation. Burning wood isn't entirely cheap after all.
The next thing I would like to accomplish with the common orders is a sense of progression. I love the crafting system, but currently there isn't much in way of feeling that you have really grown as a blacksmith. Seeing more customers coming in to buy more expensive swords I hope will really give that sense of growing a business and seeing your skills be valued by the world. But, of course, we don't want to just stop there. The third thing I'd like to accomplish with the custom orders is context and player agency in the kinds of swords they create. Do you enjoy just making an expensive sword with the highest quality alloy you can refine? Well maybe you'll cater to those kinds of customers. Do you like getting in deep with the numbers and min/max every aspect to make the **perfect** blade? Well there will be certain customers for that as well. Or maybe you just like the forging mechanic and want to relax, shut your brain off. It's not necessarily about making the "best" sword as much as it is about making swords in general. Well there will be customers there for you too. I want to allow players to not just decide what kinds of swords they create, but also what kinds of shops they want to run.
Okay, all that being said, we have a massive list of requirements to work through now. We need a system where the player can make money on their swords, that grows as the player makes better swords, and has a diversity of customers that will adjust and become more specialized as the player lists their swords for sale. No problems right? (now you see why I cried a little) Genuinely, I sometimes wish I could be a sane dev and create simple mechanics that were easy to build. But, I'm not. So how do we intend to accomplish this? Well, design is still evolving as the project goes on, but I think we have something that'll do the trick. We are going to start with customer diversity. We will have a couple of different kinds of customers that are looking for different aspects of a sword. These all start super low so the player can basically sell anything. But, as the player sells swords, the game will keep track of the kinds of customers that enjoyed their time in the shop, and the ones that didn't. It will then slowly adjust the kinds and amount of customers that come into the shop when the player opens it. This will later be expanded to include the shop reputation as well. As the shop grows, so will the customers' pockets and maybe even type. But that's basically the start of it. I feel this system is modular enough to be able to be iterated upon later, while also being simple enough to get started now.
Final Summary
Well, there's a *short* summary of the last couple of weeks. The game is honestly coming along well and assuming these NPCs get built without too much hassle, we'll be in a great spot to release the first major update for the shop management system. This will be a HUGE step for the game and I feel all of the major groundwork will be done by the time this system is completely finished. However, there is still a lot of work to be done, so we'll be working hard to ensure it all gets done and integrated well. It honestly feels like I have toppled the first few dominos in a long chain of development, so I am excited to see where this goes.
As usual, if you haven't tried the game and given feedback, please do! I naturally am a very iterative dev so hearing what works and what doesn't is always a help. I'll see you in a week or two... hopefully with a new release :D
Get Blessings Of The Forge
Blessings Of The Forge
A Better Way To Smith
Status | In development |
Author | Forgotten Throne |
Genre | Simulation |
Tags | 2D, blacksmithing, Casual, Cozy, Crafting, Experimental, Godot, Pixel Art, Swords |
Languages | English |
More posts
- Shop System, Common Orders, and NPCs18 days ago
- Update on Shaders and Lighting25 days ago
- I'm LEARNING! Game Dev Math: 1 = 260 days ago
- The Pre-Release Update70 days ago
- New Mechanics And Next Steps80 days ago
- UI Overhaul90 days ago
- The Demo Is Out! (Finally...)May 31, 2025
- The Devlog You Deserve (and Probably Forgot About)May 25, 2025
- Metal Refining At LastApr 05, 2025
Leave a comment
Log in with itch.io to leave a comment.