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.

3 Dimensional Chat / Terrain Following/Object collision for a racing game

Author
Message
Fusion
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: UK
Posted: 12th Nov 2003 14:47
Hey there, I am looking for some help with my game i am making for my final year project (Virtual Reality Design BSc). I am making a game similar in style to an old game called Skidmarks on the Amiga/Megadrive. It is a top down racer which is view from a slight angle.

I have my car accel and braking as i want and i have even added some gravity to it. However i need the car to follow the terrain and also travel up objects like ramps, briges etc which are separate from the terrain model.

My problem is worsened by the fact that i am only using DarkBasic Pro to prototype my game, My final project will be done in C++ and openGL. So I ideally have to stay away from using things such as "Get ground height" in order for most of the code to be useful when i eventually get round to porting it.

If anyone can offer any help it would be greatly appreiciated!
Thanks, Marcus

P4 3 GHZ, 1GB DDR RAM, ATI RADEON 9700 PRO, SB AUDIGY 2 EXT, PIONEER DVD-R, PLEXWRITER 48x, 18.1" TFT Monitor. "PON DE RIVER, PON DE BANK" YUP! GOOD TA GO!
Beta 1
21
Years of Service
User Offline
Joined: 27th Aug 2003
Location:
Posted: 12th Nov 2003 15:16
Wierd suggestion - could you right a routine that would combine you terrain model and your ramps etc into a single mesh after loading the level. Then you only have the one object to test against and could use an "intersect object" style approach.

I came up with something using memblocks that could take 2 meshes (both as memblocks) and combine them into one mesh but it messes up the texturing at the moment (although vertex colors work fine)
Fusion
22
Years of Service
User Offline
Joined: 1st Dec 2002
Location: UK
Posted: 12th Nov 2003 16:12
That sounds wonderfull... cept that I am not sure what you are saying

I am looking for something a wee bit simpler

I am alright at coding but am no expert! haha

Oh yeh! Also if i combine it all in one mesh, surely that would cause problems when the car drives under a bridge or summin????

P4 3 GHZ, 1GB DDR RAM, ATI RADEON 9700 PRO, SB AUDIGY 2 EXT, PIONEER DVD-R, PLEXWRITER 48x, 18.1" TFT Monitor. "PON DE RIVER, PON DE BANK" YUP! GOOD TA GO!
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 12th Nov 2003 20:32
You'll need to check for collisions with structures seperately from your terrain, also - you'll need a linear interpolation ground height function, of which there are plenty. Perhaps it'd be an idea to look around for C++ code for collision, and try and convert it for use in DBPro.


Van-B


I laugh in the face of fate!
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 12th Nov 2003 22:22 Edited at: 12th Nov 2003 22:40
Greets,

We've been designing a collision DLL for DBPro. However, the library is not specific to DBP. We're in fact going to use it for our own internal C++ gaming related projects and want to release it as a C++ lib for the higher end developers.

The lib would work and interact very similar to how the DBPro DLL does, the only real changes would be to the DBPro functions so they're not DLL calls, and a few other nuances, but the syntax could be made to be nearly identical to the DBPro code (with the use of a C++ header file that communicated with the lib).

The current DLL release can act a little sketchy when you hit 2 models at the same time, but the issue is being resolved for the next release within the next 1-2 weeks.

We're going to develop the C++ package shortly after we get it working with DBPro, DB, and blitz. We'd be happy to work with you on it as it would help resolve any issues in the C++ package.

If I had to make a rough guess, I would say 3 weeks before we see the C++ package coming out.

Link to the DLL is below.

EDIT:
You will need access to the triangle data of your objects from C++/OpenGL so you can pass them to the collision system when necessary.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 13th Nov 2003 05:12 Edited at: 13th Nov 2003 05:13
Ok, i've downloaded the dll and gone through the tutorials but could you give me a better breakdown of what all the commands do so i could implement them better? And also, how could you use this dll to do shadows?

