Sign in to follow this  
!Null

wolfenstein 3D (How To)

Recommended Posts

!Null    380
So I'm trying to explore more methods of making games for experience.

And a friend of mine can make raycasting games quite well (Like Wolfenstein).

However He tried to explain how the code works and he just failed. Also I've checked a few places Online but theory doesn't work with me unless I see the code explained.

Can any of you wonderful GameDev people Help me out.

Maybe with some pointers (not 0x00000000) or some pseudo code examples to explain to me how to get at least a floor and ceiling done.

I hope someone can help.

:D

Share this post


Link to post
Share on other sites
DracoLacertae    518
What rendering API are you targeting? If you are rendering in software (pixel by pixel), then you will want to proper raycasting like the old games did. There's many tutorials on how raycasting was done for wolf-3d style engines.

However, I would recommend you put a modern spin on it and draw with a hardware accelerated API. There are many advantages:[list]
[*]When you are raycasting, you aren't drawing, you are just building a list of walls or floors that are visible to the player. You can then sort these by texture/material or whatever and just draw it.
[*]You can rotate on other axes for 'free'; just mess with the modelview matrix.
[*]Texturing walls and floors are easy; you don't have to deal with constant-z texture mapping
[*]You can use 3d models for characters instead of sprites
[*]If you're clever, a bump or displacement-mapped wolf3d level might look pretty good. You will be stuck in a 2.5D maze, but that doesn't mean the brick wall can't look bumpy and metal surfaces can't be environment mapped.
[*]When the engine gets advanced enough that you want to move on from raycasting to something else (like portals & sectors), you will have a bunch of code you can reuse.
[/list]

Share this post


Link to post
Share on other sites
mholmes    190
You will need a basic understanding of tile maps or you can use a tile map engine to build the maps which in this case would be the hardest part in my eyes. You also need to research the games layout, NPC stats, monsters etc. Its very important in remakes you try to replicate them best you can but add your own flavor in as well. Hope that helps. Edited by mholmes

Share this post


Link to post
Share on other sites
DpakoH    1204
you can check my [url="http://rinzler-blog.blogspot.com/"]post[/url] with some references and a sample for raycasting written in C# using XNA.

Share this post


Link to post
Share on other sites
MarkS    3502
[quote name='DracoLacertae' timestamp='1349128242' post='4985883']
However, I would recommend you put a modern spin on it and draw with a hardware accelerated API. There are many advantages:[list]
[*]When you are raycasting, you aren't drawing, you are just building a list of walls or floors that are visible to the player. You can then sort these by texture/material or whatever and just draw it.
[*]You can rotate on other axes for 'free'; just mess with the modelview matrix.
[*]Texturing walls and floors are easy; you don't have to deal with constant-z texture mapping
[*]You can use 3d models for characters instead of sprites
[*]If you're clever, a bump or displacement-mapped wolf3d level might look pretty good. You will be stuck in a 2.5D maze, but that doesn't mean the brick wall can't look bumpy and metal surfaces can't be environment mapped.
[*]When the engine gets advanced enough that you want to move on from raycasting to something else (like portals & sectors), you will have a bunch of code you can reuse.
[/list]
[/quote]

I don't need to start a new project... I don't need to start a new project... I don't need to start a new project... Gaah!

Share this post


Link to post
Share on other sites
caldiar    715
[quote name='!Null' timestamp='1349166244' post='4985993']
caldiar I just wanted to say thanks for the quick detailed reply.

[img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]

Not a problem :) Ray-casters are always fun projects to work on. They're a very interesting piece of history. It's amazing to me, even today, the results you can get with the relatively simple code and basic trigonometry.

I'm really itching to put together a ray-caster now...

Share this post


Link to post
Share on other sites
!Null    380
[quote]Not a problem Ray-casters are always fun projects to work on. They're a very interesting piece of history. It's amazing to me, even today, the results you can get with the relatively simple code and basic trigonometry.
I'm really itching to put together a ray-caster now...[/quote]

you totally should man, I like trying old things because it's good to get a sense of how things evolved.

If you wanna see the code then let me know :) Edited by !Null

Share this post


Link to post
Share on other sites

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

Sign in to follow this