's Avatar

@lennnnart.bsky.social

6 Followers  |  21 Following  |  19 Posts  |  Joined: 13.02.2025  |  1.8982

Latest posts by lennnnart.bsky.social on Bluesky

Both @cissyspeaks.bsky.social and Sean Vanaman were kind enough to comment on it on Twitter back when I uploaded it

29.07.2025 23:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

In the middle of my little production, news broke that a production company had acquired the rights for a film adaptation @keithcalder.com

29.07.2025 23:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I shot it in Manning Park, BC. After weeks of research I found a lookout that looks very similar to the one in the game: Monument 83

29.07.2025 23:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
FIREWATCH - Title Sequence
YouTube video by Lennart Breede FIREWATCH - Title Sequence

Going through my backlog of short films I made and stumbled across my favorite project, a title sequence for Firewatch: youtu.be/mDCWPsSlQOM?...

29.07.2025 23:14 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
How-Hash-Maps-Work-(From-Scratch)

I wrote it all up โ€” including a Python implementation โ€” in my latest post:
How Hash Maps Work (From Scratch)

๐Ÿ› ๏ธ Buckets, hashes, resizing, the whole thing:
๐Ÿ‘‰ lbreede.github.io/quartz/how-h...

#BuildSlowThings
#TIL
#programming #hashmaps #rust #python #dataStructures

11.07.2025 03:19 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Thatโ€™s what makes hash maps fast:

Good hashing
Resizing at the right time
Rehashing keys to rebalance the buckets
All this work to make map["key"] feel instant.

11.07.2025 03:19 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

When the load factor (length / capacity) crosses ~0.7, we double the array size...

โ€ฆand then we rehash every key.

Because:

hf("some key") % 3 == 1
hf("some key") % 20 == 10

Changing the capacity changes everything.

11.07.2025 03:19 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Okay, but what happens if you keep inserting?

Buckets get longer โ†’ scan time goes up โ†’ things get slow.
So we resize.

11.07.2025 03:19 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Insertion = scan the bucket.
If the key exists, update the value.
If not, append it.

Lookup? Same thing:
Hash, mod, scan the bucket for a match.

11.07.2025 03:19 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

But what if two keys land in the same slot?
We donโ€™t overwrite โ€” we use separate chaining:

[
[],
[("a", 1), ("b", 2)],
[]
]

Each bucket is a list of keyโ€“value pairs.

11.07.2025 03:19 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

You start with a hash function: something like
hf(key) -> int

Hash the key โ†’ turn it into an index with % capacity โ†’ store it in an array.

Simple, right?

11.07.2025 03:19 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

TIL how hash maps actually work under the hood.
(aka: how dict, map, or HashMap magically give you fast lookups.)

Turns outโ€ฆ it's not magic โ€” it's buckets, hashing, and resizing.

Letโ€™s build one from scratch.

๐Ÿงต๐Ÿ‘‡

11.07.2025 03:19 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Thank you!

05.05.2025 20:13 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Moving away from Rust is sad but man it feels good to just write code without fighting with your borrow-checker

05.05.2025 00:59 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Huge shoutout to @gingerbill.org for his gamedev live streams. I was on my own for my fights agains xml and csv though.. skill issue?

05.05.2025 00:58 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

Rewrote my little isometric game engine in #Odin and #raylib
Now that it supports tile sets and maps from Tiled, it's much more fun to run around in it #gamedev #indiegame

05.05.2025 00:55 โ€” ๐Ÿ‘ 20    ๐Ÿ” 4    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

Press F5 for debug mode #indiegame #rust #raylib

12.04.2025 15:11 โ€” ๐Ÿ‘ 5    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Video thumbnail

State machines are fun. The `Pickup` state basically blocks player input for a couple of frames until switching to `Idle` once the animation is over #indiegame #rust #raylib

11.04.2025 00:13 โ€” ๐Ÿ‘ 6    ๐Ÿ” 2    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Video thumbnail

He's a runner #indiegame #rust #raylib

10.04.2025 16:50 โ€” ๐Ÿ‘ 3    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

@lennnnart is following 20 prominent accounts