Godoku v0.3.7
Update
This week, we're bringing a couple of small touches of polish.
- Modal menus that pop up over other controls now display a darkened background so it's easier to tell when a modal has control.
- We finally figured out how to fix the `Next Song` button, which you can map in `Settings`!
- Improved dpad and keyboard inputs when a LineEdit control is focused. Your gamepad will no longer get stuck when you try to enter text!
- Additional translations for older alerts that were using string literals.
- Various GUI updates, including smoothing menu transitions and making modal pop up/down more responsive.
Godot Dev
This update has been significantly less of a pain than some of the more recent devlogs. The signal architecture has been paying off in rearranging and reconnecting various nodes without having to rewrite code.
The hardest one was the `Next Song` feature. It uses the Godot AudioStreamRandomizer resource type to automatically randomize selecting an audio file from an array of files. That's not hard to write on your own, but it's usually a good idea to pick off-the-shelf parts for better support.
The problem with it was that the audio player checks to see if a request to play a new stream is for the currently playing stream. Since the resource file that contains references to all of the BGM is always the same, it was technically always playing the same resource and would never try randomizing again.
You'd think you could just stop and start it to circumvent that, but due to factors like fadeout times and deferred calls, it never finished a stream before the new play request came in. We solved it by simply padding out the call with enough time to clear it. These aren't mathematically derived times (that's how the feature got stuck never working!), but instead we just tested a variety of values until it worked consistently.
Once we found the solution, it was satisfyingly simple to put together with timers and signals.
if event.is_action_pressed("next_song"): SoundManager.stop_music(MUSIC_FADEOUT_TIME) get_tree().create_timer(MUSIC_NEXT_SONG_TIME).timeout.connect( func(): self.play_music() )
Overall, it's been a fun week to work in Godot!
Files
Get Serene Sudoku
Serene Sudoku
Serene Sudoku with meditative puzzles. The mind must be an open door to empty space.
Status | In development |
Author | templewulf |
Genre | Puzzle |
Tags | Godot, sudoku |
More posts
- Serene Sudoku v0.4.1Jul 08, 2024
- Serene Sudoku v0.4.0Jul 04, 2024
- Godoku v0.3.6May 16, 2024
- Godoku v0.3.4Apr 24, 2024
- Godoku v0.3.2Apr 22, 2024
- Godoku v0.2.6Mar 28, 2024
- Godoku v0.2.4Mar 26, 2024
- Godoku v0.2.2Feb 04, 2024
- Godoku v0.2.1Jan 19, 2024
Leave a comment
Log in with itch.io to leave a comment.