SFML community forums

General => SFML projects => Topic started by: TricksterGuy on December 12, 2009, 08:22:26 am

Title: Tilemap Editor (working title)
Post by: TricksterGuy on December 12, 2009, 08:22:26 am
Ok so here is a tilemap editor that I created for myself if you want to look at it or use it for your own purposes feel free too :) Also I need a good name for this obviously but I have yet to decide on it suggestions are welcome

Its written in C++ using wxWidgets for the GUI and good old SFML to render stuff onto a wxWidgets view.

Features and Planned Stuff
But here are all of the planned features bullets marked with an + are done, - are not done, and / are partially done Requirements and Features (http://trickster.wg2140.com/Temp/requirements.txt)

Screenshots

Map With Collision Layer
(http://trickster.wg2140.com/Images/halgui42.png)




Default Map
(http://trickster.wg2140.com/Images/halgui43.png)




Zooming and Grid
(http://trickster.wg2140.com/Images/halgui44.png)



Download
The Program.
http://www.wg2140.com/users/trickster/Temp/TileMapEditor.zip

Base code to build a game using maps created with this program.
http://trickster.wg2140.com/Temp/MapWalker.zip

Other Stuff
There is a user manual with more information about the map formats!

Feedback and bug reports and feature requests are welcome!
Title: Tilemap Editor (working title)
Post by: Nothingness0x on December 12, 2009, 10:32:44 am
Hi, I just have downloaded your editor and I'm testing it as I need one for my game.

First feedbacks :

1)When you click on a tiles or a groupe of tiles, it would be great if your mouse pointer take the image of the tiles you clicked on, because it's hard to aim with the basic mouse pointer and you dunno what you took.

2) When you keep on clicking on a map to draw a lot of time the same tiles, you should forbid to draw a tiles if it  would be draw on one other, (that's mean it should be a collision system to know if you can actually draw the tiles or not)

3) The tiles image you provided with the editor is not very handy because the tiles ar not centered, I mean for example you can't take the whole tree or the whole boat in one time to draw it

4) You only have one layer

I haven't tried to save a map for now ii was just to give you idea to improve your editor if you wanna improve it

see ya
Title: Tilemap Editor (working title)
Post by: TricksterGuy on December 12, 2009, 10:56:36 am
1) Thanks I'll look into this!

2) I don't understand what you mean.

3) I don't understand what you mean. Could you please elaborate. And yeah the images I provide suck as I am not an artist :P

4) that's not true. Goto Map > Properties and its under the Layer Tab.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on December 12, 2009, 11:11:56 am
First sorry if you don't understand as I'm not a native english speaker.

So :

2) I meant when you keep on clicking on the mouse to keep on drawing the tiles you choosed, for example if I take the whole tree, if I wanna draw 4 tree close to each other, I can't do it by keep on clicking on th mouse because it's gonna erase the tree drawed before, you should forbid to draw a new thing if it's gonna be draw on an already existing thing on the map. The only solution to erase something would be to choose the option erase or draw grass.

3) I just talked about the order of the tiles on your image for example imagine "3" is the different part of the tree :

11111333111111
11133311111111

You can't take the whole tree because the middle part is not perfectly below the high part. (sorry for this ugly  design  :D  ) hope you understood this time

4) Sorry I haven't seen.

of course everything I'm saying is what I would bring to my editor so it's just suggestions I'm not saying your work is bad or something :)

Anyway when you save a map, does it save the collision of the objects or just an image of what you drawed ?
Title: Tilemap Editor (working title)
Post by: TricksterGuy on December 12, 2009, 11:33:47 am
2) I don't know if I want that to restrict that, but I will think about it, but if you want to draw two trees next to each other then you should use the Rectangle tool or even the Fill Tool. The default tool (Pencil) works to some extent if you know where to click :P

3) Ahh! When you load a tileset it should resize the left window such that the image appears as the image loaded. Seems like that's failing... Well a workaround that is to move it so that it looks like the original image.

Nah its alright I want good feedback. I've posted this at other places, but I don't get very good responses. So thanks :)
Title: Tilemap Editor (working title)
Post by: Nothingness0x on December 12, 2009, 12:03:09 pm
Ok I'm glad you understood all my request this time, I'm gonna use more your editor when I get the time , and I will do feedback again if I find another thing
Title: Tilemap Editor (working title)
Post by: Nothingness0x on December 12, 2009, 12:16:03 pm
Another questions :


