6 ms·
A new line drawing method for the cycle savvy
- JonathanBeuys 3y agoI'm surprised the demo scene is still targeting the C64. Why not the browser? Would be a lot of fun to try the different demos then. Would be entertaining and educational to see different things you can actually do in the frontend these days. Also, why not directly link the demos to a C64 emulator, so at least on can try them out?
- sharpneli 3y agoWith browser it’s the bog standard WebGL and now WebGPU. They bring nothing over just doing normal demo using native graphics apis directly. They are good ways to distribute programs for customers but that’s it.
- z3t4 3y agoWebGL is low level, so you need a graphics engine ontop.
- Sharlin 3y agoWebGL is a very high level API because OpenGL itself is a very high level API in this context. People have been coding directly on top of OpenGL since it was first created, including 4k demos. A demoscene demo will itself implement whatever custom "graphics engine" is needed (for a 4k, essentially nothing is needed). Demos don’t commonly use third-party dependencies because the entire idea is to show off your (group’s) programming and art savvy.
- pavlov 3y agoThere are browser demos, but it’s not really a unique platform. With WebGL and WebAssembly and soon WebGPU, you can pretty much render anything in the browser. There’s not much difference between making a Windows demo and a browser demo. Old platforms like the C-64 are appealing to a certain kind of clever person because the constraints are fixed and a lot of the possible tricks have already been thoroughly exploited in the past. When you find a novel trick, it will be remembered by the aficionados.
- Sharlin 3y agoPure Wasm is, OTOH, a fairly interesting constrained platform if you keep the JS glue to a bare minimum (essentially requestAnimationFrame, call Wasm, and blit the TypedArray you get onto a <canvas>, plus similar for the audio) and don’t export any JS APIs to the Wasm side either. Then essentially all you can do is pure computation without side effects, writing the results to a fixed chunk of memory to be blitted. No HW acceleration, no OS services, no "unbounded" heap to allocate from at your leisure… Of course you can do all this natively too, but you have to enforce the constraints yourself.
- weinzierl 3y agoWhat draws me to the C64 demo scene is that they use a fixed hardware in ways that it was never supposed to. Doing all this wonderful graphics and sound in just a couple of bytes on hardware that's less capable than an average washing machine is just mind blowing.
- Aardwolf 3y agoI like everything about it except the slightly depressing purple/brown-focused color palette :)
- Sharlin 3y agoThe palette is quite clever. It’s optimized for being able to reasonably represent real-world things, as well as gradients, unlike the garish primary color based palettes of some of its contemporaries.
- weinzierl 3y agoIt's better than the color palettes of most other machines of that era. Especially CGA, man I hated CGA;-)
- Aardwolf 3y agoYeah, CGA's white+cyan+magenta+black is a baffling choice for a default palette!
- Ekaros 3y agohttps://www.youtube.com/watch?v=niKblgZupOc https://www.youtube.com/watch?v=niKblgZupOc You can make funny tricks when passing image as composite. Where with those you can produce other colours. And state of computers were quite limited and primitive then. On other hand for business use, those are still acceptable, everything was text anyway.
- Lerc 3y agoI once tried to figure out the smallest modification to cga hardware that could be made to substantially improve the palette. Inverting the digital red line produces some amazing options. Not least because the palettes containing red became black enabling the colour that was typically used for black to be reused as this was the only palette entry that could be set to any of the 16 colours.
- Aardwolf 3y agoI really agree that they should have an integrated browser-based C64 emulator to view all those demos. The browser itself is not very a interesting target for this kind of demo, since it doesn't have much limitations and changes over time too.
- Ekaros 3y agoArt is in the limitations. And with browsers, why not just push video? Could pre-render it in some farm. In the end it is not just that interesting platform compared to even native things.
- amelius 3y ago> Art is in the limitations. Ok, but then back in the era of the C64 why weren't they making cave paintings? ;)
- p-e-w 3y agoI love this comment. It just cuts through all the pseudo-traditionalist cargo cult BS that surrounds topics like the one being discussed here. To be clear, I think those demos are cool and contain interesting technology. But the pretense that the cutting edge equipment of a specific time is somehow the measure of art and what came after is "just not that interesting" is difficult to stomach. Pity that attitude is so common on HN, I would enjoy being here much more if it weren't.
- Aardwolf 3y agoFor this particular form of demo, modern hardware is just too powerful, and the quality of the demo is purely the quality of the assets. So a demo for a modern platform would require the same scale as what big AAA game or movie studios produce. Which is also art, but a different kind. With limitations, more interesting cleverness, and a scale of project a single person can muster, can thrive instead. So there probably really is something to this particular generation of hardware, the order of thousands of bytes is more "human scale".
- richardjdare 3y agoyes, I was a keen follower of the demo scene in the 16 bit days. not so much the C64, but the Amiga, and then the mid-late 90s PC scene. Back then, it wasn't so much about limitation, though size-coding was always a thing. It was about seeing something new and cool that hadn't been done before. Pushing things further artistically and technically at the same time. The Amiga was one of the most powerful machines available to the home market so programming it didn't feel like working under constraint, it felt like pushing the envelope of what was possible. Nobody had anything to compare it to, except maybe SGI workstations, which you'd only see on TV shows about movie special effects. At that time demo programmers had parity with game developers and were sometimes the same people. You generally saw higher quality and more innovative effects in a demo than you did in even the biggest video games. And there was no video playback on computers, so all graphical effects you saw had some element of demo-scene adjacency, which made the whole thing feel unified, progressive and relevant. As time went on and technology changed, it became less feasible for lone bedroom coders and small groups of Scandinavian teens to reach that "edge", and keep pushing the boundaries with the same mindset as before, so the emphasis of the artform seems to have changed towards constraint, and towards working with retro machines as historical artefacts. The scene has had to reinvent itself a few times. I remember reading articles in HUGI diskmag 20-odd years ago discussing how demos had changed from being about hardware hacking, and getting graphics chips to do unusual things, to becoming more of an "algorithmic trip" thanks to the new pc graphics cards that were coming out.
- detrites 3y agoHere you go: https://8bitworkshop.com/v3.10.1/?platform=c64&file=hello.dasm https://8bitworkshop.com/v3.10.1/?platform=c64&file=hello.da... Also has NES, Sega Master System, ZX Spectrum, etc.
- Sharlin 3y agoDemoscene targets whatever platform can display some graphics and make some sound. People write C64 demos because they want to. It’s a subculture within the greater scene, and approximately zero percent of C64 sceners would want to move to writing browser-based demos. The whole point of the C64 scene is to cycle-shave and torture the hardware into performing tricks its designers would never have thought about.
- marginalia_nu 3y agoWhy not the browser? Because playing in a browser sandbox just isn't very fun is probably the short version.
- hgsgm 3y agoJS demos: http://creativejs.com/category/demoscene-2/index.html http://creativejs.com/category/demoscene-2/index.html https://www.bitsnbites.eu/muon-baryon-in-6k-javascript/ https://www.bitsnbites.eu/muon-baryon-in-6k-javascript/
- jacobgorm 3y agoFixed hardware platforms are more interesting for demos, because they provide a level playing field, and because anything that the hardware will allow goes.
- Cyykratahk 3y agoIf anyone wants to see a recording of the demo, click on the "Boo!" link in the article to view its entry on the CSDb site. The blue sidebar on the right has a YouTube link.
- proto_lambda 3y agoThanks! That's way too well hidden.
- andai 3y agohttps://www.youtube.com/watch?v=CaCisnpvvTU https://www.youtube.com/watch?v=CaCisnpvvTU
- hgsgm 3y agoThe lines are used in drawing the edges of the cube. Is the new technique needed to achieve the framerate for the single spinning cube?
- pavlov 3y agoThe new technique enables a bigger cube at full frame rate. From the article: > “Apart from unlocking a number of improvements in XOR fillers and similar effects, the method, as used in the 4k, also significantly raises the bar for realtime filled sprite vector cubes. The cube displayed in "Boo!" draws over an area of size 172x172, up from 140x140 in Protogeo 100%. This improvement to size is because line computation that previously either took 7+ cycles per pixel (or exhaustive amounts of memory) can now, thanks to the BRR ("bit reverse rendered") line method, done in just 5 cycles per pixel.”
- detrites 3y agoHere's the non-size-limited competition winner, for the curious. It's freakin' incredible - and 23 minutes!, but you can skip from 5m - 8m (I think extended for music): https://youtube.com/watch?v=CxkTwJoAzBE https://youtube.com/watch?v=CxkTwJoAzBE
- petesergeant 3y agoCan I see the described Boo video without needing an emulator? EDIT: I think it’s this? https://youtu.be/FpGwT0QqJbY https://youtu.be/FpGwT0QqJbY
- tleb_ 3y agoThe csdb.dk entry linked in the post has a YouTube link: https://www.youtube.com/watch?v=CaCisnpvvTU https://www.youtube.com/watch?v=CaCisnpvvTU
- weinzierl 3y agoIf anyone wonders why it starts with a lot of character garbage on the screen: I can be wrong, but I think it is usually the decompression. The demo is only 4K in size, but gets expanded after loading so it fills the entirety of the available memory. Not to waste space for the decompression routine, it runs directly in the video RAM which is latter overwritten. What you can see is literally program execution, with the fastest changing characters often being inner loop vars.
- egypturnash 3y agoYes; throwing the decompression routine and/or its variables into screen RAM also has the bonus of making it obvious to the user that something is happening without spending any time implementing a progress bar. Sometimes there's text like "Decrunching..." or "SuperPacker2.4 by c00lDude/TLA".
- weinzierl 3y ago4k here means that the program is 4096 bytes long and not the screen resolution. Yes, that's only four thousand and ninety six 8-bit octets. And they are supposed to run on a machine with 985.248 kHz clock frequency. Yes, thats kilo as in one thousand. The machine in question has only a single core (with a single thread), but the demo cleverly uses the CPU of the floppy drive for a speed up, so you could say it features true parallelism on multiple cores. Also arithmetic on the machine operates only on 8-bit values and of course there is no hardware multiplication. Division, you wouldn't even think about.
- karmakaze 3y agoTo state the implicit/obvious, the CPU is a 6502 from the assembler mnemonics and specifically a 6510 in a C64 from reference to the 1541 external floppy drive. > Note that as far as the slope math goes, Bresenham is special since it doesn't require the division of x by y, but BRR lines do. So for short line segments, Bresenham can still "win". In fact, BRR lines also need a bit more elaborate math for the remainder. (So this method really shines if you're able to pull in the 1541 for help. See my upcoming post about drivecode) The BRR algorithm is 5 cycles per position vs 8-10 cycles for Bresenham, which is impressive. Its step position inner loop calculation is only cpx #imm ;compare x-register to constant adc zp ;add with carry the value in (0-page) address to accumulator (a-register)
- Mizza 3y agoThis is a cool and simple technique, it seems like the sort of thing that should have been discovered 50 years ago. Not only is it more cycle efficient, the lines are more stable in animation, which to me seems like the primary benefit. Amazing this stuff is still being improved.
- naillo 3y agoOn that topic there's so many things that are so simple and should have been discovered 50 years. Diffusion feels like it should have been discovered 30 years ago (adding noise to an image and solving for the reverse to generate new images of the same kind).
- david-gpu 3y ago> adding noise to an image and solving for the reverse to generate new images of the same kind [should have been discovered 30 years ago] Diffusion networks sre new, but denoising autoencoders work on the principle you outlined and were invented in the eighties. The reason neural nets didn't become popular sooner is because achieving the sorts of results they produce nowadays requires a ton of computing power and a ton of data to train from.
- hgsgm 3y ago"You will have noticed that the slope-based lines above "wiggle" more. This is true, and might be considered one of the drawbacks of the algorithm. However, the fact that BRR lines are more temporally stable can also conceivably be useful in some applications." For nearly all applications, better quality for trivial cost is preferred. The "instability" of classic lies is almost always a benefit -- it provides a very cheap form of motion blur / time-dimension dithering anti-aliasing that hides the ugly pixel aliasing of stable lines. BRR is only better when generating extremely complicated demos, where hyperoptimization matters more than control over the image. For most applications, drawing what the developer/user wants is more important than more complex but arbitrary effects.
- jacobgorm 3y agoIndeed impressive, but compared to when the demo scene fist started, a C64 programmer today has access to all the world’s knowledge via the Internet, and is not constrained by having to host the development environment on the same machine used for testing. Just the fact that you don’t have to reboot the entire setup and possibly even recreate your program every time it crashes, will greatly improve development throughout.
- hgsgm 3y agoHow do you run a demo .prg file? Do you get an emulator from somewhere?
- _the_inflator 3y agoThe best - cycle exact - emulator are CCS64 and Vice. Only Windows: http://www.ccs64.com/ http://www.ccs64.com/ VICE, also OS agnostic: https://vice-emu.sourceforge.io/ https://vice-emu.sourceforge.io/ Enjoy.
- MagerValp 3y agoCCS64 is old and inaccurate. You want x64sc from VICE, preferably with a 50 Hz display mode and matching emulation speed for smooth scrolling.
- duckqlz 3y agoThis was my first introduction to the “demoscene”. I would really like to get into this type of programming, it is so beautiful. The efficiency and creativeness of the programmers who make these c64 demos is jaw dropping when looking at any of the top submissions. I will be investigating further but to anyone else interested in this specific rabbit hole: https://csdb.dk/event/?id=3187 https://csdb.dk/event/?id=3187
- TheJoeMan 3y agoThis is still my favorite: Elevated https://youtu.be/jB0vBmiTr6o https://youtu.be/jB0vBmiTr6o
- whitemary 3y ago[flagged]
- Solvency 3y ago[flagged]