Jump to content
  • Advertisement

Archived

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

_slayer_

Walking on irregular tiles

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!