- How do I put collision ? (if it's possible) because I wanna know for example if i put collision on a tree and I save it, would the collision be saved as well in the file ? In rpg maker you can do it by puting X when you can't go throught and O when you can pass

-and maybe you should put a cancelled button to cancel the last action (like ctrl Z) ?

-What about animated tiles ? For example water ?


-Why do I have a grey background on the tiles ? How do I get opaque background ?

I'm sorry but I've got a lot of bug with the layers ... I created a map with 3 layers, and sometimes layer doesn't apear on the screen, sometimes I can't draw it ... sometimes what I drawed disapear when i change layer ..
It's been one hour I tried things, but I think there's definitely a problem with your layer bewteen layer view and layer selection
Title: Tilemap Editor (working title)
Post by: TricksterGuy on December 12, 2009, 03:44:50 pm
1,2,3) Yep all of those are not implemented Check the first post for a list of everything that works haha

4) There isn't a grey background. The tileset image is transparent in some areas. Those tiles were meant to be placed on Layer > 1

5) There aren't any bugs that I know of with Layers

This may sound stupid but this is how it works

Ok so when you first create a map and load a tileset the default tile is 0 so you start out with a map with one layer that just has tile 0 in it.

When you create a new layer it just contains tile 0 in it (in this case its the grass tile) and this new layer draws on top of previous layers

so when you create a new layer you have to fill it with a completely transparent tile

You can switch the layers you are editing by going to Map > Layers and then selecting the layer you want to edit.

yeah thats one workaround and the other is to just make tile0 in the tileset image be completely transparent

I used to do it the other way where I have a tile called tile-1 which was completely transparent but people complained about that system where in the tile window will I draw this tile so that it can be selected? Another map editor program called Mappy just drew that as the first tile and that ruined the alignment of the tiles and I don't like that and neither will users :P.

But yeah theres the story on that


Also thanks :)!
Title: Tilemap Editor (working title)
Post by: Nothingness0x on December 12, 2009, 04:55:26 pm
1 2 3) , are you going to implement it in a near future ? It would be a perfect editor with those options.



I've found the way to draw a map with the layers now. Not very handy because if I don't have opaque tile on the tileset I load ? How can I fill with opaque tile ? maybe you should bring an option to auto bring opaque tile when you create a layer ...



and I thing the first option I told you is essential :

(When you click on a tiles or a groupe of tiles, it would be great if your mouse pointer take the image of the tiles you clicked on, because it's hard to aim with the basic mouse pointer and you dunno what you took.)

to see where what you're about to draw is gonna take place  :D
Title: Tilemap Editor (working title)
Post by: TricksterGuy on December 22, 2009, 06:54:26 am
Quote from: "Nothingness0x"
1 2 3) , are you going to implement it in a near future ? It would be a perfect editor with those options.

Yes, everything I am planning is in the first post.


Quote from: "Nothingness0x"

I've found the way to draw a map with the layers now. Not very handy because if I don't have opaque tile on the tileset I load ? How can I fill with opaque tile ? maybe you should bring an option to auto bring opaque tile when you create a layer ...


Umm mind explaining this again.


Quote from: "Nothingness0x"

and I thing the first option I told you is essential :

