#### Archived

This topic is now archived and is closed to further replies.

# Walking on irregular tiles

This topic is 5679 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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]

##### Share on other sites
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

##### Share on other sites
But what if the tiles are like (example):

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

That would be a poly, wouldnt it? I dont 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]

##### Share on other sites
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

1. 1
2. 2
JoeJ
20
3. 3
frob
19
4. 4
5. 5

• 10
• 10
• 12
• 13
• 9
• ### Forum Statistics

• Total Topics
632199
• Total Posts
3004733

×