Walking on irregular tiles

Started by
2 comments, last by _slayer_ 21 years, 2 months ago
How can I implement decent map walking on irregular (curved even) 2D tiles? Thanks in advance! [edited by - _slayer_ on February 1, 2003 4:26:13 PM] [edited by - _slayer_ on February 1, 2003 4:26:43 PM]
Angel of Death
Advertisement
I''m assuming this concerns your Sonic-like game. I tried posting a response, but forum bugs have been preventing me from doing so.

To make a long story short: Define line segments and have the player and enemies collide with it, rather than assuming a tile is horizontally flat.

This is what the Sonic games for the Genesis did.


----
Bart
----Bart
But what if the tiles are like (example):

# . . . . ## # . . # ## # # # # # 


That would be a poly, wouldn`t it? I don`t exactly know how to dissect tiles into something useful for sprite walking-plane determination. Could you put the story in the long form?

Btw, thanks for interest.


[edited by - _slayer_ on February 2, 2003 10:51:14 AM]
Angel of Death
quote:
# . . . . ## # . . # ## # # # # #  


That would be a poly, wouldn`t it?



No, just break it up into a series of smaller tiles, each with 1 line segment to represent it.

quote:
Could you put the story in the long form?


Sure. A Sonic map is made up of a 256x256 grid (or maybe it''s 128, 64, or something -- I can''t remember.)

It''s important to note that the Sega Genesis represents the display as a series of scroll planes composed of 8x8 pixel tiles. Because of CPU RAM/ROM memory limits, it would be impractical to have each element of the map grid correspond to a single tile. Therefore, each of the "blocks" in a level is actually a large group of tiles -- something like 32x32 tiles. For example, one of the loops in a Sonic level is a single block type, I think.

Besides defining the 8x8 pixel tiles themselves, each block also defines a bunch of line segments that Sonic can walk on or collide with. Moving entities like platforms are, AFAIK, not part of the actual level maps, but are simply some sort of sprites, like enemies, that Sonic can interact with.

On the PC, you could do something similar. Make large blocks made up of smaller tiles and define line segments for the entire block, or for each small tile, define a line segment.

Hope that makes sense. The key is to create blocks large enough to represent structures of the level that can have a sufficient number of line segments defined for them. These blocks can be further subdivided into tiles of a uniform size for rendering (and also to allow the blocks to be built up of common components, as you''ll notice is the case in Sonic.)



----
Bart
----Bart

This topic is closed to new replies.

Advertisement