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.

Program Announcements / DBP Collision DLL v2.05

Author
Message
The Real Abaddon
10
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 21st Oct 2008 20:49 Edited at: 21st Oct 2008 20:55
Hello,
First thing i want to thank you for this dll it's superb.

I have a BIG problem with the dll, i`ve worked alot on my game and now i want to add some shaders but adding ShaderData.h and initializing it give an error which conflicts with this dll.

I`m in a real need of a fix.

This is the error which my compiler (Visual Studio 2008) throws:


I`m using the latest versions of GDK, VC++, SC.
zzz
13
Years of Service
User Offline
Joined: 13th Nov 2005
Location: Sweden
Posted: 22nd Oct 2008 16:36
Hi,
I have the exact same problem as The Real Abaddon. I made a thread
in the DarkGDK forum about it: http://forum.thegamecreators.com/?m=forum_view&t=138641&b=22&p=0

I'm also using VC++ 2008 express.

Van B
Moderator
16
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Oct 2008 19:18
Mr Johnston...

I'm sure I don't have to tell you how great this plugin is, in fact DBPro would not be the same without it, but there's just 1 thing I'd love to see in it. You've probably already said no to this at some point but I have to ask.

Could you add in a function to return the UV coordinates of the collision point?

I've had this idea for a couple of years that I want to try, and the maths behind it is simply beyond me (like most math!). I want to be able to paint a heightmap onto an object then build a normal map and update it in real time, but the key factor is being able to get the UV's from a collision point. I have a reasonably un-abused kidney going spare if you could look into this for us .


Health, Ammo, and bacon and eggs!
wh1sp3r
15
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 26th Oct 2008 17:54 Edited at: 26th Oct 2008 18:49
Van B: yeah, excellent idea !

Paul Johnston:
I have problem with ray casting, Can you have a look please ?

Source with media attached. Its few lines of code demonstrating my problem


EDIT: I using SC_rayCast now, and Its working

EDIT2: I have tried Dark physics for ray casting .... In DP, raycasting doesnt work correctly ! Its show bad positions, where raycast intersect. Your plugin works correctly

PS: Real programmers aren't afraid of math!.

AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio

Attachments

Login to view attachments
The Real Abaddon
10
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 27th Oct 2008 13:27
Mr. Paul Johnston can you please look into my and zzz problem that we have with the conflict betwen SC and DarkShader please ?
Thanks!
Paul Johnston
TGC Developer
16
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Oct 2008 18:31
Quote: "can you please look into my and zzz problem that we have with the conflict betwen SC and DarkShader"


I've put the global collision stuff in a SCCollision namespace, that should solve the conflict. I'm most of the way through a SaveData command that was requested at the convention so I'll do a proper new release when that's sorted. I've attached a recompiled lib for those that can't wait for the fix.

Quote: "Could you add in a function to return the UV coordinates of the collision point"


I think I know how I could do this, it would probably only work on texture stage 0, but I'll see what I can do.

Attachments

Login to view attachments
Van B
Moderator
16
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Oct 2008 18:52
That would be totally fine Paul - any additional textures made from it would use the same UV data, so whatever you can come up with would help a great deal.


Health, Ammo, and bacon and eggs!
The Real Abaddon
10
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 29th Oct 2008 23:00
Thank you for the fix but i have a problem..
i have this code

with the new library the collision is wrong, it responds like the object never been scaled down and i can't aproach the rocks and stay 2 feet away from them. Changing to the old lib it works again.
Paul Johnston
TGC Developer
16
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Oct 2008 00:05
Quote: "it responds like the object never been scaled down"


I changed all the setup commands to direct vertex access to match the setupcomplexobject command, mainly for setup speed. As a result of this all scaling must now be done after setup, and use SC_AllowObjectScaling to register it.

For ray casting there is very little overhead to allowing scaling (the ray is scaled to match the object being checked), but it makes it simpler that when using direct vertex positions the object has no scale applied during setup.
zzz
13
Years of Service
User Offline
Joined: 13th Nov 2005
Location: Sweden
Posted: 30th Oct 2008 16:57
Quote: "I've put the global collision stuff in a SCCollision namespace, that should solve the conflict."

Ah, great! Thank you very much!

The Real Abaddon
10
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 3rd Nov 2008 11:50
Adding SC_AllowObjectScaling and scaled it after the setup still didn't work. Here is the code and an image attached:

Attachments

Login to view attachments
Scraggle
Moderator
15
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 7th Nov 2008 13:32
Quote: "'m most of the way through a SaveData command that was requested at the convention"


Excellent news!

How is that going?



The Real Abaddon
10
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 20th Nov 2008 13:14
no fix ?
AlexI
14
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 25th Nov 2008 00:16 Edited at: 25th Nov 2008 00:17
Any chance you would be able to make sparkys support animated objects?

Sparkys only checks collision against the first frame, and my enemies are animated. It would be really appreciated if you could add this?

Thanks,
Alex

AlexI
14
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 30th Nov 2008 02:15
Also any chance you would be able to add a command to check weather an object has been set-up or not?

Lavalord7
12
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 30th Nov 2008 04:24
Do I need another dll? The "make object terrain" and similar terrain commands aren't lighting up.

CoffeeGrunt
11
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 1st Dec 2008 01:41
Quote: "Also any chance you would be able to add a command to check weather an object has been set-up or not?
"


Why not set a boolean when you setup an object, then make DBP check that?

AlexI
14
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 1st Dec 2008 21:18
Good idea Still it would be useful if it automatically did that

CoffeeGrunt
11
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 7th Dec 2008 15:09
True, but you gotta use work arounds sometimes lol....

revenant chaos
Valued Member
12
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 8th Dec 2008 08:32 Edited at: 8th Dec 2008 08:33
Hi Paul, Do you think you think that you could add commands to toggle the collision for objects by their group? Something like : SC_setGroupCollisionOff and SC_setGroupCollisionOn would be great additions to the plugin.
Paul Johnston
TGC Developer
16
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Dec 2008 19:57
Quote: "Adding SC_AllowObjectScaling and scaled it after the setup still didn't work."


Did you call SC_UpdateObject to update the scale for the object? If so email me the model and I'll take a look.

Quote: "How is that going?"


Really busy with other stuff at the moment, but I haven't forgotten about it

Quote: "Any chance you would be able to make sparkys support animated objects?"


I don't have any solid ideas on how to make it work so probably not. sorry.

Quote: "any chance you would be able to add a command to check weather an object has been set-up or not?"


Yeah, that sounds easy enough to do, I'll add it to the todo list.

Quote: "Do you think you think that you could add commands to toggle the collision for objects by their group?"


I don't remember exactly how group checks work but I'll see what I can do.
sindore
14
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 17th Dec 2008 14:41
why have I never got this befor today I dont know but this is the best collision system I've ever see in dbp, this should have bin added to dbps updates yeras ago.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
jason p sage
11
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Dec 2008 22:14
LOL - It is pretty darn cool isn't it? And I'm not sure of the status - but Paul was working on making it so you could save off calculated results.

Case and point: I make a huge terrain and I want raycast collision to serve as ground height function. I load the terrain and do all my processing (which takes time) to get normals set etc etc. It looks great.. NOW I tell Sparky About my Terrain... and wait... wait.. wait.. wait some more.. then finally eventhing is perfect! Ray Casts and collision are stellar!

So.. the idea behind what I'm talking about is that Paul was working on (maybe its finished) the ability to "SAVE" the information it processed on my terrain to a file.. so the next time you run the same game, the set up time goes all the faster! Because all the calculations have been done.

Now this isn't an issue for a couple models and a small terrain.. but as the game gets more complex - this is a NICE touch to make things load and get running all the faster

--Jason

sindore
14
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 24th Dec 2008 00:09
Thats kind of like what Dark Physic does, it makes terrain in to a static object and makes all calculated for you, you then use raycast to pick up on things like ground height.

although you don't need to be-cos things like ground height is automatic.

but sparkys collisions is cool, at the mo I'm working on DP free game, so I can make a basic online game.

that would be nice if terrains pre loaded calculations could be added to sparkys collisions.

raycasting in DP is ok but it would be nice to have a go with sparkys ray casting.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
GMS0012
12
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 26th Dec 2008 21:42
hi all

is there any comparable for the GDK . Net???
AlexI
14
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 29th Dec 2008 16:09
Hi,
I think there are some variables which are redefined in Sparkys that are used in DarkLights. Is there any chance you could rename them or check if there already defined?

Here's the errors I get when I am using both libraries:



Thanks,
Alex

Cash Curtis II
13
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 28th Jan 2009 14:34
Can we have the option to suppress collision error messages? Right now they crash the game.

I'm not advocating sloppy programming practices, but every now and then I get some strange collision error and the game dies (clearly my fault, not the DLL). Today an NPC tried to arm and disarm a table for some reason and crashed the game because when it disarms it removes the collision from the item. I was able to reproduce and trace that one but every now and then I get an error I have no idea how to reproduce. Plus, once I determine the game is finished, I'd just like to suppress any non critical error messages that I can.


Come see the WIP!
Paul Johnston
TGC Developer
16
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Feb 2009 02:49 Edited at: 9th Feb 2009 02:51
Check the first post for version 2.05:

-All setup commands now use direct vertex access, memblock commands are no longer required
-Instance objects can now be setup
-Slightly increased the distance the collision point is move off the plane
-Fixed some link issues with GDK version when used with ShaderData.lib
-Direct vertex access means any object scaling must now be done after object collision setup to be noticed
-Fixed a bug that caused sliding collisions near 0 on any axis would cause a sticky collision instead
-Fixed a bug where objects with multiple transformed limbs would not be recognised as transformed during setup.
-New command to save object collision data to a file (SC_SaveCollisionData)
-New command to load collision data from a file to an object (SC_SetupObjectFromFile)
-New command to change the error handling mode to one of: ignore,display,or quit (SC_ErrorMode)

Also added some help files for the new commands.
Mistrel
Retired Moderator
13
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 9th Feb 2009 05:56 Edited at: 9th Feb 2009 05:57
Thanks for the update.

Quote: "Can we have the option to suppress collision error messages? Right now they crash the game."


Paul, instead of providing a unique error handler for the DLL why not just return 0 (false) on actions that fail. Or provide a GetLastError and we can check it ourselves.

Paul Johnston
TGC Developer
16
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Feb 2009 15:40
Quote: "why not just return 0 (false) on actions that fail"


This would require all commands such as SC_SetupObject to have brackets around their arguments as they currently don't return a value at all. Not something I really want to do.

Quote: "Or provide a GetLastError and we can check it ourselves"


This is a good idea, and will probably make it into a future version at some point. Although I imagine calling the GetLastError command after every command to check for errors would get annoying.
Mistrel
Retired Moderator
13
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 12th Feb 2009 08:00 Edited at: 12th Feb 2009 08:22
Quote: "This would require all commands such as SC_SetupObject to have brackets around their arguments as they currently don't return a value at all. Not something I really want to do."


Isn't it possible to have two string table entries? One that returns a value and one that does not?

If DBP's syntax is getting in the way of extensible programming practices for the sake of saving a couple of brackets then something is inherently wrong with its design. Albeit it might be the programmer's fault for passing the wrong data but it should also be the programmer's responsibility to handle these errors gracefully when they occur.

Paul Johnston
TGC Developer
16
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Feb 2009 18:33
Quote: "Isn't it possible to have two string table entries?"


Actually I hadn't thought of that. As far as I know it is possible, I'll have to test it. But I still prefer the idea of having a GetLastError() as it requires less changes to the code.
Mistrel
Retired Moderator
13
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 13th Feb 2009 02:29
I appreciate that you're considering a solution. PureGDK users are not limited by DBP's syntax and benefit from being able to implement their own error handling routines in their code.

Sixty Squares
12
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Mar 2009 18:37 Edited at: 1st Mar 2009 18:45
Great job on the DLL Paul . I use it for all of my collision needs. Anyway, I was wondering-- is it possible to set an object's collision radius? For example, say I have two spheres of radius 10, but in collision checks I only want the radius to be 5. This would allow for some object overlap. Is this possible? If I use the SC_SphereSlide command I can set the collision check radius but the object that I'm checking against still uses its default radius.

EDIT: Hmm, would scaling the sphere to a radius of 5, setting up the object without allowing scaling, and then scaling it back to 10 work?

Thanks,
-Sixty Squares

Azunaki
10
Years of Service
User Offline
Joined: 11th Feb 2009
Location:
Posted: 3rd Mar 2009 04:14
where could i fnd a command list for this?
jason p sage
11
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Mar 2009 04:23
In the keywords ini file in the DarkBasic Pro folder there should be a file you installed that has them all. On My PC: C:\Program Files\The Game Creators\Dark Basic Professional Online\Editor\Keywords

Mr Bigger
14
Years of Service
User Offline
Joined: 31st Jan 2005
Location: was here!
Posted: 19th Mar 2009 23:51 Edited at: 20th Mar 2009 01:26
I am looking for away to remove all collision data, like a reset without rebooting the game.I delete objects and removeobject is not used at that time,on purpose.I then load a new level and setup the same objects.

If the old collision data is automatically removed when i set the new objects up using the same old numbers then its no problem,but if it doesn't...

Solution:


AMD 2600+/1GB ram/GeForce 6600oc 256MB/W2KPro/DBPro 6.6.b
abe
13
Years of Service
User Offline
Joined: 6th Feb 2006
Location:
Posted: 1st Apr 2009 14:26 Edited at: 1st Apr 2009 14:27
hi,
does DBP Collision DLL v2.05 support
sphere > sphere and sphere > polygon
dynamic collision = NGCollision plug in?
Uncle Sam
13
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 22nd Apr 2009 08:12
Sparky you genious! I didn't know this was out! You can set up instanced objects?!!!! YOU ROCK!!!!!!!!

KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 28th Apr 2009 00:25
Quote: "is there any comparable for the GDK . Net??? "


Saw this question on the last page, and wanted to make sure it didn't get skipped.

Paul, would it be possible to make this available for DGDK.Net?

DB PROgrammer
12
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 29th Apr 2009 07:27
I have a request. Could you make it possible to update one vertex on an object? Something like "sc_UpdateVertex ObjectNum, Vertex" or "sc_UpdateVertex ObjectNum, Limb, Vertex." If it's not possible it wouldn't be the end of the world, but if it is it would really help me.


DBPro, limited by the programmer.
Progressive new
10
Years of Service
User Offline
Joined: 16th Dec 2008
Location:
Posted: 13th May 2009 09:33
Hi paul

Very good job.

You can take a racing game? as is the acelerarion and brake smoothly in the collision of your code?

Thanks and regards

N3wton
9
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 4th Jun 2009 01:41
This plugin is just amazing my hat would be off to you, if i was wearing one!

Thankyou!

yours
N3wton

The Goldorak
14
Years of Service
User Offline
Joined: 29th Aug 2004
Location:
Posted: 14th Jun 2009 02:11
And once again I use an excellent plugin in my game !
Congratulation for your work Paul Johnston !


Darkbasic is great !
Duke E
10
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 15th Jun 2009 02:56 Edited at: 18th Jun 2009 10:55
Edit:
Seems i was wrong, using another (good) memory probe it seems the rapid growth is just a misrepresentation in Taskmanager .
Grows a little but it can just be written up to other variable accumulation.

Back on track, happy camper, truly an amazing and useful plugin, many thanks!

<---------
Great plugin, many thanks.
( Can't be without it so i hope this can be fixed in an update )



With the 2.05 & DBP 7.3 i noticed that it probably has a memory leak (have not rolled back to test the old memblock version yet).

I was rewriting stuff to prevent memory leaks in DP (more "ouch" there ) but i noticed my memory was eaten up anyway. On scene reset i have to remove or resetup the collisions. While in the main loop i reuse all objects so it's not noticeable then. The application has to be restarted eventually as it is now though.

Maybe a "clear all collisions" command like Mr Bigger suggested, but i suspect the leaked memory wont be returned by that.

Made a test program, two boxes colliding and getting removed, and a mode where it just uses sc_setupobject on the same objects again.
Check taskmanager...




Regards
Omen
12
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 4th Aug 2009 06:44 Edited at: 4th Aug 2009 06:48
Paul,

The new version of SC doesn't seem to correctly read object scale (although translation and rotation are fine) under dbpro 7.4.

Sample code below to demonstrate the problem - notice the bounds are the object's original size instead of the correct smaller size. Testing in-game also verifies that the bounds drawn do represent where the collision volume was created :/

I have attached a model file I'm using for testing.



Attachments

Login to view attachments
dark coder
16
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 4th Aug 2009 08:31
You must scale objects to 100%, apply the collision, enable scaling on the object then finally scale it and call update on the object for scaling to work.

Omen
12
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 4th Aug 2009 21:16
@dark coder,

That works for original objects, but it still fails for instances :/



dark coder
16
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 6th Aug 2009 17:57
Quote: "That works for original objects, but it still fails for instances :/"


It works for clones too, I E-Mailed Paul a few days ago about this and a few other things so I guess he's aware of it. Dunno if we can expect any updates VV.

OldPMan
TGC Store Seller
10
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 15th Aug 2009 14:37
maximum object id 100000?

forall

Login to post a reply

Server time is: 2019-03-27 01:59:47
Your offset time is: 2019-03-27 01:59:47