6 ms·
Someone Got Doom Running in Notepad at 60 FPS, Somehow
- viraptor 4y agoSince I haven't seen the source, I don't know how this one was made, but if you want to do something like that, there are some high performance libraries for converting images into ascii. Mainly libcaca (http://caca.zoy.org/wiki/libcaca http://caca.zoy.org/wiki/libcaca) and aalib (https://en.wikipedia.org/wiki/AAlib https://en.wikipedia.org/wiki/AAlib) Both have integration as codecs for ffmpeg, so you can easily convert whole movies (if you really want...).
- anshumankmr 4y agoIf it really is a playable version of Doom running in Notepad.exe, that seems like quite literal black magic to me. (I am not a game dev)
- troupe 4y agoNotepad doesn't really have a way to execute code as far as I know. In this case, Doom is running on the machine, but it has been modified to copy and paste the display to notepad very quickly as ASCII text.
- kbelder 4y agoI wonder how it reliably captures the key input if notepad is the window with focus.
- 988747 4y agoI guess it 'renders' the whole frame in some buffer, and then copy-pasting it to Notepad takes less than 1ms, leaving you with at least 940ms of each second waiting for key input (assuming 60fps). And might have overestimated the copying time by few orders of magnitude, maybe copying takes just a microsecond ? Another thought: do you even need to bring notepad to focus in order to copy contents to it? Maybe it's not in focus at all, and just happens to be the only thing on the screen?
- lbruder 4y agoIf this is "just" sending keystrokes to notepad.exe, as in "ctrl-a, del, lots of keystrokes until one frame is done", then I'm actually more impressed by the speed keystrokes and redrawing are handled in the good ol' Win32 EDIT field.
- anfractuosity 4y agoI thought it might be using the windows equivalent of PTRACE_POKETEXT, to poke data into notepad's memory. I've altered the contents of the gedit text editor within a linux VM, via PTRACE_ATTACH and PTRACE_PEEKTEXT/PTRACE_POKETEXT, to find and modify the text.
- quietbritishjim 4y agoNotepad opens files using memory mapping, so an alternative might be to open the same file also using memory mapping, and then you have shared memory directly with notepad. Except, that would mean notepad updates the display as the file changes, and I didn't think it did that. So I think I've got something wrong.
- benrow 4y agoMaybe the edit buffer is a different area of memory to the mapped file. This would make sense as editing a file doesn't update it on disk until you choose to Save.
- no_time 4y ago>I'm actually more impressed by the speed keystrokes and redrawing are handled in the good ol' Win32 EDIT field. I wonder what went wrong. I can't see today's MS ever living up to what the NT and desktop team delivered ~20 years ago. Its baffling to think that the same company is responsible for Teams.
- m000 4y agoComparing a windows-only minimum viable visual text editor with a cross-platform videoconferencing software which integrates with a ton of other productivity software. Sounds legit. I get it, Teams may not work perfectly on every setup. But the same goes with practically all enterprise-level videoconferencing solutions.
- teddyh 4y agoDoom is not running in Notepad, it’s being displayed in Notepad. Just like that pregnancy test display; it wasn’t actually running Doom, it was just used as a display.
- abcd_f 4y agoYou are stating the obvious.
- jasongill 4y agoThe pregnancy test thing comes up in every one of these threads about "Doom running on XYZ" - the "Doom running on a pregnancy test" was (effectively) totally fake. He removed the internals from the pregnancy test and put in a tiny OLED screen where the pregnancy test's LCD indicator had been. It wasn't even used as a display, it was simply where the display was. (It was still cool because of the tiny OLED screen, and it was a funny story, but it's become some kind of legend because I think people took the story as "he ran Doom on the CPU and screen inside a pregnancy test!" which it's clear you saw through but I guess some people didn't)
- teddyh 4y agoOh, so it was even more fake than I thought, then.
- kuschku 4y agoDo note that foone uses they/them pronouns, please use those if possible :) Also, afaik, the pregnancy test would actually have the performance necessary to run the test, just no hardware to display it.
- jasongill 4y agoNo, it was just the plastic shell of the pregnancy test that was "original"; IGN says: "it's important to note that Foone did replace the display and microcontroller, so the only part of the original tester is the shell. However, getting Doom running and playable on a 128x32 pixel monochrome display at 1bpp is still an impressive feat."
- NaN1352 4y agoCapture the output of DOOM (typically the dos port where the screen is super simple to read as a byte array). Do some filters on it. Render it somewhere else. YAWN.
- biohax2015 4y agoLol. Do it yourself then
- Bakary 4y agoWhy the negativity? Better whimsical projects like this than another cynical moneygrubbing attempt or polluting gadgetry
- NaN1352 4y agoJust getting tired of the "DOOM running on xyz" posts I guess.
- filoleg 4y agoFor me, it is more about just the low-effort "ports" like this (e.g. where they just render it there). However, I enjoy seeing more creative and actually novel ways of "DOOM running on xyz". One such example would be DOOM actually implemented in Excel. Back when it came out, it was genuinely cool and novel. This is the type of stuff that I would not mind seeing more of at all.
- YPPH 4y agoI'm glad notepad.exe has avoided the modernisation trends in other Windows utilities. I wonder if there was ever a push to have a UWP replacement implemented. If so, I'm thankful to whoever knocked it back.
- peterpost2 4y agoThat already exists!
- glandium 4y agohttps://news.ycombinator.com/item?id=29477375 https://news.ycombinator.com/item?id=29477375
- iamevn 4y agoSee also: http://thesiteformerlyknownas.zachtronicsindustries.com/notepad-weekend/ http://thesiteformerlyknownas.zachtronicsindustries.com/note... with http://thesiteformerlyknownas.zachtronicsindustries.com/images/notepad_hijack_framework.cpp http://thesiteformerlyknownas.zachtronicsindustries.com/imag... linked in the comments. I had a lot of fun writing a few small games with this method, don't think I ever shared them anywhere though. Here are the key bits: char* c = "Hello World!"; HWND hwnd = FindWindow("Notepad", NULL); HWND edit = FindWindowEx(hwnd, NULL, "Edit", NULL); SendMessage(edit, WM_SETTEXT, NULL, (LPARAM)c);
- huhtenberg 4y agoIt's rather unlikely to get you anywhere close to 60 fps. I'd guess that they do wm_settext once and then update notepad's copy of the text directly, triggering a repaint after each update.
- justsomehnguy 4y agoBanding suggests this.
- flykespice 4y agoSo it is constantly sending text to the opened notepad, won't he eventually run out of memory and slow down the whole system? (or hang up)
- afinlayson 4y agoAlthough technically this is really cool, I worry that there is something more important we could be doing with our best minds?
- ogurechny 4y ago> at 60 fps!!! Poor copy editors couldn't display their ignorant disdain for all that geeky gaming stuff better than stating that game that had a fixed 35 updates per second loop (to match 70 Hz video mode) ran at 60 fps. (I know that interpolated rendering has been available in ports for a long time. The engine still runs at 35, because interpolating it would drop all compatibility, and rely on arbitrary decisions on how to resample and predict trajectories defined by original constants.) Also, something in the narcissist manner of presentation tells me the whole thing can be just a gameplay video processed with libcaca, seemingly without even aligning the source and output resolution, if we pay attention to the edges.