forums

TNT Basic Forums > Programming Q&A
Best picture size for Genesis?
< Last Thread     Next Thread >
Author
Thread        Post A Reply

01-02-2006 12:26

Posted by:
NickFalk

Location:
Oslo, Norway

Find more posts by NickFalk

Hi there, just starting to experiment with tiles. When I use a picture as a basis for the tiles all the tiles are jumbled up so that it can be quite hard to sort out what tiles belongs together.

Is there a prefered width/height size/ratio to be used for the pictures to prevent this from happening?

Thanking you in advance! :)

01-02-2006 19:57

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Not really...

The picture is cut up from top left, working right until it hits a boundary when it moves down a row and starts again... If you want to keep them together you could cut them like this in an art package and place them in order. Alternatively you could work with tiles which are all the same size (I assume yours aren't) and just place them in the tileset in the right order.

When thinking about coding using your map you should keep all tiles a 'power of two' high and wide (16, 32, 64 etc.) as this makes collisions faster, you can 'bit shift' the X and Y values to check rather than perform integer division, and the speed increase is quite considerable.
Apart from that though, it's up to you.

How did they do the other night by the way? ;)

Danny (nods)

01-02-2006 20:08

Posted by:
NickFalk

Location:
Oslo, Norway

Find more posts by NickFalk

Thanks. I planned to use 16x16 tiles and would probaby work with something like 64x64 in Photoshop and then put all the different parts into one image in the end.

All went well the other day. Crouch scored (again) 1-0 . Their goaly was man of the match and I got drunk alright. (Or so they tell me).

Unfortunately I don't have any beer left, too bad, as we finally stopped our winning streak with a 2-2 draw at Bolton today. Oh, 10 wins in a row isn't too bad I guess. :) Sort of reminds me of how it used to be...

01-03-2006 13:32

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Good stuff...

I know diddly about footy me... I'm a Gooner 8)

(American translation: I am unaware of the complexities of soccer as I follow a team called Asrenal)

Danny (nods)

01-03-2006 13:34

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Arsenal Even...

Doh!

01-03-2006 15:04

Posted by:
NickFalk

Location:
Oslo, Norway

Find more posts by NickFalk

Well I'll be sharing the Gunners tonight that's for sure! Good luck! ;)

01-03-2006 19:57

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Cheers...

I'll get the beers in...

Danny (nods)

02-27-2006 07:25

Posted by:
goober doober

Find more posts by goober doober

"When thinking about coding using your map you should keep all tiles a 'power of two' high and wide (16, 32, 64 etc.) as this makes collisions faster, you can 'bit shift' the X and Y values to check rather than perform integer division, and the speed increase is quite considerable."

Danny (nods)


=========


HI Danny,

Could you explain , with possible example how you implement bit shift operations for sprite collisions.

Currently my sprite collisions are done is the following way :

collision = sprite col ( 2,0 to 100)

if collision > 0 and sprite image (collision)=7
sprite off (collision)
play sound (1)
etc etc .....
end if

The sprite collision is handled by the TNT function so I don't do any bitshift operations. I am currently using tiles that are 50 pixel square . Or are you talking pure about tile collisions rather than object collisions ? i.e are you are talking about interacting the character(s) with the tiles ( eg . bumping into walls )


02-27-2006 09:17

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

I am talking about background or maps, yes.

The bit shift theory is used for collisions with backgrounds. It simply makes the division of the X and Y co-ordinates faster. At the moment you would divide by fifty to find out the row and column indices in your map structure, if you made the tiles 64x64 then you could bit shift by 6, which is considerably quicker.
The TNT sprite collision calls are pretty quick, but you can 'pre-flight' them a bit to speed up the process. Prior to performing a collision check you could see if the 'abs' difference between the two hotspots is less than or greater than the size of a sprite (plus a bit). If it's greater then you can skip the call, the integer check is quicker than a collision check, and as such can save you a bit of time if the two images are too far away from each other to warrant a more precise check.
Hope that helps...

Danny (nods)

02-27-2006 09:58

Posted by:
goober doober

Find more posts by goober doober

They both sound like a good ideas. I especially like your sprite pre-check collision ideas ... thanks Danny , I'll give them a go .

Oh, does anyone know if there is a parallax scrolling example still available anywhere ? The link to the one posted on the examples page ( http://tntfiles.site.voila.fr/ ) is a dead link now days.

02-27-2006 16:37

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Try this for size goob...

Click here. A little bit of code from JAS, should cover what you're looking for.

Danny (nods)

02-28-2006 23:15

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

>>
Oh, does anyone know if there is a parallax scrolling example still available anywhere ? The link to the one posted on the examples page ( http://tntfiles.site.voila.fr/ ) is a dead link now days.
>>

I still have the parallax scrolling demo on my computer, but have no more hosting for it. If i could host it here, or anywhere else, i could send it again. Or i could send it by e-mail if you wish

03-01-2006 00:55

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

I'll host it on my website.
Just email me the file.





< Mail

03-01-2006 00:59

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Oh...

And check out my website: TNT Basic Files

03-02-2006 13:37

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

It's on there now.

03-04-2006 08:15

Posted by:
goober doober

Find more posts by goober doober

Thanks heaps guys !

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.