Skip to content

Commit c7919f9

Browse files
committed
Add no signal 2025-03-07 notes
1 parent 0520f28 commit c7919f9

File tree

7 files changed

+151
-2
lines changed

7 files changed

+151
-2
lines changed

content/entries/20250307052217.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
created: 2025-03-07T05:22:17Z
3+
---
4+
5+
Working on _no signal_ offline:
6+
- Copied TODOs from [20250306173232](20250306173232.md)
7+
- Found out that `reduce` is cursed: [20250307170955](20250307170955.md)
8+
9+
Tanuki:
10+
- [ ] Add audio-locked box
11+
- [ ] Articulate piano keys
12+
- [ ] Decorate music room
13+
- [ ] Separate toilet lever so it can be animated in Godot
14+
- [ ] Fix Rubix cube UVs
15+
- [ ] Make Naoko's charm model
16+
- [ ] Switch velcro mats to something more "traditional"?
17+
- [ ] Bobby-fy `meeting-a plan`
18+
- [ ] Make models to fill drawers in medical room
19+
- [ ] Make models to fill drawers in workshop
20+
- [ ] Make ovens in kitchen open-able
21+
- [ ] Starfish model
22+
- [ ] Separate `sm_door_bathroom` door from frame so it can be animated in Godot
23+
24+
TODO:
25+
- [ ] Update input tutorial to show both controller and mouse inputs
26+
- [x] Add interaction with drive bays for controller
27+
- [x] Grab focus in signal UI
28+
- [x] Add interaction with circuit puzzle for controller
29+
- [ ] Add interaction with card writer buttons for controller
30+
- [ ] Add interaction with fuse box for controller
31+
- [ ] Add interaction with card reader buttons for controller
32+
- [ ] Remember to use crosshair when last input was joystick
33+
34+
Part Two:
35+
- [ ] Make toilets flushable
36+
- [ ] Implement Rubix cube
37+
- [ ] Add poem song puzzle to music room
38+
- [ ] Make doors in bathroom open
39+
- [ ] Add starfish model to 2g (see `radio-a nevaeh`)
40+
- [ ] Music room is missing drive bay and dialog screen
41+
- [ ] Add compliance decal to office
42+
- [ ] Add decal that describes the Oberth effect
43+
- [ ] Add decoy drive bays to gravity backup
44+
- [ ] Add sliding puzzles to gravity backup
45+
- [ ] Add cork board with clues in meeting room
46+
47+
Part Three:
48+
- [ ] Add breathing sounds
49+
- [ ] Dynamically change resolution of cinematic
50+
- [ ] Add cables in EVA

