Skip to content

Commit 53cbc0c

Browse files
committed
add star to bitboard post
1 parent 7a844fc commit 53cbc0c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

data/posts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const popularPosts = [
77

88
// Starred posts (not in any specific order)
99
export const postStars = [
10+
"visualizing-chess-bitboards",
1011
"installing-npm-packages-very-quickly",
1112
"compiling-lisp-to-bytecode-and-running-it",
1213
"making-python-less-random",

posts/compressing-cs2-demos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,6 @@ There are other tricks to achieve further compression like this blog series on [
261261

262262
I could also encode position data using [bit arrays](https://en.wikipedia.org/wiki/Bit_array). I'll explain how this would work with equipment changes as it's easier to explain than float compression.
263263

264-
Instead of storing a map with a `uint8` as a key, and a list of `int8` for the change events. I can compress the data into a bit array where each value is: a player id (4 bits) and an add or remove event (5 bits) for 9 bits total. A frame's equipment change field can just be a list of those (repeating the player id is actually okay because it's rare that multiple piece of equipment are acquired on the same frame).
264+
Instead of storing a map with a `uint32` as a key and a list of `int32` for the change events, we could compress the data into bit arrays where each value is: a player id (4 bits), an equipment id (5 bits), and an add/remove flag (1 bit) for 10 bits total. A frame's equipment change field could be a list of these 10-bit values, where each value represents a single equipment change event. While this means repeating the player id when multiple pieces of equipment change in the same frame, this is rare in practice and the space savings from the bit array would outweigh this minor redundancy.
265265

266266
It's fun to theorize but a protobuf schema is as far as I need to go for now. View the source code for this toy compression program [on GitHub](https://github.com/healeycodes/compressing-cs2-demos).

0 commit comments

Comments
 (0)