Porting My JavaScript Game Engine to C for No Reason
Dominic Szablewski announced the high_impact game engine, a C port of his Impact JavaScript engine, designed for 2D action games, supporting multiple platforms and featuring essential game development tools.
Read original articleDominic Szablewski has announced the development of a new game engine called high_impact, which is a port of his original Impact JavaScript engine to C. This small engine is designed for 2D action games and is compatible with Windows, Mac, Linux, and WebAssembly. The project is inspired by the decline of Flash, which once dominated web gaming but was phased out due to lack of support on platforms like iOS. Szablewski's initial foray into game development led to the creation of Biolab Disaster, demonstrating that games could be made without Flash using the JavaScript Canvas2D API.
The high_impact engine aims to simplify game development by providing essential features such as tile-map loading, entity management, physics, and collision detection. It is structured as a framework rather than a library, allowing developers to implement their game logic within its scaffold. The engine supports two platforms, SDL and Sokol, and utilizes JSON for level formats to maintain compatibility with the original Impact engine.
High_impact also includes a straightforward entity system, collision detection methods, and rendering capabilities through OpenGL and a basic software renderer. Szablewski emphasizes the simplicity and depth of C, which he finds enjoyable to work with, and aims to create a minimalistic yet effective game development tool. The project is open-source and licensed under MIT, with the source code available on GitHub.
Related
Homegrown Rendering with Rust
Embark Studios develops a creative platform for user-generated content, emphasizing gameplay over graphics. They leverage Rust for 3D rendering, introducing the experimental "kajiya" renderer for learning purposes. The team aims to simplify rendering for user-generated content, utilizing Vulkan API and Rust's versatility for GPU programming. They seek to enhance Rust's ecosystem for GPU programming.
Bevy 0.14 – Data driven game engine
Bevy 0.14 release includes Virtual Geometry, Sharp Screen Space Reflections, Depth of Field, Motion Blur, Volumetric Fog, and more. Updates also cover Animation Blending, ECS Observers, Color API, and UI improvements.
Asteroids Game in Racket (2021)
The article details implementing the Asteroids game in Racket, focusing on a game and physics engine within 1000 lines of code, enabling spaceship control, collision detection, and user interaction.
2D Game Development: From Zero to Hero
The book "2D Game Development: From Zero To Hero" by Penaz is a free, evolving resource for aspiring game developers, offering tips, multiple programming languages, and encouraging community contributions.
My favorite tools and techniques for procedural gamedev
Casey Primozic shares his procedural game development techniques, focusing on seamless textures, custom shaders, AI-generated textures, and volumetric effects, while exploring future applications like Constructive Solid Geometry for 3D manipulation.
- Many users express admiration for the performance and capabilities of games developed with the Impact engine, such as Cross Code.
- There is a discussion about the transition from JavaScript to C, with some users noting performance improvements.
- Several comments highlight the importance of open-source contributions and the potential for further development, including a port to WebAssembly.
- Users share personal experiences with game development and the challenges of monetizing side projects.
- Some comments touch on the historical context of game engines and the evolution of web technologies.
Impact was so ahead of its time. Proud to say I was one of the 3000 license owners. One of the best purchases I’ve ever made. The only game I’ve ever really properly finished was made in Impact.
I loved that the source code was part of the license, and even modified the engine and the editor to suit my needs.
I was so inspired that I worked on my own JS game engine (instead of finishing games - ha!) for years after. I never released it, but I learned a ton in the process and made a lot of fun gamejam games with it.
I was also inspired by Impact’s native iOS support (Ejecta), but frustrated that it didn’t run on Android (at the time at least), so I fumbled my way through writing JVM bindings for V8 and implemented a subset of WebGL to run my game engine on Android without web views.[0] I made the repo for V8 bindings public and to my surprise it ended up being used in commercial software.
I won’t bore you with the startup I tried to bootstrap for selling access to private GitHub repos, which was inspired by Impact’s business model…
Anyway, it warms my heart and makes me laugh with glee to see Impact getting an update for the “modern” web with a C port!
I’d say these are strange times for the web, but I can’t remember a time when things were anything but strange. Cheers!
Cross Code is an excellent game. I knew that it used web tech and I was constantly amazed by how performant it was on the Nintendo Switch hardware. I would guess that this engine deserves some credit there!
I believe that somewhere in there was frustration with Adobe who seemed to abandon the MacOS platform support for Windows' much larger user base, eg. Mac versions were always behind Windows versions. Perhaps Jobs also may've felt that there would be no Adobe without Apple as much as the other way around but that's speculative
The game looks slick af btw,
As someone who is interested in eventually freeing myself from the corporate job and diving head-first into my side projects, I would love to hear more about this aspect.
For some reason the idea of trying to charge folks for the work I would normally do for the fun of it on the side is daunting to me, even though I know it could enable me to focus on doing the stuff I love full-time.
I normally phrase this in a much more negative way: a "framework" is simply a "library" that does not place nice with others. It's good to hear a sensible positive phrasing for once.
Out of respect for your player's battery life, perhaps :)
In the (toy) web server I'm writing I initially also started with arenas. However I quickly realized that I don't actually need to grow and shrink memory at all.
Currently I'm simply allocating the memory I need up front then slice it up into pieces for every module.
When we're programming, we often pretend like we could be needing arbitrary amounts of memory, but that's not necessarily the case.
Many things actually have very clear limits. For the rest one can often define them. And if you enumerate those, you know how much memory you will need.
It is fun to think about and define those limits up front. It builds a lot of confidence and promotes a healthy frugality.
I still love futzing around in C...It was the original langauge I learned and God did I struggle with it for years. Like the OP mentioned, C is awesome because its such a concise language but you can go as deep as you like with it.
Thanks for all your efforts and the writeup...the game has a throwback Commander Keen-type vibe to it and I loved that franchise for a minute back in Carmack's pre-3D days.
From what I recall, what killed Flash wasn't iOS, but rather the acquisition of Macromedia by Adobe.
Are there new engines that are far better?
In the end I switched back to JS/TS, because I found way more benefit from minimizing layers of abstraction and translation (WS is set up so you are forced to interface with JS to actually do anything), more than the benefits of any language or library.
(An exception might be something like Unity, due to the excellent featureset, but the IDE has become so slow it's unbearable...)
FYI - in non-fullscreen mode, on my Mac / Chrome, the bottom of the viewport is cut off. So can only play in fullscreen.
The game looks cool.
Weird, considering that JS is an even higher level language.
This guy made billions illegally [2], and maintained the biggest ransomware crypto coin network for years, by offering the tools and SDKs to fund dozens of cyber war involved agencies across the planet. [3]
I have no idea how he got away with it, because his name keeps appearing in lots of crypto trading companies and trade registries. (Not gonna post them, but you can google his name to find this evidence)
He even organized a doxxing campaign against brian krebs at the time called "krebsistscheisse" via his pr0gramm platform [4] [5] [6], to somehow defend the idea that abusing user's computers for personal enrichment is a legit way of making money if you donate some low percentage to cancer research with it?!?
Sorry, but I would never trust this guy's code again. You should be careful, and audit any code he writes before you execute it.
[1] https://krebsonsecurity.com/2018/03/who-and-what-is-coinhive...
[2] 30% fee of monero/XMR went to coinhive: https://coinmarketcap.com/currencies/monero/
[2b] Schuerfstatistik on pr0gramm, where it all started: https://web.archive.org/web/20231005033135/https://pr0gramm....
[2c] Troyhunt analysis after he snatched away the coinhive TLD: https://web.archive.org/web/20240804081830/https://www.troyh...
[3] https://www.trendmicro.com/vinfo/us/security/news/cybercrime...
[3] https://krebsonsecurity.com/tag/dominic-szablewski/
[4] https://krebsonsecurity.com/2019/03/annual-protest-raises-25...
[5] (German) https://www.t-online.de/digital/aktuelles/id_83466874/tausen...
[6] https://www.heise.de/news/krebsistscheisse-Spendenwelle-an-K...
(Lots of other articles about it, and that dominic szlablewski was the guy behind coinhive, and the original owner of pr0gramm, while still doing development work for the company that owns the imageboard officially nowadays)
j/k :D
https://github.com/phoboslab/high_impact#libraries-used
yep. exactly why I dont use C anymore. the package management story is so bad/non existent, that the typical approach is to just vendor everything. no thanks.
Related
Homegrown Rendering with Rust
Embark Studios develops a creative platform for user-generated content, emphasizing gameplay over graphics. They leverage Rust for 3D rendering, introducing the experimental "kajiya" renderer for learning purposes. The team aims to simplify rendering for user-generated content, utilizing Vulkan API and Rust's versatility for GPU programming. They seek to enhance Rust's ecosystem for GPU programming.
Bevy 0.14 – Data driven game engine
Bevy 0.14 release includes Virtual Geometry, Sharp Screen Space Reflections, Depth of Field, Motion Blur, Volumetric Fog, and more. Updates also cover Animation Blending, ECS Observers, Color API, and UI improvements.
Asteroids Game in Racket (2021)
The article details implementing the Asteroids game in Racket, focusing on a game and physics engine within 1000 lines of code, enabling spaceship control, collision detection, and user interaction.
2D Game Development: From Zero to Hero
The book "2D Game Development: From Zero To Hero" by Penaz is a free, evolving resource for aspiring game developers, offering tips, multiple programming languages, and encouraging community contributions.
My favorite tools and techniques for procedural gamedev
Casey Primozic shares his procedural game development techniques, focusing on seamless textures, custom shaders, AI-generated textures, and volumetric effects, while exploring future applications like Constructive Solid Geometry for 3D manipulation.