TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Porting my JavaScript game engine to C for no reason

525 点作者 zichy10 个月前

31 条评论

namuol10 个月前
I owe a lot of the most informative programming work I’ve done to Impact.<p>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.<p>I loved that the source code was part of the license, and even modified the engine and the editor to suit my needs.<p>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.<p>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.<p>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…<p>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!<p>I’d say these are strange times for the web, but I can’t remember a time when things were anything but strange. Cheers!<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;namuol&#x2F;jv8">https:&#x2F;&#x2F;github.com&#x2F;namuol&#x2F;jv8</a>
评论 #41159319 未加载
senkora10 个月前
&gt; Many Web games were created with Impact [the game engine from the article] and it even served as the basis for some commercial cross-platform titles like Cross Code, Eliot Quest and my own Nintendo Wii-U game XType Plus.<p>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!
评论 #41154649 未加载
评论 #41156406 未加载
评论 #41155336 未加载
评论 #41154981 未加载
评论 #41155408 未加载
评论 #41154927 未加载
fitsumbelay10 个月前
&quot;Thoughts on Flash&quot; may just have saved the Web platform at its hour of greatest need, ie. creeping dominance of a single piece of software.<p>I believe that somewhere in there was frustration with Adobe who seemed to abandon the MacOS platform support for Windows&#x27; much larger user base, eg. Mac versions were always behind Windows versions. Perhaps Jobs also may&#x27;ve felt that there would be no Adobe without Apple as much as the other way around but that&#x27;s speculative<p>The game looks slick af btw,
评论 #41155377 未加载
评论 #41155752 未加载
hammycheesy10 个月前
&gt; My decision to sell it was met with a lot of backlash but was successful enough to launch me into a self-sustained career.<p>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.<p>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.
评论 #41167772 未加载
kirbyfan64sos10 个月前
Had to log in to my rarely-used HN account to mention that I had played Biolab Disaster over and over again years back but lost track of it and forgot the name. Kinda wild to find it again by sheer luck!
o11c10 个月前
&gt; high_impact is not a “library”, but rather a framework. It&#x27;s an empty scaffold, that you can fill. You write your business logic inside the framework.<p>I normally phrase this in a much more negative way: a &quot;framework&quot; is simply a &quot;library&quot; that does not place nice with others. It&#x27;s good to hear a sensible positive phrasing for once.
评论 #41158348 未加载
评论 #41157027 未加载
评论 #41161425 未加载
muragekibicho10 个月前
Somewhat related. Your QOI lossless file format coupled with 7Zip outperfoms lossless PNG. Amazing work!
评论 #41154687 未加载
nottorp10 个月前
&gt; for No Reason<p>Out of respect for your player&#x27;s battery life, perhaps :)
dgb2310 个月前
I like the part about memory management. Arenas are so simple.<p>In the (toy) web server I&#x27;m writing I initially also started with arenas. However I quickly realized that I don&#x27;t actually need to grow and shrink memory at all.<p>Currently I&#x27;m simply allocating the memory I need up front then slice it up into pieces for every module.<p>When we&#x27;re programming, we often pretend like we could be needing arbitrary amounts of memory, but that&#x27;s not necessarily the case.<p>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.<p>It is fun to think about and define those limits up front. It builds a lot of confidence and promotes a healthy frugality.
评论 #41162568 未加载
评论 #41162434 未加载
cubano10 个月前
ohhh I love your use of UNION to create a polymorphic-type ENTITY data structure. Nice work and design.<p>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.<p>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&#x27;s pre-3D days.
tomcam10 个月前
Fun idea, open source for maximum learning value, seemingly flawless execution, vanity-free and clear writeup—what a lovely contribution to the world. I feel privileged just seeing things like this.
Defletter10 个月前
As one of those 3000 licence holders, I&#x27;m happy to see a revival of Impact :) wonder how nicely it plays with Zig.
mgaunard10 个月前
The history section does not feel quite accurate.<p>From what I recall, what killed Flash wasn&#x27;t iOS, but rather the acquisition of Macromedia by Adobe.
评论 #41155609 未加载
评论 #41155148 未加载
评论 #41155529 未加载
jonwinstanley10 个月前
Looks like it’s a great game engine. Why does the article state its near end of life?<p>Are there new engines that are far better?
评论 #41156937 未加载
andai10 个月前
I did 5 game jams this year, 4 of them in various WebAssembly languages (C++, Zig, Odin, Rust).<p>In the end I switched back to JS&#x2F;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.<p>(An exception <i>might</i> be something like Unity, due to the excellent featureset, but the IDE has become so slow it&#x27;s unbearable...)
评论 #41155684 未加载
two_handfuls10 个月前
Nice writeup! I didn’t see mention of the license: it’s MIT and the code is on GitHub.
评论 #41161328 未加载
slowhadoken10 个月前
I used to play X-Type all the time on iOS, it’s how I discovered Impact. I love web-based games but lately I’ve been tempted to write in C or C++. Did you notice dramatic gains in optimization porting Impact from JavaScript to C?
esschul10 个月前
Remember I was working on an impact.js game 10 years ago. Just can&#x27;t seem to find the source code! First time I hired a guy to create some graphics. Very inspiring gaming platform.
hoten10 个月前
Amazing work!<p>FYI - in non-fullscreen mode, on my Mac &#x2F; Chrome, the bottom of the viewport is cut off. So can only play in fullscreen.
jokoon10 个月前
What amazes me is how modern javascript engines are able to optimize for a &quot;hot execution path&quot;.
pjmlp10 个月前
Love the honesty of the headline.<p>The game looks cool.
elfelf1110 个月前
Would love to have a ruby binfing.
评论 #41159268 未加载
syockit10 个月前
&gt; The name high_impact is a nod to a time when C was considered a high level language.<p>Weird, considering that JS is an even higher level language.
评论 #41158675 未加载
uberman10 个月前
Thanks, this was a great read.
zoogeny10 个月前
The next logical step is to port this to WASM so that it can run in the browser.
评论 #41155306 未加载
moffkalast10 个月前
With WASM it might actually run faster in the browser as well.
评论 #41154813 未加载
评论 #41154770 未加载
评论 #41154907 未加载
taf210 个月前
Now to compile with wasm so we can use it in a browser
theapache6410 个月前
dude is an OG!
cookiengineer10 个月前
Honestly I would never ever execute any code from this guy. He is the inventor&#x2F;founder behind the coinhive crypto mining network. [1]<p>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]<p>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)<p>He even organized a doxxing campaign against brian krebs at the time called &quot;krebsistscheisse&quot; via his pr0gramm platform [4] [5] [6], to somehow defend the idea that abusing user&#x27;s computers for personal enrichment is a legit way of making money if you donate some low percentage to cancer research with it?!?<p>Sorry, but I would never trust this guy&#x27;s code again. You should be careful, and audit any code he writes before you execute it.<p>[1] <a href="https:&#x2F;&#x2F;krebsonsecurity.com&#x2F;2018&#x2F;03&#x2F;who-and-what-is-coinhive&#x2F;" rel="nofollow">https:&#x2F;&#x2F;krebsonsecurity.com&#x2F;2018&#x2F;03&#x2F;who-and-what-is-coinhive...</a><p>[2] 30% fee of monero&#x2F;XMR went to coinhive: <a href="https:&#x2F;&#x2F;coinmarketcap.com&#x2F;currencies&#x2F;monero&#x2F;" rel="nofollow">https:&#x2F;&#x2F;coinmarketcap.com&#x2F;currencies&#x2F;monero&#x2F;</a><p>[2b] Schuerfstatistik on pr0gramm, where it all started: <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20231005033135&#x2F;https:&#x2F;&#x2F;pr0gramm.com&#x2F;user&#x2F;pr0gramm&#x2F;uploads&#x2F;2048362" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20231005033135&#x2F;https:&#x2F;&#x2F;pr0gramm....</a><p>[2c] Troyhunt analysis after he snatched away the coinhive TLD: <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20240804081830&#x2F;https:&#x2F;&#x2F;www.troyhunt.com&#x2F;i-now-own-the-coinhive-domain-heres-how-im-fighting-cryptojacking-and-doing-good-things-with-content-security-policies&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20240804081830&#x2F;https:&#x2F;&#x2F;www.troyh...</a><p>[3] <a href="https:&#x2F;&#x2F;www.trendmicro.com&#x2F;vinfo&#x2F;us&#x2F;security&#x2F;news&#x2F;cybercrime-and-digital-threats&#x2F;coinhive-miner-the-6th-most-common-malware" rel="nofollow">https:&#x2F;&#x2F;www.trendmicro.com&#x2F;vinfo&#x2F;us&#x2F;security&#x2F;news&#x2F;cybercrime...</a><p>[3] <a href="https:&#x2F;&#x2F;krebsonsecurity.com&#x2F;tag&#x2F;dominic-szablewski&#x2F;" rel="nofollow">https:&#x2F;&#x2F;krebsonsecurity.com&#x2F;tag&#x2F;dominic-szablewski&#x2F;</a><p>[4] <a href="https:&#x2F;&#x2F;krebsonsecurity.com&#x2F;2019&#x2F;03&#x2F;annual-protest-raises-250k-to-cure-krebs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;krebsonsecurity.com&#x2F;2019&#x2F;03&#x2F;annual-protest-raises-25...</a><p>[5] (German) <a href="https:&#x2F;&#x2F;www.t-online.de&#x2F;digital&#x2F;aktuelles&#x2F;id_83466874&#x2F;tausende-pr0gramm-nutzer-spenden-aus-aerger-ueber-brian-krebs-gegen-krebs.html" rel="nofollow">https:&#x2F;&#x2F;www.t-online.de&#x2F;digital&#x2F;aktuelles&#x2F;id_83466874&#x2F;tausen...</a><p>[6] <a href="https:&#x2F;&#x2F;www.heise.de&#x2F;news&#x2F;krebsistscheisse-Spendenwelle-an-Krebshilfe-als-Protest-gegen-IT-Journalisten-4007994.html" rel="nofollow">https:&#x2F;&#x2F;www.heise.de&#x2F;news&#x2F;krebsistscheisse-Spendenwelle-an-K...</a><p>(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)
评论 #41159559 未加载
评论 #41161805 未加载
评论 #41158620 未加载
评论 #41159803 未加载
leeoniya10 个月前
now rewrite it back to JS with <a href="https:&#x2F;&#x2F;github.com&#x2F;KilledByAPixel&#x2F;LittleJS">https:&#x2F;&#x2F;github.com&#x2F;KilledByAPixel&#x2F;LittleJS</a><p>j&#x2F;k :D
评论 #41154712 未加载
评论 #41154688 未加载
3810 个月前
&gt; Except for SDL2, all libraries are bundled here (see the libs&#x2F; directory).<p><a href="https:&#x2F;&#x2F;github.com&#x2F;phoboslab&#x2F;high_impact#libraries-used">https:&#x2F;&#x2F;github.com&#x2F;phoboslab&#x2F;high_impact#libraries-used</a><p>yep. exactly why I dont use C anymore. the package management story is so bad&#x2F;non existent, that the typical approach is to just vendor everything. no thanks.
评论 #41159271 未加载