Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
SirJuicyLemon

From Wolfenstein engine to Doom engine

Recommended Posts

Hello community,

I'm a big fan of the Doom franchise just as you guys are and I've been wondering about how the original Doom engine works at rendering a 2D map into a kinda "emulated" 3D image and the advantage of this compared to Wolfenstein 3D.

 

As far as I know (from what I've read/heard) Wolfenstein used the Ray casting algorithm which works kind of like a ray being casted from left to right in all of the player's point of view range inside the 2D map, the "casted ray" (referencing to the name of the algorithm) was used to know how long must travel the ray from the source to the nearest wall so it can get the distance between the source (player) and the nearest wall; and the nearest the next wall is to the player the larger the pixel tray will be shown on screen and vice-versa (sorry if I screwed up that sentence in english; walls near = bigger pixel lines , walls far = smaller pixel lines) which will give a feeling of a 3D space.

 

Doom on the other hand uses binary space partitioning which divides all of the space in half many times (I'm not sure how it is determined when to end dividing the space in half) and organizes it on a binary tree, which is a good help for the CPU as it reduces the amount of cycles used (I guess it's kinda intuitive for a CPU to process the information of a binary tree) and then (somehow) it shows on screen the parts of the nodes from the binary tree that corresponds to the nearest walls from the node where the player is located.

 

All of this boring text so far can be summarized with this video: https://youtu.be/yTRzfKh4Tg0

 

So we got Wolfenstein 3D's ray casting against Doom's binary space partitioning as far as image rendering (and space organization) matters.

 

Now if we take a look at the maps design and features we can see a big hell of a difference between both: 

-Wolfenstein 3D's maps were many square or rectangular rooms while Doom had a greater freedom for shapes.

-Wolfenstein 3D's maps were always at the same level (height) while Doom could have different levels (heights) on the same level (this allows Doom to have stairs and elevators).

-Wolfenstein 3D's maps were always at the same brightness while Doom had a variety of different brightness zones on a same level.

-Wolfenstein 3D's maps had lesser interactions with the player than Doom where you could shoot at a wall to open a secret area, or step on an specific area/floor to do the same, while Wolf3D you just could try to open a door in front of a wall to find a secret area.

 

And obviously, there is a huge difference between the audio and image quality between both but I think that's pretty much more logic and natural difference just because of unavoidable progress of the passing of time and the improvement of the game industry back in the days and, even if it's interesting, I thinks it's a topic for another day.

 

Both Wolfenstein 3D and Doom gave the impression of playing a 3D game but there's no doubt that Doom engine was far more powerful as it was more complete, better prepared for a new era of gaming and gave many resources to enjoy a game like Doom was.

 

Sorry for my ignorance on the game design topic but what gave Doom's engine the advantage over Wolfenstein 3D's engine? I mean, ray casting had any limitations that could not let Wolfenstein to have the kind of features that Doom had? (different heights, different brightness, more shapes) Or the part responsible for those features is within the Doom engine programming capabilities/limitations? (or even it's yet another part apart from the image rendering and engine?)

 

Also, how does the binary space partitioning shows on screen the map that it just organized on a binary tree?

 

It's quite an interesting topic for me and I'd like to know more about this. Sorry for bothering you if you think otherwise.

Also, just to be clear, I'm not saying that Wolfenstein 3D was a bad game. It wasn't a bad game at all. But that level of improvement between both of games in a little more than a year is kind of surprising as hell!

 

What's your opinion on the topic?

 

Thanks for reading!

Share this post


Link to post

Binary Space Partitioning (Ill call it BSP for the rest of the post) will only display what the player sees. It wont load anything that wont be seen by the player fully load simply because it doesnt need to. Raycasting (As far as i know) loads the whole map and casts those weird censors or "Rays" to detect depth. So thats one advantage that BSP has. Another one is height/z-axis. Now of what I understand, BSP can do the z-axis because it doesnt necessarily have to cast your vision horizontaly (If that makes sense). Ill provide images on how the renderings work. This is BSP:

download.png.c17380579fa425f7a24d724937f133f9.png

This is raycasting:

2060720325_download(1).png.9bf47bfc16e55fc00a4cc0777b106f21.png

 

This next is my capacity of understanding it, so it may not be fully right. Do you see how with raycasting the vision is focused around the player while in BSP it will cast the vision around the map. The z-axis is split into 2 different 2d planes, so thats how tit can divide the planes up into a 3d world. Thats another advantage.

 

yeah cool 

Share this post


Link to post

If you're interested in getting explanations of how it works behind the scene, my advice would be to look at Fabien Sanglard's stuff.

http://fabiensanglard.net/

 

You have a quick overview of how Wolf 3D works here:

http://fabiensanglard.net/wolf3d/index.php

(It's mostly about the iPhone port, but it does feature this link which explains the nitty-gritty.)

And a quick overview of how Doom works here:

http://fabiensanglard.net/doomIphone/doomClassicRenderer.php

 

For more details, you can also buy his books:

http://fabiensanglard.net/gebbwolf3d/

http://fabiensanglard.net/gebbdoom/

 

Finally, there are time-lapse slowed down videos of how Doom renders stuff. Always interesting to view at least once.

 

Share this post


Link to post
20 hours ago, Gez said:

 

Finally, there are time-lapse slowed down videos of how Doom renders stuff. Always interesting to view at least once.

[video snip]

Wait, wouldn't it be different, considering the linked video is for ZDoom, which renders differently to vanilla?

Share this post


Link to post
38 minutes ago, Can't play on Nightmare said:

What's the video solution of Wolfenstein 3D?

 

For Doom, it was 240X320 Pixels.

wolf3d was 320x200, like doom.

Share this post


Link to post
30 minutes ago, cambreaKer said:

wolf3d was 320x200, like doom.

As far as I know, Doom was 240X320 pixels if you choosed the high quality option in the game. There were 2 options in the game such as high quality and low quality. 

Edited by Can't play on Nightmare

Share this post


Link to post
1 hour ago, Can't play on Nightmare said:

As far as I know, Doom was 240X320 pixels if you choosed the high quality option in the game. There were 2 options in the game such as high quality and low quality. 

Doom ran only in a tweaked VGA "Mode Y" 320x200 video mode, regardless of the quality option (low quality only duplicated pixels in the world drawer, it didn't change the video resolution). This is not "as far as we know", we actually absolutely know this and documented it.

Edited by Edward850

Share this post


Link to post
2 hours ago, Novaseer said:

Wait, wouldn't it be different, considering the linked video is for ZDoom, which renders differently to vanilla?

Nah, there's no change in the principles behind how the renderer works. The only difference is that ZDoom has some additional things it can render, provided they are actually featured in the scene.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×