(When you click on a tiles or a groupe of tiles, it would be great if your mouse pointer take the image of the tiles you clicked on, because it's hard to aim with the basic mouse pointer and you dunno what you took.)

to see where what you're about to draw is gonna take place  :D


Just implemented that in the updated version download it and check it out
Also I fixed the problem where you load a tileset and it didn't align it correctly (At least I think its fixed I need another system to test it).
Title: Tilemap Editor (working title)
Post by: Luinechor on December 30, 2009, 07:00:24 am
This Editor looks kinda cool. I want to program a little Tile-based RPG (after I'm done with a spaceshooter) and using this editor would be very helpful.
Title: Tilemap Editor (working title)
Post by: TricksterGuy on January 01, 2010, 09:53:13 am
Thanks :D


Quote

01 January 2010
   released version 0.8.0 of TilemapEditor

     Change log:
        -New: Undo & Redo!
            -New: Select Tool has been implemented
        -New: Things in the Edit Menu (Copy, Paste, Cut, etc.) has been implemented
        -Fixed: Tools drawing at the corners of the map when clicked outside the map area
        -Fixed: Clear wasn't working properly
        -Fixed: Bug with saving specifically if your filename was named x.EXT where EXT had a capital letter
        -Fixed: Preview of tools drawing at the edges of the map when cursor was outside the map area
            -Fixed: Scrolling the map didn't show the area of the map that was revealed.
        -Updated: Default maps are now filled with -1 (null tile) instead of 0 (the first valid tile). This should lead to less confusion when adding layers.

Title: Tilemap Editor (working title)
Post by: WSPSNIPER on January 01, 2010, 07:03:59 pm
did you use a seperate image for each tile or did you use a sheet and how if you did cause i am trying to figure out how to clip and blit sheets in sfml like you can in sdl and allegro but can not figure it out yet, sweet editor keep it up
Title: Tilemap Editor (working title)
Post by: Grownup on January 03, 2010, 12:06:54 pm
When i open the archiv they come this message:

"The Archiv are destroyed!"

Can you upload it again pls?
Title: Tilemap Editor (working title)
Post by: TricksterGuy on January 04, 2010, 07:53:34 am
the archive must have got corrupt while It was being uploaded

oh well I created a fresh copy and its already up!
Title: Tilemap Editor (working title)
Post by: TricksterGuy on January 09, 2010, 04:53:22 am
Quote from: "WSPSNIPER"
did you use a seperate image for each tile or did you use a sheet and how if you did cause i am trying to figure out how to clip and blit sheets in sfml like you can in sdl and allegro but can not figure it out yet, sweet editor keep it up


Nope it uses tilesets/tilesheets

mainly the functions you should use is SetSubRect

how I do it is create a sprite for each tile set the sprite to use the tileset image and set the subrect appropriately

then if the current layers tile is that tile then position the tile and draw it.


Anyway
Quote

08 January 2010
   released version 0.8.1 of TilemapEditor

     Change log:
        -New: Toolbar added with three icon sizes (16x16, 24x24, and 32x32) You can configure the size via the Properties Window
        -New: Export all Layers as images added
        -Fixed: Minor problems with gui control positions fixed
        -Fixed: Bug introduced in V0.8 in regards to the default "null" tile being -1 instead of 0
        -Updated: Tiles Window doesn't "shuffle" tiles on resize anymore


Quote

10 January 2010
   released version 0.8.1.1 of TilemapEditor

     Change log:
        -Fixed: Fixed "Fix Tiles" in that it still broke the program and did not respect "null" tiles
        -Fixed: Fixed Export to Image


Quote

18 January 2010
   released version 0.8.2 of TilemapEditor

     Change log:
        -New: Current Layer now shows up in the status bar
        -Fixed: Erase Tool was erasing things on the next row if you went out of bounds on the x axis
        -Fixed: File saving/loading was forcing all characters to be lowercase due to an earlier fix
        -Fixed: Minor GUI corrections
        -Fixed: If you had a selection on the map and then switched tools the selection rectangle stayed on the screen
        -Fixed: On opening a map the current layer resets to 0 (potential bug)
        -Fixed: Status bar didn't update properly on Undo/Redo
        -Updated: If a image can not be loaded then the tileset will go back to default (one white tile)
   -Updated: MapViewer.exe
   -Updated: Test.zip


Quote

20 January 2010
   released version 0.8.3 of TilemapEditor

     Change log:
            -New: Minimizing the application now tells the application to stop updating. Should reduce CPU usage when the app is minimized
        -Fixed: If saving/loading fails it will be reported to the user
        -Fixed: Framerate preference was not respected
        -Fixed: Resizing the main window did not refresh the map properly
        -Fixed: Opening a map with a background sometimes showed the background as white
        -Fixed: Opening a map did not refresh the map properly
        -Fixed: Scrolling a map sometimes did not cause the map to refresh properly
        -Fixed: Minor memory leak when using backgrounds.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on January 24, 2010, 11:23:00 pm
When you put collision into the editor I think I m gonna use it for my game cause its the best editor I ve seen so far, i mean for now it is not usable, but if you put everything we need into, its gonna be perfect
Title: Tilemap Editor (working title)
Post by: TricksterGuy on January 28, 2010, 05:09:50 am
Haha I would like your definition of usable. Right now I see it as lacking some nice features other map editors have. Collision Layers are probably the next thing I will implement.

But yeah also I did kinda forget some DLL files in the last release (silly me) since I am now linking with the audio libraries of SFML. Those have been fixed now.

Also thanks for all of your bug reports!  :D

Quote

31 January 2010
   released version 0.8.5 of TilemapEditor

     Change log:
        -Fixed: If you load the same image twice the application asks if you want to replace the first
        -Fixed: Save always brought up the filedialog window
        -Updated: Map name is now displayed in the title bar
        -Fixed: Config file was being saved in the wrong place sometimes.
        -Updated: You may now save to image if there is no tileset (before the app ignored it)
        -Updated: Cooler Selection Rectangles
        -Fixed: Resizing the editor when you had a tile selection killed the selection.
        -Fixed: Creating a new selection on the map required two clicks (now you can just select outside of the selection)
        -Fixed: Erase Tool and Rectangle Tool use when first click is out of bounds

29 January 2010
   released version 0.8.4 of TilemapEditor

     Change log:
        -Fixed: Map did not refresh correctly on Clear
        -Fixed: Hiding the layer you currently are editing now makes the app yell at you
        -Fixed: When loading a tileset the tile window fully snaps to the image width when loaded.
        -Fixed: When changing a tileset or tile dimensions if a tile becomes invalid it will be set to -1
        -Fixed: Bug when opening and then creating a new map
        -Fixed: Bug with Erase Tool
Title: Tilemap Editor (working title)
Post by: TricksterGuy on March 01, 2010, 08:38:11 am
New version.

Quote

28 February 2010
   released version 0.9.0 of TilemapEditor

     Change log:
        -New: You may now dim lower layers
        -New: You may now set the grid size in tiles
        -New: TileBased Collision Layers
        -Fixed: On loading a map where the image is missing the application now asks for that image instead of exploding
        -Fixed: Fixed a couple of bugs with Undo/Redo
Title: Tilemap Editor (working title)
Post by: Lokk on March 05, 2010, 11:41:51 am
Good job !
Is there any documentation about the map format ?
Title: Tilemap Editor (working title)
Post by: Nothingness0x on March 15, 2010, 12:36:06 am
I do not understand how the collision management works ? I mean how do I put collision on my map ?? Besides can you tell us more about the way the map are saved ?? In an xml file ? Every informations are saved ? (tiles positions collision ...) It would be helpful to know this in order to program a map reader using your maps in our games

thanks
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 01, 2010, 03:50:36 am
Haha well I feel that I can call this V1.0 now. I have fixed plenty of bugs and redid some of the things in the program. So there are a lot of changes in this version if anyone just happens to have did something with this your .map files are now incompatible you are still able to load it within the program though (File > Import > Other).

Quote

30 May 2010
released version 1.0.0 of TilemapEditor

Change log:
-New: XML Exporting / Importing
-New: GBA formats Exporting
-New: User Manual
-New: Improved .map format (see Technical Information in User Manual for specification) the program will still load the older version.
-New: Advanced Import / Export (use this to open maps saved in the older format)
-New: Map Walker Program to test collision and a generic starter for games.
-New: Playtesting maps from within the program
-New: You can now zoom in/out the tileset
-Fixed: Selection when selecting from different corners
-Fixed: Selection not vanishing when switching from Select Tool.
-Fixed: Zooming in on map is a lot nicer (camera stays in its position)
-Fixed: Tile Window always changing when image loaded / changed map properties. Now it only changes when a new image is loaded or tileset zoom changes
-Fixed: In addition made the Tile Window sash change less annoying when loading wide images.
-Updated: Map Viewer Program to work with new map format.
-Updated: You may now load from a txt file


Also as usual any bug reports are appreciated! :D

And lastly here is the Source code for the MapWalker program (IN C++) this can be used to make a basic game that uses maps made by my program

MapWalker (http://trickster.wg2140.com/Temp/MapWalker.zip)

@Nothingness/Lokk Sorry for not responding sooner, college caught up with me :/ the map format used was documented in the first post (though the link for it was rather hidden). I have changed the format and it is now documented in the User Manual provided with the program.  The source code above includes a reader for the new format.

To use the collision editor all you have to do is Map > Properties under the Collision Tab select HasCollisionLayer.  Then choose MapBased and TileBased (the only type supported at this time).  From there change the current layer to collision and then you are able to tell which tiles are passable or not.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 01, 2010, 01:05:07 pm
yeah but you didnt post the version 1, the one in the first post is still v o,9
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 01, 2010, 01:28:39 pm
The link always points to the latest version? I downloaded it and checked...
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 07, 2010, 11:17:53 pm
I updated the first post with more up to date material

Also another update
Quote

07 June 2010
   released version 1.1.0 of TilemapEditor

     Change log:
        -New: Map Templates. To use have a map named template.txt (in the proper format) in the same directory as the program.
        -New: Map/Layer shifting
        -New: Capturing areas of the map and using it as your current tile (Eyedropper)
        -New: Save on exit.
        -New: File History.
        -Fixed: Memory leaks in a couple of special/error cases (TextMapHandler)
        -Updated: Now always shows the background of the map in a faint blue.
   -Updated: Config file format.
Title: Tilemap Editor (working title)
Post by: Quillraven on June 18, 2010, 05:38:27 pm
is there a reason, why you use -1 for "unused" tiles instead of zero? -1 is harder to "parse" than a zero imo.

also your xml file has a lot of unnecessary whitespaces, which again, makes it harder to parse/read.

would be nice, if you can optimize that a little bit? :)
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 19, 2010, 02:48:11 am
I don't believe its any harder to parse if the unused tile is -1.

All you have to do to parse that section of data is to split the data into tokens using space and a new line as a delimiter (you can use strtok or something equivalent).

And then for each token from the string just convert it into an int (atoi or something equivalent).

or you can use stringstream. either way should work well for this.

Btw in my next update there will be more negative numbers (not just the unused tile) in the layer data for animated tiles.

And as for the whitespace thing splitting the string into tokens should take care of that, but I use wxWidgets to export the XML data and I just have control over the Nodes and Data it outputs, I'll check again to see if I can fine tune it.  But really that shouldn't be a problem if you follow the method above.

But you could also use an xml reading library like tinyxml or something. I haven't used tinyxml for anything, but I've heard good things about it.
Title: Tilemap Editor (working title)
Post by: Ashenwraith on June 19, 2010, 06:07:36 am
I'm not a fan of xml unless it's specifically for user editing.

Maybe a better solution would be for output modules so you don't have to worry about your code base going out of date or hacking it together just to change it?

Then with a quick edit you can make it 0 or whatever you want and never have to worry again.
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 19, 2010, 08:08:16 am
Xml is not the main save type of this program, It is actually my own format .map . How the data is laid out in the format is explained in the User Manual.  

Also I do not understand what you are suggesting in your post.  If it is what I think you mean then I have already done that.  There are several ways to save your map (.map, .txt, .xml, .png, etc.)  And in the future if someone wants it to support another format they will be able to write a handler for it.

Also there is already a reader for my .map format in my first post. It is included with the sample program's source code.

But I am not changing the unused tiles tile id I've changed it many times before and it will break files exported from the program which the number of times I do this I want to keep very small.
Title: Tilemap Editor (working title)
Post by: Ashenwraith on June 20, 2010, 02:48:29 am
I just don't see the point of negative numbers when they can be characters looked up from char codes (or simply representative characters) to be compact and aid in compression.

There is internal parsing logic either way.
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 20, 2010, 07:08:47 am
Its not really a big deal, its just numbers really nothing no one should get worked up over. Besides this only happens in the xml and txt exporters.

Also I do not understand your post.  The data is not compressed it is laid out in a format readable for other people.

I mean if it really bothers someone that I used -1 for the for the unused tile then they can just manually put as the first tile in their tileset an empty tile that is completely transparent and then when they create a new map fill it with tile 0.


But yeah not enough reason for me to change it

And this is all I am saying on this matter


Here is a screenshot of the current thing I am working on (Animated Tiles)
(http://img156.imageshack.us/img156/2310/animation4.png)
Title: Tilemap Editor (working title)
Post by: gsaurus on June 20, 2010, 11:10:17 am
This reminds me of Jazz Jackrabbit 2 Creation Station  :P
Title: Tilemap Editor (working title)
Post by: Ashenwraith on June 21, 2010, 01:04:58 pm
Hey sorry, not trying to be a pain.

I'm just saying it makes sense to use a unique character instead of a negative number because if you were to compress the data you would have less data.

Plus it makes it more readable and easier for novices to edit with find/replace in text editors--which is always powerful.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 22, 2010, 07:06:58 am
hey,

1) I was wondering if i can import my own tiles set in your editor ?

2) If yes do i have to respect some rulez to make it work as good as your exemple with your tiles ?

3) Why I still can't put collisions on the map ?

4) Collisions and layer management are saved and managed by the map walker ? I mean my character will directly be stop by a collision or will be able to walk behind a tree ?

5) After the animated tiles, do you expect to do something else or the editor will be finished ?

Good job for your editor, i cant wait for the last release so i can use it for my RPG
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 22, 2010, 10:17:54 am
Quote from: "Ashenwraith"
Hey sorry, not trying to be a pain.

I'm just saying it makes sense to use a unique character instead of a negative number because if you were to compress the data you would have less data.

Plus it makes it more readable and easier for novices to edit with find/replace in text editors--which is always powerful.


Yes, I keep what you say in mind; However the data is not compressed at the moment as right now I am only implementing the most important (and sometimes easiest) set of features to implement each release.  I have not touched compression yet, however when I do I will consider what you have told me here, but as of now I am not worried about compression yet.

Quote from: "Nothingness0x"
hey,

1) I was wondering if i can import my own tiles set in your editor ?

2) If yes do i have to respect some rulez to make it work as good as your exemple with your tiles ?

3) Why I still can't put collisions on the map ?

4) Collisions and layer management are saved and managed by the map walker ? I mean my character will directly be stop by a collision or will be able to walk behind a tree ?

5) After the animated tiles, do you expect to do something else or the editor will be finished ?

