Ray casting is close to my heart as it's easy to understand and has a very high "effort to reward" 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'd probably not do it again. Your top-down ray debug view is very similar to one I came up with!
You mention GCd languages being a bad choice for games in your README. But these days Java has GCs that have < 1ms pauses. I wonder if it is still true?
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.
I would add to the list of feature to tackle next:
- 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/x6 which give you the same aspect ratio as 320x240 and you get no pixel selection artifacts.
I'm wondering if anyone develops a spinoff exactly as back in 1992.
You know, it would be interesting to follow the Carmack'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...
Bonus points for using the same tooling and languages from then too. 6502 assembly, then a bit of 16 bit x86 assembly, and finally some C with Borland's 1992 tooling.
I noticed it in the examples too, I’m speculating wildly that the ray cast is even angular steps rather than pinhole projection. Totally reasonable to not correct it, IMO, I’ve long thought we should have more non-linear cameras in games.
If you generate the rays the linear way instead, you don't even need any correction.
Generate two points which represent the left and right edges of the screen - you'd put them in at say 45 degrees left and right of the forward vector of the player. Then to generate the direction vector for each column of the screen, just interpolate linearly between those two points, and find the vector from the player to that intermediate point.
Is there a limit when looking at retro games when the retro-ness becomes a burden rather than "old games is simpler"? 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.
Was there a "peak" 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?
The trick isn’t to look at the complete game code which will
always have platform specific code but rather look at the tricks used by the game engines that are conceptual. Or in other words, look at the design rather than the implementation.
This is true even for modern games, because you might implement something differently for a mobile game than you might for a high end PC.
"dos-like is a programming library/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."
I'm thinking exactly about the same thing, but a broader one called the Carmack's road, from Shadowforge on Apple ][ to maybe Quake I, all developed on the original platforms (emulator). Of course not as a tutorial series but as a learning path for myself for the next maybe 5-8 years.
I had the same idea while working in this project. Either play directly from the map view (the prototype sort of already does this) or even use a rogue like ascii interface (which, yes, would probably be similar to the Silas Warner game)
"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.". Wow, he really is amazing.
Fast inverse square root was part of the lighting calculations in Quake III IIRC. Nothing so obtuse is required for the simple ray-casting demonstrated here.
its a shame they included the original shareware resource files in there without any mention that they are NOT covered by the MIT licence that the repository is under.
[+] [-] gh123man|4 years ago|reply
Some of the interesting bits of the engine are open source: https://github.com/gh123man/Portal-Raycaster
1. https://blog.sb1.io/gateescape/
[+] [-] martincmartin|4 years ago|reply
Sorry to be pedantic, but I think you mean the opposite? Big reward for modest effort?
[+] [-] spullara|4 years ago|reply
https://kstefanj.github.io/2021/11/24/gc-progress-8-17.html
[+] [-] fabiensanglard|4 years ago|reply
I would add to the list of feature to tackle next:
- 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/x6 which give you the same aspect ratio as 320x240 and you get no pixel selection artifacts.
[+] [-] facundo_olano|4 years ago|reply
[+] [-] markus_zhang|4 years ago|reply
You know, it would be interesting to follow the Carmack'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...
[+] [-] aninteger|4 years ago|reply
[+] [-] nine_k|4 years ago|reply
But many more people look for the fun. The good bits without the pains of ancient tooling, lacking debuggers and graphics tools, etc.
[+] [-] jacquesm|4 years ago|reply
[+] [-] dormando|4 years ago|reply
[+] [-] dahart|4 years ago|reply
I noticed it in the examples too, I’m speculating wildly that the ray cast is even angular steps rather than pinhole projection. Totally reasonable to not correct it, IMO, I’ve long thought we should have more non-linear cameras in games.
[+] [-] hrydgard|4 years ago|reply
Generate two points which represent the left and right edges of the screen - you'd put them in at say 45 degrees left and right of the forward vector of the player. Then to generate the direction vector for each column of the screen, just interpolate linearly between those two points, and find the vector from the player to that intermediate point.
[+] [-] alkonaut|4 years ago|reply
Was there a "peak" 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?
[+] [-] laumars|4 years ago|reply
This is true even for modern games, because you might implement something differently for a mobile game than you might for a high end PC.
[+] [-] unknown|4 years ago|reply
[deleted]
[+] [-] ant6n|4 years ago|reply
[+] [-] tyrells|4 years ago|reply
"dos-like is a programming library/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."
[+] [-] ahuth|4 years ago|reply
[+] [-] Koshkin|4 years ago|reply
[+] [-] superfamicom|4 years ago|reply
[+] [-] markus_zhang|4 years ago|reply
[+] [-] nyanpasu64|4 years ago|reply
[+] [-] kibwen|4 years ago|reply
[+] [-] facundo_olano|4 years ago|reply
[+] [-] syngrog66|4 years ago|reply
cough
Castle Wolfenstein, by Silas Warner for MUSE
kids: get off my lawn
[+] [-] abrookewood|4 years ago|reply
[+] [-] filereaper|4 years ago|reply
Fast Inverse Square Root: https://news.ycombinator.com/item?id=24959157
Excellent article btw.
[+] [-] AnIdiotOnTheNet|4 years ago|reply
[+] [-] adamrezich|4 years ago|reply
[+] [-] dannyincolor|4 years ago|reply
[+] [-] philderbeast|4 years ago|reply
[+] [-] pjmlp|4 years ago|reply
[+] [-] 10x-dev|4 years ago|reply
[+] [-] 5-|4 years ago|reply
https://github.com/amroibrahim/DIYDoom
[+] [-] lkxijlewlf|4 years ago|reply
[+] [-] dejv|4 years ago|reply
Readable implementation (in C) is this: https://github.com/fogleman/Craft
[+] [-] lopuhin|4 years ago|reply
[+] [-] ziggus|4 years ago|reply
[+] [-] atum47|4 years ago|reply