View Full Version : AS3 TileBased RPG Map Editor
bojosiri
July 22nd, 2009, 01:10 PM
Hi Every1!
Im currently making a simple 2d based tile game and I have been looking everywhere for map editors, will look into creating my own later on, need to do this for a project with strict deadlines! = S
Anyway, back to my question. Does anyone know of any decent free / open source map editors that will allow me to create my maps, and export them as array?
The only one I have found this far is http://www.arraypainter.com and although it does the trick, i am wondering if there are other more advanced versions out there.
Thanks for the help :krazy:
therobot
July 22nd, 2009, 01:30 PM
are other more advanced versions out there.
What more do you need it to do? You should be able to build something like arraypainter.com's editor in a few hours if you know what you're doing.
bojosiri
July 22nd, 2009, 01:41 PM
What more do you need it to do? You should be able to build something like arraypainter.com's editor in a few hours if you know what you're doing.
Sorry, must have not explained myself properly. I am not trying to create a map editor (for now anyway).
Basically what im wondering is if there is a map editor somewhere that will take a full image (i.e. the map) as an input and output it as a 2d array along with the tiles.
For example. Say i have an image of 100 x 100 pixel image. I open this image in said software (if it exists). It then converts the image into a 2d array where each element in the array will correspond to a n x n block of the image.
Hopefully it makes it clearer, maybe not = P
Thanks for your help anyway
senocular
July 22nd, 2009, 01:47 PM
I'm still not following. What should be in the array exactly? You say "each element in the array will correspond to a n x n block of the image", but what is that element and how does it correspond to said block? Is the element a bitmap? Is there some unexplained set of tiles that this software is supposed to know about that it can match to the blocks used by the image? What's the deal?
bojosiri
July 22nd, 2009, 01:56 PM
I'm still not following. What should be in the array exactly? You say "each element in the array will correspond to a n x n block of the image", but what is that element and how does it correspond to said block? Is the element a bitmap? Is there some unexplained set of tiles that this software is supposed to know about that it can match to the blocks used by the image? What's the deal?
Heres the deal:
Im following tutorials from this site: http://tbg.tonypa.pri.ee/tut00.html
The way he generates his tiles is via 1 single image (tileSheet). Each n x n pixel block is the equivalent to a number, i.e. 100 etc etc.
myMap:Array = [
[ 0, 0, 0, 0, 0, 0, 0, 0],
[ 0,101,101,101,101,101,101, 0],
[ 0,101, 0,101,101,101,101, 0],
[ 0,101,101,101,101, 0,101, 0],
[ 0,101,101,101,101,101,102, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0]
];
so for example, 0 = a wall, 101 = tree etc etc.
What Im trying to find out is if there is a software that can take an image, convert it into tiles and output it as a 2d array, together with a TileSheet sort of thing.
I have found a nice software that does all that apart from the exporting as a 2d Array (At least i havent been able to find it yet - http://tilestudio.sourceforge.net/)
Sorry if im being dumb, i just dont know how else to explain this, it has been doing my head in all week. = S
senocular
July 22nd, 2009, 02:03 PM
Apparently tilestudio can export anything...
But I'm still confused about what you have now. Do you already have a completed map? Something that would otherwise have been put together by tiles and a 2D array? If so, how did you make that? And does this mean you already have the tiles stored separately? Or do you just have one big image and you want software to analyze that, divide it into tiles, and give you both the tiles and the array? That's what I'm getting, that you only have the resulting image
Gnoll
July 22nd, 2009, 05:04 PM
Mappy :D
Gnoll
bojosiri
July 23rd, 2009, 05:19 AM
Apparently tilestudio can export anything...
But I'm still confused about what you have now. Do you already have a completed map? Something that would otherwise have been put together by tiles and a 2D array? If so, how did you make that? And does this mean you already have the tiles stored separately? Or do you just have one big image and you want software to analyze that, divide it into tiles, and give you both the tiles and the array? That's what I'm getting, that you only have the resulting image
Thats exactly right senocular. I am only developing the engine etc for the game, someone else is creating the map, and he has done it in photoshop. So all i have is either a jpg / png etc..
Does TileStudio export it as a 2d array? couldnt find the option at all.
Thanks Gnoll, will have a look at those.
senocular
July 23rd, 2009, 09:37 AM
Does TileStudio export it as a 2d array? couldnt find the option at all.
I just read the description in your link and saw:
"But Tile Studio can be used together with ANY programming language, since the output is completely programmable! You can program Tile Studio to output your maps, animation sequences, bitmaps, palettes, etc. in any format and include the output directly into your source code!"
flyingmonkey456
July 23rd, 2009, 07:39 PM
i came up with a way to write the map in text and generate the array from that. just have a single character that represents each tile and type up the whole map in notepad. then you put a character like a comma between each "tile", get the text from the file with AS, and split it into it's separate characters. simply add those to the array and viola! you should ask gnoll for the code on this, he's the one that told me how to do the splitting thing.
EDIT: i forgot to mention that you'll need to include the map width in the document so you can tell AS when to start a new row :)
Gnoll
July 23rd, 2009, 09:31 PM
i forgot to mention that you'll need to include the map width in the document so you can tell AS when to start a new row :)
You don't need to include the length if you put a seperating character in between each line, I used ('%' in my example I think,
Gnoll
bojosiri
July 24th, 2009, 03:55 AM
Thanks for your help everyone. Im starting to get the hang of tile studio! There was a Haxe Code Generator script, and at the moment im just playing with it so that it generates the code that I want. As soon as i do i will post it here, hopefully it could help someone else in the future ; )
The only thing that is doing my head in with tile studio is that it seems very unstable. It will either close or crash out of nowhere!!
SparK_BR
July 27th, 2009, 12:40 AM
if you convert tonypa's tutorial to AS3 you can use the tileset as a bitmapData
then you split it, get the sub-classes of your tiles with their properties and tile graphic type
make your editor will be easy as attach tiles make click listener actions that take the tile code put into a global var, then when you click in your screen it uses mod to know which tile you did click and find that position in your array, assigning it to the current tile code selected.
that's all i think...
and you can show the array value later or store it where you want
the tileset should be in the same folder as the game and it will load the same tileset for both the game and the editor.
tilesets should have their ID too so your can load different tilesets for different maps and choose the tileset you wan't in the editor, the editor should save the code that flying monkey (he will steal your dog) and gnoll told you along with the name, uniqueID and description (optional) of your map.
the links betwen each map (doors, wells, portals and stuff) must have the tile property of link enabled and the map uniqueID, destination tX and tY, which will load another map file with tileset, name, uid, desc and the 2dArray...
that's all i can think of right now...
HAVE FUN!
Caravaggio
July 29th, 2009, 02:09 AM
Kind of OT but about that arraypainter program, does anyone know how to save it to a hard drive? I think I'd like to try and make use of something like that but am hesitant to throw it into the pipeline if it's dependent on visiting the site...
bojosiri
July 29th, 2009, 04:29 AM
Just right click on the link to it and save target as. It should save it as a standalone i think.
:hugegrin:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.