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.