content/entries/20250307170955.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
created: 2025-03-07T17:09:55Z
3+
---
4+
5+
Found out last night that `Array.reduce` in Godot 4.4 does not work the way I would have expected coming from a functional programming background.
6+
7+
I wanted to write a function which would fold over a list and return best suitable match based on some criteria or `null` if none of those results were appropriate. However, I found that when I used `reduce`, it would keep picking an inappropriate result (which happened to be at the front of the list).
8+
9+
According to the documentation for [`reduce`](https://docs.godotengine.org/en/4.4/classes/class_array.html#class-array-method-reduce), this is because of how the `accum` parameter works:
10+
11+
> The method takes two arguments: the current value of `accum` and the current array element. If `accum` is `null` (as by default), the iteration will start from the second element, with the first one used as initial value of `accum`.
12+
13+
Which means that even though `reduce` has the same type signature as `foldl`, if `accum` happens to be null it turns into what would be a `foldl1` in Haskell. The solution was to use a `for` loop instead.
14+
15+
A chatter `Reaganomicon` mentioned that JavaScript, F#, and Python's `functools` also implement reduce in the same way.
16+
17+
JavaScript does implement [`reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) in a similar way:
18+
19+
> The value resulting from the previous call to `callbackFn`. On the first call, its value is `initialValue` if the latter is specified; otherwise its value is `array[0]`.
20+
21+
But, if you call `reduce` with `null` or `undefined`, the function works correctly (at least in Firefox 136.0):
22+
23+
> ```js
24+
> console.log([1].reduce((acc, v) => null, null))
25+
> console.log([1].reduce((acc, v) => null, undefined))
26+
> console.log([1].reduce((acc, v) => null))
27+
> ```
28+
> Prints:
29+
> ```
30+
> null
31+
> null
32+
> 1
33+
> ```
34+
35+
This is probably because JavaScript functions can check how many arguments a user defined even if one of those arguments is undefined.
36+
37+
F# also [does it correctly](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-arraymodule.html#reduce) as it has both `Array.fold folder state array` and `Array.reduce reduction array` (which have the same type signatures as `foldl` and `foldl1` respectively in Haskell)
38+
39+
And it turns out that `functools` in Python 3 also implements [`reduce`](https://docs.python.org/3/library/functools.html#functools.reduce) correctly:
40+
41+
> ```py
42+
> import functools
43+
>
44+
> print(functools.reduce(lambda x, y: None, [1], None))
45+
>
46+
> print(functools.reduce(lambda x, y: None, [], 1))
47+
> ```
48+
> Prints:
49+
> ```
50+
> None
51+
> 1
52+
> ```

content/entries/20250307175601.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
created: 2025-03-07T17:56:01Z
3+
---
4+
5+
I recently installed OBS through Flatpak, but it appears that the captioning plugin I like to use cannot be installed because there is no Flatpak packaging of it:
6+
7+
> [GamertechAU](https://github.com/ratwithacompiler/OBS-captions-plugin/issues/101#issuecomment-2337224798):
8+
>
9+
> OBS team disabled being able to use plugins on Flatpak without them being Flatpak extensions in 30.2.0

content/notes/godot-array-reduce.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "`reduce` returns first value in array when accumulator is `null`"
3+
created: 2025-03-07T17:37:00Z
4+
aliases:
5+
- "`reduce` returns first value in array when accumulator is defined as `null`"
6+
tags:
7+
- godot
8+
---
9+
10+
# `reduce` returns first value in array when accumulator is `null`
11+
12+
`Array.reduce` as of Godot 4.4 will use the first element in the array when the accumulator is either undefined or explicitly set to `null` by the user, contrary to how JavaScript, F#, and Python works. [^1]
13+
14+
This means that you cannot write a function to pass to `reduce` that would fold over a list and return the best suitable match based on some criteria or `null` if none of those elements are appropriate. This is because it could keep picking an inappropriate result if one exists at the front of the list. [^1]
15+
16+
If you are familiar with Haskell, another way of thinking about it is that `reduce` in GDScript silently turns into `foldl1` when `Nothing` is passed to `foldl` as the initial value for the accumulator. [^1]
17+
18+
This behavior is documented in the documentation for [`reduce`](https://docs.godotengine.org/en/4.4/classes/class_array.html#class-array-method-reduce), this is because of how the `accum` parameter works: [^1]
19+
20+
> The method takes two arguments: the current value of `accum` and the current array element. If `accum` is `null` (as by default), the iteration will start from the second element, with the first one used as initial value of `accum`.
21+
22+
[^1]: [20250307170955](../entries/20250307170955.md)

content/notes/godot-crimes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Godot crimes
33
created: 2024-06-29T08:10:42Z
4-
modified: 2024-10-11T02:35:15Z
4+
modified: 2025-03-07T17:37:26Z
55
aliases:
66
- Godot crime
77
- Godot crimes
@@ -26,6 +26,7 @@ These crimes have not been addressed and are still issues in the Godot codebase.
2626
- [Cubemaps are not oriented consistently between rendering pipelines](godot-cubemap-orientation.md)
2727
- [Godot always runs scripts in deserialized resources](godot-runs-scripts-in-resources.md)
2828
- [Godot doesn't export dependencies](godot-export-dependencies-broken.md)
29+
- [`reduce` in Godot returns first value in array when accumulator is `null`](godot-array-reduce.md)
2930

3031
## Solved Crimes
3132

content/notes/no-signal.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: no signal logs
33
created: 2023-05-27T10:23:24Z
4-
modified: 2025-03-06T17:33:31Z
4+
modified: 2025-03-07T07:33:46Z
55
aliases:
66
- no signal logs
77
- lost contact logs
@@ -20,6 +20,7 @@ If you've been asked to playtest the game, please see the [playtesting steps](no
2020

2121
| date | version | notes |
2222
|------|---------|-------|
23+
| <span class="timestamp">2025-03-07</span> || [052217](../entries/20250307052217.md) |
2324
| <span class="timestamp">2025-03-06</span> || [173232](../entries/20250306173232.md) |
2425
| <span class="timestamp">2025-03-05</span> || [055115](../entries/20250305055115.md), [181755 (stream 179)](../entries/20250305181755.md) |
2526
| <span class="timestamp">2025-03-04</span> || [173319 (stream 178)](../entries/20250304173319.md) |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: OBS captions plugin doesn't work with Flatpak install
3+
created: 2025-03-07T17:57:33Z
4+
aliases:
5+
- OBS captions plugin doesn't work with Flatpak install
6+
tags:
7+
- obs-studio
8+
---
9+
10+
# OBS captions plugin doesn't work with Flatpak install
11+
12+
The [OBS captions plugin](https://github.com/ratwithacompiler/OBS-captions-plugin) cannot be used with a Flatpak installation of OBS Studio because the OBS team disabled being able to use non-Flatpak plugins on Flatpak in 30.2.0. [^1]
13+
14+
[^1]: [20250307175601](../entries/20250307175601.md)

0 commit comments

Comments
 (0)