forums

TNT Basic Forums > Programming Q&A
Hardware mode and collisions and sprite masks
< Last Thread     Next Thread >
Author
Thread        Post A Reply

07-04-2006 23:20

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

I made a small game - but my fps on 1.2 GHz eMac is about 6-12 fps.
on a 400 Mhz G4 6 fps is the max I get.
It runs fine on recent machines.
If I change to Window Hardware Mode I get 30+ fps on ANY machine.
BUT - some sprite collisions fail and certain sprites end up with
incomplete or spotted image masks.

Any ideas?

cheers

Barry

07-04-2006 23:59

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Code snippet please =) i can't read your mind to see what you're doing ;)

07-05-2006 00:02

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

or maybe screenshots of "incomplete or spotted image masks."... i'm not sure what you mean

07-05-2006 20:24

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

link to the screenshot is at: www.swagstuff.com/Bad_Mask.jpg

the red arrowa indicate problem areas.

This only happens in hardware mode. Thanks

07-05-2006 20:38

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

Sorry link should be: www.swagstuff.com/downloads/BadMask.zip

07-05-2006 20:39

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

ARRRRGH - really need to be able to edit posts


sigh - link is: www.swagstuff.com/downloads/Bad_Mask.zip



sorry

07-05-2006 23:37

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

ok... that's a bit weird :S

what's the sprite? is it a house sprite drawn onto a grass background, or is the ground part of the sprite? (i believe my first option makes more sense, but anyway it's better to ask ;)

what's your OS? i remember hardware mode had problems on my old computer (though on os X it's just fine)

please tell me what kind of mask you're using (color mask, or black-and-white image mask) are you compressing it in a specific format? i'm not sure TNT supports TGAs or TIFFs with included alpha channel, if you're doing it this way it might be the problem...

can i see the original image too, so that i can try?

for the sprite collisions that fail, i can't do anything without seeing code, sorry

07-06-2006 00:21

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

Thanks for your help - I really appreciate it :)
I have tried this on 4 different macs all using 10.3.9
my old 400 mhz G4
my 1.2 ghz emac
2 new G5's with 2 GIGs of ram

same result

I've posted the source at: www.swagstuff.com/downloads/nathanrsrc.zip

See what you think (PS any suggestions on cleaner code would be welcome)

cheers

barry

07-06-2006 00:48

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

I see what the problem is! you saved it as JPG... you should not do it because JPG sightly alters the color of the image and thus can ruin the color mask with colors that look similar to the mask color but that aren't. the reason it only happens in harware mode is because software mode colors are less precise, so the difference introduced by JPG probably wasn't sufficient to ruin the mask. however, hardware mode uses lots of colors so it did matter.


> See what you think (PS any suggestions on cleaner code would be welcome)

The game looks nice =) The code is a bit too small to talk of cleanness but you use a lot of procedures so i'm pretty sure you're not going to end up with spaghetti code :D

07-06-2006 00:51

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

by the way... your project was 4 mbs, with music, sounds, etc. here it's super friendly so there's no problem =), but try to strip down projects to the minimal necessary in demonstrating the problem before posting... many people won't want to help you if the project is too big or has too many lines of code, doing this also helps to narrow the problem faster ;) on other forums, if you don't do that, you might even get really nasty answers

07-06-2006 00:51

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

AHHHH - of course the solution is simple.... I'm a simpleton! :)

Thanks bunches! Appreciate it!

cheers

barry

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.