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.

Dark GDK / Issue with Sparky's - SC_GetCollisionSlide and 1.#QNAN00

Author
Message
curse
11
Years of Service
User Offline
Joined: 5th Feb 2013
Location:
Posted: 11th Mar 2013 11:47 Edited at: 11th Mar 2013 13:27
Another thread another problem.

From yesterday I can not use properly the function SC_GetCollisionSlideX (SC_GetCollisionSlideY and SC_GetCollisionSlideZ). The program freezes when it should go to place the object that collided.
The problem resides in the fact that SC_GetCollisionSlideX (SC_GetCollisionSlideY and SC_GetCollisionSlideZ) return a value of 1.#QNAN00. In the last day it worked, but since yesterday no longer works, and I do not seem to have changed anything. Is also very strange that if I use one object the function works, if I use two or more objects there is the problem. Moreover, if I use in the setup as the type of collision Collision box (2) two objects of the same type do not create problems, while 3 and more yes. When used as a kind of collision the Sphere collision (1) the problem is not created with an object, but with two or more objects.

In the image you can see that SC_SphereSlide return 1 (the terrain) but SC_GetCollisionSlideX return 1.#QNAN00.

Here some code.
Setup of objects



The function that move enemies (objects that collide with ground and which create the problem.



Have you have any solution?
Thanks!

Attachments

Login to view attachments
Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 13th Mar 2013 17:35 Edited at: 13th Mar 2013 17:43
"A bad real number is represented by all “1” digits in the exponent field. The fraction field
can be used to represent a large number of classifications of “bad.” Some compilers use
the symbol NaN to indicate that the result of the computation is not valid. Some also
distinguish two types of NaNs, a “quiet NaN” , QNaN, indicating an indeterminate result,
and a “signaling” NaN, SNaN, indicating an exceptional or error condition. For
example, for Visual C++ the float value of 0x7fffffff has the value, 1.#QNAN00
indicating a quiet NaN. It cannot be expected that the behavior of these classifications
will be standard across compilers."

From a source that I googled.
Basically this error happens when the calculations turn out to be a non-real number. I'm assuming in this case, something is making Sparky's divide by zero (or something else that is indeterminate). I would advice making sure that the collision detection is actually checking a difference between points and not just zero. I don't know how Sparky's does its math but if you divide by the distance when the distance is zero, you will get a non-real number.

Sorry I wasn't the biggest help, maybe that could help you find the issue.

Edit: Another idea is to check to see if the result is a real number. If it isn't then set it to zero.


Ventures of the worlds around us are limited only by our imagination.
curse
11
Years of Service
User Offline
Joined: 5th Feb 2013
Location:
Posted: 18th Mar 2013 17:17
Thanks for your support Qqlite.
However, a few days ago without changing anything, everything is back to work well. It is a very strange issue and I can not understand why.
Just a few minutes ago, the problem has come back, but with a different ground. I tried using the default functions of Dark GDK to build a ground from a heigthmap file and BlitzTerrain. Same issue.
By trying other grounds, the problem does not occurs.
Then I tried to use the "fault" terrain in another project, and it works correctly.
Kretaner
14
Years of Service
User Offline
Joined: 19th Oct 2010
Location: Crete, Greece
Posted: 27th Mar 2013 11:39 Edited at: 27th Mar 2013 11:40
Came back to update old source code of my project which used also Sparkys Collison and have different troubles, including that the code often freezes when I'm using 'SC_setupObject' with polygon collision (0).
Want to try it now with original Dark GDK collisions commands, which didn't work in older versions and what was the reason for me to use Sparkys Collision in the past.

These commands are working in the meantime with the October 2010 update ?

Thanks for a short hint before I try it and have to change a lot of code !

Login to post a reply

Server time is: 2024-11-18 21:35:29
Your offset time is: 2024-11-18 21:35:29