Good job for your editor, i cant wait for the last release so i can use it for my RPG


1) Yes find an image. In the menu Choose Tileset and Choose Change...
2) Image must be loadable from within SFML
3) In the menu choose Map then choose Properties.  Under the collision tab in the Notebook Control Check the HasCollisionLayer checkbox
Choose MapBased and TileBased in the radiobutton groups.  Click Ok.

Change the Current Layer to Collision.  there.

4) It is saved in the .map file for more information read the user manual.
If there is a collision (it is denoted by a glowing red tile) then the player will not be able to walk there.

5) There will be a list of everything I will be doing in the user manual next version, But I am far from finished; However, don't let this stop you from using the program. As of now (minus animated tiles and other collision types) It is usable for creating 2d rectangular maps.

And I don't plan on changing the .map format for awhile so your .map files should remain compatible between updates for awhile. (And if I do change it I will include an option to load from the previous format as I have done for .map files created with the first few versions of the program).

And thanks!
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 22, 2010, 11:05:40 am
i forgot to ask , is it a "pixel perfect" method of collision ? because its important in a rpg, a rectangle collision method is not realist ...

and how do i put collision on the limit of the map, so the player cant get out of the window ?

the .map is an image that i load in my game ? Or just a file with information about the tiles and collision ? Because if the map is bigger than the screen, does it work ? (i have a scrolling management)

 thx
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 22, 2010, 01:50:30 pm
I also would like to report a bug :

