Page 1 of 2 12 LastLast
Results 1 to 10 of 40

Thread: TileStudio for Lazarus

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    I'm glad to see this tool is still begin worked on. (even if slowly) Would the tool Tiled be of any inspiration?

    I've been using it myself for my Game Maker Studio projects and it's pretty decent. There could be a few more features of course. I like how they included isometric as well as the normal 1:1 tile grid.

    Something I'd love to see is a hex tile grid. Maybe animated tiles and of course the ever popular auto-tiles.

    Would you consider making Tile Studio export to various formats? XML, match other popular tools (like Tiled), JSON and others?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2
    Quote Originally Posted by WILL View Post
    There could be a few more features of course. I like how they included isometric as well as the normal 1:1 tile grid.

    Something I'd love to see is a hex tile grid.
    At the moment only normal 1:1 tile grid will be supported. But since the map drawer/editor is a TFrame with all functionality inside it should be easy to add isometric and hex tile grids too.

    Quote Originally Posted by WILL View Post
    Maybe animated tiles and of course the ever popular auto-tiles.
    Not sure what "auto-tiles" is. Animated ones might be in the future too.

    Quote Originally Posted by WILL View Post
    Would you consider making Tile Studio export to various formats? XML, match other popular tools (like Tiled), JSON and others?
    Actually this will be the strong point. The application will allow to define the output format by using a simple description language, simpler than the original TileStudio.
    No signature provided yet.

  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Here is a couple articles/tutorials on auto-tiles: here and here

    And now an interesting video on some dude making an auto-tile...

    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4
    Thanks. Actually I planned to add it but didn't know how was called.

    Nice tutorials.
    No signature provided yet.

  5. #5
    There are only two undeniable truths in this universe:
    1. Human stupidity has no limits.
    2. I'm the less tenacious programmer ever.

    Anyway, after playing with Tiled I decided to continue with this project, as I really need a simple tilemap editor (I'm still wondering why are other ones so complex ).

    But (and here is where my human stupidity is involved) I didn't found a clean copy of the project. It seems as I forgot to do a back-up of the latest barely-stable version and I had found a broken one. Broken because it has an unfinished "brush-selector" much like the original TileStudio one. So (more stupidity involved) I started to clean and fix, and I decided to wipe-out Allegro from the program. I started to use LCL's TBitmap and TPicture components. They aren't as bad as I remember. But not everything is wrong: I did some smart work with a few wrapper classes around Allegro's bitmaps so porting isn't so big pain. The bad thing is it loads BMP files only. But it's 0k now.

    At the moment it seems to import tiles correctly. Now I should update the tile selector.
    Last edited by Ñuño Martínez; 19-08-2016 at 05:46 PM.
    No signature provided yet.

  6. #6
    After playing with code, I'm stuck. There's something in TBimap, TPicture, TPaintBox and TCanvas that I don't understand. Sometimes they don't render what is supposed to. I'm tired of this so I decided to hack the Allegro.pas' demo map editor. Fortunately I can borrow some stuff from the work I did.
    No signature provided yet.

  7. #7
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    Quote Originally Posted by Ñuño Martínez View Post
    After playing with code, I'm stuck. There's something in TBimap, TPicture, TPaintBox and TCanvas that I don't understand. Sometimes they don't render what is supposed to. I'm tired of this so I decided to hack the Allegro.pas' demo map editor. Fortunately I can borrow some stuff from the work I did.
    maybe you should try sdl2 it seem pretty easy to work with.

  8. #8
    Interesting to read a thread like this...
    @Ñuño Martínez, sorry for not replying, I don't remember ever seeing your mail.

    Anyway, I've tried get Tile Studio to compile in Lazarus many times over the years and always failed, until this time.

    Now I got the tile editor working (almost) completely. The map editor however doesn't do much. There are some really strange things going on with the Canvas.Draw function with transparent bitmaps.

    It took me quite a while to figure out that the behavior of TabControl.TabIndex and Form.Resize are different from Delphi in whether events are fired or not. I don't know if such things are bugs or maybe intentional choices.

    Anyway, the newest source code is available on github: https://github.com/Wiering/Tile-Studio/tree/lazarus, maybe some of you lazarus experts immediately see what the issues are, any help would be appreciated!

  9. #9
    Quote Originally Posted by Wiering View Post
    Interesting to read a thread like this...
    @Ñuño Martínez, sorry for not replying, I don't remember ever seeing your mail.
    Don't worry. You're here now!

    Quote Originally Posted by Wiering View Post
    Anyway, I've tried get Tile Studio to compile in Lazarus many times over the years and always failed, until this time.

    Now I got the tile editor working (almost) completely. The map editor however doesn't do much. There are some really strange things going on with the Canvas.Draw function with transparent bitmaps.
    I know, I had the same problems. No idea why it doesn't work correctly.

    Quote Originally Posted by Wiering View Post
    It took me quite a while to figure out that the behavior of TabControl.TabIndex and Form.Resize are different from Delphi in whether events are fired or not. I don't know if such things are bugs or maybe intentional choices.
    I recommend to use TPageControl instead. The advantage is you don't need to "draw" the stuff by yourself tracking the tab changes. The bad thing is that it may need more memory but I think it is not your case.

    Quote Originally Posted by Wiering View Post
    Anyway, the newest source code is available on github: https://github.com/Wiering/Tile-Studio/tree/lazarus, maybe some of you lazarus experts immediately see what the issues are, any help would be appreciated!
    Ok, I've look at the GitHub project and I have to say something:

    Use subdirectories! Please. "src" for sources and "bin" for the final binary. And "docs" for documentation. Really, it will help a lot.

    The main problem I had when I worked with your code is that most of it is in the main form. That mean thousand controls and it's hard to keep track of they all. You should split the stuff, using TFrame for different control groups (i.e. I did a TFrame for the "brush" selector, another one for the tiles selector, etc). This will also group your code and increase the order.

    Also separate "logic" and "GUI" should help too. For example, split the "tile selector" in two units, one for the logic (i.e. add, remove, replace, load, save...) and the other will be the GUI that just renders the tiles and allows the user to select one of them.
    No signature provided yet.

  10. #10
    Quote Originally Posted by Wiering View Post
    There are some really strange things going on with the Canvas.Draw function with transparent bitmaps.
    Quote Originally Posted by Ñuño Martínez View Post
    I know, I had the same problems. No idea why it doesn't work correctly.
    Can you guys provide some more information about this so together we might try to figure this out.

    Quote Originally Posted by Ñuño Martínez View Post
    Also separate "logic" and "GUI" should help too. For example, split the "tile selector" in two units, one for the logic (i.e. add, remove, replace, load, save...) and the other will be the GUI that just renders the tiles and allows the user to select one of them.
    Separating logic from GUI is always a good approach. Why? Because by doing so you are making first step toward multiplatform support since usually the main difference between different platforms is the way how GUI is handled. Not to mention that you might also be opening yourself an option to start moving some lengthy operation into separate threads if needed.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •