A Falling Sand Visualization

godotvizaoc

In another Advent of Code puzzle we were tasked to drip sand into a map (defined by the puzzle input) and count them. At this point I had switched to Godot and its scripting language GDScript.

Performance

Trying out Godots GUI programming and the custom draw functions present in each CanvasItem. Once the sand amount got high enough things started being quite sluggish again and for part 2 I had to disable visualization. The sand gets high enough to cover the entry point. I did a naive "draw everything each frame" implementation, so this could've easily been fast enough by rendering the stationary elements separately and blitting that.

I stored the stone and sand in a simple Dictionary with Vector2 keys without any fancier tricks. We're not making Noita here!

Code for my day 14 solution. There are a few more parts needed for a functional setup, they can be found in the repository. Easiest way is to take the whole project in godot-aoc.