News for hackers. Stuff that matters.
Re:Commander Keen's Adaptive Tile Scrolling by Aeolun on Thursday July 27, 2023 @07:59PM (#36901668)
I think it might be hindsight, but a lot of these ‘revolutional’ developments seem kind of simple compared to a lot current development.

“Our memory is slow, so let’s redraw only things that changed” is kind of a given nowadays.

Still the optimization in 4-6 is fun. Did the whole thing in 1-3 just because of an assumption that the buffer would not wrap around, and then it did and all that work became obsolete.

Re:Commander Keen's Adaptive Tile Scrolling by Sharlin on Thursday July 27, 2023 @08:28PM (#36901871)
Games have redrawn everything on every frame for decades, certainly since GPUs became a thing. Memory speed is definitely not a concern. 2D windowing systems used to only redraw "dirty rectangles" but that changed when they moved to GPU compositing as well.

On the other hand, of course, CPUs do have a complex system of several levels of caches, but that's not primarily because of (lack of) memory bandwidth but memory latency.

Re:Commander Keen's Adaptive Tile Scrolling by badsectoracula on Thursday July 27, 2023 @10:06PM (#36902425)
> 2D windowing systems used to only redraw "dirty rectangles" but that changed when they moved to GPU compositing as well.

For Win32 and X11 at least the damaged region (or "invalid region") approach is still there and AFAIK recently (as in a few months ago) the modesetting driver for Xorg added the ability to use the damage regions when "TearFree" is enabled (this does server-side composition to avoid tearing - it is disabled by default) to only update the of the screen that changed instead of the entire screen.

Also i remember reading some time ago about some monitors being able to use partial frame data (the monitor "shadows" the frame) so that they can support faster updates.

I think the concept can also help with slow display tech like e-ink devices.

Re:Commander Keen's Adaptive Tile Scrolling by HWR_14 on Thursday July 27, 2023 @11:05PM (#36902719)
Games started redrawing everything because once you have a camera that rotates in 3D, the pixel reuse drops a lot vs one that pans over a 2D plane.
Re:Commander Keen's Adaptive Tile Scrolling by esprehn on Thursday July 27, 2023 @11:11PM (#36902756)
All modern web browsers still do tiling (at the compositing layer level). It's the only way to handle large layers and scrolling efficiently.

Some also implement partial redraw into the tiles to handle things like cursors blinking to avoid having to redraw the entire tile.

Re:Commander Keen's Adaptive Tile Scrolling by pjmlp on Friday July 28, 2023 @02:08AM (#36903528)
More like after shaders became a thing, and it hardly matters when it is an application runnning on the GPU that is responsible for actually drawing.

However it is still an issue if one wants to achive maximum performance, and it is done by only sending the vertices and textures to the GPU that are actually going to be visible.

Re:Commander Keen's Adaptive Tile Scrolling by djmips on Friday July 28, 2023 @02:25AM (#36903616)
Some modern game UI still use dirty draw tech.
Re:Commander Keen's Adaptive Tile Scrolling by II2II on Thursday July 27, 2023 @08:22PM (#36901827)
If I recall correctly, the original Macintosh would go as far as telling the software which regions of a window had to be redrawn at any given time so the idea itself wasn't exactly new. The thing is that these optimizations required tradeoffs. Figuring out which tiles had to be updated required storing extra data and doing extra computations. Not only did you have to recognize the value of these techniques, you actually had to write the code in a way that did not slow things down (and design the levels so they would not slow things down).
Re:Commander Keen's Adaptive Tile Scrolling by magicalhippo on Thursday July 27, 2023 @09:11PM (#36902082)
Windows has had this[1] for as long as I remember as well, at least since Windows 3 days so I assume since the very beginning.

[1]: https://learn.microsoft.com/en-us/windows/win32/gdi/clipping

Re:Commander Keen's Adaptive Tile Scrolling by peterfirefly on Friday July 28, 2023 @09:58AM (#36906863)
They needed the same info to do clipping (on both the Mac and Windows).

I think it is more interesting that the pipeline was invalidaterect/region => getevent => event was a draw event => draw region (or part of it). The getevent would only generate draw events if nothing more important was going (keyboard/mouse input, timer, message from other app/desktop accessory). It would also prioritize top windows first so you would only get a draw event for a window at the bottom once the windows above had no more dirty areas.

