Classic PC demoscene productions running natively in the browser
treylorswift.github.io
treylorswift.github.io
> That recording is translated into C - the original instructions, one for one, with the exact cycle timing of the emulated machine.
What's the advantage of this approach vs cycle-accurate emulation? (I'd guess it can go faster, due to compiler optimization?)
> The result is checked against the emulator event for event: every interrupt, port access and frame at the same moment of emulated time.
It's funny how LLMs leak their test procedure docs into user-facing output.
It works, and has done for some time, surely. What more is there to add here above accurate playback?
> From 386SX-16 to Pentium 66 MHz, that's 10-20x difference in performance.
Yep, and some demos had specific requirements for not only minimal CPU but maximal because the assumptions inherent in small-code timing tricks would break beyond a certain speed or because of significant differences in relative instruction execution times (and sometimes the unpredictability of those execution times as the P5 architecture and some of its frankenstein-486-like competitors added branch prediction). Larger demos were more flexible as you didn't need the small-code tricks to squeeze into 4Kb or sometimes less, so 64K demos and larger could be more flexible wrt target CPU.
But cycle-accurate emulation has this sorted to: you just need the instruction cycle time accuracy to be matching a particular CPU running to the pace of a particular clock. And given the description of how this is being done (“The demo is run on an x86 emulator that records…”) I assume this is actually using cycle-accurate emulation!
I'm guessing the benefit here is that the overhead of playing back the demo on each client machine is lower when playing this recorded version, compared to each viewer's browser running the initial emulation live in the browser. That and doing something a new way was fun or otherwise intellectually stimulating for the dev(s) involved.
You have to constantly fight so hard to not get this. And for the past few months it seems most people do not even care to remove it and have proper user facing docs
By “fight so hard” you mean “do a bit of basic editing before publishing the text”?
You wouldn't have thrown a junior's text straight at end users without any review in the past (at least I hope not, though obviously some teams actually were and still are that lax), why do you expect to get away with skipping the review/edit step with your clockwork colleague?
Also: I've always avoided being anything like a lead or manager, but I do effectively have a couple of relative juniors ATM who I wish would have a better long-term learn/forget ratio when it comes to feedback from myself and elsewhere!
I don't think anyone is doing it this way because they chose to do it this way. All the AI decomp/recomp projects I've seen recently have done it this way. It just seems an easy way to have an AI brute force "port" something.
In some ways this is similar to the concurrent-systems problems that memory barriers are a tool to address. Your emulator will come in two halves, a CPU side and a gfx/sfx side, as well as control inputs, and the "intermediate" approach is when you're just trying to preserve the sequence of load/stores between the two with an accuracy relative to frame timing. Maintaining ultra precise timing within a frame imposes more detailed coordination requirements on both sides of the emulation.
Then I betrayed you all: I bought my first ugly machine because of Doom. I was so ashamed...
Now, only 4KB demos can at least impress me a bit.
Feeling old.
But watching Crystal Dreams II on my phone actually made me feel young again :)
State of the Art was ported to the browser as well.
The effects in some of the demos simply kill any video encoder, only way to properly experience them is by running or emulating locally. Not that crystal sharp upscaled square pixels on modern display or poor quality CRT filters are very representative either, but it's likely better than blurry mess you get when video encoder tries to deal with high frequency details or random noise from procedural effects.
If the games had been for DOS, it would probably have made more sense to just run the original binaries in DOSBox-X or some other emulator. I think there is already some debug API that can be enabled. Or adding MCP or something similar to DOSBox(-X) would probably be a lot less work than to reimplement the games.
The entire point of the port was to add headless play for AI training. But porting the old interface and playing it in the browser was lots of fun. Can not upload that to GitHub, obviously.
IIRC Windows 9x & ME were based on (MS)DOS; but 2k and XP were based on NT, which was quite different.
(Note sure what those differences actually are, since I only started programming once I'd switched to Linux...)
The demoscene was all about human ingenuity getting the most out of the machine. It was about showing off how good your crew was at making things from nothing but their minds.
Now, it too, has been swallowed by the AI that is destroying this entire mode of being, the joy and creativity of writing code, of solving seemingly-impossible puzzles with ones mind.
My favorite creative and intellectual outlet is dying off and its killer is wearing its corpse as a costume.
We'll get unlimited frozen pizzas, but we'll kill off chefs in the process.
It's not a trade I'm feeling good about.
It's really cool to be able to rewatch these demo, but the spirit in which they were created is somewhat lost.
lol, that would be 160MB then, a fraction of what a Firefox Tab consumes and in todays hardware specs its a roundoff error :-D
(while back then you were the ultimate king if you had 8 MB of RAM available at all! :-)
But it did require a 386, which typically had 2 MB or more of RAM back then.
AI slop productions tend to be frowned upon, or even banned, writing code and using cool tricks to to what seems impossible is still a big part of the demoscene, in particular in the sizecoding, oldschool and wild categories. Clever use of AI is a debated topic, the demoscene is about pushing the limits of current technology, and AI is part of current technology. There is also the question of using AI for tooling (modelers, compressors, test harnesses, etc...), as in, will you stop using a particular IDE because it is written with the help of AI, even if it is good?
But still, most productions are hand made.
I write demos and games as a hobby predominantly for MS-DOS and machines ranging from the 386 up to the Pentium (soon to add 8088/286 to that list) as well as old consoles like the Sega Master System and other random platforms (like ARM-based kids toys like the Leapster Explorer).
Right now I'm working on an EGA production. I could just get an AI to generate a lot of the code for me or give me all the answers, but instead, I have my Programmer's Guide to the EGA/VGA/SVGA by Ferraro and another reference open on my desk trying to understand the CRTC so I can create a custom video mode. I live for this stuff and want to fully understand what's going on in the hardware. I like the creative aspects of making demos and games but I also like the technical aspects, and understanding the platform and the deep details.
When I spend too much time reading HN or X and see too much of the AI stuff, it really bums me out, so I have to detox by unfollowing/ignoring and getting back to my projects.
/s if that wasn't obv.
Those demos from the '90s remind me of the incredible creativity and ingenuity of the human mind. Thanks for bringing them back to life and making them so effortlessly accessible.