TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: QUINTIN OLIVER
from: HERMAN SCHONFELD
date: 1997-04-27 12:02:00
subject: Doom like games...

QO>Hi All,
QO>I've been wondering on where's a good starting point for writting a game
QO>like
QO>DOOM, I'm planning on writting the game in MSVC++ V1.00 I know this is
QO>not one
QO>of the best software development tools for writting it in but with some
QO>realy
QO>good lib's I think it's possible...
QO>So where do I start?
QO>And where can I get some good graphic LIB'S?
Are you sure you want to make a DOOM-clone? Considering the fact that the 
vast majority of computers are pentiums, it wouldn't hurt to make a 
QUAKE-clone. (What i'm currently working on).
If you start a 3d game as such, you need to chose the kind of 3d engine your
game will most likely need. ie, if your just aiming for a doom-clone type 
you'd be aiming at something like a 2d-bsp tree engine.
BSP tree's are a method of sorting out your world once, and using the tree to 
render the visible walls that you currently see based on your view position 
and los. (line of sight).
ie.
       +---------+
       |         |
       |         |
       |         |
       |         |
       +---------+
If your player was in that room, it wouldn't matter which walls got rendered 
first because they will never occlude each other. This works fine in 
something simple like that, but in a room such as
+-------\a /--b-+
|         \|c   |
|      p    p2  |
|               |
|               |
|               |
+---------------+
the player would need to render wall b, then c then a. But if player were 
standing at p2 then walls a,c,b would need to be rendered. The thing about 
BSP trees are that you only need to figure out the order once and store it in 
a partioned tree that makes it very fast and easy to look through and pick 
the walls that need to be rendered and the order.
To figure out the order firstly is a very hard task. If you want a fast 
algorithm then I suggest looking through the program DEEP and going through 
source codes like ID's map builder and DEU. (Source are availble for all).
I will demonstrate how you would perform the task. Take that room that i used 
before, to split it accordingly you would
+--b---\c /---d--+
|       \|      |
a        |      |
|  1     |  2   e
|        |      |
+--------f------+
Line D would be the partioning line and now you have two rooms 1 & 2. 
Remember how I said before that in a square room it doesn't matter in which 
order you render the walls, well thats what you basically have to do, split a 
map into atomic areas.
The tree for that room would look like -
              split line
              /   \
             1     2
Now, if your on the left of the split line, traverse the bsp tree right.
so, i am in left that means go right which is 2, then go back into 1.
So if i was in the left of the split line then rendering area 2 then 1 would 
be correct.
If i was in the right side of the split line then rendering 1 and 2 would be 
correct. This is all basically what you do.
Take this bsp tree for eg.
                  1
                 /  \
                2    3
               /\    /\
             a   b  c   d
The numbers are the split lines and the letters are the atomic areas.
First of all, you find out which side your on the root node. (split line 1).
Say we are on the right, that means traverse left which leads us to split 
line 3, say we are on the left of node 3 that means traverse right which 
leads us to atomic area c, area c isn't a node so we need to render it, (we 
have rendered C) now go back to 3, we were just in the left so go right 
(render D),
now back to node 1, we just went to 3 so goto 2, we are on side right of 2 so 
render A then go back to 2 and render B. The result would be a correctly 
rendered room.
The order we rendered it in was (C,D,A,B).
It is quite simple when you look at it.
QO>I've never tried to write somthing like this so it will be a case of
QO>trial and
QO>error.  I'm also not planning on releasing it on the market, maybe once
QO>I've got
QO>the hang of developing these type of projects...
QO>All idea's and brain stroms will be happly recieved...
... !edis gnorw eht morf siht ta gnikool era uoY
--- Ezycom V1.48g0 01fd016b
---------------
* Origin: Fox's Lair BBS Bris Aus +61-7-38033908 V34+ Node 2 (3:640/238)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.