Are there plans to use the Tiled editor in the future?

Are there plans to use the Tiled editor in the future?

Postby Roots » 24 Dec 2014, 23:39

This is something I've been curious about for a while. I thought I read/heard somewhere that VT was planning to stop using the current VT map editor and to use the Tiled map editor instead. Is this true? Is this planned for the future? Was this discussed but decided not to follow through with converting? I can certainly understand why if so. The Tiled editor seems much more mature and complete than the VT editor, which is an improved version of the Allacrost editor. If Tiled existed when Allacrost got started, we probably would have used that editor (and contributed to it) instead of making our own. A few months ago I considered moving Allacrost to Tiled, but decided against it because it would require a lot of work and we'd have to add a major feature to the editor to support Allacrost maps.


I have studied the heck out of the latest VT editor and brought its features and design back into Allacrost. In the process, I ended up pretty much rewriting the Allacrost map editor completely from scratch, as both the Allacrost editor code and VT editor code had poor software architecture and was somewhat of a mess. I'm still working on it and probably will be for at least another month or two, but the code is much, much easier to understand and maintain now and easier to use as well. If VT isn't going to use Tiled, maybe it would be worth while to re-take the editor code from Allacrost? You'll need to make a couple changes (removing the map context feature and changing the read/write map file functions), but I don't think it will be too much work to do. If you're interested in the new Allacrost editor code, let me know and I would be happy to help VT adopt it in the future. I don't think it would be wise to start using our code until February at the earlierst though.
Image
Roots
 
Posts: 96
Joined: 04 Mar 2010, 21:54

Re: Are there plans to use the Tiled editor in the future?

Postby Bertram » 27 Dec 2014, 02:50

Hey,

Roots {l Wrote}: I thought I read/heard somewhere that VT was planning to stop using the current VT map editor and to use the Tiled map editor instead. Is this true?

This was indeed an ideal goal. The initial plan was to create an import plugin for VT and go ahead with this, especially as Bjorn is an old virtual friend and his tool is awesome.

This was before I start digging in Tiled code and saw that both an animation editor and support for custom tile size per layer support (for collisions) were lacking.
Since then, the animation editor has been added, and as I decided to make the VT editor import Tiled maps in the future, the collision part can be done once in the VT editor.

But yes, VT won't open tiled maps but I'll work toward adding an import function from a lua-based exported tiled map, and yes, I'll keep the VT editor for maps.

As for importing functionalities from HoA to VT about map editing. Well, I must say I'm eager to see what you have done with Hoa in term of map editing, code design and such, but I won't have time for this until a few weeks when I see my own TODO list and patches to finish, but I will gladly have a look at this sooner or later.
I do hope that porting the VT editor to QT 4.8.x was useful for your own dev time, though.

Two things that also are really needed for maps IMHO, are:
1. Add an option to make it possible to edit the collision layer within the editor, and flag the map as having a custom collision set.
2. Add support for tilesets with different size than the old fixed 512x512 (even if it is fitting most of the needs.)

I must say that those were the next things I wanted to add to the VT editor.

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Are there plans to use the Tiled editor in the future?

Postby Akien » 27 Dec 2014, 17:13

I don't know how far VT and HoA are from each other now, but generally speaking it would be awesome if you could have one editor for the two games. This way you could work on it together, but of course it can only be done if VT and HoA still use the same kind of maps.
User avatar
Akien
 
Posts: 723
Joined: 22 Feb 2014, 13:14

Re: Are there plans to use the Tiled editor in the future?

Postby Roots » 27 Dec 2014, 19:24

Cool, good to know.

Bertram {l Wrote}:As for importing functionalities from HoA to VT about map editing. Well, I must say I'm eager to see what you have done with Hoa in term of map editing, code design and such, but I won't have time for this until a few weeks when I see my own TODO list and patches to finish, but I will gladly have a look at this sooner or later.
I do hope that porting the VT editor to QT 4.8.x was useful for your own dev time, though.