Sparring - Loved by many, Pefected by few.
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 13th Nov 2003 05:57 Edited at: 13th Nov 2003 05:59
Okay, at the top we "need" the following constant block:



We'll ask you to update that block when we make upgrades, and you'll get a new block to put there. Basically this gives us an "ellip-2-poly" collision method, with a sliding response method, and a "no dynamic" response method. This will be expanded to include a "ellip-2-ellip" coll method, sticky collision, and more. So that's what it's for.

Next you have the collision type ID's, you can create your own, this is in the comments as well.



Next we have collision definitions:



This may seem useless as of right now, but this allows you to define which objects can collide with which objects.

IE: You can create an alien type and make a definition so it collides with spaceship meshes, and humanoids that collide with earth objects. Here's an example of how this might look:



The next part would be to define which objects are of what type ID. We need to do define our aliens, and earthlings, etc. We also might want to set the ellipsoid size of our aliens and earthlings at the same time. Here's what an example might look like:



And that's about all there is to it.
All you do to make collision work is:



And this would make the Aliens collide with the spaceships and the humanoids will collide with the Earth objects.

There is a nice command to disable/enable the collision of an object. So if you have a spaceship that is far away and don't need to test collision with it you go like:

DeActivateObjPRO( SpaceShip_Obj )

And if the time comes where you need to test collision with the mesh again you go like:

ActivateObjPRO( SpaceShip_Obj )

------

New stuff coming and things to note:

You cannot rotate the mesh after defining it. This is being changed for the next release, so you'll be able to rotate your meshes.

If an ellip is pressed up against a mesh when it moves, the ellip may go through the mesh. (this is where dynamic response comes into play. Dynamic response will come out with the shareware copy of the DLL)

Ellip-2-ellip collision is coming out in the next release. So you can make the aliens/humans safely and quickly collide with one another.

And more is on the way!

Let me know if you have any more questions.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 13th Nov 2003 06:01
Hmmm, sounds good....

I am having trouble implementing matrix collisions...I am trying to make a vehicle (a tank) "realisticly" (landscape tilting mostly) move along the matrix. I have had little luck; do you think this DLL will work with what im looking for?

Amist the Blue Skies...
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 13th Nov 2003 06:15 Edited at: 13th Nov 2003 06:15
@CPU
I'm not sure on how you would handle shadows, as it would depend on the accuracy you're after, etc.

There is a ray-cast function coming out in the next release which may be beneficial for shadow systems. As you'll be able to cast a ray and get the exact point of intersection on a mesh, etc.

They may be difficult with the current release though.

@TheAbomb12
The system is not directly able to handle matrixes as objects.

This would be done by going through the matrix and quickly breaking it down into triangles at run-time and passing the triangles to the collision system so the matrix could be treated as a mesh. The specific "AddTri" function was left out of the current release, so you may find it difficult to use for your purpose right now.

However, I had planned to place specific matrix functions in the next release. Basically it'd create a NULL object and hide it and then go through and pass the matrix triangles to the system.

For collision with a matrix I would highly recommend waiting for the next release. And yes, then it would probably be greatly beneficial to your work.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 13th Nov 2003 07:02 Edited at: 13th Nov 2003 07:05
when is your next expected release?

Also, what are the objects currentlly availible for use in collisions? for instance..."I need ______ kind of object inorder to collide with ______ kind of object". Im not sure if this was presented elsewhere; I might have overlooked it...

Amist the Blue Skies...
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 13th Nov 2003 07:20 Edited at: 13th Nov 2003 07:24
The next release is expected in 1-2 weeks.

You have the following kinds of objects: "ellipsoid" and "mesh"

Currently, the collision system supports ellipsoid to mesh collision. However, you can define any "db object" as an ellipsoid.

In example, you could have a set of soldiers and have a definition like:

SetCollisionsPro( TYPE_SOLDIER, TYPE_WORLD_OBJECT, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP )

And the soldier can be animated and treated like a normal DB object. The collision system recognizes the soldier as an ellipsoid and tests it against all of the objects defined as "TYPE_WORLD_OBJECT" using ellipsoid to mesh collision.

With the above definition, when you go like:

CollisionTypePRO( myObj, TYPE_WORLD_OBJECT )

The system immediately recognizes that this object was defined as a the target of the "ellip-2-mesh" definition and therefore loads all of the triangle data for the object into DLL memory.

Any object set to:
CollisionTypePRO( myObj, TYPE_SOLDIER )
would be treated as an ellipsoid

and any object set to:
CollisionTypePRO( myObj, TYPE_WORLD_OBJECT )
would be treated as a mesh.

This is even more powerful in the upcoming version as the same Source type could have multiple definitions. Example:

SetCollisionsPro( TYPE_SOLDIER, TYPE_SOLDIER, ELLIP_2_ELLIP, RESP_SLIDE, DYN_NO_RESP )
SetCollisionsPro( TYPE_SOLDIER, TYPE_WORLD_OBJECT, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP )

This would tell the system to use "ellip-2-ellip" collision between the soldiers and use "ellip-2-poly" collision for the soldiers against the world objects.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 14th Nov 2003 01:05
> The current DLL release can act a little sketchy when you hit
> 2 models at the same time, but the issue is being resolved for
> the next release within the next 1-2 weeks.

Good to hear. A friend of mine built a track editor out of 'tiles' and your DLL has a hell of a time transitioning from one tile to the next.

It's good to know that I'm not completely stupid because I could not easily fix that problem in DBP.
--
TAZ
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 14th Nov 2003 01:17
I was checking out your site; quality stuff

anyways, So basiclly I can define a object model(.X?) as an ellipsoid? am I right?

And is the "mesh" the same way?

Amist the Blue Skies...
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 14th Nov 2003 02:08
@zircher
lol, yeah, we found that problem right before we went to release it and realized we had to re-write the logic of the system to make it function properly. So it stuck. Until the next release anyhow.

@TheAbomb12
The collision system sees all db objects the same. So you can define any db object as a mesh, as an ellipsoid, or as both.

Meshes are not limited to loaded X models. You can define a DB primitive (sphere, etc.) as a mesh and it'll be handled as any other mesh. So yes, for instance:

you could have an animated player X model defined as an ellipsoid
you could have the world defined as an ellipsoid
or you could have the world defined as a mesh
note: ellipsoid to ellipsoid collision is coming out in the next release, currently only "ellipsoid 2 mesh" collision is supported.

btw, the package from the website has an example program that details how each call works, etc., just in case you haven't checked it out already.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 14th Nov 2003 03:25
aahhh....I see the light now

Amist the Blue Skies...
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 14th Nov 2003 05:14
@ TheAbomb12:
If you want to have realistic positioning and tilt check out the example/progam that comes with db, it's it myproj->tank i think

@nucularglory
I have a Q, how would you define elipsoidal collision with DBC? it seems that everything your doing is in pro so i'm wondering how you could do it in classic.

cheers

Sparring - Loved by many, Pefected by few.
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 14th Nov 2003 05:49
Hi CPU,

The next release will have packages for a few platforms. These include: DBPro, DB Classic, and blitz.

Once we work out the memory and collision routines we're going to go forward and design packages and examples for all 3 platforms.

Lead Programmer/Director
Powerful Collision DLL for DBPro: http://www.nuclearglory.com
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 14th Nov 2003 08:04
@CPU

Lol, I already looked at that program, Its not flexible enough to run the maps I need it too

Amist the Blue Skies...
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 15th Nov 2003 05:42
@ TheAbomb12
Just trying to help

Sparring - Loved by many, Pefected by few.

Login to post a reply

Server time is: 2025-05-13 12:09:37
Your offset time is: 2025-05-13 12:09:37