When you try to switch the current layer and The select tool is activated, the program crashes.

Do not forget to answer my questions above though  :D
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 22, 2010, 05:21:48 pm
Quote from: "Nothingness0x"
i forgot to ask , is it a "pixel perfect" method of collision ? because its important in a rpg, a rectangle collision method is not realist ...


No. The collision as of now is defined per tile not per pixel.
So you can tell which tiles on the map as of now are not passable.
If you want per pixel you will have to wait.

Quote from: "Nothingness0x"

and how do i put collision on the limit of the map, so the player cant get out of the window ?


The way I coded my map playback thing for SFML is that the player can not go outside the bounds of the map.

Quote from: "Nothingness0x"

the .map is an image that i load in my game ? Or just a file with information about the tiles and collision ? Because if the map is bigger than the screen, does it work ? (i have a scrolling management)
 thx


No it is not an image, again information on what this file contains is explained in the manual like the very last few pages I talk about how the information is laid out in that file, but basically each layer, each background, and the collision layer are stored.  You must also have the tileset you used for the map in your project as the tileset graphics is not stored in the map file. (As I find it better this way storing the tileset with the map makes things bloated if you use the same tileset for each map).


But yeah this was in the first post, but it is the source code I have written to make a small program that

1) Loads a map
2) Displays a player
3) You can move the player around with the arrow keys
4) It does check if the player can move to that tile. (Collision Layer)
5) The player can not go outside of the map.
6) Scrolls the map if the map is bigger than the screen and the player moves (The player is always in the center except for when he reaches the edge of the screen).




Quote from: "Nothingness0x"
I also would like to report a bug :

When you try to switch the current layer and The select tool is activated, the program crashes.

Do not forget to answer my questions above though  :D


Ok, I will have this fixed.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 23, 2010, 02:19:04 am
I tried to test your map walker but the compilation doesnt work, why ?

Here are the error I get :

||=== MapWalker, Debug ===|
C:\Users\user\Desktop\New Folder\map walker\Background.hpp|46|error: `sf::Renderer' has not been declared|

C:\Users\user\Desktop\New Folder\map walker\Background.hpp|46|error: ISO C++ forbids declaration of `queue' with no type|

C:\Users\user\Desktop\New Folder\map walker\Player.hpp|28|error: `sf::Renderer' has not been declared|

C:\Users\user\Desktop\New Folder\map walker\Player.hpp|28|error: ISO C++ forbids declaration of `queue' with no type|

C:\Users\user\Desktop\New Folder\map walker\Player.hpp|51|error: cannot declare variable `player' to be of type `Player'|

C:\Users\user\Desktop\New Folder\map walker\Player.hpp|51|error:   because the following virtual functions are abstract:|

C:\Program Files (x86)\CodeBlocks\SFML-1.5\include\SFML\Graphics\Drawable.hpp|341|error:  virtual void sf::Drawable::Render(sf::RenderTarget&) const|

C:\Users\user\Desktop\New Folder\map walker\Map.hpp|60|error: `sf::Renderer' has not been declared|

C:\Users\user\Desktop\New Folder\map walker\Map.hpp|60|error: ISO C++ forbids declaration of `queue' with no type|

C:\Users\user\Desktop\New Folder\map walker\Map.hpp|80|error: cannot declare variable `map' to be of type `Map'|

