Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Small race game with models and code

Author
Message
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 16th Dec 2002 07:04
Hi all,

As promised I uploaded a small race game with models and code to;

www.gamedevvault.com/dbpro/race/race.zip

It includes an opponent who races against you. It's not textured all the way, but it's really just a resource to learn from.
Dennuz666
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 16th Dec 2002 09:26
Hmm.. i wonder if this i a problem with my PC or... the problem is; the screen stays black and does nothing.

I'm having more problems so if no one else has this :-(
Bighead
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location:
Posted: 16th Dec 2002 09:30
Yeap, the same happens to me.

Try running it in debug mode ...
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 16th Dec 2002 17:01
it takes a moment before it pops up. It does here on mine as well.

cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 16th Dec 2002 20:51
maybe it's a patch issue, do you have the latest for DBPro?

cypher

SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 17th Dec 2002 03:42
Not a patch issue but cypher, dude, did you know you were using Polygon collision. Either it's a buggy command (likely) or our machines/cards can't cope with models:

Body.x: 1190 Verts 2032 Faces
And
Track1.x: 10150 Verts 20240 Faces

Having Poly collision between them!

I'd suggest reworking this with a BSP. Do the BSP Collision commands work yet??

Anyway I turned off the collision and enjoyed the race all the same

BTW you might be interested in my DB1 tutorial for creating tracks such as this. Unfortunately, the limb commands in DPPro still seems bugged so it may not work for that but in theory it should http://www.actinic.hiway.co.uk
Bighead
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location:
Posted: 17th Dec 2002 06:13
Well, I also get the same error with your example Angus. The problem seems to occur when the objects are loaded.

Only that this time I could neither get the program running in Debug Mode.
Bighead
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location:
Posted: 17th Dec 2002 06:26
ok, under Debug Mode I happened to get a message like this when trying to run Angus program: "Runtime Error 1: Broke from nested subroutine. Cannot resume program after CLI usage."
SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 17th Dec 2002 15:58
Yeah, Bighead I'm afraid the tutorial is DB1 only, plus if you're just downloading the DB1 compiled .exe you'll need the media files download as well
ie
http://www.actinic.hiway.co.uk/webpro_files/SCTut.zip
AND
http://www.actinic.hiway.co.uk/webpro_files/Sliding.zip

extracting both to the same dir.
PiratSS
21
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 18th Dec 2002 00:04
Um, it flikers, u didn't turn on sync
just sync on,

u got everythin else

I am the greatest thing since sliced bread!!
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 18th Dec 2002 06:49
Thanx for the advice Angus. So is using Polygon collision a bad thing?

I am new to this, so any info is appreciated.

tx,
cypher

SonicBoom
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 18th Dec 2002 07:41
OK, cypher I'll put my 2p worth in please don't take as gospel though just my own observations really:

As I understand it, most games wouldn't have Poly collision between two complex models, far too slow, rather the models would be approximated in some way (like having a box or simple model applied) to work out the collisions.

The other nasty thing I've found with poly collision in DB is that the functions that determine if a hit or collision has occured (Object hit and Object Collsion) don't return the angle of the Normal of the Poly you hit. In other words you don't get any info on the direction the poly you hit was facing, making it "imposible" to work out any kind of sliding collision response.

BSPs in DBPro are a little different tho as they're made from simple "closed" units, like a box or wedge, the BSP is then compiled into something manageble well before your game loop, allowing for HUGE levels to be constructed. However I believe that the DB collision commands are not working yet so your code will never know if you hit the wall, although an "auto collide" object will simply glide along it regardless of your code knowing anything about it or not. Basically, especially with the bugs reported, you seem to loose a level of control using BSP at present.

If you don't use Pro & BSP and you don't want to use static, non rotated (and bugged - see below) DB collision boxes, what have you got if you want to create something like a winding race track in a 3D package and have fast Collision Detection (ie simple shapes) and a Sliding Collision Response for your track barriers?

Well that's what I was trying to get some way to solving with my little tut. It isn't the best solution to all of this by any means, seems only to work in DB1, doesn't cater for "hills" and does require alot of mucking about in 3D Studio or whatever, rotating and sizing Plains into position to get it to work.

What it does demonstrate tho is how to "manually" insert the simplest of objects that will be hidden in your game to act as the "collision boundries". Also because they're broken into seperate objects (Plains) if a hit is detected the angle of the rotation can be retrieved from the objects parameters (object angle y(n)) to enable us to work out our sliding response.

Having said all that tho, in DB Classic the easiest way to do all this would be to just use non rotated boxes in your 3D model (like a city grid - very UNLIKE your track tho) and then use similar code to pull out each limb and create a Static Box to replicate it, thus enabling you to use DB1's built in Sliding collision response (there's a tutorial on this in the standard DB help files). A word of warning though - rotating the boxes is not allowed as DB will no longer give sliding response data and I believe there's a bug with Static objects and GeForce Cards (as I have) which will crash your proggie.

Finally, I saw DarkGT the other day, posted elswhere on this forum, where he'd got (quite nice) Collision detection on his hand modelled track - it even did hills (lol). Unfortunatly he's not telling anyone how's he's implemented that, saying only that he's hand modelled each polygon. Possibly he's storing some data in a file in a similar manner to my "array to hold the widths of your plains". Again though, even in that example he's not got Sliding Response, it looks more of a "bump and test" routine.

Sorry to ramble on, hope this info helps you a little
CodeBase3D
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location:
Posted: 1st Jan 2003 11:31
I can not make good games...

DBWinner

Login to post a reply

Server time is: 2024-04-20 05:57:10
Your offset time is: 2024-04-20 05:57:10