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.

Rustenstein 3D: Game programming like it's 1992

351 pointsby facundo_olanoover 3 years ago

16 comments

gh123manover 3 years ago
Ray casting is close to my heart as it&#x27;s easy to understand and has a very high &quot;effort to reward&quot; ratio, especially to someone who is new to graphics programming. I built a game + engine around ray casting portals [1] (think the game Portal). It was a lot of fun trying to figure out how to bounce rays around a scene and intersect with different objects in the environment and immensely satisfying to have built the whole engine from the ground up. Though I&#x27;d probably not do it again. Your top-down ray debug view is very similar to one I came up with!<p>Some of the interesting bits of the engine are open source: <a href="https:&#x2F;&#x2F;github.com&#x2F;gh123man&#x2F;Portal-Raycaster" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gh123man&#x2F;Portal-Raycaster</a><p>1. <a href="https:&#x2F;&#x2F;blog.sb1.io&#x2F;gateescape&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.sb1.io&#x2F;gateescape&#x2F;</a>
评论 #30186547 未加载
评论 #30187449 未加载
fabiensanglardover 3 years ago
That looks great. I actually wanted to do a port of an id game in Rust for the longest time but never managed to find spare cycles.<p>I would add to the list of feature to tackle next:<p>- Convert from 320x200 aspect ratio to 320x240 aspect ratio. You can do that by converting from 320x200 to 1600x1200. This is easily done with x5&#x2F;x6 which give you the same aspect ratio as 320x240 and you get no pixel selection artifacts.
评论 #30184537 未加载
markus_zhangover 3 years ago
I&#x27;m wondering if anyone develops a spinoff exactly as back in 1992.<p>You know, it would be interesting to follow the Carmack&#x27;s route: start from Apple ][ programming for a couple of Ultima and Wizardry spinoffs, port them to PC. Then move to 80286 to make a scrolling engine for a double trilogy, and move up to 80386 to make a Wolfie clone, and continue from there. The point is to use real world machines or emulated env for development. One can probably learn a LOT programming by that way, although much if it is irrelevant in modern gamedev...
评论 #30184094 未加载
评论 #30187237 未加载
评论 #30184497 未加载
dormandoover 3 years ago
Looks like the engine is missing the fish-eye correction in the ray-cast calc. I love writing these engines for fun :)
评论 #30188122 未加载
评论 #30190445 未加载
alkonautover 3 years ago
Is there a limit when looking at retro games when the retro-ness becomes a burden rather than &quot;old games is simpler&quot;? Obviously if you move too far back in history you end up with basically game specific hardware, long-dead assembler code. In the original wolfenstein it seems there is a bunch of code relating to things that manage weirdness that we no longer care about (paging, legacy graphics handling) which obscure the actual game.<p>Was there a &quot;peak&quot; in simplicity when games were at their simplest for a reader from 2022? That is, they are modern enough to not be obscured by historical weirdness yet still simple enough to be approachable? Perhaps Doom is simpler to understand than Wolfenstein for this reason?
评论 #30189993 未加载
评论 #30227132 未加载
评论 #30190571 未加载
tyrellsover 3 years ago
Saw this recently too: <a href="https:&#x2F;&#x2F;mattiasgustavsson.itch.io&#x2F;dos-like" rel="nofollow">https:&#x2F;&#x2F;mattiasgustavsson.itch.io&#x2F;dos-like</a><p>&quot;dos-like is a programming library&#x2F;framework, kind of like a tiny game engine, for writing games and programs with a similar feel to MS-DOS productions from the early 90s.&quot;
ahuthover 3 years ago
Adding my own raycasting implementation, in... what else... React&#x2F;JavaScript -&gt; <a href="https:&#x2F;&#x2F;huth.me&#x2F;raycast&#x2F;" rel="nofollow">https:&#x2F;&#x2F;huth.me&#x2F;raycast&#x2F;</a>
评论 #30184093 未加载
superfamicomover 3 years ago
There was a more recent Kickstarter that got my interest in the DOS style games restarted: <a href="https:&#x2F;&#x2F;www.kickstarter.com&#x2F;projects&#x2F;eniko&#x2F;coding-history-3d-from-mode7-to-doom" rel="nofollow">https:&#x2F;&#x2F;www.kickstarter.com&#x2F;projects&#x2F;eniko&#x2F;coding-history-3d...</a>
评论 #30227198 未加载
nyanpasu64over 3 years ago
I wonder how practical it would be to create a Wolfenstein 2D with the same level design, but played in top-down view.
评论 #30185337 未加载
评论 #30185222 未加载
评论 #30184961 未加载
abrookewoodover 3 years ago
&quot;a “Carmack” compression, which is John Carmack’s variant of the LZ (Lempel-Ziv) method. According to the Black Book, without much access to the literature, Carmack would “invent” an algorithm to later find out that someone else had done it before.&quot;. Wow, he really is amazing.
filereaperover 3 years ago
I&#x27;m guessing the infamous inverse square root algorithm was used originally for ray-casting described in the article?<p>Fast Inverse Square Root: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24959157" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24959157</a><p>Excellent article btw.
评论 #30184042 未加载
评论 #30183776 未加载
dannyincolorover 3 years ago
A direct link to the source code, for those interested: <a href="https:&#x2F;&#x2F;github.com&#x2F;AdRoll&#x2F;rustenstein" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AdRoll&#x2F;rustenstein</a>
评论 #30189663 未加载
pjmlpover 3 years ago
I guess using Rust kind of fits the boots of Turbo Pascal for 1992.
评论 #30184062 未加载
5-over 3 years ago
see also: a series of posts (with accompanying code) on rewriting the doom engine from scratch:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;amroibrahim&#x2F;DIYDoom" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amroibrahim&#x2F;DIYDoom</a>
lkxijlewlfover 3 years ago
Is there anything like this for Voxels (what&#x27;s used in Roblox, MineCraft,etc)?
评论 #30184779 未加载
评论 #30191434 未加载
评论 #30184384 未加载
atum47over 3 years ago
I&#x27;m a sucker for wolf 3d technology... Great job!!!