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
Rainbow Evil
14
Years of Service
User Offline
Joined: 31st Mar 2010
Location:
Posted: 31st Mar 2010 22:30 Edited at: 1st Apr 2010 01:22
How do you install the Dark GDK version?

Sorry about the double post - my first didn't come through and it was only after I posted this one that I saw the message saying it needed moderating.

good things come to those who rate!

"I hate you all" - Simon Nicholls
Serge Adjo
18
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 4th May 2010 14:59 Edited at: 4th May 2010 16:32
I'm using Sparky Collision along with DarkAI, but I get the following problem:
-I use SC_setupObject to activate collisions on the 'enemies'
-Then I let the 'enemies' move around and hunt the player...
-Then: The collisions seems to stay at the same place and they don't follow the 'enemies'
- consequence: the player can't actually shoot at the 'enemies' but if he shoot at the place where 'SC_setupObject' was used, he will 'hit the nail on the head'

I don't know if you get the same kind of problem... but I really need help please!

EDIT !!! EDIT !!! : Thanks to @HowDo the problem is resolved ! I just didn't noticed the SC_updateObject command! there is no problem, no longer

Marth Koopa
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 19th May 2010 10:11
I love this collision DLL, makes this crazy easy, but I have one slight problem that I would like to try and fix.

Using the spherical collision in your example, the character is completely round, which makes it look like you're REALLY short and REALLY fat when bumping up against walls. What would be a good way to make it so the player's collision is taller than it is wide?
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 19th May 2010 16:18
HI,
I asked a very similar question a while ago:

http://forum.thegamecreators.com/?m=forum_view&t=117216&b=1

Cheers.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th May 2010 18:16
Make a sphere, scale it to envelope your character/object, adjust the scale on the X, Y and Z axis to fit around your character/object tightly.

Then hide the sphere, attach it to the character/object, and set up polygon collision on the sphere object.

The sphere doesn't have to be high poly, and so it's just as fast as using sphere collision, just more accurate in relation to your object.

Kryogenik
15
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 28th Jun 2010 14:52
Really simple question. Is this plugin direct x 9.0c relient? I use an older DBPro version so people who play my games don't have to install direct x 9.0c, but would they have to if I used this? I'm having some trouble with Sparky's v1. Thanks.

cout<<"I'm learning C++, and this is all I know \n"
Rainbow Evil
14
Years of Service
User Offline
Joined: 31st Mar 2010
Location:
Posted: 8th Jul 2010 01:28
Does anyone know how the ray-casting stuff works because I am looking for something similar for my Dark GDK game but in a 2D sense - I have created an A* pathfinding algorithm which is based on nodes and connections but some of the connections need to be dynamic such as connections between units and nodes which will change as the unit moves across the map. This needs to be done in 2D because, like a height map, impassible zones are mapped in 2D.

Any help on this matter would be greatly appreciated, thanks in advance.

good things come to those who rate!

"I hate you all" - Simon Nicholls
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 28th Aug 2010 13:39
I'm having some issues with rotating objects on the x- and z-axises; the collision mesh only seems to update to the y angle?
Or am I doing something wrong?
(Using the complex setup routine).
Any further information on how to go about such rotation would be greatly appreciated

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Aug 2010 20:13
@Rudolpho - I haven't had the privilege of coding in DBP lately, but I thought maybe I'd ask a question or two; I'm hoping memory serves me correctly.

For example: are you sure the collision mesh is only updating on y? And how do you know for certain? I ask because if memory serves me correctly there are a couple things that might help you even if I don't recall the exact commands/syntax.

1: I believe there is a function that can be used to toggle the collision mesh to a visible state so you can literally see what it is the DLL is basing it's collision on.

2: There are calls in the DLL that need to made ( I forget if every loop of only after you do a certain thing.. move rotate etc) but these functions update the internal information that collisions are based on. It MIGHT be that your collision mesh(s) are simply not where you expect from a simply missing function call. I don't know for sure (though feel pretty spot on about the concept being correct)

3: I've noticed in versions I 've used that AFTER a scaling maneuver on your object, things can get dicey. For example, for collision to work in some cases when I wanted to scale... I had to

A: Load a mesh/model
B: Make a copy of the mesh in a MESH OBJECT using a DBP command that can pull a mesh out of an object.
C: RESIZE that Copied MESH (not the original Model)
D: REPLACE the model mesh with my copied+scaled mesh.
E: NOW introduce to the collision DDL and all was well.

this obviously can cause potential appearance issues like textures losing their positioning for complex models with multi textures and potentially layers.. But the idea was that the collision DLL didn't recognize the scaling and this procedure kinda forced the issue.

