aiaxna
Would you like to react to this message? Create an account in a few clicks or log in to continue.


XNA Development Group
 
HomeLatest imagesSearchRegisterLog in

 

 Tileing...

Go down 
2 posters
AuthorMessage
Koga73
Sober



Posts : 3
Join date : 2008-05-04

Tileing... Empty
PostSubject: Tileing...   Tileing... I_icon_minitimeThu Jun 05, 2008 8:57 pm

Hey its AJ
For those of you who dont get how tiling works, Ill try to explain it a bit here.

First of all, why even use tiles?
Well, tiles provide an easy way to detect collision, and keep file sizes down by reusing pieces. If there was one big image, how would the character react within it. (there are ways of corse). A big image is undesirable however, because if a change is needed the entire image needs to be changed opposed to a single tile. In a sense, tiling allows you to "create" a map rather just using a big image.

But... collision detection sucks!
There are ways to improve collision detection with the tiles. Besides basic bounding box collision with the tiles, angled collision is a possibility along with using 'getPixel' and checking for alpha spots.
The alpha method works, but performance can be slowed down when having do a MINIMUM of 4 point checks per object. We can, however, play around with this and see what kind of performance we can get. Reguardless of whether this will work to our needs or not, tiling will still be used.

So how does tileing work?
Basically, inside each map is a grid. Each grid spot contains one tile space. When making the map, whenever a new tile is created it will be assigned an array index number in sequential order. When generating the map itself, you just specify the tile number. For example:

The following will be a 5x5 grid. If each tile is 32x32 then the size of the map would be 32x5 or
160x160

1 = grass tile
2 = dirt tile
3 = sky tile
4 = box tile

3,3,3,3,3
3,3,3,3,3
3,3,4,3,3
1,1,1,1,1
2,2,2,2,2

Each tile will have specific properties such as whether you can or cant collide with it. So in the above example, you would want to colide with the grass and the crate, but not the sky and the dirt doesnt matter since you cant get to it.

All 2d games use tiling. 3d games do not need to do this because in a 3d world, any geometry is just that, geometry. Since it is geometry, it contains x,y,z locations with textures applyed to the surfaces. This allows us to do collision checks with the surfaces themselves. In 2d we do not have this geometry, which is why tileing is used. Tiling provides us with "geometry" since we now have an x,y and width and height we can interact with our surroundings.

I hope this gives you all a better picture of how it will work.
And sorry for jumping back and forth, im in a hurry!
Back to top Go down
RedGiant
Guest




Tileing... Empty
PostSubject: Re: Tileing...   Tileing... I_icon_minitimeThu Jun 05, 2008 10:45 pm

That sounds like a good idea and you said this is what you have done before for your art history game you made?
Back to top Go down
Koga73
Sober



Posts : 3
Join date : 2008-05-04

Tileing... Empty
PostSubject: Re: Tileing...   Tileing... I_icon_minitimeThu Jun 05, 2008 10:58 pm

ya, next time ill bring my laptop and show you the map files and the game. so u can get a better idea of how it works
Back to top Go down
NoPityPeter
King Pukey
NoPityPeter


Posts : 45
Join date : 2008-05-03
Age : 42
Location : Alabama

Tileing... Empty
PostSubject: Re: Tileing...   Tileing... I_icon_minitimeFri Jun 06, 2008 10:02 am

I understand how tiling works but... Is that not a primitive style of programming? I don't wan't you guys to take the easy way out. It may be in our better intrest to work with the Torque X engine. Wouldn't working in a 3d engine make more sense? It would be an easier transition and less archaic? I have a feeling that we a going to far back in time and transitions to Unreal will more difficult without building a firm foundation in 3D programming. Let's push the envelope people!
Back to top Go down
http://www.myspace.com/llorwang
Sponsored content





Tileing... Empty
PostSubject: Re: Tileing...   Tileing... I_icon_minitime

Back to top Go down
 
Tileing...
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
aiaxna :: Main Chat-
Jump to: