Side Scroller Map Editor

Started by
13 comments, last by spek 16 years, 10 months ago
Hi, Just for the fun, I'd like to make an old fashioned 2D game, instead of fancy 3D this time. Something like the good old Double Dragon, or Final Fight. This requires a map editor of course. Although most of the time in these games you can only walk in a rectangle area, I would like to be able to add platforms and stairs. If the game was fully flat, it wouldn't be hard. But since the players can also walk into the depth, the bounding area is somewhat 3D. Imagine Super Mario, but then also with some depth (like in the Double Dragon) games. My question is, how to define the "collision area" / places you can walk? I could make a real 3D mesh for the collision detection, but maybe there is a more simple way. It would be nice if I could make a simple map editor where I can define this, without doing real 3D stuff. Greetings, Rick
Advertisement
i would define depth position and range for collidable objects (so min/max values would be: position +- range/2)
and when testing collisions, i would ignore objects outside of this range
Well, I mean how to define the "bounding area's" for the world itself. In a normal flat 2D game, I could place lines where the player has to stand on, or I could make a 2D array of tiles, and tell for each tile if its "solid" or not. But since there is also depth now, it makes it a little bit more complicated. I'm looking for an nice easy way to define the area.

Greetings,
Rick
first, make it totally 2D, as if it was without depth

then add two parameters: depth position and depth range

for example, player is 0.2 wide in depth
if we define nearest possible value to 0.0 (the lowest part of screen), his nearest location can be: 0.2/2 = 0.1
if the furthest possible depth is 1.0, then his furthest location is: 1.0 - (0.2/2) = 0.9

if there was a wall over the whole place, it would be 1.0 wide, positioned on 0.5
if there was a straight path in upper part, and stairs in the lower part, it would be 0.5 wide (half the depth) and its position would be 0.75 (the stairs would be 0.5 too, but positioned at 0.25)

these two parameters will be always tested as first:
if (obj1.max_z < obj2.min_z || obj1.min_z > obj2.max_z) then no collision in 2d is possible
else: now you can think about these two objects as if they were just normal 2d objects

about 2d collisions - make basic scene node with:
Vector2 position; // x, yVector2 size; // height, width// and for depth:float depth_position; // or simply 'z'float depth_range;// or whatever names you like..
Thanks for the reply.

Well, the collision math itself or coding it is not the problem. But I'm looking for a user-friendly way to make this "3D grid" into a map editor. A long time ago I made something like this as well. The screen was divided into small cells, and for each cell I could tell the height, by raising those cells like if it was a cube shooting out of the ground.

But that had a couple of downsides. First of all, the cell-size was fixed. Because they were small, it was a lot of work to do this. And multiple platforms above each other was not possible.

greetings,
Rick
why do you want to use any grid at all?
i dont really get it.. do you need grid for some reason?
if not, what's bad about the linear world?
[by linear, i mean that positions can be any real number, not only "nearest" as it would be when using tiles, grid, etc]
I will direct your attention to the classic game that robbed me of many quarters in the arcade days of my youth - Golden Axe. This sounds like what you want to do and the tile mapping is done almost the same as it would be for a 2d RPG like Final Fantasy 1-6 the biggest difference would be the images themselves are at a different angle than most others although I am sure you could get away with using some RPG Maker tiles since they have some decent "sudo height" tiles.

sceenies of Golden Axe on various systems (although none of the arcade).

I would recommend Mappy for now until you can make your own.
Evillive2
Hi,

That is indeed what I want. Making the code or tiles itself is not a problem though. I have a tile-grid where I can place the tiles in. The tiles don't have a fixed size though. First I have big tiles. When I need more details, I can split that tile into 4 sub-tiles, and so on. But that is the visual part. That is not going to be a problem, although I'm still thinking about how to render it fast (using an atlas texture, how to deal with animates tiles, ...).

But the collisions bug me. Not the detection itself, that is relative simple as well. But I need to create a nice interface in the Map Editor to define the ground where the player is walking on, platforms, walls, slopes, stairs... So it's not really a technical problem, but I'm looking for a proper User-Interface to do this.

You mentioned "Mappy", is that a level-editor? Maybe it's a good idea to look at some existing level-editors for such games so I can see how they did it.

Greetings,
Rick
This might not work, but the way I would do it is that each tile can have six collision "types", the standard four sides and two diagonal ones. You would use position of the characters feet for collision detection(so the bottom-middle of the sprite). Assign special values to things like stairs/ladders and drop-offs. This is probably how most old tile based games did it.

You could give Tile Studio a try, I prefer it over Mappy.
Hmmm... The problem is that the world is "3D". The link you gave shows a nice example of how the collision detection works, the tiles are "outlined", the player walks over these lines. But I need depth as well, like you can see on the screenshots that evillive2 gave.

I saw that Mappy supported Isometric world as well. I think that comes pretty close to what I want, although in my case the camera is viewing straight forward. I guess in Mappy, walls are defined by "raising" the tiles. Maybe I should do that as well, although its a little bit tricky because the tiles need match with the (invisible) collision grid. And it could be quite a lot work in some cases.

Is there a level-editor for games like Double Dragon, Final Fight, or Golden Axe? I think that would give exactly the solution I'm looking for.

Greetings and thanks for helping,
Rick

This topic is closed to new replies.

Advertisement