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.

DarkBASIC Professional Discussion / will this be fixed in a future patch?

Author
Message
Flashing Blade
23
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 30th May 2003 18:04
I just need to know if the sprite collision functions are gonna be made pixel perfect in a future patch.
I aint complaining or saying it should be done soon - its just I need to know if it is planned.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 30th May 2003 18:18
I very much doubt it - you would need to compare all the pixels in the visible area with the pixels in another sprites, which would be rather processor intensive...

There is alternative (this was used on the Archimedies computers, so it may be too processor intensive here) - effectively you XOR the pixels...

On the PC this would about to creating 2 new bitmaps, pasting each sprite on the each of these and then doing an XOR and then look to see what pixels have been changed...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 30th May 2003 18:27
DBPro really should do collision detection on a masking system but alas - PCs just aren't Amigas. If they where we'd have called sprite offset 'hotspot'

I wonder if you did a rgb(128,128,128),0 mask of your sprites then pasted (on a background screen) the collision test masks over each other with alpha - then read off each dot's rgb value?

Personally i'm not convinced such accuracy is really needed, an x,y,size zone or two around each sprite is more than sufficient in most cases.

Pneumatic Dryll
Flashing Blade
23
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 30th May 2003 18:45
Personally i'm not convinced such accuracy is really needed, an x,y,size zone or two around each sprite is more than sufficient in most cases.


yes usualy, but heres my problem:
in the first level of my game there's a couple of mountains which i did 3 or 4 collision boxes on, not to inconvinient. In the 2nd level the terrain was pretty square so no prob.
Now i on the 3rd level and there's these big easter island type faces spitting bullits. Each head needs 3 collision boxes. Now when you shoot one it blows up and becomes a pile of rubble that requires 1 collision box of different proportions. So when it gets shot i gotta turn it to ruble, destroy the 3 collision boxes and make a fourth.
Now this aint hard or brain taxing and it don't affect game speed - its just something i don't need to do if i know we gonna get pixel perfect collisions.

I do believe DBC had it, and I know Blitz has got it.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 30th May 2003 19:11
DBP uses 3D plains to do sprites, unlike DBC and Blitz. This means that sprites are very fast, but DBP only detects collisions between the edges of the 3D plains.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 30th May 2003 19:37 Edited at: 30th May 2003 19:41
Would creating, pasting sprites onto these new bitmaps, XOR'ing and then deleting bitmaps create a significant time-delay ?
I presume it would really... However, time could be saved by having a bitmap attached to each sprite when loading/creating/scaling etc. Thus the creation & deletion part wouldn't be needed.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Flashing Blade
23
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 30th May 2003 20:32
@ Rob K
Ahhh I see. Didn't know that.

So as the bible says DBP giveth and DBP taketh away
ie we loose pixel perfect collision but gain stuff like rotate sprite.

Login to post a reply

Server time is: 2026-07-11 11:42:23
Your offset time is: 2026-07-11 11:42:23