Tiles .

Hello gang!!!

I want to know what you do when you don't want

to do somes overlay (like in Parralax-3||4 example).

If a tile overlay another one corner... what you do ?

e.g.

/------\
|      |
|      |
|      |---\
\------/   |   => What you do with this tile ?
    |      |
    |      |
    \------/

Did you apply a pixel mask on the one under ?
Did you blit it and just forget this overlay ??

In my little projets, I’m not drawing the outscreen tiles
(it’s quite normal) but in a case like that, I do some
overlay (too much… heh ) and I want to know and/or get more
details about the art of zero overlaying ;))

And how about non-rectengular tiles (with somes transparency . . .)
, like a house in the map (where the house is 2-3 times the
height of a “map” tile ?

And by the way, do you think that 40x40 tiles is too big
for a 640x480 screen ? When I’m looking the final result,
I think the tiles is too little and our “future” graphist
sayed that it’s way to little to draw something beautiful…

Thx guys!

Hello gang!!!

I want to know what you do when you don't want

to do somes overlay (like in Parralax-3||4 example).

If a tile overlay another one corner... what you do ?

e.g.

/------\

|      |---\

\------/   |   => What you do with this tile ?


    \------/

Did you apply a pixel mask on the one under ?
Did you blit it and just forget this overlay ??

It depends on how the rendering is done, and the amount of overdraw
eliminated versus the cost of doing the elimination. (Just try using more
layers, smaller tiles and/or larger screen in parallax-3, and you’ll
realize that the overdraw elimination actually is rather expensive!)

Using a blitter that supports “on-the-fly” masking might be useful when
you render directly into VRAM (where most per pixel operations are
cheaper than writing a pixel to the screen), but other than that, I think
it’s more cumbersome - and potentially even expensive - than it is
helpfull.

What I do in parallax-3 and 4 is based on clipping and reverse order
rendering.

What the recursive rendering function does is to render part of a single
layer into a specified rectangle - just like you would design almost any
form of tiled map rendering function.

The difference is that this one detects fully and partially transparent
tiles, and recursively calls itself to render the next lower layer in the
hole. (parallax-4 also merges horizontal runs of “holes”, to reduce
recursion and clipping overhead.)

That is, every hole in a map layer is (recursively) treated as a
"window", through which you can see what’s underneith that layer - just
like the whole screen is treated like a window viewing the top layer,
when the main loop makes the initial call to the rendering function.

In my little projets, I’m not drawing the outscreen tiles
(it’s quite normal) but in a case like that, I do some
overlay (too much… heh ) and I want to know and/or get more
details about the art of zero overlaying ;))

And how about non-rectengular tiles (with somes transparency . . .)
, like a house in the map (where the house is 2-3 times the
height of a “map” tile ?

As SDL doesn’t support nonrectangular clipping regions, there’s no
efficient way of avoiding overdraw in such situations.

The parallax-3/4 examples simply treat such tiles as transparent; first
recursing down, and then rendering the tile on top of the result.

And by the way, do you think that 40x40 tiles is too big
for a 640x480 screen ?

320x200/240/256 games have been known to use 32x32 tiles (which would
correspond to 64x64 in 640x480 mode)… Either way, it all depends on
your maps and art.

If 40x40 works for your game, fine - fewer blits per frame! :slight_smile:

When I’m looking the final result,
I think the tiles is too little and our “future” graphist
sayed that it’s way to little to draw something beautiful…

Uhm, I think you’re failing to grasp the concept of tiles properly. In
more advanced games, tiles aren’t supposed to restrict level design and
graphics. They’re merely a performance hack, to save memory and/or
improve rendering performance. Ideally, a tiled map should appear to be
a huge, solid image, rather than a grid filled with little square objects.

Tile size is not the objects size limit, but rather the map resolution.
A map object can use any number of tiles, and the tile size dictates the
positional accuracy available to the level designer.

BTW, the graphics used in the parallax examples is from my old DOS game
"Project Spitfire", which uses 16x16 tiles in 320x232 mode (VGA Mode-X).
I’ve just merged 3x3 tiles together into stand-alone “blocks” to make it
possible to hack up maps in ASCII without going nuts. (I used a visual
editor to create the demo map for the game.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Thursday 31 January 2002 19:45, Gerard wrote: