2D game map WITHOUT tiles.

Started by
11 comments, last by Servant of the Lord 11 years, 6 months ago
Firstly, the structure of the world and collision data are not inseparable -- they are related, but the data that defines them need not be one and the same. For example, you can have "primitive-based" collision (lines, curves(splines), and shapes) in a tile-based world, or you can have tile-based collision in a hand-drawn world.

All you need for collision is a method for determining whether something is "inside" of a shape, or "outside" of a shape. For lines and splines (planes and parametric surfaces in 3D), because there is no inside or outside, you simply choose one side to mean outside.

In rough order of complexity to calculate inside/outside:
Axis-aligned boxes and cubes
Circles and spheres
Lines and planes
Triangles (the trivial case of convex n-gons in 2D, because triangles are guaranteed to be convex)
Non-aligned boxes (again, boxes are known to be convex)
Convex n-gons in 2D
Axis-aligned ellipses and ellipsoids
Tetrahedrons (the trivial case of convex n-gons in 3D, because tetrahedrons are guaranteed to be convex)
Non-aligned cubes (again, cubes are known to be convex)
Convex n-gons in 3D
Non-aligned ellipses and ellipsoids
Curves and Surfaces (splines)
Concave n-gons in 2D and 3D

throw table_exception("(? ???)? ? ???");

Advertisement
Hi all, I'm working on a platform game that doesn't use tiles - I use box2d for collision detection. The idea is to place boxes/spheres that will determine the world collisions, but the question is how to place artworks on top of it? How is it done in games such as Braid or Limbo ? I dont see any tiles repeating, it looks like the whole level is covered with a single image. I suspect using a single big image would be probably slow and memory consuming (the image would have to be like 10000x10000px). I cant think of any clever solution to this.
This thread is 5 months old - typically you should start your own thread where you'd get more focused help. Posting here, most people wouldn't see the thread, and those that do see the thread would think to themselves: "Hey, 14 people already responded, so I don't need to help also" not realizing a new question was asked. Posting a new thread actually increases your chances of getting help. wink.png

Anyhow, in answer to your question:

Tiles are just placements of similar size images in a uniform grid. You could just as easily place images of any size freely without a grid, even rotating and scaling them.

First you'd draw a background, usually a single image, that since it's so far away doesn't need to be 10000 by 10000, just 1000 x 1000 or so. See parallax scrolling.
Second, your game would draw images on top of the background, wherever you tell the engine to draw them, not constrained by a grid, and of any size, scale, and rotation you specify.
Thirdly, your collision rects for the images would be calculated automatically from the position, size, scale, and rotation of the images where placed in the level.

See GLEED2D (a 2D level editor) and Parallax scrolling (for nicer backgrounds).

There is no reason you can't draw an image randomly where you please over the game window; people only make tile-based games for some of the nice conveniences tile-based grids bring, but that doesn't mean images have to be drawn in rows like that.

This topic is closed to new replies.

Advertisement