edit: chrome btw
Show HN: Unity like game editor running in pure WASM
141–150 of 166 posts
Re: Show HN: Unity like game editor running in pure WASM
#142Earlier quoted context omitted.
I'd be curious if it runs any better under Chrome. Seems a lot of people are hitting Firefox issues. I'll be sure to test Firefox regularly though.
AFAIK, Firefox has all around awful webgl and webgpu performance. I know personally, anything 3d in Firefox is a slideshow, even with a 4090
Re: Show HN: Unity like game editor running in pure WASM
#143Earlier quoted context omitted.
Hey Doug, it’s Avi Eisner - long time no see! Dan told me you’re working on your own game engine - would love to see it some time and catch up!
Hi Avi! Great username. I assume the Dan you're talking about is my brother-in-law, because I don't recall telling Danny about my engine. It's true, technically: I was working on a game engine in JavaScript and then later TypeScript and then later JavaScript again, and since I haven't literally deleted the repo, I guess you could say I'm still working on it, but it's pretty far from the top of my priority stack right…
Re: Show HN: Unity like game editor running in pure WASM
#144Earlier quoted context omitted.
that ship has sailed. Minified and optionally obfuscated js is already highly annoying to decipher. The wasm spec is surprisingly high level for what should be a low level VM, and is planned to get much more high level approaching near jvm levels, and isn't any less readable than C++ compiled to asm.js.
Still infinitely better than WASM blobs where everything is painted on a canvas, which is un-adblockable. The experience will also be hellish, because every website will ship a 10 MB blob of half-baked things that your browser already does a million-times better out of the box. And for what? Because people think it will be faster (it won't).
If the canvas website really was a threat we would have seen much more of it by now already, but it hasn't happened for a number of reasons -- we only see them in the dedicated desktop-app-like use cases like this one. Anything scrollable won't be viable because it would be inherently less responsive than the real deal. Fonts look different, most designers actually prefer for people to be able to select text, and be able to use browser functionality that looks native for the different OSs. Canvas websites are also more expensive in terms of blob loading and ability to cache pages. So it's not really a threat.
Most adblocking happens by the means of network/URL blocking and I don't see any potential difference between WASM and JS in this regard(unless the APIs are enshittified, but JS isn't impervious to this too). If ads can't be blocked by network, and the website proxies ad contents through its own domain(as far as I know that's not prevalent, maybe I'm ignorant -- they need to track users and clicks themselves anyway), than you could get hard to block websites with JS+DOM too -- it's possible disrupt DOM based blocking by frequent randomization/obfuscation to the degree that one would need some kind of advanced AI to even hope to find the ad DOM elements. Between WEI, web bundles, Topics API push, webassembly's supposed higher indecipherability (which isn't true, chrome "disassembles" WASM into the WAT form and it's pretty readable. More readable than wasm.js) doesn't even register.
>And for what?
To not deal with JavaScript? To be able to develop for the web in the language you want, without floats being the fundamental numeric type and other BS? Is that too fantastical of a desire?
Re: Show HN: Unity like game editor running in pure WASM
#145Earlier quoted context omitted.
I teach GAM 300/350 at DigiPen. We still require them to create custom engines in their sophomore year, but in their junior year (and beyond, in some cases), they're all using commercial engines. One of the main things we want to focus on is giving them a chance to work on a truly cross-discipline team, where every member has a chance to thrive at their work, regardless of their degree program. If you're a student of…
I think it's great that sophomores still have to make their own engine from scratch. making two engines, one in C for GAM150, and another in C++ for GAM200, were extremely formative experiences for me. when I was attending DigiPen, it was at the beginning of the ECS craze, so, naturally, I implemented terrible, extremely naive ECSes, in C and C++. they were woefully inefficient and byzantine to the point of ridiculou…
could this be a specialization or "minor", perhaps?
IDK, it's tough. I want more students to be learning this stuff while in a proper environment, but the reality is that so much of the real tricks and sauce are either a) buried deep, deep inside some "public" repos, or more likely b) tribal knowledge at a AAA studio. Maybe Digipen is different as a gaming focused school, but I never learned about ECS or object pooling or profiler usage or especially cache coherency in college. And I'd struggle grouping all these important engine concepts into a course since the knowledge is simultaneously disparate but related. each topic could be its own thesis if you wanted them to be.
>what happens to their former students now that Unity's in the situation it's in? do they feel cheated, like the only way that they know how to make games, the way they were taught, has now been somewhat invalidated?
custom engine or not, I do adamantly feel like a proper game dev program should teach enough CS chops for this to not be a problem. using a high level engine is useful, but the rest falls on fundamentals. Data structures and algotithms to know what to use to group data together and the tradeoffs, systems level programming to understand memory management (yes, even in Unity. Intuiting the cost of allocating and deleting game objects only helps. Any one of mulitple of various domains (network, graphics, databases, UI) to get different perspectives on how data can be structured and processed, etc.
Re: Show HN: Unity like game editor running in pure WASM
#146Earlier quoted context omitted.
I think it's great that sophomores still have to make their own engine from scratch. making two engines, one in C for GAM150, and another in C++ for GAM200, were extremely formative experiences for me. when I was attending DigiPen, it was at the beginning of the ECS craze, so, naturally, I implemented terrible, extremely naive ECSes, in C and C++. they were woefully inefficient and byzantine to the point of ridiculou…
>if students stop learning about how video games work at any lower level than "just use an off-the-shelf general-purpose game engine", then who's going to make game engines going forward? could this be a specialization or "minor", perhaps? IDK, it's tough. I want more students to be learning this stuff while in a proper environment, but the reality is that so much of the real tricks and sauce are either a) buried dee…
I could write maybe a short pamphlet's worth of information that I wish I was taught by professors while I was at DigiPen that would've made all the difference in the world to me at least. the existence of cache coherency is definitely one of these topics, but ECS definitely is not. it would just be a few other general ideas, like:
“hey, y'know how you just learned about malloc() and free() in CS 120 when you learned C? well, it's not a good idea to be calling those all the time in your game. instead, have something like this:
#define MEMORY_NEEDED 1024 * 1024 * 4 /* adjust as needed */
unsigned char all_the_memory_you_need[MEMORY_NEEDED];
size_t end_of_game_memory = 0;
size_t end_of_level_memory = 0;
size_t end_of_frame_memory = 0;
void *alloc_for_game(size_t bytes) {
assert(end_of_game_memory + bytes
check it out: now instead of malloc() and free()ing everything everywhere all the time and worrying about memory leaks, we have "lifetimes" now, one that's per-frame, and one that's per-level (if your game needs levels). you just use alloc_for_game() to allocate stuff that your whole game needs at the start of the program's execution, and then you reset_level() and alloc_for_level() when you change levels, and reset_frame() at the end of your frame and alloc_for_frame() during it, and bam, now you don't need to worry about memory leaks, you don't need garbage collection, and your temporary bump allocator is reset and ready for the next frame—and the only cost was resetting a single variable to zero in a couple key places. neat, huh?”stuff like that—stuff that's super basic and easy to understand once it's explained to you, but that most people wouldn't intuitively conclude on their own, especially when you're new to game programming and just chasing cargo cults like ECS without sufficiently understanding how stuff really works. for example, the ECS I wrote in C was terrible in part because I only understood the high-level ideas at the time—the whole thing was (hysterically, when looking back now) implemented with linked lists, as I was approaching systems design in terms of API, instead of actual functionality.
once you've taken a CS course to learn the basics of C, and a math course to learn the basics of matrix math and how it pertains to game programming (both of which were excellent at DigiPen, by the way!), you're just a few pointers like these away from being able to completely—and relatively competently—implement your own 2D "game engine", given that you're using external libraries for e.g. rendering, input, and sound playback.
but then, of course, the resulting student games whose screenshots and video clips you gather to use for promotional material for your school wouldn't be as flashy, compared to contemporaries who only teach e.g. Unity...
Re: Show HN: Unity like game editor running in pure WASM
#147It lags very slow on macbook m1 pro 14 inch chrome
Had to reboot.
Lame.
Re: Show HN: Unity like game editor running in pure WASM
#148Re: Show HN: Unity like game editor running in pure WASM
#149Cool project. Is there any way to scale the UI for high dpi displays? On a 2:1 display, the fonts look aliased, if I set the browser zoom to 50%, the UI looks crisp, but everything is a bit small to be useful.
To OP: The fix is setting canvas width to window.innerWidth * window.devicePixelRatio, and height to window.innerHeight * window.devicePixelRatio. Then use CSS to maximize the canvas on the screen.
Had to take into account the mouse coordinates too since they were not scaled.
Re: Show HN: Unity like game editor running in pure WASM
#150I like the concept. My GPU and browser weep with lag. Its a very impressive slideshow. I finally managed to highlight the starting sphere after several tries. At first I wasn't sure if it was loaded. Of course, I'm only using a 1.8 GHz Celeron with onboard GPU and 8GB Ram in Firefox, so... not exactly high-end stuff.