TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Write a First Person Game in 2KB with Rust

235 pointsby disadvantageabout 2 years ago

10 comments

gh123manabout 2 years ago
Nice writeup! Building raycasting engines is fun and rewarding. You can get a lot of visual impact with very small and easy to understand code. I took a stab at it and ended up adding portals which I thought was really fun (<a href="https:&#x2F;&#x2F;github.com&#x2F;gh123man&#x2F;Portal-Raycaster">https:&#x2F;&#x2F;github.com&#x2F;gh123man&#x2F;Portal-Raycaster</a>).<p>I&#x27;ve been thinking about re-writing my raycasting engine in Rust but never really found the time - glad to see someone has done it and documented it so well!<p>If anyone else is interested in raycasting this page is also worth a read: <a href="https:&#x2F;&#x2F;lodev.org&#x2F;cgtutor&#x2F;raycasting.html" rel="nofollow">https:&#x2F;&#x2F;lodev.org&#x2F;cgtutor&#x2F;raycasting.html</a>
评论 #34952780 未加载
评论 #34966684 未加载
userbinatorabout 2 years ago
<i>1.7K is not the smallest you can make this program. You can get this to fit in even smaller sizes and I encourage you to try!</i><p>I think 128 bytes may be close to a lower limit, although for a different platform (MS-DOS): <a href="https:&#x2F;&#x2F;www.pouet.net&#x2F;prod.php?which=63518" rel="nofollow">https:&#x2F;&#x2F;www.pouet.net&#x2F;prod.php?which=63518</a>
评论 #34954625 未加载
fvilersabout 2 years ago
The source code from this article is available at <a href="https:&#x2F;&#x2F;github.com&#x2F;grantshandy&#x2F;wasm4-raycaster">https:&#x2F;&#x2F;github.com&#x2F;grantshandy&#x2F;wasm4-raycaster</a>
schemescapeabout 2 years ago
Wow, I didn’t know that WebAssembly had a “square root” instruction (although it sounds like that’s required for the floating point standard, so probably shouldn’t have been such a surprise).
评论 #34952564 未加载
Galanweabout 2 years ago
&gt; My first experience with games like this (though I didn’t know at the time), was in middle school with games like zDoom on my calculator. zDoom<p>Sharing experiences. My first encounter and fascination for these kind of perpective effect was in the 90s demoscene.<p>I learned to program the magic behind &quot;tunnel&quot; effects by just spawning multiple non-concentric growing circles.
评论 #34953715 未加载
ww520about 2 years ago
That&#x27;s excellent. I didn&#x27;t realized Rust to Wasm can be squeezed to such small size. Great work.
评论 #34954583 未加载
评论 #34953339 未加载
评论 #34955693 未加载
评论 #34954311 未加载
ummonkabout 2 years ago
I assume this was higher performance than rasterization due to slow RAM and the amount of time required to make depth buffer lookups &#x2F; writes?
评论 #34955246 未加载
pantulisabout 2 years ago
Brings memories of the &quot;Cave-in&quot; game for the unexpanded Vic20.
bitwizeabout 2 years ago
Where&#x27;s the dinosaur?
hi_helloabout 2 years ago
This is a wonderful writeup. Puts the map back in bitmap.