Subversion Commit Log

For discussion of the code running behind the game

Moderator: Staff

User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sun Dec 07, 2014 8:02 am

Committed revision #2103.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/map_data.cpp
    M src/editor/map_data.h

Primary Changes
  • Tile layer names and information now display correctly in the top widget
  • Changed new maps to default from using a single layer named "Ground" to three layers: "Ground", "Detail", and "Sky"

Notes
Ground/Detail/Sky are effectively the same things that we used to call the Lower/Middle/Upper layer. This default setting is used because it is the most common I think we'll see in the game, so I thought it made more sense to have this be our initial layer format for a new map rather than a single layer that requires the user to add more layers as necessary. Of course these layers can all be renamed and removed. The sky layer has collisions disabled by default (that is, no collision info from tiles in this layer is taken into account when constructing the map grid).

The layer names/properties can currently not be modified after a map is initially created or loaded. Of course I'll make this feature happen at a later time. I'm debating whether or not to remove the layer toolbar (a series of small buttons displayed just below the layer widget). The reason being is that I feel any action we need to take with layers can be done directly in the widget. You can double click the layer name, eye icon, or collisions property to change the value. You can drag layers to reorder them (a lot easier than clicking a move layer up/down button several times). You can right click a layer to delete it (and give the user a confirmation). Just seems like a better UI design to me. :shrug: I'll think about it.

Next step is to fix the editable area of the map so that map tiles can be drawn (currently its just a big black space and if you click in it, nothing happens). Once that is complete, we should have the core features of the editor functional again. I'm surprised that so far fixing the editor bugs introduced by the refactoring overhaul have been pretty darn simple and easy. Hope it continues to be this way, as it will get us back to work on our maps that much sooner. :approve: :hack:
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sun Dec 07, 2014 5:08 pm

Committed revision #2104.
============================================================
Files Modified
    M src/editor/dialog_boxes.cpp
    M src/editor/dialog_boxes.h
    M src/editor/editor.cpp
    M src/editor/editor_utils.h
    M src/editor/map_data.cpp
    M src/editor/map_view.cpp
    M src/editor/tileset.cpp

Primary Changes
  • Fixed map view widget so that the editable map area is viewable in the editor again
  • Fixed missing icon for marquee select

Notes
All core functionality of the editor is now working. :D You can create a new map, paint tiles (including groups of tiles), move tiles, delete, etc. The marquee selection tool is broken (edits incorrect areas of the map and/or leads to a seg fault). You can also only edit the bottom most tile layer. You can't insert/remove rows or columns either, although the menu appears just fine. I might work on fixing this next, and then get to work on the tile layer widget.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Mon Dec 08, 2014 5:21 am

Committed revision #2105.
============================================================
Files Modified
    M src/editor/map_data.cpp
    M src/editor/map_view.cpp

Primary Changes
  • You can now insert and delete rows and columns of tiles in the map editor

Notes
Insert/delete still needs some work. You can only do an insert or delete for one row/column at a time right now. I think what I want it to do is to open up a small dialogue window where you can select the number of rows/columns to add/remove and change the starting index when the insert/delete happens. Right now the tile that you right click is where the insert/delete will happen. This means if you want to add a column or row on the end of the map, you can't. The closest you can get is the second to last row or column. We might re-use the map properties dialogue to achieve this sort of add/remove op.

For now though, I'm leaving to-do notes and moving on to fixing more important things. Next up is working on the layer widget.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Tue Dec 09, 2014 4:37 pm

Committed revision #2107.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/tile_layers.cpp
    M src/editor/tile_layers.h
    M src/editor/map_data.cpp
    M src/editor/map_view.cpp

Primary Changes
  • Map editor is now using the new LayerView class to display the tile layer information in the top right corner of the editor. This replaces the use of a QTreeWidget in the Editor class. This was done to isolate the logic for this component of the GUI from the main editor, which will reduce the clutter and make it more maintainable
  • The LayerView class is still in a very primitive state and doesn't do much (but it doesn't do any less than it did before). I'll be gradually implementing this class one piece at a time as I figure out how to get it to do what I want.

