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.

Newcomers DBPro Corner / Collision with .X world object

Author
Message
Phoenix King
16
Years of Service
User Offline
Joined: 21st Sep 2008
Location: United States
Posted: 21st Sep 2008 19:55
I'm a novice when it comes to programming, and I've been working on a game in which you're a spaceship that can fly around, rotate in any direction, and shoot. I've done most of the basic stuff but I can't seem to get the collisions with the world object working. It's a .X file and whenever I use the built-in functions like Object Hit or Object Collision, it seems to collide with the world in places where it shouldn't. I've looked at Sparky's Collision DLL but it looks complicated and I don't need sliding collision, just to have the spaceship explode when it hits it. Can anyone help? The project file is attached. Any help is much appreciated.

Play my games made with Game Maker at http://www.yoyogames.com/members/pichupower2

Attachments

Login to view attachments
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 21st Sep 2008 20:55
The problem is that you're using box collision. That means that DBP is basically placing your terrain in an appropriately sized box, and if you hit the box then it'll register as a collision. You're gonna wanna use Sparky's collision regardless of it's complexity because polygonal collision in DBP is inefficient, and with Sparky's you can use something like SC_SetupComplexObject( ) which will do better collision while still maintaining a decent framerate.

90% of statistics are completely inaccurate.
Phoenix King
16
Years of Service
User Offline
Joined: 21st Sep 2008
Location: United States
Posted: 21st Sep 2008 22:22
I tried using Sparky's DLL, but every time I run the game it closes right after I press the "Start" button. I did like the Readme said, I put the DLL in the plugins-user folder, and I wrote the code like the syntax is. Am I missing something here?

Sorry to bother you again but if you know the answer that'd be really helpful. 10 is the world object number, 1 is the player.

Play my games made with Game Maker at http://www.yoyogames.com/members/pichupower2
Phoenix King
16
Years of Service
User Offline
Joined: 21st Sep 2008
Location: United States
Posted: 22nd Sep 2008 00:33
(I tried posting this earlier but it never went through)
I tried using Sparky's collision, but when I use it the game just closes as soon as I press Start on the menu. I did like the Readme said, I saved the DLL in the plugins-user folder and I used the correct syntax, so I don't know what's wrong.

Am I doing something wrong here? I'm sorry to bother you but any help would really be appreciated.

Play my games made with Game Maker at http://www.yoyogames.com/members/pichupower2
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 22nd Sep 2008 00:38
you could use an intersect object routine to check distance from map and trigger death when so close to hit it

Phoenix King
16
Years of Service
User Offline
Joined: 21st Sep 2008
Location: United States
Posted: 22nd Sep 2008 01:00
Thanks Scorpyo, it works but it's just really slow.

Play my games made with Game Maker at http://www.yoyogames.com/members/pichupower2
epithika
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: Music composer for games
Posted: 22nd Sep 2008 22:30
i think it would work if you didnt make any collision boxes or use any DLL's

if 10 is the world object and 1 is the player i think you could use:



Phoenix King
16
Years of Service
User Offline
Joined: 21st Sep 2008
Location: United States
Posted: 22nd Sep 2008 22:51
I tried that originally, the problem is DBPro uses a bounding box for the world object, so you die even when you don't hit the actual object. I would like to get Sparky's DLL working because the intersect object routine is too slow, but I don't know how to make it work.

Play my games made with Game Maker at http://www.yoyogames.com/members/pichupower2
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 22nd Sep 2008 22:55
Slow?
I get 350 fps ( setting sync rate 0 )
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 22nd Sep 2008 22:56 Edited at: 22nd Sep 2008 22:57
Quote: "Slow?
I get 350 fps ( setting sync rate 0 )"


Well, for now, but if you planning on making it into a full game you're gonna need AI, physics, and several aspects that WILL make it slow. And 350FPS is slow for what you're doing. Moving a simple model in a terrain for me will get roughly 1500 FPS. If adding collision slows it down by 500% you're doing something wrong.

90% of statistics are completely inaccurate.
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 22nd Sep 2008 23:08
dunno
on 1 project i am working at i still get between 25 to 35 fps with 50.000 polygons on screen( 1 AT terrain, 2000 trees,100 vehicles, several buildings and many intersect collision routines - vehicles to vehicles, vehicles to trees,vehicles to scenery,plus a bit of AI, all at once: And I still have to put in place the timing routines and code optimization).
Specs: Sempron 3000+, geforce 7600 GT.
At this point I wonder what his specs are
Phoenix King
16
Years of Service
User Offline
Joined: 21st Sep 2008
Location: United States
Posted: 23rd Sep 2008 01:35
Even when I set Sync Rate to 0, it's still really slow. The FPS was around 16. It wasn't nearly that slow before. I'm pretty sure this is the code you gave me:

If I'm doing something wrong, please let me know. In the meantime, if anyone knows how to use Sparky's...

Play my games made with Game Maker at http://www.yoyogames.com/members/pichupower2
Random color object
16
Years of Service
User Offline
Joined: 14th Aug 2008
Location: Montreal Canada
Posted: 26th Sep 2008 21:45
Just get yourselve Dark Physics it make good collision on .x

-Win XP SP3 -P4 3go/Ge Force 9600 GT driver 178.13
PhysX 08.09.04
DBP + Dark A.I. + Dark Physics + Easy Rotate + enhancement + Sprite Packe
Phoenix King
16
Years of Service
User Offline
Joined: 21st Sep 2008
Location: United States
Posted: 26th Sep 2008 23:59
Maybe Dark Physics would be the best, even though it's expensive, and maybe I could get it along with Dark A.I. so it's cheaper. Hopefully I won't have a problem with DLLs again.

Play my games made with Game Maker at http://www.yoyogames.com/members/pichupower2

Login to post a reply

Server time is: 2024-11-25 17:49:30
Your offset time is: 2024-11-25 17:49:30