Collision, wtf

Posted By: ChrisB

Collision, wtf - 06/10/10 17:12

I remember posts in this forum saying that the collision system of 3dgs is shit and doesn't work. So how comes that i can create a raytracing renderer using c_trace?
blablablabla blablablablablabla blablabla blabla blablablabla blabla bla blablablabla blabla blabla description blablabla blablabla blablablabla blabla bla blablablablablabla blablablabla how it works blablablablablabla blablablabla blablablabla blabla blabla bla blabla blablablabla.
Screeshots:






around 2min per image (the glass-effect is slower)
code:
raytracing.c

Don't go outside, the sun is shining!!!!11111oneeleven
Posted By: ChrisB

Re: Collision, wtf - 06/10/10 17:12




Posted By: 3run

Re: Collision, wtf - 06/10/10 17:20

Looks really great man! laugh
Posted By: Widi

Re: Collision, wtf - 06/10/10 17:28

Quote:

blablablabla blablablablablabla blablabla blabla blablablabla blabla bla blablablabla blabla blabla description blablabla blablabla blablablabla blabla bla blablablablablabla blablablabla how it works blablablablablabla blablablabla blablablabla blabla blabla bla blabla blablablabla.

i agree!

Nice work.
Posted By: Mythran

Re: Collision, wtf - 06/10/10 17:37

I have nothing to do with it, but maybe bla bla bla come before c-script? I remember a lot of people arround the forum saying collision doesnt work, but i guess that was from c-script, now lite-c appears to be alot better laugh
Posted By: Vinous_Beret

Re: Collision, wtf - 06/10/10 17:39

well,can't find the right word for this.
Simply stunning wink
Posted By: muffel

Re: Collision, wtf - 06/10/10 17:49

Great stuff.
Even to get such an Idea

muffel
Posted By: Superku

Re: Collision, wtf - 06/10/10 17:50

I'm not 100% sure what's going on, so ChrisB could you please translate some of the bla text? Nevertheless it looks interesting and somehow cool.

Btw. I like the collision engine a lot, it all depends on your knowledge on how to use it.
Posted By: ventilator

Re: Collision, wtf - 06/10/10 18:30

Quote:
So how comes that i can create a raytracing renderer using c_trace?

raytracing is easy. tongue the ellipsoid collision detection and response is the problem. that's much harder to do properly and there definitely are some issues with it...

btw. i also wrote a simple raytracer with ambient occlusion a few years ago and posted it here on the forum. if i remember correctly there were some problems because of var precision though.

Quote:
ODE physics, A6 map collision detection and AABB collision was now removed from the A8 engine. This has the following consequences:

* Terrain is now always chunked, also in the Free and Extra versions.
* Old A6 WMB files must be recompiled to the A7 WMB format.
* Controllable with the collision_mode variable, levels and entities are now loaded noticeably faster and consume less memory.
does this mean the ellipsoid collision detection got removed and replaced with some physx functions? would be nice...
Posted By: aztec

Re: Collision, wtf - 06/10/10 18:49

This Alien remind me of the last scene from the latest Indiana Jones movie grin
It looks cool though
Posted By: Vinous_Beret

Re: Collision, wtf - 06/10/10 19:33

Originally Posted By: aztec
This Alien remind me of the last scene from the latest Indiana Jones movie grin
It looks cool though

true,the movie's name was:indiana Jones and ,,,oh,,crystal skull,,may be!
damn it i forgot it. mad
any way the head in the movie was a little bit taller grin
Posted By: Germanunkol

Re: Collision, wtf - 06/10/10 21:07

ChrisB, the thing I used to be complaining about was less the collision itself (c_trace never failed) but more about the way c_trace never used to have a good system with which to set what entities to ignore (ACTIVATE_PUSH worked but is a pain to implement in some cases).

Also, model+terrain or model+model collision has failed on me before, but I don't know how that is with newer versions.

Seems like that changed with the newest beta, there's now a new way to ignore mutliple groups, but now there's a bug in c_trace, they said... That's the sort of thing that bugged me.


Neat work. At first I was wondering "that can't be realtime"... then I saw your "2 minutes" sentence grin
Posted By: Damocles_

Re: Collision, wtf - 06/10/10 21:18

in a serious implementation, c_trace would
give out a sorted list of objects, with the objects and hitpositions.

This way the programmer could have full control of what to detect
and what to ignore.

----

the raytracing is really cool btw
Posted By: JibbSmart

Re: Collision, wtf - 06/10/10 22:09

Very cool laugh It's a great experiment, and might even be useful for pre-rendered cinematics if you expand it.

Some possible future directions:
Multisample anti-aliasing;
Rendering animations;

Jibb
Posted By: Pappenheimer

Re: Collision, wtf - 06/10/10 22:14

Hm, looks almost like my renders in blender! wink
You used the same sky color! shocked grin

Would this work with a skybox, too?
Posted By: HeelX

Re: Collision, wtf - 06/10/10 22:30

Using c_trace for raytracing is forbidden in about 15 countries in the world. I just warn you, don't do that again or your soul will be multiplied with

Code:
var bernsteinBrillenglaeserOfDeath = 1 / 1024;



If you don't get this... compare it with floats and doubles ;-)

...

Awesome Gamestudio hack!
Posted By: Joozey

Re: Collision, wtf - 06/10/10 22:59

