Frozen

šŸ“… 2023-05-02

Mmm, if I could melt your heart. Mmm, weā€™d never be apartā€¦ Today, I spent most of the day in engine, getting existing issues ironed out and moving through our huge to do list, in order to get the looping scene logic functional. 21 items crossed off the list, but to be completely honest, there are things I did I donā€™t want to quite reveal yet, and things that just amount to bug crushing and adjusting/tweaking shit, that wouldnā€™t make for very much of a developer post.


For my own benefit though, so I can look back and know what we accomplished today, without spoiling the things I donā€™t want to spoil yet, here is what we did:



Ignore the typos, but that is sufficiently vague. With that out of the way, weā€™re making some pretty great headway on this section of ā€˜Mirrorsā€™, and while we do have quite a bit to implement in regards to cut-scenes, story elements, dialogue, and expanding the ā€˜Echoā€™, we have something fairly playable. It just really needs a sound pass, which I had on my to do list all day. Iā€™m not really in the mood to start sourcing sounds right this minute though, so for the development blog I figured why not create this areas custom UI.


Essentially, in these areas when we are playing as Daphne, we want a UI that sort of matches the overall theme of ice and snow. It canā€™t be cartoony or out of place considering our genre, so maybe something akin to those grimy UI elements we often see in Horror games, but with a icy feel to them. I want a background for our hovertext, our dialogue, our on screen UI elements (which is just held item, for the moment) and Iā€™ll want one for our tooltips as well. In fact, letā€™s quickly implement the hint system from HFPS so we can see how weā€™re going to need to change it.


While other segments of ā€˜Mirrorsā€™ will likely not utilize the hint system, this particular segment will, so letā€™s figure out how it works. The easiest way to do this is to jump over to our example ā€œShowcaseā€ scene in the original HFPS package, and figure out itā€™s dependencies. Of course, the Showcase has changed considerably since we installed the package, as development has continued, but most of it is still standing for when we need to figure things about the systems out.



Aww, look itā€™s Iris. Long time no see, Iris. So, letā€™s run the Showcase scene and see how the Objectives work. We may initially crash because of all the changes weā€™ve made in the Snow Scenes to our pre-existing systems, but most I tried to wrap in scene dependent language - you never know what slipped through.


How about that, not a single error. Letā€™s fucking go. But I have to say the movement feels so much rougher than our current Daphne version, that will need some tweaking when we get back to her sections.



So, you could see the Objectives coming up in the top left corner. What I did hate, however, is the ā€œYou Have New Objectives, press [Tab] to check itā€ - no thanks fam, just show me what it is. That isnā€™t going to cut it, that should be a simple fix though, weā€™ll just add the Objective panel to our InGame panel, either that or itā€™s already an option in here, so letā€™s actually highlight the objective boxes and have a look.



And of course itā€™s a fucking ID system, like the cutscenes. Ugh. I really feel bad about how much I dislike the way that the HFPS kit is put together, I mean thereā€™s a reason it takes me so long to decipher a lot of it, it is advanced coding. But I donā€™t know if itā€™s the language barrier (pretty sure the developers are Russian) or just a difference in coding preferences, but everything in the kit feels so damn unintuitive. Anyway, we have a dropdown that letā€™s us choose New Objective, Complete, and Complete and New. This whole time Iā€™ve been using my main character itā€™s had the Objective Manager script on the UI component - I never removed it because if you remove literally anything in HFPS the entire thing begins to unravel and explode, unless youā€™re willing to jump in with some hedge trimmers and cut out all the dependencies. So luckily, itā€™s still there.



Right, so we have a scene scriptable, well thatā€™s nice. Small miracles. We have direct UI plug ins, and ObjectivesParent is nestled in our Inventory panel, so weā€™ll need to move that if we want an Objective list in our top right corner. We have the ā€œPushā€ Objective UI, which is the one we see in game when we run over the trigger. And we have two prefabs, which likely just handles the actual appearance and disappearance of the UI element on a timed fader. Letā€™s look at the scriptable.



The first two are basically just testers, but the third has an Event ID. Hmm, how is that working? Apparently, itā€™s on a fence door, lets go have a look. I found the fence door, but it only has an animation script on it, so weā€™re calling that somehow from our scriptable? The scriptable has ā€œCollect Three Apples To Open Doorā€ and then each apple has TriggerObjective script on it that is set to ā€œCompleteā€ Objective 2ā€¦ how is this? Oh, for fuck sake the TriggerObjective gameobject on the fence is not even attached to the fence, why would it be, I guess?



So, it contains an ObjectiveEvent script which takes an ā€œeventā€ name, which we define in the scriptable, and it fires the event if marked complete. Fair enough, so what we need to do is create a scriptable, mark events that we need, then tick them off as theyā€™re completed using the ObjectiveEvent or TriggerObjective scripts. I should be able to wrap my head around that, letā€™s jump back into our snow scene and attempt to create one for our snowman.


First thing Iā€™ve noticed is they didnā€™t add a shortcut to make their scriptable objectives in the editor. Thatā€™sā€¦ odd, considering how little they care about filling your project with HFPS namespace dependencies. Letā€™s just duplicate the showcase ones and empty it out, then add some of our own. Weā€™ll start with, ā€œBuild a Snowmanā€ and since we just need to include it in our UI overhaul, we can go about figuring out exactly how to complete it at a later date.



Ta-da! Itā€™s alive. Okay, now to go into the script and remove the Push instantiation, since weā€™re going to move the parent Objective holder to our main in game UI. Weā€™ll also remove the parent holders ā€œObjectiveā€ title because it takes up too much room and is an ugly addition for an in-game version of an Objective list. We can also turn the objective audio down to .0025 because itā€™s fucking deafening. So here is our, for now, complete list of things we need to create UI elements for.



I jumped online and started looking for resources, and found a cool screen overlay we could probably use with a bit of photoshop tweaking. I have to decide if I just want it to fade in and out, or if we want it to actually grow and shrink, so some sort of frame animation. Letā€™s keep it simple for now and weā€™ll just use a fade.



And I figure we can re-purpose the overlay to create some sort of text label as well. After a little photoshop we have:



Listen, I didnā€™t say I was a UI Queen or anything, but I think these might work, provided I can get the TextMeshPro to have an outline. I know it has that feature but I also know you sometimes have to fuck around a lot to get TextMeshProUI to work properly. Weā€™ll need a little script that checks if a text field has text, and if it does, it will lerp the image to a value, and if it doesnt, it'll lerp the image to nothing.



And here it is once theyā€™re all in and placed:



Honestly, pretty happy with that. We have it set at .1 alpha so it isnā€™t overwhelming, it just adds a nice little flavor to it. In fact, it can probably stand to go .05 or something. And since itā€™s 10pm, and Iā€™ve been in engine for like 12 hours, letā€™s call it there, upload the post, and finally unwind a little.