Stage is a minimalistic 2D, cross-platform HTML5 game engine
piqnt.com
piqnt.com
I appreciate it because I'm interested in this kind of thing (not necessarily just games, but graphical custom interfaces in general) and getting confirmation on why it was slow (on powerful hardware) is good to know.
Unfortunately almost every web site out there does a poor job of showcasing those abilities.
Then they wonder why they don't have any issues playing native 3D games and move on to another Website.
I’ve noticed a lot of people with integrated graphics as well as a decent card often have the browser set running on the bad GPU. Also a surprisingly large number of people have turned hardware acceleration off! Usually fixing this sorts out any performance issues they have with WebGL.
WebGL game engines could already been the new Flash for casual games market, but it is just better, from business sense and support, just to ship native mobile games instead.
They are not allowed to, thanks security.
> Or an application could hold a list of easy-to-use step-by-step tutorials.
Still too complicated versus installing a native game from an app store, given "from business sense and support".
Yep. The list is here - https://chromium.googlesource.com/chromium/src/gpu/+/master/... It includes things like Intel HD 3000, which is the GPU in all 2011 models of the Macbook Air. It's quite annoying but maybe better than having browsers crash horribly when the graphics driver throws.
Just a heads up if the author is around: I may have found a bug in the Break Out example. Seems to have frozen when two balls collided just the right way: https://www.dropbox.com/s/12z2au9rkkw7hlm/Screenshot%202020-...
Is there even a spatial index for accelerating collision detection?
If you end up needing to redraw most (or all) of the screen anyway, that effort is wasted. The overhead of it can even end up slowing things down.
Just assuming everything needs to be redraw from the start saves the effort, and is optimal in the case where everything does need to be redrawn.
For games in particular, this is usually a good assumption. If you're wrong, you end up slowing down less complex cases but they can usually afford it. When you're right, you're optimal for the most demanding cases. You're usually trying to hit a frame rate and care a lot more about hard cases falling below the target than how far above target easy cases are.
And there are many common cases in games where you do need to redraw everything anyway. E.g., once you start scrolling or any other kind of full-screen effect. (In the old, pre-PGU days you often actually would scroll the image in a buffer and only redraw newly the exposed area through the scene graph, but there's really not an advantage to that these days and doesn't help you with any other kind of full screen effect.)
There are exceptions to this, for example a visual novel or a turn-based strategy game, but those are often satisfied to just eat the performance penalty for the ability to use standard tooling, or can use engines or standard UI toolkits like React that can do a temporal diff. For example, I've written several text-based games [1] that just use the DOM because using canvas or WebGL wasn't necessary. I've written other games that use a hybrid approach of absolutely-positioning temporally diffed DOM over a frame-by-frame redrawn canvas, to get the best of both worlds [2]. And I've also written games in e.g. Unity where it's easier and performant enough to use ImGui and redraw it every frame. Ultimately it cones down to what's practical and what's performant enough.
[1] https://vgel.itch.io/themengi , https://vgel.itch.io/the-sacred-text [2] https://vgel.me/hoverator
I guess this was before HWA, though.
All of this changed with the advent of 3d hardware acceleration, but I remember doing it up until 2005 to get significant performance gains (on bad hardware).
e.g. mozilla's tips for canvas performance state: "Avoid unnecessary canvas state changes." And: "Render screen differences only, not the whole new state."
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/...
Disclaimer: I really don't know anything about doing games in html/js. The question is honest.
Disclaimer 2: I do remember "write once, run anywhere". It was only mostly right back then.
Something like this might be just what he needs.
(Also if the demo is single threaded and not frame rate capped it probably eats as much of a single core as it can, and that's a dual core cpu so 50% checks out)
Any chance you're working on adding Box2D?
EDIT: n/m, I just saw Planck.js by the same author.. cool beans, will use ..