Hello, we apologize but forum registrations are non-functional at this time. This issue should be fixed around mid-December. Until then, please stop by our Discord channel if you'd like to get in touch with the team. Thanks!

Subversion Commit Log

For discussion of the code running behind the game

Moderator: Staff

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

Re: Subversion Commit Log

Post by Roots » Thu Jan 01, 2015 9:39 pm

Committed revision #2132.
============================================================
Files Added
  • A + img/misc/editor_tools/inherit.png
    A img/misc/editor_tools/inherit_area.png
Files Deleted
  • D img/misc/editor_tools/inherited.png
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/map_view.cpp
    M src/editor/map_view.h
    M src/editor/tile_context.cpp
Primary Changes
  • Fixed several bugs with inheriting contexts. I believe this feature is working correctly now.
  • Updated the image icons for the inherit tools
  • Layers are no longer editable if they are not visible. This is a usability improvement as there have been way too many times in the past where I accidentally edited a layer that was not visible and had to undo my mistakes
Other Notes
Reminder: I don't write a post here for every single commit that I make. I only post here if they are changes that I feel that other people should know about or are otherwise significant enough. That's why my commit numbers "skip ahead" one or two numbers sometimes.

There might be some weirdness with the missing tile overlay. I'm aware of it and will get around to fixing it eventually.

Next I'm going to work on tileset addition/removal support.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Fri Jan 02, 2015 2:37 pm

Committed revision #2135.
============================================================
Files Modified
  • M Makefile.am
    M src/editor/editor.cpp
    M src/editor/map_view.cpp
    M src/editor/tile_context.h
    M src/editor/tileset.cpp
    M src/editor/tileset.h
Primary Changes
  • There's now a TilesetView class for the tileset widget in the bottom right of the screen
  • TilesetView updates correctly on new/open/close file operations
  • Made some improvements to MapView drawing code by moving relevant logic blocks to TilesetView
  • Moved some code out of Editor class to TilesetView
Other Notes
This new class is a great improvement in terms of software design. It's also what will help me to enable support for adding and removing tilesets to map data. Adding support for this will take a little more work on this class, as well as a new dialog class I intend to write to allow selection of tilesets.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Fri Jan 02, 2015 10:30 pm

Committed revision #2136.
============================================================
Files Modified
  • M src/editor/map_data.cpp
    M src/editor/map_view.cpp
    M src/editor/tileset.cpp
    M src/editor/tileset.h
Primary Changes
  • You can now remove a tileset from a map by right clicking the tileset widget to bring up a context menu. Includes a nice confirmation dialog window and everything.
  • Made the map data class smarter about raising its "map modified" flag when a modifying function completes. This eliminates the need (in most cases) for the UI classes to remember to set the modified flag when they make changes.
  • Fixed a bug where seg faults could occur if you clicked in the map view area when map data was not loaded
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Sun Jan 04, 2015 11:36 pm

Committed revision #2138.
============================================================
Files Modified
  • M src/editor/map_data.cpp
    M src/editor/map_data.h
    M src/editor/tile_context.cpp
    M src/editor/tile_context.h
    M src/editor/tile_layer.cpp
    M src/editor/tile_layer.h
Primary Changes
  • Added new feature that allows you to create a new tile layer or context by cloning an existing one. All properties and data are copied over when initializing the clone.
  • Added a confirm action dialog window whenever you try to delete a tile layer or context. This will prevent us from accidentally deleting data.
  • Made a number of fixes to both layer and context widgets. Layers now do not lose data if you drag and reorder them. New overlays now appear correctly when selecting a new layer.
Other Notes
I believe this fixes all of the bugs with layers and contexts aside from one. If you drag around layers and reorder them, and then make clones of them, the wrong layer is cloned. I'm not sure what the issue is here, but I imagine it's something to do with a disconnect between the map data model and the layer widget. I'll fix this at a later time as I want to work on the more common features and problems first.

