New BSP Engine

This is a discussion on New BSP Engine within the Game Programming forums, part of the General Programming Boards category; Hey everyone, I've been working for about 2 weeks now on a BSP engine and have come up with some ...

  1. #1
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903

    New BSP Engine

    Hey everyone, I've been working for about 2 weeks now on a BSP engine and have come up with some good results. Basically I've got the renderer complete, along with collision detection and entities (like doors and elevators)

    You can download the current version here:
    http://www.thejefffiles.com/projects/BloodRight/

    that's my development site over at TheJeffFiles.com for the game. There are some screenshots and the updates.txt file from the game.

    I'd like to see some of the specs that some people got while playing the game, to see if I need to fix any bottlenecks in the code.

    Well, take it lightly on the engine, I've only had about 2 weeks to work on it so far, so it's probably got bugs in it

    Note: to show the frames per second and stuff, you need to set the debugging mode to 1 in the game.ini file

  2. #2
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    looks like a pretty good start, keep up the good work.

    maybe for a future add on you can have some collision response code

  3. #3
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    hm, what do you mean by collision response code? the way I do it right now is just do projections at the ground and the ceiling, and then project rays in the direction that you move. The only problem I've found with that at this point is sometimes if you land just right on the edge of a block or something, you can go through it........so i'm still trying to figure that out

    I'm at school right now, working on getting elevators working correctly.

  4. #4
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    I don't know what algorithm you're using for collision detection, but what I mean for collision response code is that your velocity is modified so that your new direction makes you slide across the plane you hit. Obviously there's a LOT more to it than this (I am reprogramming my physics, essentially I'm trying to make a rigid body simulator), but the basic idea is to get that nice smooth sliding effect when you hit a surface, such as in quake

  5. #5
    Intranasal Heroin User Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,035
    hey, nice job. believe it or not bsp editors are in high demand.

  6. #6
    Banned
    Join Date
    Dec 2003
    Posts
    367
    Looks good. It could look a LOT better with better textures though, namely the wall texture (Look @ screenie 2). It's not that important in the very beginning, but without good textures, you may make false judgements about your engine.

    I'm currently working on a indoor 3D engine that I'm going to make a simplistic FPS with. I don't know what all I'm going to optimize it with yet, but I'm probably going to use octrees.

  7. #7
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    thanks for the feedback everyone


    i have just posted an update to the engine, and actually, one of the bug fixes has to do with the textures. I noticed that the texture coordinates weren't correct for certain sized textures. So, what I did is just took the texture dimensions divided by 64 which gave me a scalar to change the texture coordinates by for all of the vertices, then I just apply that scalar to everything and it seems to work pretty nicely.

    I also fixed the elevators a bit and made them have a timer, and also made it so you stick to them when going up so it's not so jittery (it still gets jittery sometimes.......but i don't really understand why it does that yet....still trying to iron it out, heh)

    you can get the new version at my site, I also made a new testing level to test out the engine's elevators/doors and other things
    Last edited by jverkoey; 04-27-2004 at 09:33 PM.

  8. #8
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    how did you screw up the texture coordinates? they're compiled and stored in the bsp file, unless you're making your own editor?

  9. #9
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    it's not that anything is really screwed up, it's just that some of the textures are stretched bigger than they're supposed to be. This gets annoying when you have a door texture that you tile to fit right on the door, but when you compile it, it loads the texture in to the engine with half ratio, so you see twice as much as you're supposed to....

    I don't think it's anything wrong with my loader, because i've gone over that a few times to make sure that it wasn't. I suppose I'll just have to see....

  10. #10
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    Okay, umm, I am assuming that
    a) you are basing your engine off of the quake3 format
    and subsequently
    b) you are using some version of Radiant. If you are using the crossplatform GTKRadiant highlight the surface (or hold down shift in 3D to select the entire brush and all of its faces) press S which is for the surface editor, then hit fit...that automatically calculates the texture coordinates to fit. It is probably the same for Q3Radiant but I'm not totally sure (and there are some differences between GTK and Q3 Radiant).

  11. #11
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    yah, of course i'm using the quake3 format, and i'm also using GTKRadiant 1.2.1, because 1.4.0 or whatever the newest one is generated really screwed up polygons for some reason.

    I'll tell my level designer about the fit thing, and i'll see if it fixes the problem. Thanks

  12. #12
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    okay, you need to implement rendering by triangle meshes, not triangle strips or fans or whatever it is in the tutorial.

    just look at my source. YOu need to load the mesh indices from the file. Look at gametut's definition for a tBSPFace...it has vertex indices and meshvert indices, you need to use meshvert indicex so you can render GL_TRIANGLES not the other crap.

    gtk1.2.1 is basically garbage by now anyway

  13. #13
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    Isn't it faster to render as fans, because there's a lot less vertices that need to be passed to the pipeline? Or is there some obscure thing that I'm not noticing about this?

  14. #14
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    actually no, im pretty sure the fastest thing you can render is a triangle. What do you think most implementations of OpenGL do when they get a triangle fan or some higher order primitive? They turn them into triangles!

  15. #15
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by Silvercord
    actually no, im pretty sure the fastest thing you can render is a triangle. What do you think most implementations of OpenGL do when they get a triangle fan or some higher order primitive? They turn them into triangles!

    Rendering triangle fans or strips is faster than just plain triangles. If you have a mesh where many triangles share vertices and you render it as individual triangles, the same vertex will be sent through the pipeline many times. If you use a strip or a fan, shared vertices only go through the pipeline once saving expensive bus transactions and pipeline calculations.

    Heres a decent explanation:
    http://www.codercorner.com/Strips.htm

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In a game Engine...
    By Shamino in forum Game Programming
    Replies: 28
    Last Post: 02-19-2006, 10:30 AM
  2. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-25-2006, 11:14 PM
  3. Ultra chess engine contest
    By yodacpp in forum Projects and Job Recruitment
    Replies: 8
    Last Post: 11-21-2004, 06:58 AM
  4. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 11:38 AM
  5. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 01:47 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21