If you really knew what you were doing, you could short circuit this a bit and draw in your windows outside of draw event handling.

Re:Commander Keen's Adaptive Tile Scrolling by incrudible on Thursday July 27, 2023 @08:07PM (#36901722)
“Our memory is fast, so let us redraw everything” is a given. Our web APIs on the other hand are incredibly slow, so let us carefully track changes in a complicated runtime (or compiler) to avoid redundantly modifying properties in a tree.
Re:Commander Keen's Adaptive Tile Scrolling by dylan604 on Thursday July 27, 2023 @11:06PM (#36902729)
>I think it might be hindsight, but a lot of these ‘revolutional’ developments seem kind of simple compared to a lot current development.

Yes, it's you and your vaulted position of standing on the shoulders of those to whom these developments actually were ‘revolutional’. I equate the level of accomplishments from Id to be at the level of cavemen throwing rocks at the spaceship to cavemen buying insurance on TV levels of achievement.

Re:Commander Keen's Adaptive Tile Scrolling by x0x0 on Friday July 28, 2023 @12:54AM (#36903221)
If you weren't playing games in early 1997 then Quake started using voodoo cards, it's nearly impossible to understate the before vs after.

Carmack and id are responsible for at least 4 or 5, "I had no idea a computer could do that" moments for me.

Re:Commander Keen's Adaptive Tile Scrolling by fzeindl on Thursday July 27, 2023 @11:48PM (#36902953)
> “Our memory is slow, so let’s redraw only things that changed” is kind of a given nowadays.

Tangentially related: Android still doesn't get this. Turn on the screen refresh flashes in the developer menu and then look a your static screen and be amazed who often android draws even though nothing changed.

Re:Commander Keen's Adaptive Tile Scrolling by ajuc on Friday July 28, 2023 @01:55AM (#36903473)
With modern gpu pipeline and cost of cache misses compared to CPU cycle being what they are - it's almost certainly faster to redraw a few thousand sprites no matter what than to check what changed and redraw only a subset of them.

Energy efficiency is a separate matter.

Re:Commander Keen's Adaptive Tile Scrolling by djmips on Friday July 28, 2023 @02:23AM (#36903599)
That's not true at all
Re:Commander Keen's Adaptive Tile Scrolling by ajuc on Friday July 28, 2023 @02:32AM (#36903654)
Iterate over 1000 objects doing ifs and draw let's say 50 of them vs dump them in VBO and call glDrawArrays every frame drawing all 1000 of them?

I'm willing to bet :)

The difference in time spent by GPU between drawing 1000 and 50 sprites is almost 0.

Re:Commander Keen's Adaptive Tile Scrolling by dakom on Friday July 28, 2023 @03:05AM (#36903823)
Is there another way? I've only done WebGL, so not familiar with Vulkan/Metal/DirectX/etc. - but in my experience you're clearing the screen and re-drawing everything every tick no matter what. If only for applying post-processing effects.

Updating buffers is of course a totally separate thing, and on that side I don't think anyone updates everything every tick, usually there's some sort of scene graph that knows about dirty transforms and their children, so only those get updated..

Re:Commander Keen's Adaptive Tile Scrolling by izacus on Friday July 28, 2023 @05:33AM (#36904667)
This is nonsense, Android always did "this". It always rerendered only damaged regions and even after switching to HW accelerated rendering, it still only rerenders changed views.

And the animation framework always just "scrolled" the view (or screen) when it could.

Re:Commander Keen's Adaptive Tile Scrolling by anthk on Friday July 28, 2023 @05:09AM (#36904529)
Ncurses does the same on text, just redraw what it changes. Reason? Think about slow terminals or modems.
Re:Commander Keen's Adaptive Tile Scrolling by ygra on Monday July 31, 2023 @07:57AM (#36941327)
When I developed a text-mode UI library (not using curses) with a friend in university for fun, we tested this on his actual terminal connected via serial cable. You'll notice unnecessary redraws very quickly that way. (Granted, piping the output through some throttling may have had the same effect, but there was something about writing modern code (even as students) and seeing it work on decades-old hardware :).)