Now here is where I get a bit fuzzy. I recall that SOME models NEEDED this approach and others didn't. I forget what the general rule of thumb was. It might be that COMPLEX SETUP required this extra prework while basic box and cube type colliion objects didn't ... I forget.

But I hope this post helps ya, gives you and idea, some fodder for googling or at a minimum prompts someone who knows better to comment and make everything I said moot!

--Jason

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 29th Aug 2010 00:25
Thank you very much for the elaborate post

In order to know for certain how the collision mesh looked, I used exactly the approach you described in (1)
(I also found that the drawn mesh did indeed correspond well to how my character was hindered by it).

I read about the mesh remaking workaround in some previous posts and was thinking of trying it out, but haven't gotten around to it quite right. Hopefully it will solve the issue (seems like that could well be it from the rest of your posted recollections).

I've been looking over the documentation quite a few times and the only relevant bounds updating functions I've found are sc_updateObject and sc_allowObjectScaling; I'm calling the first one when appropriate, and I've tried setting the scaling flag both on and off without any differing results, so that shouldn't be the issue.

Anyway, I tried using standard polygon collision just now when you mentioned the complex setup being a possible issue... and it worked! So at least there is that
I'll look into the mesh replacement fix later and hope it will work (for now the standard polygon collision is good enough as I'm only using this approach for a few, not too high poly-count obstacles scattered around a small concept demo multiplayer level).


Again, thank you very much for your reply
Rudolpho

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Aug 2010 19:55
Glad to be of help - your methodical approach will get you to the bottom of this if you continue to stay the course. These are those areas where things get kind of tough and sometimes the only solution is RESEARCH and (test)Development so see what is the cure - and then to implement it systemically through out your system/game/code whatever.

Sometimes ... actually often I make little sub projects that can recreate the issue, solve it there.. and then implement into the "real code" once I got it figured out.

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 7th Dec 2010 14:43
I can't compile my game with sparky's collision.
it say serror C3861: 'SC_objectCollision': identifier not found
I included the header in the code, and copied the lib and the header in the game creators folder(dark gdk). What can I do?
I'm using visual c++ 2008 express edition.

Forward thanks.
Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 8th Dec 2010 10:46
@Yero: Pay attention to the error: It says it can't find the function/identifier, the first thing you should check is did I wrote it right, the answer in your case is No. You have SC_objectCollision, it should be:

SC_ObjectCollision(int obj1, int obj2);

...notice the 'Object'.

Good luck with your project.

Greets,

RedEye

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 8th Dec 2010 20:24
Thanks alot RedEye, it was useful.
lean
13
Years of Service
User Offline
Joined: 18th Dec 2010
Location:
Posted: 24th Dec 2010 03:16
hello, i'm having a weird problem when using the sc_drawobjectbounds command with a loaded model, what happens is that when the bounds are drawn they aren't aligned with the object, instead their Y position is greater than objects Y position. The weirdest thing is that the collisions DO work, so the bounds are set in the same place as object, they just seem to be shown in the wrong place.

a link to the thread where i gave more details about the problem:

http://forum.thegamecreators.com/?m=forum_view&t=179239&b=7&p=0&pd=y

i can't find any logic solution to this problem, so i think it could be a bug.
Sty1emonger
13
Years of Service
User Offline
Joined: 18th Dec 2010
Location:
Posted: 28th Dec 2010 09:16
I think I'm experiencing a similar issue to the one above. I bought some FPSC models hoping to import them into a Dark GDK game, and when I call DrawObjectBounds, the result is all over the place. (Note that unlike the poster above, collision is working only where the bounds are showing.)

See the image attached. It's awesome, I know ... Anyway - three models from the Fantasy Pack loaded in great, but when I call DrawObjectBounds, it's pretty clear something's off. (I used the exact same code to load each of these models onto the screen.)

So, is this a known issue with FPSC models? Or am I doing something wrong? (I'm extremely new at this, so it's very possible.)

If it is the models that are the problem, what are my options? Other collision algorithms? Or, if there is a way to clean up the models, how would I do that?

(Ir?)relevant code, if you wannit:

Attachments

Login to view attachments
Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 28th Dec 2010 20:04
Is there box or other types of sliding collision other than sphere?


revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 29th Dec 2010 15:44
lean and Sty1emonger:
If you guys are trying to load an animated model and setup collision for it, it wont work. You have to create objects for each of the models limbs, setup collision for them, then move them with the object's limbs. This takes a bit more work, but it opens the door to things like detecting/dealing character damage (headshots, etc..).
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 30th Dec 2010 08:51 Edited at: 30th Dec 2010 10:44
sc_setupcomplexobject doesn't seem to work with Evolved's LODTerrain functions from his Advanced Lighting kit. Has anyone ever used the two in conjunction?

