Castle Game Engine: Web target – big progress, first 3 demos to try

zfg | 74 points

Interesting that it is written in Pascal:

https://github.com/castle-engine/castle-engine

The minimal demos are still surprisingly big though (same ballpark as Unity web builds for similar simple demos).

For a language without runtime I would expect a couple hundred kilobytes at most for those simple demos (but the download is 6.4 MB compressed and decompresses to 43 MByte, and takes significant time after the download is finished to start). Would be interesting to figure out why dead code doesn't seem to be removed by the compiler (e.g. is it because of the engine design, or because the Pascal-to-WASM compiler doesn't support dead code elimination). Also why is the compressed to uncompressed ratio so big, there seems to be a lot of duplicate code or data in those WASM files.

flohofwoe | 2 hours ago

Never understood why cocos doesn't get more love.

jbverschoor | 23 minutes ago

Very cool!

The wasm file here could be optimized more. It looks like a 43 MB wasm is downloaded, and wasm-opt -O3 shrinks that to just 14 MB. It might also be faster that way (due to inlining and other optimizations). Startup will definitely be faster.

azakai | 9 hours ago

It's kind of crazy to see this project posted here on hackernews just now. I've been trying to compile an open source Delphi 7 project and have been having issues sourcing a dependency called OpenGLLib. Through my searches I actually bumped into the Castle Game Engine a bunch! Unfortunately it looks like the usage of opengl doesn't exactly line up.

nicholasmoser | 6 hours ago

Love it, I'd prefer a more popular language, but this is really cool.

Docs aren't great yet, but that's probably not a priority yet.

999900000999 | 6 hours ago

Nice 90s vibe. Web target is cool. The invaders demo though... I have to say AD+W is not a good set of key bindings for that game.

tomovo | 11 hours ago

Cool. I love to see progress for any new engine.

mathgladiator | 11 hours ago

If you press Ctrl+Alt+Delete, it thinks you're still holding Ctrl+Alt afterwards, even if you're not. The same for Alt+Tab. The web exposes whether modifiers are pressed in the keydown event, but the game engine is trying to keep track of this information separately for some reason. (I'm not sure whether this is a Castle Game Engine, pas2js, or fpc library bug.)

wizzwizz4 | 10 hours ago