Live data from Hacker News

Build your own old-school 3D shooter in a weekend

github.com

41–50 of 105 posts

Re: Build your own old-school 3D shooter in a weekend

#41
post #16

I think leaving the "old-school" out of the title doesn't do this justice. My first thought was, with modern engines, or even raw OpenGL that isn't that hard... I did it in a weekend for my "Advanced Computer Graphics" elective in college using OpenGL and that was 2008. But this is kind of cool... it's more of a tiny ray tracer and... well to borrow the title... old-school arcade game.

> it's more of a tiny ray tracer It's a ray caster, where the rays are sent out from the camera to intersect the map. With ray tracers, the rays are sent out from the light source, IIRC. Your point on OpenGL is valid, but that just removes all the learning from it. OpenGL does so much of the grunt work for you. This kind of old-school game engine is a great learning experience.

> It's a ray caster, where the rays are sent out from the camera to intersect the map. With ray tracers, the rays are sent out from the light source, IIRC.

Not correct. I see this pedantry often, but it's factually wrong. If you look at the Wikipedia articles for both ray casting [0] and ray tracing [1], they BOTH describe the methods as sending rays from the camera/eye.

From what I can tell, the difference between ray casting and ray tracing is that in ray casting, only the primary ray is traced. The ray does not get reflected, refracted, or even traced to light sources for checking shadows. At most, surface normals are dealt with for lighting and texture mapping is applied.

[0] https://en.wikipedia.org/wiki/Ray_casting

[1] https://en.wikipedia.org/wiki/Ray_tracing_(graphics)

Re: Build your own old-school 3D shooter in a weekend

#43
post #16

I think leaving the "old-school" out of the title doesn't do this justice. My first thought was, with modern engines, or even raw OpenGL that isn't that hard... I did it in a weekend for my "Advanced Computer Graphics" elective in college using OpenGL and that was 2008. But this is kind of cool... it's more of a tiny ray tracer and... well to borrow the title... old-school arcade game.

> it's more of a tiny ray tracer It's a ray caster, where the rays are sent out from the camera to intersect the map. With ray tracers, the rays are sent out from the light source, IIRC. Your point on OpenGL is valid, but that just removes all the learning from it. OpenGL does so much of the grunt work for you. This kind of old-school game engine is a great learning experience.

> With ray tracers, the rays are sent out from the light source, IIRC.

Are there any implementations which send rays from the light source(aka. forward ray tracing)? This is astoundingly inefficient, as most rays will not intersect the camera.

I've never seen one, other than in brief academic discussions. What you can use forward ray tracing for is to compute shadows.

Re: Build your own old-school 3D shooter in a weekend

#44

Earlier quoted context omitted.

Instead of doing a memset, I'd recommend using std::fill (which will likely call memset or another fast implementation behind the scenes): it makes it clear what you are doing, and preempts questions of "is this legal to do" (which it is, but only for POD data types).

I'm far more inclined toward img.assign(w*h, color); myself.

Normally I choose the methods in because they take an ExecutionPolicy parameter, allowing me to make this code parallel if I wish, but both are valid.

Re: Build your own old-school 3D shooter in a weekend

#45

People are saying this is a "quite dated" method for creating a 3D game. Does anyone have a tutorial on creating a 3D game in one weekend (or even 1 day?) using modern tooling? It'd be cool to make a token 3D game with the kids. I'm curious myself.

Use a modern engine like Unreal or Unity, watch a few videos and I'm sure you can get something basic running fairly quickly.

Re: Build your own old-school 3D shooter in a weekend

#46

People are saying this is a "quite dated" method for creating a 3D game. Does anyone have a tutorial on creating a 3D game in one weekend (or even 1 day?) using modern tooling? It'd be cool to make a token 3D game with the kids. I'm curious myself.

This kind of engine is great as a starting place for programmers, I think, but Unity is probably what you want for the kind of thing you're doing. There's also Godot if you want to stay in Open Source land, but it probably isn't as good and certainly doesn't have the same level of coverage in tutorials and documentation.

Or there's the time-tested path to gamedev: modding existing games.

Re: Build your own old-school 3D shooter in a weekend

#47
post #45

People are saying this is a "quite dated" method for creating a 3D game. Does anyone have a tutorial on creating a 3D game in one weekend (or even 1 day?) using modern tooling? It'd be cool to make a token 3D game with the kids. I'm curious myself.

Use a modern engine like Unreal or Unity, watch a few videos and I'm sure you can get something basic running fairly quickly.

Well yea you can get an FPS game made in Unity in about an hour or two. But it won't really tell you much about what is happening in the background.

Re: Build your own old-school 3D shooter in a weekend

#48
post #12
post #10

Earlier quoted context omitted.

> the original Wolfenstein. Well, the original Wolfenstein 3D, the third game in the series. https://en.wikipedia.org/wiki/Castle_Wolfenstein https://en.wikipedia.org/wiki/Beyond_Castle_Wolfenstein

Uh, I had never heard about these games before. I always thought Id created the franchise. Thank you for that bit of videogame history.

Castle Wolfenstein was a noteworthy and revolutionary game in its own right: https://www.filfre.net/2012/04/castle-wolfenstein/

Re: Build your own old-school 3D shooter in a weekend

#49

I think leaving the "old-school" out of the title doesn't do this justice. My first thought was, with modern engines, or even raw OpenGL that isn't that hard... I did it in a weekend for my "Advanced Computer Graphics" elective in college using OpenGL and that was 2008. But this is kind of cool... it's more of a tiny ray tracer and... well to borrow the title... old-school arcade game.

> in college using OpenGL and that was 2008 Wolf3D was 1992, 16 years before. SGI released OpenGL a few months later. IIRC, the first gfx cards were thousands of dollars. The first successful consumer gfx was 3DFX Voodoo2 in 1996. We take so much for granted nowadays.

I'm not sure what your point is here. My point was it was easy in 2008 I'm sure it is as easy or easier now so a first person game isn't that impressive. I have massive respect for the people who do it from scratch. Especially the ones who were pioneers in the 90's and earlier.

Programming a game from scratch, even a simple looking one without the aid or modern APIs is certainly much more difficult. Which is why I was saying this posting is amiss by excluding the fact this Github project uses older techniques from the title.

Post reply on HN