Notes
This commit required an update to the Linux build files for the new MOC file for tile_layers.h. I put the LayerView class there because it made more sense than keeping it in editor.h. Not sure if that will be its permanent home or not, but for now that's where it will rest.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Wed Dec 10, 2014 3:25 pm

Committed revision #2108.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/tile_layers.cpp
    M src/editor/tile_layers.h

Primary Changes
  • Layer toolbar has been removed from the editor.
  • Layer view widget is now more functional. You can toggle the collision and visibility properties by double clicking the appropriate column in the widget (currently these don't have any effect to the map view display, however). The layer name can not be modified just yet as I am still trying to figure out the best way to do that.
  • Added a new class called ContextView, which like LayerView is a QTreeWidget. It displays the map context information and is just below the layer view in the main window. Currently does nothing but display the base context information.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Thu Dec 11, 2014 9:36 am

Committed revision #2109.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/map_data.cpp
    M src/editor/map_data.h
    M src/editor/tile_layers.cpp
    M src/editor/tile_layers.h

Primary Changes
  • Modifying the visibility and collision properties of tile layers now makes the appropriate changes to the map data and map view widget
  • You can edit the various tile layers now (previously you could only edit the bottom-most layer)
  • New maps don't immediately fill the layers with the first tile in each tileset anymore. New layers are blank as they should be
  • Adjusted the initial sizes of the various widgets in the editor to make better use of the window space. Also increased the initial window size to about 100x800 pixels

Notes
Please excuse the large amounts of debug prints and other temporary code that are going into these commits. This is a learning process for me so I am trying things out and don't want to clean my mess up before every commit when I'm just going to add it back in. I'll remove all of this junk eventually once things are complete.

Unless there's something I'm missing, i have three things left before the layer view widget is finished:
  • Add a right click menu to the layer view widget to allow you to add and delete layers
  • Allow the renaming of layers via a persistence editor in the object
  • Add support for layers to be dragged around to have their order rearranged

Have made some progress on all three of these tasks. If I'm lucky, I'll have this all finished by the beginning of next week. Then I'll need to move on to the context view widget.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Fri Dec 12, 2014 4:08 am

Committed revision #2110.
============================================================
Files Modified
    M src/editor/map_data.cpp
    M src/editor/map_data.h
    M src/editor/tile_layers.cpp
    M src/editor/tile_layers.h

Primary Changes
  • You can now reorder tile layers by dragging the layers around in the layer view widget. Its pretty slick. :)

Notes
When swapping the tile layers around, it seems that sometimes the layer will lose all of its tile data. Pretty sure this is a bug with the MapData class and not a bug within the widget. I'll fix it sometime soon.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sat Dec 13, 2014 5:41 am

Committed revision #2111.
============================================================
Files Modified
    M src/editor/map_data.cpp
    M src/editor/map_view.h
    M src/editor/tile_layers.cpp
    M src/editor/tile_layers.h

Primary Changes
  • You can now right click within the layer view widget and select available actions: add layer, rename layer, delete layer
  • Add layer and delete layer both work correctly. Rename layer still remains to be implemented.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sat Dec 13, 2014 7:17 pm

Committed revision #2112 and #2113.
============================================================
Files Modified
    M src/editor/tile_layers.cpp
    M src/editor/tile_layers.h

Primary Changes
  • You can now rename tile layers. This is done by either double-clicking a layer name, or right clicking any layer row and selecting "Rename Layer" from the option menu. When a layer is being renamed, a line editor opens within the widget (not a separate dialogue window) making it quick and easy to change names.
  • Made some minor improvements all around the LayerView widget. The column space for the visibility column is now fit to size (instead of being way too large for the icon). The selected layer changes appropriately when adding or removing tile layers.

