return to table of content

City in a Bottle – A 256 Byte Raycasting System

immibis
4 replies
14h16m

Remnants by Alcatraz - similar 256-byte MS-DOS demo - youtube link included: https://www.pouet.net/prod.php

I think this one is more impressive for being in Javascript, which often has worse density than 16-bit x86 machine code.

immibis
0 replies
9h10m

I'm a moron. Somehow I read "width" and deleted the irrelevant parameter because people have different screen sizes and the site should auto-detect instead of using my one.

beagle3
0 replies
11h55m

Not necessarily worse density - variables are 1 byte names vs 2+ byte load instructions (often 3).

But the thing that gives JS a huge advantage here is the “standard (dweet) library” which has sin/cos/fill/line etc whereas x86 bios has “switch mode” and then it’s just a pixel array.

elijahbenizzy
4 replies
13h37m

that’s spectacular — the information density we perceive is off he charts for such a small amount of code.

Makes me wonder if LLMs aren’t the best way to model the world at all…

thfuran
1 replies
6h55m

Why would you think they are?

elijahbenizzy
0 replies
3h48m

Meh I don’t (they’re clearly imperfect) but I’m more wondering if we’re leaving lots of efficiency on the table in approaches to modeling the world.

sim7c00
1 replies
5h23m

obfuscated code with a lot of short cuts is likely also not the best way to model the world :P but this is definitely an impressive feat :D i'd be happy to get it done in like 256 lines of code, likely it would take much more than that! XD...

as for visual stuff. a lot of things man made and natural follow patterns (otherwise it'd be hard to recognize anything). So there's a lot of maths stuff you can use. Different types of noise or other patterns line for the height textures, fractals can be used interestingly, fibbonach/phi ratio for vegetation/trees, size ratio between skeletal elements / bones etc. - don't need any magic guessing machines for any of that.

elijahbenizzy
0 replies
3h45m

You’re telling me god didn’t cut corners? /s

Yeah, reacting to so much perceived information being represented in such little code. Versus billions/trillions of weights in LLMs…

tedunangst
1 replies
11h56m

This is very cool, but it's a bit unfortunate the loop runs continuously the entire time I'm trying to read the article and overheating my laptop.

TazeTSchnitzel
0 replies
7h15m

Oh so that's why my phone felt unusually warm the last few minutes!

Marazan
1 replies
9h42m

If you like this you'll love #tweetcart on Twitter.

Tweet sized programs for the Pico-8 virtual console.

taylorius
0 replies
11h31m

Oh I like that! That's awesome, nice one man!

rossant
0 replies
11h52m

That was amazing.

peter_d_sherman
0 replies
13h38m

Related:

How [Atari 2600] Pitfall Builds its World:

https://evoniuk.github.io/posts/pitfall.html

Procedural Generation [Elite, early 8-bit game]:

https://procedural-generation.tumblr.com/post/112509130817/e...

Procedural Generation [general article]:

https://en.wikipedia.org/wiki/Procedural_generation

Somewhat related:

Lazy Evaluation [from Functional programming (FP) languages]:

https://en.wikipedia.org/wiki/Lazy_evaluation

Random observation:

If a given raytracing algorithm (https://en.wikipedia.org/wiki/Ray_tracing_(graphics) only evaluates visible points for a 2D image created as a view from a set of 3D data -- then that's sort of similar to the FP concept of Lazy Evaluation, that is, "delay the evaluation of an expression until its value is needed"...

Which in turn, prima facie, seems at least cursorily related to "Observation collapses the wave function":

https://en.wikipedia.org/wiki/Wave_function_collapse

codetiger
0 replies
11h26m

This is amazing, both the work and the article

EpiMath
0 replies
16h17m

that's a pretty fun read.