To the user, there's not a whole lot of difference between the VT editor and the latest Allacrost editor. The same widgets are found in the same locations. I removed the layer editing toolbar because I thought it stuck out like a sore thumb. Instead, you can do everything you did with that toolbar by interacting with the layer widget itself. You can drag and drop layers to reorder them. Double click their name and edit their name to whatever you wish. Toggle whether they are ground/sky layers (I instead called this a collisions property), and right click in the widget to add/rename/delete layers appropriately. Another change is that I added another tree widget that operates very similar to the layer widget that handles map contexts in the same way. VT doesn't use contexts, so you'd just remove this widget from your editor if you choose to import the changes back. I'm also planning to make minor improvements to the tileset tab widget (making it easier to go through all tileset tabs) and the main window menu and toolbar.

Most of the changes are in the underlying class structure to make the code more sane and easier to maintain. For example, I pulled out all of the map data from the Grid class (which I renamed the MapView class) into a MapData class. The editor keeps an instance of MapData and passes a pointer to it to each widget that may need to access or modify the map data (the map view, the layers widget, etc.). Just about every class except for the dialog boxes and tileset editor have undergone a complete restructuring of their innards. And yes, moving to QT was nice. I was most excited to remove the use of our video engine to render the scene in the editor, as that was something that we always felt wasn't necessary and causes more trouble than its worth.

Oh, we also followed your example and separated out maps into separate data and scripting files. This has been awesome. We are able to write multiple script files that use the same map, so it helps keep our map scripts more organized and easier to read through. It looks like to me that VT still uses a single script for every map file, which is fine. Its just that certain maps (like Layna Village) have a ton of different scripting paths for different events that occur throughout the game on those maps. I also updated our map data file format, which you can read about here: http://www.allacrost.org/wiki/index.php/Map_File . I doubt VT is going to want to convert to a new map file format considering how many maps you already have released that would need to be converted over. It's really easy to edit the load/save map function in the allacrost editor code to store the map data in whatever way you like.

Bertram {l Wrote}:Two things that also are really needed for maps IMHO, are:
1. Add an option to make it possible to edit the collision layer within the editor, and flag the map as having a custom collision set.
2. Add support for tilesets with different size than the old fixed 512x512 (even if it is fitting most of the needs.)


I've thought about the first for a long time, but I've never made it a priority because I don't think we're going to need to use such a feature anytime in the near future. I have no interest in supporting the second feature.

The features I want to add to the editor are more focused on usability and making it easier and faster to produce quality maps. Maps were so tedious and frustrating to make with our old editor. It was a major reason why Allacrost stalled out a couple years ago. Here's the list of features I'd like to add.

  • Add support for making custom shape selection areas
  • Add support for changes to selection area to apply to more than one tile layer
  • Add support for changes to selection area to apply to more than one context
  • Add support for cut/copy/paste from one layer to another
  • Add support for cut/copy/paste from one context to another
  • Add support for cut/copy/paste across multiple layers