Known Bugs
Layer renaming can get kind of weird if you move focus to another widget before you finish editing. It doesn't break anything, but the persistent line editor remains open and is not optimal behavior. But fixing this seems like it will require a great deal of work, and since its not terribly important I'm going to leave a note to fix it later and move on to other things.

Other Notes
I now consider my work on the LayerView widget complete. :approve: Next I'll move to the ContextView widget to get map contexts working. I might extract the TileContext and ContextView classes to a new file: tile_contexts.h/.cpp, because keeping these in tile_layers.h/.cpp is a little odd and there's enough tile layer code to really fill up these files.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Mon Dec 15, 2014 6:39 pm

Committed revision #2114.
============================================================
Files Added
    A src/editor/tile_context.cpp
    A src/editor/tile_context.h
    A + src/editor/tile_layer.cpp
    A + src/editor/tile_layer.h

Files Modified
    M Makefile.am
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/map_data.cpp
    M src/editor/map_data.h

Files Deleted
    D src/editor/tile_layers.cpp
    D src/editor/tile_layers.h

Primary Changes
  • Fleshed out the ContextView class for the editor. This widget is still largely untested and still missing some functionality. Future commits will plug these holes.
  • Moved TileContext and ContextView classes to a new file: tile_context.*. They were moved out of tile_layer.* because those files were getting to be too large.

Known Bugs
Several with the context view widget. Future testing will address and fix problems.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Tue Dec 16, 2014 4:22 am

Committed revision #2115 and #2116.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/map_data.cpp
    M src/editor/map_data.h
    M src/editor/map_view.cpp
    M src/editor/tile_context.cpp
    M src/editor/tile_layer.cpp

Primary Changes
  • Fixed numerous bugs with map contexts both in the MapData and ContextView class
  • Made some UI improvements to the columns of the layer and context view widgets

Known Bugs
  • Deleting the second context in a list brings up a harmless empty warning box. Not sure why, but it still deletes the layer and isn't harming anything, so it's a low priority for me to fix.
  • Renaming contexts are just as weird/quirky as renaming map layers. They work, but they're awkward to use. Won't be able to get around to fixing these for a while I imagine, as there's more urgent things to do.
  • The inheriting contexts feature is not enabled. I still need to look into the best way to do this. I wanted to be able to edit it and present a selection drop down to the user when they go to edit it, but I don't think this is going to be possible (or at least not very easy to do). I may decide to hack together a temporary solution instead.

Other Notes
Map context editing is now working! :) You can add/rename/delete contexts and select between the different contexts with a single click. It's very fast and much easier to use than the old editor.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Wed Dec 17, 2014 1:36 am

Committed revision #2117.
============================================================
Files Modified
    M src/editor/map_data.cpp
    M src/editor/map_data.h
    M src/engine/script/script_write.cpp
    M src/engine/script/script_write.h