I also tried using sc_setupcomplexobject with Blitz terrain and it caused the application to crash.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 1st Jan 2011 15:22
Quote: "I also tried using sc_setupcomplexobject with Blitz terrain and it caused the application to crash."

Did you create objects for each of the terrain's "Sectors" and setup collision for them?
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 4th Jan 2011 06:48 Edited at: 11th Mar 2011 16:12
Quote: "If you guys are trying to load an animated model and setup collision for it, it wont work."


Can't say that I agree with this 100% of the time. I have used Sparky's with a number of animated models and it works great and the object bounds are drawn correctly. However, a few models work like what has been mentioned previously. I have tried moving the model around in Milkshape and re-exporting it, to no avail. I've tried offsetting limb 0 to no avail. I've tried offsetting it when I export it, also with no luck.

EDIT: I think I figured out the problem (works for me anyway).
When the model is created, the very first joint needs to be at 0,0,0. I made the model that had this problem with the first joint at the bottom and worked up from there. When I re-rigged it, the new model had the sc_drawobjectbounds working correctly.


Post edit: I wonder why this thread was never made a sticky. (??) It is essential to programming with DB Pro and most everyone uses it.

gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 7th Jan 2011 05:23
hi I tryed to compile "Zombies"
the first posting of it
I've not looked though other posting to see if there were fixes
or updates and I do have the addon "Sparky's collision DLL"

the first error happends in "Zombies.dba"
in sub file "Variables.dba"

Compilation Failed. Variable
'Message' name is not valid at line 928.

" Global Title As String"

the second on happends with in the server part "ZombiesServer.dba"
sub file "Variables.dba"

Compilation Failed. Variable 'Message' name is not valid at line 1339.
" VelY As Float"

I've got the last working verion of DBP 7.5
and it's tweeked and has quite a few addons

any one got and idea why this is happending ?

If a thought is Just a thought ~ so whats the main thought ?
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 2nd Apr 2011 21:07
if you ever possibly made another version. A box cast would be fantastic

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 9th Apr 2011 13:48
Someone suggested somewhere (!) (and I can't find the relevant thread anymore) that you could use commands in SC collision plugin to ascertain the particular limb [number] of any particular object under the 2d coordinates (ie. x,y 2d screen coordinates)....

Does anyone know anything about that? Is it something to do with raycasting?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 9th Apr 2011 17:05 Edited at: 9th Apr 2011 17:18
Hi Duffer,we had this chat ages ago when i found this solution to picking limbs with sparky´s

http://forum.thegamecreators.com/?m=forum_view&t=166160&b=1

You put me on to a plugin,think it was one of the DK ones but either solution seems to work,just depends on the operating system as i seem to recall having problems with the DK plugins when i switched to vista/7
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Apr 2011 19:05
paul5147

nice work ;o)
it works fine on Windows xp Pro sp3

how ere you able to figure out what the problem was ?

If a thought is Just a thought ~ so whats the main thought ?
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 9th Apr 2011 19:51
Hi Resourceful,
It was a major problem in a small app i was working on (3d texture painting),i had asked quite a few times in different threads if this was possible and got very little in the way of an answer that worked,until i solved it with the sparky´s method of raycasting objects,it returns more than just a hit or miss.
Once i posted this code then got 3 answers about how to do it different ways,just like police men,never there when you want one.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 9th Apr 2011 21:25
@ paul5147,

Thanks for that. Had forgotten that chat on forum a fair while back.

Ironically, as you will see from the DLL posts, I am looking again for a version of DKShop/DKAVM which is compatible with u7.7+

I've actually found versions of DKShop/DKAVM compatible with all versions of DBPro up to u7.6 (but not u7.7) - see the first upload at the following link:-

http://forum.thegamecreators.com/?m=forum_view&t=183884&b=18

the advantage of the dk pick limb (aside from speed) is you can look at a number of objects and also only limbs between limb x and limby...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Apr 2011 12:34 Edited at: 10th Apr 2011 12:39
@ paul5147,

Any chance you could post code for just a function to pick a limb, something like:-

result = PL_Pick_Limb(2DScreenX, 2DScreenY, ObjectNum, StartLimbNum, FinishLimbNum)

where result would return -1 if not over any limb, otherwise the limb number of the limb that is hit (under the 2d screen x and y), 2DScreenX is any x-coordinate in 2d on the screen with the current camera, 2DScreenY is any y-coordinate in 2d on the screen with the current camera, StartLimbNum would be the first limb to start checking from (0 being the lowest), FinishLimbNum would be the last limb in the object to check for a hit, capped at the total limb numbers for object...?