Essentially I want the selection tool to be more powerful and to be able to make changes across multiple layers at once. Imagine a city map with a lot of nearly identical houses. Instead of building each house from scratch, what I would like to do is to make an "average" house exactly once, then select the entire house (which isn't always going to be perfectly rectangular) and hit Ctrl+C and Ctrl+V to paste multiple copies of it all over the map. Then, a user can make changes by changing the dimensions of the home, filling in the contents of the interior, etc. That would make map editing so much faster and remove the tedious laying down of individual tiles over and over to build each home from scratch. These aren't features that are guaranteed to be added to our editor this release though. It depends on where I'm most needed, as I'm currently the only one working on our map editor. Maybe if we find another developer devoted to the editor we could get this set of features in.
Image
Roots
 
Posts: 96
Joined: 04 Mar 2010, 21:54

Re: Are there plans to use the Tiled editor in the future?

Postby Roots » 27 Dec 2014, 19:29

Akien {l Wrote}:I don't know how far VT and HoA are from each other now, but generally speaking it would be awesome if you could have one editor for the two games. This way you could work on it together, but of course it can only be done if VT and HoA still use the same kind of maps.


We've diverged enough that we can't share the exact same editor code, unfortunately. Allacrost makes use of a feature called map contexts, which lets you construct multiple maps within a single map. The most common use for this is that when you enter a building, the map instantly changes to reflect the buildings interior, but you are still on the same map. VT decided not to use this feature and instead creates a lot of individual smaller maps. There are pros and cons to each approach.

We're still close enough though that certain features are easy to borrow from one another. When I rewrote our editor code, I largely started by replacing large sections of the Allacrost editor with code from VT's editor. If I did it the quick and dirty way, it wouldn't have taken me so long for Allacrost's editor to be nearly identical to the VT editor. But when I saw how much of a mess the code in both editors were, I decided to take it a step further and really work to improve it. It took me the better part of a couple months, but I think it is worth it in the long run.
Image
Roots
 
Posts: 96
Joined: 04 Mar 2010, 21:54

Re: Are there plans to use the Tiled editor in the future?

Postby Bertram » 28 Dec 2014, 00:43

Well, it's true I don't plan to use contexts as it makes map data handling and understanding much harder. (Not giving excuses here, just personally think it's not worth it.) Roots wants map context and they can actually look good, especially in towns where I witnessed it in the demo. :)

I'd rather like to focus on custom collision edition support and tileset with a not fixed size support instead.

Apart from that, I guess it will be always back and forth between our two projects, one taken updates from the other and vice versa, as usual. ;)

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Are there plans to use the Tiled editor in the future?

Postby Roots » 21 Jan 2015, 05:50

I'm nearly finished with my redesign of the Allacrost editor. I'm going to be producing a short video explaining it's usage sometime within the next couple of weeks, but for now here's a sneak preview with some of the changes from the old Allacrost editor (inspired by both the VT editor and the Tiled editor)

Image

A few notes:
  • The screen devoted to the map is much greater than before, now that the tileset data is moved to the right side of the screen (instead of the bottom)
  • You can easily see what layer and context you are working on with the two widgets at the top right. You can double click and right click in these widgets to change properties or add or remove layers or contexts.
  • Tileset tabs are easier to navigate than before (I think...can't remember how they used to be).
  • The main menu is cleaned up and is now much simpler. Each menu contains exactly what sort of commands/options you would expect.
  • The main toolbar is a bit busier now. On the left are buttons for undo/redo (currently disabled because this feature isn't there). On the right are our eight different tools. The first four are the more basic/single tile tools, while the last four are for applying an operation to an area of tiles. Also the hotkeys for these tools are now 1-8, making it easier to than trying to remember "p for paint, s for swap, r for select, ..." etc.
  • On the map view, you'll notice some areas have an orange tint. This is the "missing tile" overlay, which shows you where no tiles are painted for the selected layer (in this case, the ground layer).
  • The blue tile areas show the area that the user has selected. As you can see, we can now easily make custom shape selection areas with the Shift and Ctrl key modifiers. The selection area doesn't have to be congruent either.
  • The green area shows the paint-preview feature. We've selected this ground of tiles from the tileset, and the preview is showing where those tiles would go if the mouse was clicked at the current cursor location. Much easier to see what you're doing and figure out where things are going to go.

(Apparently this forum doesn't handle large images very well and the right-end got cut off. You can see the full image on the Allacrost forums right here).
Image
Roots
 
Posts: 96
Joined: 04 Mar 2010, 21:54

Re: Are there plans to use the Tiled editor in the future?

Postby Bertram » 23 Jan 2015, 15:05

Congrats, roots.

I'm sure you've made a fine step toward better mapping support. :)

I'll a look at the code on my next holidays and see the new beast shines.

I should have sorted out the other things I'm working on, too by then.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Are there plans to use the Tiled editor in the future?

Postby Roots » 29 Jan 2015, 08:06

I recorded a video tonight demonstrating the new editor and various features.


youtu.be/2Su31AWg3t4

If you decide to go through the code and adopt any of these changes, I'd be happy to help you figure it out. I think if you remove all of the features surrounding contexts and change the save/load feature (because our projects have different map formats now) it should pretty much do everything you'd need it to.
Image
Roots
 
Posts: 96
Joined: 04 Mar 2010, 21:54

Re: Are there plans to use the Tiled editor in the future?

Postby Bertram » 30 Jan 2015, 15:48

Hey there, :)

Excellent video! :D I'm glad you could have taken up VT code and work from there. The editor really is shining now.

If you decide to go through the code and adopt any of these changes, I'd be happy to help you figure it out. I think if you remove all of the features surrounding contexts and change the save/load feature (because our projects have different map formats now) it should pretty much do everything you'd need it to.

I'll sure do! The sole feature that is still truly lacking is undo support, IMHO. Once I've imported the code, I'll work on that if you haven't done it, so hopefully, you'll be able to retake that part for HoA as well. :)

On the general scheme, I think only three things are lacking in the editor:
- Undo support (I'm not even sure about whether redo is worth it.)
- Tileset of any size.
- Custom collision editor within the map editor, as sometimes this is handy.

Once all that is in the box, the map editor can considered complete as a 1.0 IMHO.

All the best for what's next!
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Are there plans to use the Tiled editor in the future?

Postby Roots » 30 Jan 2015, 18:45

Glad you like it. :) One feature I forgot to show in the video is that when you select a group of tiles with the selection tool, you can right click to access a menu and you can move or copy the selected tiles to a different tile layer or map context. This makes it much easier to lay down objects that you want on more than one layer, because you just need to select the object from the tileset and put it down on one of the layers, then select the portion of the object that goes on another layer and move it there.


It is vastly different from the VT code, as you will find. Perhaps most significantly, I separated out the data portion of the map into it's own class, and the various GUI objects pass around a reference to the active map data object. Yes, the undo feature is sorely needed. I just had to call it quits at some point, otherwise I could easily work on this editor for another several months. I also really want the cut/copy/paste feature to be available. I'm thinking about posting in a Qt community with this video and seeing if anyone there would be interested in contributing to adding on these features. The custom tileset sizes is not something we intend to support (although adding it shouldn't be too difficult). I do agree that the custom collision editor would be very nice to have.


I'll keep this thread updated if there's any major developments that happen in our editor in the near future. But unless we find someone who wants to work on the editor, I have no intention of spending any more of my time on it for our current release cycle.
Image
Roots
 
Posts: 96
Joined: 04 Mar 2010, 21:54

Re: Are there plans to use the Tiled editor in the future?

Postby Bertram » 31 Jan 2015, 15:31

Hey,

It is vastly different from the VT code, as you will find. Perhaps most significantly, I separated out the data portion of the map into it's own class, and the various GUI objects pass around a reference to the active map data object.

Model view controller paradigm I guess? Sounds pretty relevant for everything related to heavy GUI needing apps. Cool you did it that way. :)

Yes, the undo feature is sorely needed.

I'll be on it. I don't know when, eh. But I'll work on this.

I just had to call it quits at some point, otherwise I could easily work on this editor for another several months. I also really want the cut/copy/paste feature to be available. I'm thinking about posting in a Qt community with this video and seeing if anyone there would be interested in contributing to adding on these features. The custom tileset sizes is not something we intend to support (although adding it shouldn't be too difficult). I do agree that the custom collision editor would be very nice to have.

Well, you can't spread any thiner, so there is no problem to me about anything. I hope you'll keep enjoying to do one task after another until some help comes along.

I'll keep this thread updated if there's any major developments that happen in our editor in the near future. But unless we find someone who wants to work on the editor, I have no intention of spending any more of my time on it for our current release cycle.

I'll then update the topic myself once I've got something done on VT.

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Are there plans to use the Tiled editor in the future?

Postby Roots » 02 Feb 2015, 05:30

Initially I wanted to do a MVC architecture, but after some reading I realized Qt's design doesn't lend itself very well to that paradigm. Instead I just used a MV architecture. There's several data classes and one "mega" data class (MapData) that represents the entire map state (everything that you would save to the map file). And then there's a different class for each widget in the main window: Editor (main window), MapView, LayerView, ContextView, and TilesetView. The code follows a much better design than before, but it still feels like it could use some improvement. For example, the Editor widget maintains an instance of the MapData class and passes around a pointer to it when all the other widgets are created. Sometimes a widget will update MapData, and the other widgets need to be notified of the change so they can update themselves accordingly. Most often, this is one of the non-MapView widgets updating the map data and the MapView widget has to change what's currently drawn on the screen. The way I do that is the Editor class has some handling calls that the view widgets make, and those calls update the map view. Might be a better way to do that sort of thing, but for now it works.


I used the editor extensively this weekend in making a new map, both because we needed this map and because I needed to do some intense usage to find and fix any remaining bugs. Worked like a dream. There were a few times where I wanted to hit "undo", but the wealth of features now available made it much easier to fix my own mistakes. Particularly being able to select a group of tiles and tell the editor to "do something to this set of tiles in this layer". Here's the result from about 3-4 hours of work (still a work in progress):

http://imgur.com/a/ttfGE
Image
Roots
 
Posts: 96
Joined: 04 Mar 2010, 21:54

Who is online

Users browsing this forum: No registered users and 1 guest