2d Tile Map Editor

Community Forums/Showcase/2d Tile Map Editor

Ross C(Posted 2005) [#1]
Hey, i've been working on this for a while now, on and off, and i've got to a stage where i think it it's use-able for others. I'm mainly looking for suggestions and improvements. Saving and loading isn't in yet, but all the other features are there. You can put your own tiles in the images folder. Make sure there 32x32 and in .bmp or .png format.



Limiations:

Program only uses 32x32 tiles and cannot be changed.

Map size is currently static. Piece of cake to change.

There will probably be a limit on how many tiles can be loaded. I'm making a limit of 768.

The collision layer currently can be drawn too.

Resolution is stuck at 1024x768. I probably won't change this, as most monitors can support this.

Tool tips are always on. I'll fix this shortly.

Features: (some of these aren't features :D)
---------

STAMP system: The application provides a small tile grid you can make up your own large tiles, out of existing tiles, then stamp these onto the map. Say if you have a large tree, made from several tiles, build the tree up in the stamp, then stamp it onto the grid anywhere you want.

Tooltips for each button: Each button has a tooltip. Just put the mouse pointer over a button and a tool tip will pop up.

Fill mode: Choose a tile, then click the FILL button. Choose a start location and a finish location, and that area will be filled with the currently selected tile.

Multi-layer paint: Click the multi-layer button and every tile painted, will be painted to all layers, apart from the collision layer. Probably the only real use for this is deleting tiles from all layers, quickly. Only works in paint mode.

Show Blank Tiles: Shows any blank tiles on the bottom layer (layer 0) by drawing a "blank" tile image on them. Useful for distinguishing between the tiles that are the same colour as the backround and blank tile spaces.

Layer buttons: Easily see what layer is selected, and what tile is on that layer.

CONTROLS:
---------
Arrow keys to scroll map.
1 and 2 keys to change layer. You can also click the layer buttons to change
3 and 4 keys to change the tile selected. You can choose a tile, from the tile panel with the mouse.

Stamp Operation: Draw as normal in the stamp area. Then click the stamp button to stamp down the contents of the stamp area. You have 11 stamps available.

Fill Operation: Simply click the fill button. Choose a start location, then an end location and it will be filled with the currently selected tile, on the currently selected layer.


If anyone has any suggestion about new features or improvements, that's would be much appreciated :o) Enjoy!

www.rosscrooks.pwp.blueyonder.co.uk/tilemapeditor.zip


CS_TBL(Posted 2005) [#2]
I've made tons o' mapeditors myself (the quickest one in 90 minutes, including load/save/macro-edit etc.), so over the years I got quite some experience on the matter :)


So, my tips are purely a list of what my own mapeditors would look like.

- map must always be dynamic regarding width&height, should be able to expand/shrink at all 4 sides (north, west, south, east)
- the format of a tile is prolly either a byte for small games, or a short for bigger games. I always take a short as standard. In the ideal case this is dynamic however.
Tiles however must really have any size, just 32x32 won't do.. it makes the project dependent on the map-editor, while this should be the other way around.
- stamps, I call them macros, there should idealistically be on screen a list/menu with macros visable, rather than just one. Also, rather than a seperate editor you could think about grabbing a macro from the actual mapeditor. This way your 'macro-editor' always has the same features as the map-editor.
- the mapviewport should be customizable, if your game has 24x16 tiles on-screen, then it's a bit messy if your viewport allows 32x32 orso. The extra tiles on screen distract the design.. you tend to think that you are drawing a map for a 32x32 game.
- copy/paste = important :P
- additionally you could give each tile a lock-flag, to protect them from wrong paste/draw-actions.


'nuf for now .. maybe more l8r :P

Bottomline is that the mapeditor should be as dynamic as possible.


ImaginaryHuman(Posted 2005) [#3]
Looking good.


Ross C(Posted 2005) [#4]
Thanks for the tips man :o) I'll implement some of them. The different tile size, i'll think about that one. Shouldn't be too hard. The copy and paste, i'll get that in too. The macros thingy. Dunno about that one. I think i'll leave it the way it is :o)

After this project i'm doing, i'll give it a good redesign.

Do you have any examples of tile editors you have done?


CS_TBL(Posted 2005) [#5]
oh, one more tip: you really want to draw with macros, not just a single plot/mousehit.

I haven't made my "ultimate map editor (tm)" yet, as I wish to wait for the GUI module @ bmax .. currently B+ could be doable, but I want to be more modular/flexible.. and I hate globals/dims, so I want some data-hiding system. :)
Obviously I could already do that with banks in B+ (as I usually do).. but I just want to wait a bit more.. I actually also hope to be able to do that MDI stuff (iirc) wit bmax/GUI, window-in-window .. which is very handy for map-editors with flexible tilesize and mapviewports.




This is a map-editor for an MSX-game (RPG).. below-right you see what I mean with a list of macros, immediately clear which ones you have.
This RPG is a room-per-room one, no zelda-scrolling. The wings of the map (left) are the neighbourrooms, so you can see whether your maptiles match a bit. It's clear that these wings make the map look slightly bigger.. that's what I meant with a non-fixed viewport. Which is why I added a button to hide those wings.



This is yet another map-editor for an MSX-game, this time a gradius-style game. @ top: the map, which you can expand/shrink at the left and at the right. So you can start in the centre of the map and gradually expand. That's esp. handy for RPG's btw.. where you just start with a single building and gradually expand the world.
In the centre the tiles
Below again are macros, the little radar at the right shows where you are in the macro-list.


Ross C(Posted 2005) [#6]
I take it your using a constant tile size, and don't mix tile sizes?


CS_TBL(Posted 2005) [#7]
constant tilesize:

In these cases I do .. I could count with variable tilesizes but haven't met a situation yet where it would be handy to do..

'mix tiles' = ?


Ross C(Posted 2005) [#8]
Ah ok :o) thanks!