There's also still the weirdness with renaming of layers and contexts, but I'm not planning to fix that one at all for this release. It works reasonably well enough as it is and there are more urgent matters to take care of.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Tue Jan 06, 2015 12:10 am

Committed revision #2139.
============================================================
Files Modified
  • M src/editor/dialogs.cpp
    M src/editor/dialogs.h
    M src/editor/editor.cpp
    M src/editor/map_data.cpp
    M src/editor/map_data.h
    M src/editor/tileset.cpp
Primary Changes
  • Added a new dialog class that presents the user with a list of tileset files and allows the user to select which tilesets to add to the map.
  • TilesetView widget now supports adding additional tilesets after a map has been created or loaded via the new dialog class.
  • Minor changes to map data class
Other Notes
Tested this new feature pretty thoroughly and found no bugs. It works pretty great. :)

In the future, I'm going to remove the tileset selection widgets from the MapProperties class so that all tileset selection goes through this new dialog. I'm not sure about the best way to handle this when the user selects to create a new map though. Might not get around to this in this release though, as the current system works fine even if it's not optimal. MapProperties will also include some new data in the future, mostly free-text for users to specify the name of the map, the map designers, and map description.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Wed Jan 07, 2015 10:46 pm

Committed revision #2140.
============================================================
Files Modified
  • M src/editor/dialogs.cpp
    M src/editor/dialogs.h
    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/map_view.cpp
    M src/editor/map_view.h
    M src/editor/tile_layer.cpp
Primary Changes
  • Added a "Resize Map" option in the edit menu. This feature is fully functional and uses a new dialog window class that was written for this purpose.
  • Added another dialog class to allow for the insertion or deletion of arbitrary numbers of rows or columns anywhere in the map. This feature is not yet complete or functional
  • Updated the right click menu in the MapView widget to use a better organization
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Sat Jan 10, 2015 1:38 am

Committed revision #2141.
============================================================
Files Modified
  • M src/editor/dialogs.cpp
    M src/editor/dialogs.h
    M src/editor/map_data.cpp
    M src/editor/map_view.cpp
    M src/editor/map_view.h
    M src/editor/tile_layer.cpp
    M src/editor/tile_layer.h
Primary Changes
  • Completed a new dialog class (MapResizeInternalDialog) that allows the user to specify a number of rows or columns of tiles to insert or delete at a specific location
  • You can now insert/delete rows/columns of tiles of any permissible number at any location in a map by right clicking
Known Bugs
This feature is working, but hasn't been thoroughly tested. It has at least one known bug that causes a seg fault. Wanted to get this commit in anyway as I've been working on this for a couple days now. I'll fix the bugs and finish testing of this feature in my next commit.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Mon Jan 12, 2015 1:41 am

Committed revision #2146.
============================================================
Files Modified
  • M src/editor/dialogs.cpp
    M src/editor/dialogs.h
    M src/editor/editor.cpp
    M src/editor/editor.h
    M src/editor/map_data.cpp
    M src/editor/map_view.cpp
    M src/editor/map_view.h
    M src/editor/tile_layer.cpp
    M src/editor/tile_layer.h
Notes
There were four other commits I made before this one that I didn't submit here because they felt pretty small individually. But now that I think about it, I've done a heck of a lot in the past 48 hours. Here's a run-down of the major changes that I have made this weekend:
  • Fixed insert/delete column/row resize bugs that were introduced in commit #2141. This feature is working flawlessly now.
  • Swap tool is now implemented and move mode is no more
  • Cleaned up and renaming of various sections of the editor code (focusing mostly on MapView class).
  • Added partial support for a feature that will allow the user to view the active collision grid in the editor (this feature is not planned to be fully implemented for this release)
  • Wrote a fill-similar area function (essentially an implementation of a flood fill algorithm)
  • Clear Area and Inherit Area tools are now fully functional
  • Select Area tool is now functional
  • Some minor visual and UI tweaks to make the editor easier to understand and use
The only tool that is not functional at this point is the fill area tool. This one will be pretty simple. I just need to read through some QT documentation first to figure out how to grab the correct tile from the tileset when doing the fill. After that, the next major step to take is to get the various tools to behave correctly when a selected area is active. The basic tools probably work alright, but the area tools definitely do not.

Things are looking pretty good. If we're lucky, I may even finish work with the editor this week. :D
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Mon Jan 12, 2015 10:26 pm

Committed revision #2147.
============================================================
Files Modified
  • M lua/data/tilesets/mountain_house_exterior.lua
    M lua/data/tilesets/mountain_house_exterior2.lua
    M src/editor/dialogs.cpp
    M src/editor/dialogs.h
    M src/editor/editor.cpp
    M src/editor/map_view.cpp
Primary Changes
Fixed an error in two tileset files that were due to a typo in variable names

Repurposed the MapPropertiesDialog class as the NewMapDialog class. This class is now responsible for nearly everything related to creating a new map, removing this code from the Editor class.

Realized that it was annoying to always have to press the Escape key to clear a selected area. Now with the select area tool, clicking anywhere with this tool will clear the selection area. An unfortunate side effect is we can not have selection areas that are exactly one tile in size. I'll look into finding out a good UI design that fixes this.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Thu Jan 15, 2015 9:32 pm

Committed revision #2148.
============================================================
Files Modified
  • M src/editor/dialogs.cpp
    M src/editor/editor.cpp
    M src/editor/editor.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 actions to the right-click selection menu in the MapView area. These actions are only active if an area of the map is selected (using the Select Area tool). The actions allow you to do the following for the selected tiles in the active tile layer and context:
* Move selection to layer
* Copy selection to layer
* Move selection to context
* Copy selection to context

This means that we can now select an area of an existing map and move it around to different layers/contexts whenever we wish. It's a really good time-saver when you need to construct objects on multiple tile layers (trees, structures). This feature is only moderately tested so there may still be some bugs, but if there are they are unknown to me.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Fri Jan 16, 2015 9:53 pm

Committed revision #2149.
============================================================
Files Modified
  • M src/editor/map_view.cpp
    M src/editor/map_view.h
Primary Changes
Added a new feature that I'm calling "paint preview" to the editor. It shows the user what they are painting at the location the tiles will be placed down at prior to actually painting the tiles. Makes it much easier to see what you're doing before you do it.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Sat Jan 17, 2015 12:43 pm

Committed revision #2151.
============================================================
Files Modified
  • M src/editor/map_view.cpp
    M src/editor/map_view.h
Primary Changes
You can now select custom shapes of tiles with the select area tool. if you hold down shift when you press the mouse with this tool, the operation is additive (the new selection will be added to any currently selected tiles). If you hold down control when you press the mouse, then the operation is subtractive (any selected tiles will be deselected). The selection action tools (move to layer, copy to context, etc) should all still work with the selection layer.

Notes
This is the last feature I'm adding for the editor for the release. Only remaining work I'm going to do is bug fixes and maybe a little clean up.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Mon Jan 19, 2015 12:11 am

Committed revision #2153.
============================================================
Files Modified
  • M src/editor/map_view.cpp
    M src/editor/map_view.h
Primary Changes
Fill area tool is now functional. All of the area tools also now work properly when a selection area is active.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Mon Jan 19, 2015 7:35 pm

Committed revision #2155.
============================================================
Files Modified
  • M lua/data/maps/harrvah_city.lua
    M lua/data/maps/harrvah_desert_cave_path.lua
    M lua/data/maps/harrvah_underground_river_cave.lua
Primary Changes
Converted existing map files to the new map format. These maps can now be edited in the new and vastly improved map editor.

Notes
While these maps now work in the map editor, they no longer work in the game. The game is still expecting the old map file format, so my next step is to convert the current map loading code to parse the new map file format.