[edit]

I should say, I am then looking at using purePlugin to create at least one command when I've seen the code...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 10th Apr 2011 15:16
@Duffer
Ill look into it for you,cant see why not,the function is fairly simple that finds the limb number so it should just be a matter of adding in a few checks.The hard part is converting the 2d screen co-ordinates to 3d to do the raycast.It never seems that accurate using the pick screen commands for some reason?
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 10th Apr 2011 16:32 Edited at: 10th Apr 2011 17:18
@Duffer
Quick bit of code for you to try,like i said though the pick screen comands seem a bit off somtimes resulting in the ray missing the object,you will know when this hapens as the red target marker will dissapear,give it a go and let me know if its ok for you.

:Edit
Altered the above code slightly to get around the pick screen problem i think.Try it and see what you think Duffer
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Apr 2011 20:25 Edited at: 10th Apr 2011 20:28
@ Paul5147,

Will give it a whirl and let you know - thx

[edit]

have tested - the limb numbers for the various objects seem off a little - some obvious limbs return -1....?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 10th Apr 2011 20:53
@Duffer
You did notice i set the limits for limbs like you asked for in that code snippet,so that the tiles/blocks would only return the limb number if it was between the set values or else it would return -1,if you do the test with the limits set 0 to 2 for the blocks and 1 to 16 for the tiles it does return all the limbs that are there.Or at least it does for me but im still on u7.5,not tried this on anything higher.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Apr 2011 20:58 Edited at: 10th Apr 2011 21:15
@ Paul5147,

In the words of Socrates, Doh!

[edit]

works a treat!

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 10th Apr 2011 21:22
Thanks Duffer,what are using this for if you dont mind me asking?
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Apr 2011 21:31 Edited at: 10th Apr 2011 21:33
the above works with both u7.6 and u7.7rc6 (windows vista 32bit)

shame we have to call sc object setups outside the function but still it saves loads of time and effort - thanks!

is there an easy leap from this to grabbing vertices at the collision point? (ie for the purposes of identifying them, pulling them towards the camera, away from it?)

[edit]

using for a couple of projects - still aimlessly trying to stitch unstitched limbs by [altering] number/name -

then it's damn useful for animation - ie. know which arm is struck by the arrow, that sort of thing...

[edit]

post your pl_pick_limb to code snippets as well....

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 10th Apr 2011 21:50
@Duffer
Using Sparky´s will get you the face hit on the object but not an actual vertex,ie you have 3 to choose from for every face hit,but with some simple maths you can get the ray cast collision point from sparky´s which is were the marker object is positioned in my code,and compare it to the 3 vertices to see which is the closest.I use this method in a lot of my projects as once you have a vertex number to work from you can do all sorts of things,like scorch the texture at the same uv position as the vertex data,as long as your objects dont share textures you can have permanent bullet holes,tyre tracks or whatever you want,or as i was usimg it for,3d painting.I even made a basic light mapper from it that altered the actual texture files so you didnt need to use seperate texture layers and the set blend mapping on command.
If you need some more help on this i can post up some more code later or do a search on my user name for some of my other posts,i think it was under something like "uv painter"
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Apr 2011 21:55 Edited at: 10th Apr 2011 21:58
@ paul5147,

That would be great - I will have a squiz over the boards for the uv painter using this method... also, couldn;t you use it to pull the vertex in question towards/away from the camera? (ie reshape object meshes?) as well as painting them>?

[edit]

here's the link you were on about:-

http://forum.thegamecreators.com/?m=forum_view&t=170444&b=8

[edit]

although can't glean the painting code from that link...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 10th Apr 2011 22:06 Edited at: 10th Apr 2011 22:24
@Duffer
Yes you can,just be aware that different types of objects use different ways of storing the data in the vertex buffers,so just moving one point may work on some objects,ie all the polies that use that point would be affected so the surface would be unbroken,others do not and you would have to search all the vertex data to find shared points.
There is another solution to this thats called vertex welding,this does the search once for all the shared points and basicly builds another object out of the data that can then be edited more easily,it is tricky to do,but not impossible.
[EDIT]
UV Painter code,bit messy,but shows the principals of it.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 11th Apr 2011 20:38
@ paul5147,

Thanks for that. Will steer clear of vertex manipulation on limbs for no - I know when I'm beaten re the code...

Still, think I can make use of the UV painting code!

Thanks again.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...

Login to post a reply

Server time is: 2024-11-23 08:17:30
Your offset time is: 2024-11-23 08:17:30