Game Development Community

dev|Pro Game Development Curriculum

Quake3Bsp

by Matt Fairfax · 02/26/2004 (6:21 am) · 9 comments

Quake3Bsp

After arm wrestling the TGE collision system and losing I took a different approach. I had originally taken my code for analyzing the concave creases in a mesh and expanded it to actually splitting the mesh up into discreet convex meshes:

www.rustycode.com/matt/q3torque7.jpg
I sat down and did some research into how to close these meshes (www.cse.unsw.edu.au/%7Elambert/java/3d/hull.html is a good reference) and started in on a QHull approach.

It didn't take me long though to realize that I was wasting my time b/c by the time I was done I would be submitting tons of convexes to the collision engine in some cases and I knew from past experience that would drastically cut my framerate. I was also dealing with *loong* load times and it was only getting worse.

Then, one day while driving home I got to thinking about this shot:

www.rustycode.com/matt/q3torque8.jpg
It had been nagging me all along that there were collision brushes already in place for the tongue and the teeth in q3dm1. I had searched for the equivalent brushes in my test map for the beziers there and had never seen anything. Then it hit me! Those had to be manually placed by the level designer! Doh! So I got the level designer for the test level to do the same thing ("yeah...that is easy") and viola...working "collision" with the beziers...even if it is faked. My renderer simply rejects and visible faces that don't have a texture handle so all I had to do is rename or delete the "TGECollision" texture and they didn't render. However, they still existed as collision brushes =)

www.rustycode.com/matt/q3torque9.jpg
One nice side effect of all this is that I found a bug in my lightmap loading code where I had implemented a naive gamma correction that I was doing in addition to my real gamma correction resulting in very washed out lighting. I removed that chunk of code and the lighting improved dramatically!

www.rustycode.com/matt/q3torque10.jpg
So what is left to be done with the Quake 3 code if collision is taken care of? I need to fix the castRay since it currently doesn't work correctly for the beziers and would improve the appearance and performance of the vehicles. There is also the problem of having the vehicles go through the brushes if they get moving too fast (common problem anyway but a little worse for QuakeBsp atm). Once I have fixed those two bugs I will release a new demo and start planning out how to release the code.

Shape3ds

For those of you who don't know, I have been working on a 3ds renderer for TGE. This isn't meant to be a replacement for dts and certainly will never be as fully featured but I had a few reasons:

1) I wrote a fairly robust 3ds renderer a long time ago and thus already had 90% of the code I needed. I went ahead and ported it over one afternoon with very little fuss.
2) 3ds is about as close to a universal standard as you can come with all of the various modelling packages in use. This will allow an artist to get simple shapes into Torque with exceedingly little trouble. It will also allow programmers to draw upon the huge library of free 3ds models available on the internet.
3) The 3ds loader won't share the same 9 collision convexes limit as the current shape code. Ideally, without all of the overhead of the dts code, I can increase the collision efficiency a bit. It won't ever approach that of the interior code but I would like to reach a nice middle ground between the interiors and the current shapes. The artists will still have to manually add the collision convexes but ultimately that is for the best.
4) I wanted some nice clean vertex/triangles data that I can use to experiement on and maybe to expand into something else like automatic convex generation.

The renderer took me no time to get into place:
www.rustycode.com/matt/shape3ds1.jpg
and yesterday I added collision:
www.rustycode.com/matt/shape3ds5.jpg
www.rustycode.com/matt/shape3ds6.jpg
I just need to add transparency support and tighten up the collision (preprocess a few things) and I will release it as a resource.

Future
So what all do I have in the works now that I am close to wrapping up these two projects?

I am cranking up my part in the development of BoomBall. I am primarily responsible for the gameplay code and for doing the programmer art for placeholders. We have some really neat stuff in the works for that game and are driving hard towards getting it finished.

I discovered that the SpeedTree guys are located about an hour from me so I am thinking about trying to get a job there. The commute would be rough but it would be worth it for me to be able to do gamedev related programming fulltime =) I am in the process of updating my portfolio over the next couple of months (wrapping up a few things, polishing some, and adding a few small things) and will go down and visit them soon. Wish me luck!

Fun stuff
I spent one afternoon last week writing a *really* simple tornado class for TGE as a demonstration of a few things for Chuck on the irc channel. It made for a nice break from all the other stuff I had been working on. It also gave me an excuse to play with fraps:

www.rustycode.com/matt/tornado1.mpg

I also wanted to show a few of the blooper or funny shots I have captured from my development from time to time:

www.rustycode.com/matt/oops.JPGwww.rustycode.com/matt/hrm1.jpgwww.rustycode.com/matt/new_interiors.jpgwww.rustycode.com/matt/ouch.jpgwww.rustycode.com/matt/hrm2.jpgwww.rustycode.com/matt/q3lighting_hehe.jpg
Big News
And last but certainly not least...I'm engaged to a wonderful, beautiful woman!

About the author

I am a Game Designer at PopCap who has worked on PvZ Adventures, PvZ2, Peggle Blast, and Bejeweled Skies. I am an ex-GarageGames employee who helped ship TGE, TGEA, Torque 3D, and Constructor.


#1
02/26/2004 (7:06 am)
Congrats! on your Achievements. Hope you meet the rest of your Goals Matt! GRats on your engagment!! wheww..You guys keep raising the level of torque. That indoor skate park looks better than the BirdMan's game on PS2. heh

Looking forward to your Code resource releases!!

John H.
#2
02/26/2004 (7:39 am)
Engaged! nice.. congratulations there bud!

Looks like that stuff youre doing is fun too! hella fun!
#3
02/26/2004 (9:16 am)
Mmmmm.... more collision detection .plans.

I appreciate reading about your solutions! Good stuff! So are you planning on contributing your stuff directly to torque, selling it as an add-on, or what?

And congrats on the engagement! Sounds like good news all around!
#4
02/26/2004 (9:18 am)
Your "new interiors" picture is real nice. Its really looks like houses from the streets of Budapest. :) Are they from a game ? Which one ?

I wish you good luck with the ST job, speedtree is great i hope the job will be too :)
The 3ds renderer sounds cool, are you planning the renderer to multitexture ready ? (specular, bump)
#5
02/26/2004 (10:02 am)
Impressive!

How framerate react with your new collision system?
#6
02/26/2004 (10:29 am)
Very nice shots... A great .plan. :)

When do we get to play with all this awesome stuff ourselves? XD
#7
02/27/2004 (2:58 pm)
Gotta say, your screens look incredible. Keep it up, new stuff keeps me inspired.
#8
02/27/2004 (7:10 pm)
that tornado looks great!
#9
02/28/2004 (5:37 am)
I can just tell that 3ds support is going to be popular ;) You rule man.