January 1, 2019

Cubytes Devlog #002

As 2018 left and 2019 came, Cubytes received some tweaks and thoughts to the core game added to it recently.

The Story of Cubytes

Looking back on the previously released Alphas, there really wasn't any sense of story. The closest thing that came to a story was the Block Tutorial popups... which are really just textbox tutorials that have no kind of overarching narrative.

To make it clear, there is a planned Story (though I'm a little murky on an ending) with a planned narrator. You can see this in the C++ version of Cubytes, he's the guy that tells you to press Enter. The narrator will guide you and deliver important tidbits about the game as well as replace the Block Tutorial. The narrator will (of course) be voiced and have subtitles, just so that you can understand what he is saying without any sound.

The Story will be delivered by...

Distortions.

Distortions are features placed in the levels that serve as a hub-like experience inside of Story Mode. In them, you are transported to a simple place where you can save your game and hear audio samples of the Narrator.

The 'save your game' feature of Distortions comes as a change, as this will be the only place to Save. Think of distortions as bonfires of Dark Souls, but with an added sense of being (the narrator) other than to restock and prepare for the next levels.

Refactored Save Games

The Save Game functionality has been given a technical makeover this update. Previously it was written based of a Godot class called ConfigFile. At the time it seemed okay to write it as such, but as development went on for Alpha 7 it was apparent that the approach was flawed in a number of ways.

The ConfigFile class was designed as primarily an open tweak file for certain settings and information that can affect a Godot application.

Therefore, the file does not support encryption or even any sort of file obfuscation, which the File class does out of the box.

Collecting variables in a File class is much easier than a ConfigFile.

In a ConfigFile, you need to have the section and key of the variable. This is easy enough, but for some reason I could never find a way to directly plug in the results from the ConfigFile. The only way I could use the information is to assign it to a variable, and then plug in said variable into whatever I wanted. That might've not been a good example, so here's some code.

vsync = config.get_value("window", "v-sync")
fullscreen = config.get_value("window", "fullscreen")
resolution = config.get_value("window", "resolution")
master_slider = config.get_value("audio", "master_volume")
music_slider = config.get_value("audio", "music_volume")
sfx_slider = config.get_value("audio", "sfx_volume")
background_particles = config.get_value("gameplay", "background_particles")
show_fps = config.get_value("gameplay", "show_fps")

$TabContainer/Graphics/VsyncToggle.set_pressed(vsync)
$TabContainer/Graphics/FullscreenToggle.set_pressed(fullscreen)
$TabContainer/Audio/MasterText/MasterSlider.set_value(master_slider)
$TabContainer/Audio/MusicText/MusicSlider.set_value(music_slider)
$TabContainer/Audio/SFXText/SFXSlider.set_value(sfx_slider)
$TabContainer/Gameplay/FPS.set_pressed(show_fps)
_on_resolution_changed(resolution.x, resolution.y)


While there's no syntax highlighting on that (stupid SyntaxHighlighter not working. and me not knowing how to install js libraries...) you can clearly see the variables getting some values from a ConfigFile, and then assigning it to certain UI elements.

With File, this intermediate step is removed and saving player information on my end became much more easier.

No comments:

Post a Comment