C:\Users\user\Desktop\New Folder\map walker\Map.hpp|80|error:   because the following virtual functions are abstract:|

C:\Program Files (x86)\CodeBlocks\SFML-1.5\include\SFML\Graphics\Drawable.hpp|341|error:  virtual void sf::Drawable::Render(sf::RenderTarget&) const|

C:\Users\user\Desktop\New Folder\map walker\BinaryMapReader.cpp||In member function `int BinaryMapReader::ReadBGDS(std::ifstream&, Map&)':|

C:\Users\user\Desktop\New Folder\map walker\BinaryMapReader.cpp|304|error: cannot allocate an object of type `Background'|

C:\Users\user\Desktop\New Folder\map walker\BinaryMapReader.cpp|304|error:   because the following virtual functions are abstract:|

C:\Program Files (x86)\CodeBlocks\SFML-1.5\include\SFML\Graphics\Drawable.hpp|341|error:  virtual void sf::Drawable::Render(sf::RenderTarget&) const|
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 23, 2010, 03:24:20 am
It requires using SFML 2.x
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 23, 2010, 03:40:21 am
ohh okay :) anyway I will wait the last version of your program to finally use it, so maybe in that time sfml 2 will be realesed :)

Anyway you're a genius and I hope you'll finish your editor in an ultimate version very soon :)

ps : can you post a .exe version of what the map walker is supposed to be ? So i can just see without getting sfml 2 and without compiling, if you dont have time its no big deal :)
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 23, 2010, 04:07:57 am
It is included with the program.

I.e. When you select PlayTest within the View menu it automatically runs that program passing the current map as a parameter.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 23, 2010, 04:36:53 am
I saw that but it doesnt work, i see a windows opening and close directly ...
do i have to put a start for a suppose character or i dunno ?

But i was talkiing about a .exe in the map walker folder, i mean you compile it and you post it with the exe inside cause i cannot compile without sfml 2.

strange anyway for the play test ..
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 23, 2010, 05:19:43 am
i noticed problems with backgrounds, i can't make it run left to right for example, its always up to down, i cant control the speed of its scrolling, in the exemple Hey.map i cant remove the background below the grass part ...
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 23, 2010, 05:41:31 am
Quote from: "Nothingness0x"
i noticed problems with backgrounds, i can't make it run left to right for example, its always up to down, i cant control the speed of its scrolling, in the exemple Hey.map i cant remove the background below the grass part ...


It is a background. Not a layer.  To change how the background scrolls

Under the Map window, Choose properties.

In the Notebook choose the Background Tab.

From there there should be a Background called The Sky.  Select it from the Listbox.  You can then modify the properties of this background such as the speed it scrolls and its direction.


Also Like I said a few posts back, If you wait until I am completely done with the program you will be waiting forever.  I get (or think of) feature requests on stuff to add all of the time. You could be waiting infinitely for it!

This may help a bit to see where I am, but I will update the features list (It will be in the user manual in a nicer format than presented here) in the next version http://trickster.wg2140.com/Temp/requirements.txt
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 23, 2010, 07:34:15 am
for the background i get it but the problem in the Hey example, i dont understand why i cant remove the sky on the right and below the map, it would be normal to leave it just above no ?

yes but i mean i can wait some months more so you can finish the animated tiles, the new collision system and stuff ...

please work fast hahaha
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 23, 2010, 10:17:25 am
Its how it draws itself on the screen.  In that example it is a repeatedly drawn background.  So wherever the current view is it will draw so in this case if you maximize the window Everywhere on that right window you will see the background including the area outside the bounds of the map. So if it really bothers you then just stretch the map window to fit the bounds of the map.



The other option is to only draw it once, which would not look very good for that sky background. The background will be drawn once and it will move each frame anywhere where the background isn't will be whatever is under that background In the program's case Gray.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 23, 2010, 11:53:00 am
I'm sorry but playtest doesnt work ... when i click i see a new windows that opens but it closes directly, i dont even have time to see whats in the window ... :?
Title: Tilemap Editor (working title)
Post by: TricksterGuy on June 25, 2010, 09:10:38 am
hahaha, what I welcome bug reports. I'm not going to get angry.

Could you give me a bit more information?