Nice raytracing there. But what does raytracing have to do with collision gaps et al. People were walking through walls on spots where it wasn't the case for me. Sounds bad enough to me.
Posted By: Hummel

Re: Collision, wtf - 06/10/10 23:53

Quote:
But what does raytracing have to do with collision gaps et al.

c_trace used for ray tracing ->self-explanatory, isnt it? wink

awesome work laugh
you should dev a tool for the contest based on this wink
some kind of baking software...
Posted By: Germanunkol

Re: Collision, wtf - 06/11/10 07:15

Damocles, couldn't that get very slow with lots of objects? In cases like ChrisB's example, not stopping after the first detection would be useless and a waste of CPU power... if the trace is long, that is.

Though in many cases, I would've loved to have gotten a sorted list back as a result of c_trace, it would've saved me many an hour...
Posted By: ventilator

Re: Collision, wtf - 06/11/10 07:36

Originally Posted By: Germanunkol
In cases like ChrisB's example, not stopping after the first detection would be useless and a waste of CPU power... if the trace is long, that is.
i think internally c_trace already must have a list like that though since it somehow has to figure out what the nearest hit object is. it's unlikely that it automatically always hits the nearest object first.
Posted By: Joozey

Re: Collision, wtf - 06/11/10 08:44

Quote:
c_trace used for ray tracing ->self-explanatory, isnt it? wink

Yes but the tracing is not the problem, c_move is.
Posted By: Damocles_

Re: Collision, wtf - 06/11/10 09:31

It would make sense to have a additional c_trace then,
something like

"c_trace_objects", which would get an additional parameter
like "max_num_of_objects"

Such that you can define after how many objects it will stop
filling the list.

---

The whole idea is, that a programmer can use this
for example to ignore all weapon models, all friends,
or shooting through walls or a group of enemies.

There is not silly hassle with assigning flags, or
"ignore" statements.

You can simply receive the list, and look though
it, regarding wich object makes sense to detect and wich
you like to ignore in this situation.
Posted By: JibbSmart

Re: Collision, wtf - 06/11/10 14:08

I think such a thing is a worthy request. It could be extremely useful. If you made a request in the Future forum I'd certainly second it, and I would hope others would as well laugh

Jibb
Posted By: Hummel

Re: Collision, wtf - 06/11/10 19:25

indeed, just do it wink
Posted By: Damocles_

Re: Collision, wtf - 06/12/10 13:41

Well, maybe someone else can post the request.

I dont like the way JCL responds.
Either no response, or some "I dont understand what you mean"
silly reply.
Posted By: JibbSmart

Re: Collision, wtf - 06/12/10 15:03

Done.

Jibb

EDIT: Sorry about the off-topic, ChrisB.
Posted By: Frederick_Lim

Re: Collision, wtf - 07/13/10 08:39

I am not sure this thread is talking about collision but from my little experience the ellipsoid collision is tricky to tune for desire result.

For moving object over a un-even surface, the sphere collision hull that mean a sphere collider is prefer over ellipsoid. i.e. in my old project in order to make the tank move smoothly I use c_setminmax to make a sphere collision hull.

From 3DGS manual:
http://www.conitec.net/beta/collision.htm
Quote:
Gliding can be restricted to the XY plane by setting disable_z_glide to 1. By default the ellipsoid can move up any slope, no matter how steep it is. To restrict this motion you can alter the global variable move_min_z. If the contact normal's Z axis is less than this minimum value no gliding along Z will take place at all. Hitting the ground plane will result in a normal.z value of 1.0 (pointing straight up). Hitting the ceiling will yield -1.0 (straight down) and a head on collision with a perpendicular wall will have a normal.z value of 0. The default value of move_min_z is -1 which allows gliding at all angles. If you were to set it to 0.5 instead all slopes steeper than 60 degrees (=acos[0.5]) would cause the entity to stop and not glide up. This example is valid only for a spherical hull. For an ellipsoid some trial and error is required to find the right value. Rather than relying on move_min_zit is recommended that you place invisible entities in front of steep walls to block them off.


Since not much object is totally spherical and no level is just a flat surface, that's I think is the problem of collision system in 3DGS.

Though I haven't got much experience in Unity, I feel that their Capsule Collider is much more sophisticate compare to 3DGS's ellipsoid collision. I don't know the math behind collision, but I think the hemisphere of the Capsule is the key to make the collision works.

http://unity3d.com/support/documentation/Components/class-CapsuleCollider.html

Of course that is just my understand and it could be wrong.
Posted By: Roel

Re: Collision, wtf - 07/13/10 10:16

I think it would be cool if gamestudio supports capsules, since it are just
spheres and a cylinder. This might be a little more stable, and meaybe even faster than an ellipsoid.
I would suggest a feature request. laugh
Posted By: Frederick_Lim

Re: Collision, wtf - 07/13/10 10:56

Most moden physics engines include capsule shape as primitive collision shape.
http://developer.nvidia.com/object/physx_features.html
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Collision_Shapes

Since A8 will support PhysX, however it is not clear it will implement capsule collision shape or not.
Posted By: Frederick_Lim

Re: Collision, wtf - 07/13/10 11:02

Quote:
I dont like the way JCL responds.
Either no response, or some "I dont understand what you mean"
silly reply.


Agree, sometimes JCL respond is quite arrogant. wink
© 2024 lite-C Forums