Only one map (the cave) had more than one context, so to save myself time I just didn't convert the other context data over. These contexts were used in a kind of hackish way to show changes in the map during the passage collapse and water unblocking events. Instead, what I'm going to do is recreate these map changes with tile layers which will be able to achieve the same effect and do so a little more cleanly. The map script file will have to look at the events that have occurred and determine which layers to draw based on that information.



The script I wrote to do the conversion is very simple. If you stick this in the lua/data/maps directory and run it, it will convert the lower/middle/upper layer tiles of the old map format to the new map_tiles table. All the other data I converted by hand because it was either renaming of variables or very basic information. You put the name of the map (without the .lua extension) within the require call at the top of the file. You also have to comment out the namespace header (top four lines) of the original map file so that it can read the data correctly. Then you just run it like so: 'lua convert_map_file.lua > dump.txt" and take the output of dump.txt and paste it to the end of the original map file.

Not the most elegant solution, but it was the fastest given my limited knowledge of Lua and the immediate task at hand.

Code: Select all

require("harrvah_city")

printf = function(s, ...)
	return io.write(s:format(...))
end

print "map_tiles = {}"
for i = 0, num_tile_rows - 1 do
	printf("map_tiles[%d] = {}\n", i);
end

for i = 0, num_tile_rows - 1 do
	for j = 0, num_tile_cols -1 do
		printf("map_tiles[%d][%d] = { %d, %d, %d }\n", i, j, lower_layer[i][j+1], middle_layer[i][j+1], upper_layer[i][j+1]);
	end
end
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Tue Jan 20, 2015 9:31 pm

Committed revision #2155.
============================================================
Files Modified
  • M lua/scripts/maps/a01_harrvah_city_attack.lua
    M lua/scripts/maps/a01_opening_scene.lua
    M lua/scripts/maps/a01_return_to_harrvah_city.lua
    M lua/scripts/maps/a01_unblock_underground_river.lua
    M src/modes/map/map.cpp
    M src/modes/map/map.h
    M src/modes/map/map_objects.cpp
    M src/modes/map/map_tiles.cpp
    M src/modes/map/map_utils.h
Primary Changes
Map mode can now load the new map file format.
Sound and music filenames were originally stored in the map data file. I moved this information to the map script file instead.

Notes
Map mode currently does not support inherited contexts and treats all inherited tiles as missing tiles. This will be fixed sometime in the near future, but I currently have no maps that use inheriting contexts, so it's not a priority for me. Shouldn't be too difficult to implement though.

The cave map script will need some cleanup. Originally this map had three contexts: one for when the map was entered, another for when the cave collapse event was trigger, and a third for the unblocking of the riverbed. I don't know if I'll still use multiple contexts with this map, and instead may just go with some custom tile layers that will only be drawn after the events in question occur. Although I'm not dead set on this, so we will see.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Thu Jan 22, 2015 11:42 pm

Committed revision #2158.
============================================================
Files Added
  • A lua/data/maps/test_map.lua
Files Modified
  • M src/editor/map_view.cpp
    M src/editor/map_view.h
Primary Changes
The paint, swap, delete, and inherit tools now work properly when a selection area is active. Added a small map that we can modify and add properties to for testing purposes.

Notes
Here's a brief explanation of how these tools work with selection areas. Essentially what I've done is treated selected tiles and non-selected tiles and two separate entities. You can't start an operation in a non-selected tile and see if also affect the selected tile, and vice-versa. This allows selection areas to also work as a sort of "do not modify" safe zone when you are making a lot of changes.

Paint: If you are painting multiple tiles down and the location you click is inside a location area, only the tiles that are also inside the area are painted. Same idea if the location you start at is not selected and some of the tiles to paint are in a selected area.

