DOOM-like rendering

BlitzMax Forums/BlitzMax Programming/DOOM-like rendering

Pineapple(Posted 2010) [#1]
If I were to go about making a game very similar in style to DOOM, how might I go about rendering it? I'm absolutely lost when it comes to 3D rendering. I can map and have a feint idea of how to model, but I can't for the life of me get anything to work graphically when programming a 3D game.


therevills(Posted 2010) [#2]
Which DOOM are you talking about?

DOOM 1 and 2 were rendered via ray-casting... DOOM 3 was done via polygons etc.

To do DOOM 1/2 there are a few ray-casting examples around on these forums, for DOOM 3 you need a proper 3D engine like MiniB3D.


Pineapple(Posted 2010) [#3]
DOOM 1/2, sorry. Could you point me to some of these examples?


therevills(Posted 2010) [#4]
http://www.blitzbasic.com/Community/posts.php?topic=92053#1047895

http://www.blitzbasic.com/Community/posts.php?topic=89478#1016434

http://www.blitzbasic.com/Community/_search.php?bbs=BlitzMax&forum=&terms=raycasting&method=simple&case=no&results=topic&user=&submit=Search


Gabriel(Posted 2010) [#5]
If your goal is to make the game, for heaven's sake, don't raycast. The only reason Doom used raycasting is that 3D acceleration wasn't available back then. Now that it is, it's masochistic in the extreme to make life that much harder for yourself. Pick a simple 3D engine (eg: MiniB3D) and follow the tutorials.

If your goal is not the game but rather the experience, and you actually want to learn all the complicated maths and optimize your code to the n'th degree to make a raycasting engine, then go for it. But do it for the right reasons.

Last edited 2010


Pineapple(Posted 2010) [#6]
I want to use miniB3D, but like I said, 3D graphics and me just don't mix. I've tried countless times to use B3D and miniB3D to do even simple 3D things and I've never managed anything more impressive than navigating a heightmap.

@there
thanks much for the links

Last edited 2010


Gabriel(Posted 2010) [#7]
I want to use miniB3D, but like I said, 3D graphics and me just don't mix. I've tried countless times to use B3D and miniB3D to do even simple 3D things and I've never managed anything more impressive than navigating a heightmap.

That's precisely why I gave the response I gave. If you've never managed to get the hang of 3D when all the hard work is done for you, I can't imagine that making things a whole lot harder is going to help you. You're still going to have to do all the same stuff you couldn't do or didn't like or didn't "gel" with MiniB3d, but you're going to have to do a whole lot more as well.

Without knowing exactly what your problems with 3D have been, it's impossible to give clear advice, but perhaps a different approach or a different engine would work better.


ImaginaryHuman(Posted 2010) [#8]
It's really just a 3D model that you move through.


Pineapple(Posted 2010) [#9]
It's because I have no grasp on how to handle textured polygons. If I don't have to deal with triangles and texture mapping in the same program It's completely doable. Otherwise I'm totally lost. I can map - I mess with texture mapping but I work with primitives instead of triangles. I can do a lot of things with untextured polygons, I've even written my own (extremely) simple 3D engine. But when it comes to making models that typically requires both I'm near talentless and I absolutely can't write a program dealing with the both of them.

And thus the desire to do raycasting - that way there are no triangles to speak of and would be much easier for me to work with sans a detailed tutorial on what specifically I'd need to accomplish using minB3D, which would be to construct a model from the information that makes a DOOM level. Not that I'm trying to make a DOOM port, but just that I enjoy being able to construct the environment in 2D and then play it out in 3D.

So yeah. I suppose I'd appreciate any help I can get; I just don't know where to start.


Gabriel(Posted 2010) [#10]
So your problems with 3D are purely from the art side of things? You're ok with the programming, you just want to completely avoid having to map textures onto geometry?

What about using a mapping program like Cartography shop where the textures are mapped to geometry automatically? You just carve your maps out of the brushes (building blocks) and CShop modifies the geometry to keep textures looking decent. You say you can map, so presumably you've used programs of this kind before?


Pineapple(Posted 2010) [#11]
Well yes, I can load up a map or something into a program just fine, but then I don't have the individual polygon information to do the kind of stuff I'd like, which primarily includes the dynamic nature of DOOM maps. But yeah, you're spot-on.


Robert Cummings(Posted 2010) [#12]
Then learn. Sorry to be harsh but we all were at that point. I'm mostly an artist and I learned. Stop making excuses and start empowering yourself.

Learn what verts, polys, triangles and uv coordinates are. Learn what they do, and what things are. You are being lazy, I can tell you're not stupid.


Czar Flavius(Posted 2010) [#13]
Just do what I did. Hire an artist!


Pineapple(Posted 2010) [#14]
@Robert

I know exactly what they all are and know how they work. I am unable to get them to work how I want them to in an actual program because I don't know where to start learning how to do this. I can't use documentation because I don't know what types of commands to look at and I've never found tutorials which is understandable considering exactly what I want to do - dynamically transform and handle 3D environments - is extremely uncommon. (I've never even seen it done outside DOOM.)


xlsior(Posted 2010) [#15]
Nonetheless, creating a raycaster requires the same working knowledge plus a bunch more. You're not saving anything, you're just making it more complex.


slenkar(Posted 2010) [#16]
all you have to do is create a wall mesh in a 3d application, import it into miniB3D, create a little map editor to place the walls, use copyentity to duplicate the walls around the map.
then when you want to destroy a wall simply create a dust particle effect and move it down (then free the entity when it is out of sight)
or manipulate individual vertices of walls using commands in miniB3D
what you are wanting to do isnt that difficult, just ask relevant questions after trying to do it.

first load the wall as a mesh
then get the surface with getsurface
then use triangle vertex:
http://www.blitzbasic.com/b3ddocs/command.php?name=TriangleVertex&ref=3d_cat
to manipulate vertices

Last edited 2010

Last edited 2010

Last edited 2010


Pineapple(Posted 2010) [#17]
A DOOM level is divided into sectors, which are composed of sides which are made from verticies. The key things here are that sector ceiling and floor heights can change and that each wall has six separate textures - front and back upper, middle, and lower textures. I would much like to reproduce this specification and I was hoping to also be able to move verticies, for which explanation I thank you.


slenkar(Posted 2010) [#18]
to create the wall is easy in a 3D program like 'Ultimate Unwrap'

Just use File->Create Primitive->Cube

and stretch it to form a rectangle wall.

Then put the textures on with the same program.

You could place the walls with some 3D software but you might lose control, i.e. all the walls will be merged into one object.
So its probably best to create your own map editor.

If you dont want to spend money on Ultimate Unwrap you could use a free alternative but the free 3d software is either too heavy for a simple job (blender) or isnt very easy to use http://www.software4free.org/3d.html

Last edited 2010

Last edited 2010


Pineapple(Posted 2010) [#19]
No, I really don't want to create the level with a 3D modeler.


Matty(Posted 2010) [#20]
What exactly is this "dynamic nature of DOOM maps" that is not present in other games.


dynamically transform and handle 3D environments - is extremely uncommon. (I've never even seen it done outside DOOM.)



Pretty much any 3d engine can transform 3d information 'dynamically' (by which I take it you mean 'real-time' ) - in fact that is pretty much their main function...so what exactly happens in raycasting DOOM environments that doesn't happen in other environments with a 3d graphical representation?


ima747(Posted 2010) [#21]
As xlsior has said, anything you will want to do with raycasting is harder than with and engine.

The differences in the grand scheme are this:
An engine will provide you tools to manipulate and organize elements (be they meshes, or elements of meshes like faces, vertices, etc.), textures, cameras, etc.
With a home spun ray caster you have to do all of that yourself... and it still has to get done... so all you're doing is taking on more work.

Additionally any engine is going to use 3D accelerators and so performance of the rendering task becomes almost a non issue. Compared to a raycaster which you will spend months (literally) trying to optimize to perform even on a modern system.

I fully understand the mind f#*% that is starting to learn about 3D development and art lines. But that's going to save you SO much time, and give you much better tools to work with.

Here's a practical suggestion:
Install minib3d and take a look through the tutorials, you don't need to understand it all, just have a look to get familiar with how the syntax looks.
Using the tutorial that you find most comfortable to start from try making bunch of cubes at different positions and moving around them with keyboard controls of the camera.
That's most of what you're going to need to clone a doom game right there...
Specifics to look up in the help documentation for minib3d or blitz3d (same documentation really)
CreateCube
CreateCamera
CreateLight
MoveEntity
PositionEntity
TurnEntity
RotateEntity


It sounds like your biggest problem is the asset generation, specifically the map. And it sounds like you're hinting that you want to be able to do vertex based creation of the mesh without using a modeling suite (I can understand they're all quagmires). You're going to need to read up on the documentation regarding surfaces and vertices as well as meshes in general if you really want to go this route. You will need to spin your own map editor which is really just a mesh editor, which if you haven't guessed by the complexity of any modeling program, is probably not going to be all that easy...
I would take steps to get to this level:
Start with the above example of a world of cubes you can move around. Try to create an editor that can just place cubes. You can then expand that to create scaled cubes (ScaleMesh and ScaleEntity), add textures (LoadTexture and EntityTexture), and load/save your placements. It's not doom and it has a MineCraft feel to it but that's a basic level editor and you haven't touched a vertex yet.

Following that if you're still insistant that you can't find a modeling program you're comfortable with then its time to look into creating your own mesh from scratch. You will need to make friends with most of http://www.blitzbasic.com/b3ddocs/command_list_3d_cat.php?show=Surface. Start out just trying to build a triangle, then a square (I would recommend a keyboard action to spin the mesh you're building, you're bound to get some normals reversed for a while so you will need to see it from the back). add a texture to the square. If you get that far you have all the basics you need to make a whole level it's just how you apply them...

P.S. the minib3d forum can help you through anything that may confuse... I had tried learning 3D things for years until I stumbled on minib3d and now I'm porting the engine itself to android... it's a doable thing to pick up with a little help.

Last edited 2010


thalamus(Posted 2010) [#22]
Where's the harm in helping Madk with a Doom-esque engine? Yes, it's easier to make a game in 3D, but there's no harm whatsoever in grounding yourself in old programming techniques. And who knows, the project's success or failure may push him forwards into other things, including real 3D.


Vorderman(Posted 2010) [#23]
Good raycasting engine tutorial here:
http://www.permadi.com/tutorial/raycast/index.html


ima747(Posted 2010) [#24]
Re: thalmus
Nothing wrong with trying it that way, but when there's a clearly "better" (always opinion, but basically agreed on here as he has a clear intent, and it's to make something, not learn the ins and outs of technique...) alternative it should be stressed.

I for one would love to know more about writing a raycaster from scratch, but if I wanted to just make a game I wouldn't start there. That's a technical exercise (a very interesting one, but still an exercise).

re: Vorderman
Excellent link! breaks the concepts down nicely, can't wait to find the time to digest it