Thread: Lanthanide and Actinide

  1. #1
    Banned
    Join Date
    Jan 2003
    Posts
    1,708

    Lanthanide and Actinide

    This project:

    -Reads and quickly renders Quake3 .BSPs compiled with GTKRadiant 1.2. This is an extremely fast process utilizing Potential Visibility sets and Frustum Culling. What this means is only the potentially visible leaves that have a part of their bounding box in the viewing volume are draw to the screen. On my Geforce2mx 400 64MB card I was hitting 100 fps in 1024 * 768 (with vsync disabled). With my Radeon 9600 PRO it's always above 200FPS on 1280 * 1024.

    -Fast but accurate method of extracting view frustum (this was a PAIN to get working because usually I could rotate vectors in relation to the View vector to receive the six plane normals, but the inaccuracies multiplied out, eventually I just extracted the right and bottom plane normals from the OpenGL matrices, then mirrored those over the view vector to receive the other plane normals).

    -Collision detection using a 'semi spheroid' algorithm (as opposed to using a bounding box algorithm, which isn't that difficult to be honest. My method basically just means you can perform ray tracing using a sphere for collision detection but also have a HEIGHT which is bigger than RADIUS units...this was a pain in the arse to get working to be honest)

    -Sliding across faces: I didn't think this would be as difficult as it was, but when you slide across a face you have to recursively trace along the faces until the direction you want to move in receives an invalid length (meaning you run out of steam).

    -stepping up stairs: I didn't know how to go about this so I just detected a collision, and then I pushed the camera up STEP_UP units (STEP_UP was defined as HEIGHT>>2 because I approximated the most you can reasonably step up is 1/4th of your total height) then traces from the newly elevated position forward, and if the fraction of the move that could be travelled was greater than .5 (magic number for now) then it counted as a step. This was also difficult to get working because you could sometimes go and hit a wall and 'jump' up.

    -Realistic gravity: This part took me a while to get working properly. As you know gravity is not a velocity, it is an accelerator. I tried using the derivative 32*timeinair to calculate the instantaneous velocity of gravity, but it didn't seem right, so I instead am using 16 * timeinair^2 to calculate that velocity. I'm not entirely sure what I'm doing on this part, but it works.

    - capability to shoot the world. Also calculates the angle of reflection off of that surface and draws the normal at the point of collision

    - utilizes pre compiled quake3 lightmaps, meaning fast static shadows can be drawn without having to rely on hardware (that would slow things down if the lighting was calculated for every pixel in the scene).

    - uses time based movement, so no matter how fast the scene is being rendered you will always move SPEED units per second

    -fully functional 3d vector class with a vector operations library. Utilizes DotProducts and Crossproducts, Projects vectors onto planes, finds parallel and perpendiular components between two vectors, and rotates vectors.



    All questions, comments, and constructive criticisms welcome.
    EDIT: This site is currently working and has no bandwidth limit (as in it wont shut down on me, but it might run slow if you all download at once).
    Also, perspective may come through and loan me a site as well (*crosses fingers*), I would like to have two. Anyway this first link is the directory with all of the files necessary to test the engine. You technically don't need textures.zip, but I encourage you to download it if you can (~5MB) because it looks much much nicer with the textures. Everything must be extracted to the same directory, I wrote a detailed explanation of how everything should be laid out if you aren't sure what to do.

    http://www.thedevelopersalliance.com/~shadow12345/
    Last edited by Silvercord; 07-22-2003 at 07:52 PM.

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916

    Unhappy

    Temporarily Unavailable

    The Angelfire site you are trying to reach has been temporarily suspended due to excessive bandwidth consumption.
    The site will be available again in approximately 2 hours!
    Away.

  3. #3
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    I wonder what a 3d engine has to do with those elemental groups....

    As for the realistic gravity: If you have t (timeinair) and g (9.81) it's pretty easy to calculate the velocity - unless I misunderstand your problem which is very well possible (I'm a C++ newbie). Its v= g*t (+v0 if you have an initial speed). It's even possible to calculate the speed at the time of impact (maybe for falling damage?) if you don't have t: v=sqr(2*g*s) where s is the distance your object fell.

    Btw, if you still need a host, send me a message.

  4. #4
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    Originally posted by Silvercord
    that 9.81 is meters per second, I have everything in feet so I need 32 ((9.81 * 100)/2.54=CM, CM*2.54=inches, inches/12=feet=~32) , and the instantaneous velocity of the gravity accelerator is 32(timeinair) which is the derivative of 16(timeinair^2), and that works fine now
    You mean you use... feet ... even in physical formulas?As fas as I know NASA lost one of their Mars surveyors because they did this....

    Anyway, I'd love to see the code. I once tried to code a collision detection engine and miserably failed /bow Silvercord

  5. #5
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    It compiled okay (8 macro redefinition warnings) but it says it needs GamesTutorialsBSP.bsp on execution. Wanna attach that so I can check out your engine?
    Away.

  6. #6
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    I've deleted all of my posts and started this over with new links (bottom of first post, which is where they were originally). This site should be more reliable than friggin angelfire. So, back to where we started, download, run, tell me what you think. Sorry for the hassle, thanks for sticking in.

    email:
    [email protected]

    AIM sn:

    OpenGLProgrammer
    Last edited by Silvercord; 07-22-2003 at 07:49 PM.

  7. #7
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Eh, it's been done.
    1/10

  8. #8
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    Thats very nice, I actually tried to pull down the console to type "quit" only to realize this isn't the real quake engine =)

    The mouse input was surprisingly smooth (better than what some games use imho) but way to fast on my mouse. But thats of course just a matter of mouse specific settings.

    Keyboard input was fine.

    Gravity was not realistic Maybe my computer can't handle "feet" but unless this map is situated on a neutron star, the gravity was not what I'd expect. I was always instantly on the ground again. [Maybe this is not time- but frame- based?]

    I'll try a real quake map now =)

    edit: I did. A few other issues:

    Movement speed stacks. You are faster when strafing and at the same time moving forward. Maybe it's even intentional. Just mentioning it.

    Movement speed is based on current FPS. I had a map where the number of visible polygones changed a lot from vis to vis zone. Sometimes this made me move faster, sometimes *a lot* slower.

    Curved surfaces don't display. That's gonna be a major challenge I assume

    Impressing engine!
    Last edited by darksaidin; 07-23-2003 at 03:02 AM.

  9. #9
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    - uses time based movement, so no matter how fast the scene is being rendered you will always move SPEED units per second

    Movement speed is based on current FPS. I had a map where the number of visible polygones changed a lot from vis to vis zone. Sometimes this made me move faster, sometimes *a lot* slower.

    which is it?
    Away.

  10. #10
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    You guys are good testers, everything mentioned were problems I have been pondering over. I need to find a realistic conversion from the arbitrary world units to feet or meters, that will fix gravity. The movement isn't contsant because it measures how long it took to render the frame and uses that to determine the fraction of how far you should move (based on your speed per second). What I'll probably do to fix that is only get the time every five seconds.

    This is a very limited renderer, I have not implemented curved surfaces or entities or much of anything...in fact your starting position in the world is hard coded into the program because I haven't even written anything to read the INFO_PLAYER_START entity.

    Thanks for taking the time to look at this for me

    I'm more motivated than ever to continue working.

  11. #11
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    Originally posted by blackrat364
    which is it?
    ra3map1, the clanarena part of this map (ra3 maps consist of several small arenas with independent spawn points.)

    You guys are good testers, everything mentioned were problems I have been pondering over. I need to find a realistic conversion from the arbitrary world units to feet or meters, that will fix gravity.
    I may be wrong, but don't you try to convert something that doesn't need to be converted here ? Why don't you simply use the world units for everything, including acceleration and velocity? This should work as long as you can eliminate t.

    The movement isn't contsant because it measures how long it took to render the frame and uses that to determine the fraction of how far you should move (based on your speed per second). What I'll probably do to fix that is only get the time every five seconds.
    Mhm,... maybe try using a second thread for user input and movement. You could run it at 25 constant "snaps" (you know that quake command?) with constant speed. Thats also the way Diablo II does it, not sure about Quake here.
    Don't know how strict windows handles threading. May as well be that gl prevents the scheduler from switching the thread in the right moment. It's been a while since I did something with threads, so I may be wrong again. Just a suggestion.

    This is a very limited renderer, I have not implemented curved surfaces or entities or much of anything...in fact your starting position in the world is hard coded into the program because I haven't even written anything to read the INFO_PLAYER_START entity.
    Ya, I know. I didn't expect it to render CS anyways. Just wanted to mention it.


    edit: Not that I want to spam you with newbie suggestions, but here is another one =) It's in pseudo code. Didn't know how to explain it.

    initialize a high precision timer
    mainloop {
    - perform all user-input related stuff
    - multiply "visual" velocity with current timer value (the more time it took to render the frame, the further did the player move between frames (IF there was a movement))
    - reset timer to zero
    - render scene
    }
    Last edited by darksaidin; 07-24-2003 at 11:06 AM.

  12. #12
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    I may be wrong, but don't you try to convert something that doesn't need to be converted here ? Why don't you simply use the world units for everything, including acceleration and velocity? This should work as long as you can eliminate t.
    I am using world units for everything, but realize 32 * timeinair and 9.81 * timeinair are both accurate representations of the instantaneous velocity of gravity. The problem is representing 32 feet or 9.81 meters in order for the equation to work.

  13. #13
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    Some problems fixed:
    I fixed some problems with preserving the movelength and projecting the move onto the xz plane. I also *may* have fixed a problem that occured when looking straight into the ground and trying to move (you could go through walls when this happened, so I made it so you cannot look directly into the ground and it seems to have been fixed).

    If you want to, download the new executable named BSP1.zip and run it...when you do try walking up the stairs while looking down at the ground and/or try walking up the side of the archways and doing the same while on the top. If any of you can manage to get through the walls then I still have a bug to fix.

    the link is (again)

    www.thedevelopersalliance.com/~shadow12345
    Last edited by Silvercord; 07-24-2003 at 03:52 PM.

  14. #14
    Well, played it.......sadly I lost

    On a serious and less pathetic note, I thought it was a good game(much better than the earlier stuff you showed me), and I hope when you sell your game for millions of dolalrs I get a free copy...NO, I demand a free copy of your game!!!

  15. #15
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    I also *may* have fixed a problem that occured when looking straight into the ground and trying to move (you could go through walls when this happened, so I made it so you cannot look directly into the ground and it seems to have been fixed).
    Workarounds are bad. Terrible, like goto. Workaround=Doom of the world. Workarounds will kill us all.

    That reminds me of Dark Age of Camelot. Whenever something is broken there, they just disable the feature. Archers can shoot through dungeon walls ? oops. That must be fixed: Archers can't shoot in dungeons anymore. (Thats not a joke.)

    You shouldn't do this. It starts with something simple and in the end you will fix a problem like "the graphics isn't displaying correctly on ... cards" with "graphics has been removed from the game, ... is now a text adventure".

    Of course those were extreme examples...

Popular pages Recent additions subscribe to a feed