For instance,
Did you save the map before choosing that option?
Did the map have a valid tileset associated with it?
Title: Tilemap Editor (working title)
Post by: Nothingness0x on June 25, 2010, 10:12:53 pm
yes and yes simply because i tested it with your map exemple :)
Title: Multiple Collision Layers?
Post by: Megatron on July 10, 2010, 11:45:15 pm
Maybe you can do this already, but I'm wondering how you would handle a map with multiple levels with this editor? (for example a bridge overhanging a walkable area, youd need to be able to walk under the bridge while you're on your base level, but then youd need to add a collision layer to the boundaries of the bridge when you move up so the character cant walk off the bridge). The easiest way i could think of would be to add an event that switches the collision layer when you pass over the tile associated with the event.
Title: Re: Multiple Collision Layers?
Post by: TricksterGuy on July 13, 2010, 01:27:29 pm
Quote from: "Nothingness0x"
yes and yes simply because i tested it with your map exemple :)


Ok I will look at this again before next release

Quote from: "Megatron"
Maybe you can do this already, but I'm wondering how you would handle a map with multiple levels with this editor? (for example a bridge overhanging a walkable area, youd need to be able to walk under the bridge while you're on your base level, but then youd need to add a collision layer to the boundaries of the bridge when you move up so the character cant walk off the bridge). The easiest way i could think of would be to add an event that switches the collision layer when you pass over the tile associated with the event.


In its current state no, that would need some specialized support. I will look into it when I start working on different types of Colllision Layers which I am planning on after I finish animated tiles.
Title: Tilemap Editor (working title)
Post by: Nothingness0x on July 15, 2010, 09:54:06 pm
trikster i cant wait till the animated tiles, pixel perfect collisions, and the things witht he bridge are done ... how things are going on ? I come to this topic everyday to check it out
Title: Tilemap Editor (working title)
Post by: Hugo on July 19, 2010, 04:47:43 pm
How does e collision detection work? Is there. Check for collision function in your code?
Title: Tilemap Editor (working title)
Post by: Nothingness0x on October 03, 2010, 07:07:34 am
Hey man,

I hope you haven't given up this project, cause it's been a while without news, I count on you for finishing this awesome editor :) Please give news.
Title: Tilemap Editor (working title)
Post by: Canadadry on October 10, 2010, 02:16:54 pm
Could you released the source to not let died this project and I also wanna ported it on mac, or at least tried.
thanks
Title: Tilemap Editor (working title)
Post by: TricksterGuy on October 26, 2010, 07:25:45 am
Quote from: "Nothingness0x"
Hey man,

I hope you haven't given up this project, cause it's been a while without news, I count on you for finishing this awesome editor :) Please give news.


I have not, I'm just busy with life and school.  I am graduating this semester. And that plus other school related projects I have little time to work on this.  There may be an update before the end of the year

I am working on redesigning the application front-end and back-end.  I'm not pleased with how I designed this.


Quote from: "mooglwy"
Could you released the source to not let died this project and I also wanna ported it on mac, or at least tried.
thanks


The only problem is that I am using SFML 2 and SFML 2 as I last heard does not work on Mac.

So theoretically when that is done it should theoretically work on macs

Also my code is ugly
Title: Tilemap Editor (working title)
Post by: gsaurus on November 08, 2010, 05:53:22 pm
A small thing:
When you use the select tool and then press Del, the map isn't automatically updated  :wink:
Title: Assertion error :(
Post by: felipehen on November 27, 2010, 06:57:50 am
Hello.
I am get this error when trying to open a map:

(http://img703.imageshack.us/img703/1707/imagemxo.png)
Title: Re: Assertion error :(
Post by: TricksterGuy on November 29, 2010, 09:30:25 am
Quote from: "gsaurus"
A small thing:
When you use the select tool and then press Del, the map isn't automatically updated  :wink:


Thanks

Quote from: "felipehen"
Hello.
I am get this error when trying to open a map:

(http://img703.imageshack.us/img703/1707/imagemxo.png)


Could you give me more information?
How about did you try to open a map you created yourself or one of the example maps?


Also to anyone waiting on an update.  I apologize for keeping you waiting, but I am pretty busy with college, teaching, and other projects (which takes up almost all of my time).  I am graduating in about 3 weeks and I will have some time to work on this after that :D
Title: Tilemap Editor (working title)
Post by: Nothingness0x on August 22, 2011, 01:49:12 pm
A big up for you my friend, It looks like you entierely gave up the project, but just to show you that some people are still waiting for a final version ...
Title: Tilemap Editor (working title)
Post by: TricksterGuy on September 12, 2011, 06:35:48 am
Haha thanks, but I haven't given up sorry about not keeping you posted.  Other things like school and work take over :/

I'm working on making the program crossplatform at this time; however, running it on linux does have some major issues at this time seems like wxWidgets and SFML don't want to get along...
Title: Tilemap Editor (working title)
Post by: Nothingness0x on September 23, 2011, 07:05:40 am
Hey dude, nice to hear from you and glad to see that you're still motivated, make it crossplateform ? That's nice, but you put apart all the features you wanted to implement for now ?