Swap: if you start the swap operation in a selection area, the entire area (across the whole map) is affected by the operation. So you can move a 3x4 group of tiles 6 tiles right and 11 tiles up if you wish. If the destination for any of the tiles to swap would go outside of a map boundary, those tiles will not be swapped, but the rest of the tiles in the area will be.

Delete/Inherit: when dragging this tool around the map to set multiple tiles, if you started in a selection area and dragged to a non-selected area, no change will take place. This works exactly the same way as the tileset editor.


With this commit, the only editor work remaining to do for this release is now finding and fixing any bugs that impact usability.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Sun Jan 25, 2015 7:59 pm

Committed revision #2162.
============================================================
Files Modified
  • M lua/data/maps/test_map.lua
    M src/editor/map_view.cpp
    M src/editor/map_view.h
    M src/editor/tile_context.cpp
    M src/editor/tile_context.h
    M src/editor/tile_layer.cpp
    M src/editor/tile_layer.h
Primary Changes
Updated test map according to changes made to tilesets it previous commit (not logged here). Slight improvements to visibility of editor overlays. Wrote some code to address issues with removing inheritance from contexts.

Notes
Discovered that the editor seg faults if you have an inheriting context with at least one inheriting tile that you modify to remove the inheritance property. I'm still working on tracking down exactly where the problem is and will fix it as soon as I find the source.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Mon Jan 26, 2015 10:43 pm

Committed revisions #2163 & #2164.
============================================================
Files Modified
  • M lua/data/maps/test_map.lua
    M src/editor/map_view.cpp
    M src/editor/tile_context.cpp
Primary Changes
Fixed a bug where the select area tool would behave incorrectly if you changed to another tool while in the middle of an additive or subtractive selection operation.
Fixed a bug where removing the inheritance from a context that inherited tiles would cause the editor to crash.
Fixed a bug where the editor allowed a context to inherit from itself.

Notes
These issues were discovered during my dry run of the video I'm creating to showcase the new editor and creation of a test map for that purpose. I feel very confident now that the editor is now fully ready for this release.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Fri Jan 30, 2015 11:29 pm

Committed revisions #2165.
============================================================
Files Added
  • A lua/data/maps/harrvah_capital.lua
Files Modified
  • M lua/data/maps/harrvah_city.lua
Primary Changes
Fixed a bug in city map that was referencing an old tileset name that has been renamed. Added a new map that will eventually replace the city map.

Notes
I named the new map "harrvah_capital" because this map is going to contain both the city and the castle, so calling it just "city" wasn't accurate. Also the updates I've made to the tilesets recently messed up some of the city map, and in general I thought it would just be easier to start over from scratch. So far, the new capital map contains the first row of buildings (of three rows planned) and the southern city wall. I also did the interior of one building (the item shop) and it's looking pretty nice.

One of the things I'm doing with the buildings in the city is trying to make them various sizes and give them other features that identify them from one another. This is a little difficult as the desert house tileset doesn't work flawlessly with various sized buildings, but so far it's not looking too bad. I think I'm heading in the right direction with this map, and I'm following the plan I drew out earlier.
Image
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Post by Roots » Wed Feb 04, 2015 10:25 pm

Committed revisions #2170.
============================================================
Files Added
  • A lua/scripts/maps/a01_harrvah_capital_attack.lua
Files Modified
  • M lua/data/maps/harrvah_capital.lua
    M lua/data/maps/harrvah_city.lua
    M lua/data/maps/harrvah_desert_cave_path.lua
    M lua/data/maps/harrvah_underground_river_cave.lua
    M lua/test/maps.lua
    M src/modes/map/map_tiles.cpp
Primary Changes
Fixed inconsistency issue between editor and map mode where the editor writes the tileset filename extension and map mode expects to have to add the extension manually. Updated existing map files for this new format.

Added a very basic map script for the capital map. You can control Claudius and walk around in it (collisions currently disabled, so he can walk through walls, etc.). You can access it through test mode.

Some additional work to the capital map, building one of the two halves of the castle.
Image
Locked