Primary Changes
  • You can now save map files in the editor. Files are saved to the new map file format specified here: http://www.allacrost.org/wiki/index.php/Map_File
  • Added an option to disable table declaration lines in a Lua file when making a call to BeginTable(). (Translation: the line "my_table = {}" won't be written to the file, but it will still write data to that table just fine)

Other Notes
    Loading/opening map files is still not functioning. Working on that next.
    I expect that there may be some bugs in the save data function that I haven't uncovered yet. I only did some very basic testing so far.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sat Dec 27, 2014 1:52 am

Committed revision #2118.
============================================================
Files Modified
    M src/editor/map_data.cpp

Primary Changes
  • Fixed some problems with the save data feature in the editor that were introduced in the previous commit. Saves now appear to be working correctly.

Other Notes
  • Made a very minor change to the map file format standard (renamed table tileset_names to tileset_filenames).
  • I'm pretty confident that editor saves are now working correctly. So I'll be moving on to the load feature next. I already partially started it in this commit.
  • Back from my vacation now and will be working my butt off on the editor again.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sat Dec 27, 2014 6:57 am

Committed revision #2119.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/map_data.cpp
    M src/engine/script/script_read.cpp
    M src/engine/script/script_write.cpp
    M src/engine/script/script_write.h

Primary Changes
  • The editor can now load saved map files again.
  • Fixed another issue I found with saved map files
  • Made some slight changes to the way that we handle tables when writing Lua files in the script engine

Other Notes
With the exception of context inheritance, all the critical features needed for map development with the editor are now complete. The editor should be fully usable for editing maps with non-inheriting contexts. There are still various bugs floating around (particularly with using selection rectangles) and I still have some interior code to clean up. But still, this commit marks a huge milestone for the new editor. :approve:

I had to revert the changes I made in #2117 to the WriteScriptDescriptor class and the way it handles tables. I thought you didn't need to declare inner tables like "map_tiles[0] ={}", but I was wrong. I instead added a way where you can declare tables separately from opening them. Its just a nice little feature to organize the map data files to keep a bunch of table declarations all in one place.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sat Dec 27, 2014 11:47 pm

Committed revision #2121.
============================================================
Files Added
    A + src/editor/dialogs.cpp
    A + src/editor/dialogs.h

Files Modified
    M Makefile.am
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/map_view.cpp

Files Deleted
    D src/editor/dialog_boxes.cpp
    D src/editor/dialog_boxes.h

Primary Changes
  • Removed some old dialog classes that were for adding contexts and layers. These are unneeded as now you can do everything you need to within the LayerView or ContextView widget
  • Renamed dialog_boxes.* to dialogs.*. They are sub-windows, not boxes, so the name was deceiving.
  • Fixed the cursor coordinates as you move across the map so they display the correct position values. Also changed the formatting of this information a little bit.
  • A lot of cleanup to the Editor class. it still needs work, but its looking much better now.

Known Bugs
The editor looks quite ugly when you start it up. I'm working on it. The problem occurs because some of the widgets don't have any contents when the editor starts up, and QT minimizes these widgets instead of setting them to the sizes I request.

The layer and context widgets aren't updating appropriately when new maps are created or loaded. Should be an easy fix to make.

Other Notes
The editor got a little more buggy from this commit. It's a necessary growing pain as I clean up the final portions of the editor code and make things nice and slick.

I'm going to be changing the top level menu as I discussed a couple months ago here. Might be messing around with the main toolbar as well.

There's a lot of little bugs everywhere so I'm just going to squash them sparingly in my future commits. There are still some fairly large changes going on, so I don't want to fix something, add a new feature, and then find that my fix now has to be rewritten. Once the major features in the editor are functional, I'll go through and fix all the remaining bugs at this time. Expect bumps between now and then.

One of the features I'm going to add soon is a better way to resize maps. Currently you can only insert individual columns or rows, or resize the map so that multiple columns/rows are added to the end of the map. I think I'm going to write a new dialog class that will allow for more powerful resizing options.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sun Dec 28, 2014 9:42 am

Committed revision #2123.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/editor_utils.h
    M src/editor/map_view.cpp
    M src/editor/map_view.h
    M src/editor/tileset.cpp

Primary Changes
  • Finished cleaning up the Editor class. Members and methods are now named appropriately and the code is well organized, documented, and maintainable. Ahhh, feels so good. :cool:
  • Fixed several of the bugs that I reported in the post above (mostly fixed in the commit prior to this one, which was minor enough that I didn't write a commit log post for)
  • The main menu of the editor has been reorganized and renamed. Top level menus are now: File, Edit, View, Tools, Help
  • Minor changes to the main editing toolbar

Other Notes
This marks off yet another editor feature from the Roadmap. It was the only yellow priority feature that I wanted to finish before the editor returns to active duty, and it so happened that this feature also tied in with the cleanup of the Editor class so it worked out nicely. One more required feature remains to be added (context inheritance support).

Going to write an update and additional thoughts on the editor state later in this thread later on. We're getting really close to having an editor ready for map production again. It might be worth seeking out a QT programmer that can work on finishing the rest of the optional features for map editing. I can do them myself of course, but my efforts are likely going to be needed elsewhere once the editor is functional again.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Mon Dec 29, 2014 6:49 am

Committed revision #2124.
============================================================
Files Modified
    M src/editor/editor.cpp
    M src/editor/tileset_editor.cpp

Primary Changes
  • The tileset editor was displaying the collision data incorrectly. This has now been fixed, and the draw function for the tileset editor has also been simplified.

Other Notes
Tileset editor still doesn't work when using it to edit collision data. The clicks are corresponding to wildly different tiles. I'll fix this in the near future as well.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Tue Dec 30, 2014 4:20 am

Committed revision #2125.
============================================================
Files Modified
    M src/editor/tileset.cpp
    M src/editor/tileset_editor.cpp
    M src/editor/tileset_editor.h

Primary Changes
  • Fixed tileset editor collision editing issue. The tileset editor now functions as it did before and works well.
  • Also made the tileset editing code more efficient and easier to understand

Other Notes
There might be some issues with saving tileset definition files. This is not a fault of the tileset editor, but the tileset class itself (which stores the save code). It seems that it saves all the collision data correctly, but has trouble with the animations and/or autotiling tables. Might put this issue on the back burner, as animations are done by hand anyway and the collision data is what's really important, and that works just fine.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Wed Dec 31, 2014 7:50 am

Committed revision #2128.
============================================================
Files Modified
    M src/editor/dialogs.h
    M src/editor/map_data.cpp
    M src/editor/map_data.h
    M src/editor/tile_context.cpp
    M src/editor/tile_context.h

Primary Changes
  • You can now modify the inheriting context property in the context widget. This correctly updates the property in the map data as well

Other Notes
This is the first major step to supporting inheriting contexts. The next step is to figure out how to best change the UI so that we can "paint" tiles that use the inheriting tile. Maybe a new special kind of eraser would be best for this. The final step will be to figure out how to display inherited tiles in the editor, perhaps with a color filter drawn over inheriting tiles (and allow that filter be toggled on and off). Future commits will start working toward these goals.
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Thu Jan 01, 2015 12:37 pm

Committed revision #2129.
============================================================
Files Added
    A img/misc/editor_tools/clear.png
    A img/misc/editor_tools/close.png
    A img/misc/editor_tools/copy.png
    A img/misc/editor_tools/cut.png
    A img/misc/editor_tools/exit.png
    A img/misc/editor_tools/inherited.png
    A img/misc/editor_tools/open.png
    A img/misc/editor_tools/paste.png
    A img/misc/editor_tools/redo.png
    A img/misc/editor_tools/save.png
    A img/misc/editor_tools/save_as.png
    A img/misc/editor_tools/undo.png

Files Modified
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/editor_utils.cpp
    M src/editor/editor_utils.h
    M src/editor/map_data.cpp
    M src/editor/map_view.cpp
    M src/editor/map_view.h
    M src/editor/tile_context.cpp
    M src/editor/tile_layer.cpp

Primary Changes
  • Added several new icon images that the editor is now making use of
  • Added view options to toggle an overlay drawn over missing tiles and inherited tiles
  • Added new edit mode "Inherit Tile" that works exactly the same as erase mode, but instead of setting the value to indicate a no tile, it sets the value to indicate that the tile should be inherited
  • Removed the use of our print macros (ex: IF_PRINT_WARNING(EDITOR_DEBUG)) because the editor doesn't accept command-line args currently so it was not being used. Instead, qDebug() is used to achieve a similar effect.

Other Notes
With these changes, I consider editor support for inheriting contexts to now be fully implemented. However, there are still a few bugs to squash and additional testing to be done before this is ready for active use. But its working out okay so far. This is the final major feature for the editor for this release (not including the still uncompleted optional ones). Happy new year! :D
Image

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 3 guests