6 ms·
City in a Bottle – A 256 Byte Raycasting System
- Shocka1 2y agoThis is why I come here.
- deleted 2y ago[deleted]
- EpiMath 2y agothat's a pretty fun read.
- sanjayk0508 2y ago[dead]
- immibis 2y agoRemnants by Alcatraz - similar 256-byte MS-DOS demo - youtube link included: https://www.pouet.net/prod.php 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.
- elvis70 2y agoI think the correct link is: https://www.pouet.net/prod.php?which=96536 https://www.pouet.net/prod.php?which=96536 The source code is also included
- immibis 2y agoI'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 2y agoNot 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.
- briansm 2y ago'Spongy' does something similar in 128 bytes, half the size. https://www.pouet.net/prod.php?which=53871 https://www.pouet.net/prod.php?which=53871 http://www.youtube.com/watch?v=36BPql6Nl_U http://www.youtube.com/watch?v=36BPql6Nl_U The name comes from the 'Menger Sponge' fractal it's based on: https://en.wikipedia.org/wiki/Menger_sponge https://en.wikipedia.org/wiki/Menger_sponge
- peter_d_sherman 2y agoRelated: How [Atari 2600] Pitfall Builds its World: https://evoniuk.github.io/posts/pitfall.html https://evoniuk.github.io/posts/pitfall.html Procedural Generation [Elite, early 8-bit game]: https://procedural-generation.tumblr.com/post/112509130817/elite-1984-elite-created-by-ian-bell-and-david https://procedural-generation.tumblr.com/post/112509130817/e... Procedural Generation [general article]: https://en.wikipedia.org/wiki/Procedural_generation https://en.wikipedia.org/wiki/Procedural_generation Somewhat related: Lazy Evaluation [from Functional programming (FP) languages]: https://en.wikipedia.org/wiki/Lazy_evaluation https://en.wikipedia.org/wiki/Lazy_evaluation Random observation: If a given raytracing algorithm (https://en.wikipedia.org/wiki/Ray_tracing_(graphics) 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 https://en.wikipedia.org/wiki/Wave_function_collapse
- elijahbenizzy 2y agothat’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…
- deleted 2y ago[deleted]
- thfuran 2y agoWhy would you think they are?
- elijahbenizzy 2y agoMeh 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 2y agoobfuscated 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 2y agoYou’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…
- sim7c00 2y ago
- nabla9 2y agoFrom the same author: 1K Pinball Game in JavaScript https://frankforce.com/lu1ky-pinball-code-deep-dive/ https://frankforce.com/lu1ky-pinball-code-deep-dive/
- tedunangst 2y agoThis 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.
- TechDebtDevin 2y ago[flagged]
- TazeTSchnitzel 2y agoOh so that's why my phone felt unusually warm the last few minutes!
- KilledByAPixel 2y agoThanks for the heads up, I fixed it! (just removed the live demo for now)
- rossant 2y agoThat was amazing.
- taylorius 2y agoOh I like that! That's awesome, nice one man!
- codetiger 2y agoThis is amazing, both the work and the article
- Marazan 2y agoIf you like this you'll love #tweetcart on Twitter. Tweet sized programs for the Pico-8 virtual console.
- inkubus 2y agothere is also https://www.dwitter.net/ https://www.dwitter.net/