I did actually manage to implement a Back button for the New Project Wizard today. It was actually a lot easier than I expected; there were only two things that caused issues with my first implementation, and they were easily fixed. So, that's pretty much the last feature requested by Gridlock for v1.5; I'll ask him again for feedback before I write up the documentation and release it.
Also, I added some self-documenting behavior to the configuration file. Through yet another attribute on the fields, a comment line is automatically added before the config entry. I have added such attributes to most of the fields in editor.aconf.
Finally, performance improvements! The Tile Tweaker and Freeform Tile Placer no longer register mouse movement handlers when single tile preview is off. This makes the coordinate display and tile scanner much faster.
Various technical articles, IT-related tutorials, software information, and development journals
Friday, July 25, 2014
Thursday, July 24, 2014
FMod - Change Everything
Today was another one of those talk-with-important-community-modders-and-implement-everything-they-say day! This time, Gridlock caught me on IRC in addition to sending me a message on the PCKF. The following changes and additions ensued:
- Pressing a tool's shortcut key while it's active now acts as a toggle, turning it off and switching back to the default tool.
- Pressing the space bar opens the previous tileset in addition to closing an open one.
- The Y offset in the tile palette is remembered until a different palette is opened.
- The Tile Instance Locator now allows placing tiles.
- Plane state labels change font and color depending on the represented plane state (to provide multiple and faster means for recognition of the plane state, which is critical while designing).
- A render-crash bug with Assimilate Infoplane mode is fixed.
- Assimilate Infoplane mode no longer disables the infoplane palette. Multiple selection in that mode on the combined foreground tileset has been removed.
- The legacy Dependency Collector no longer appears as an option in the New Project Wizard unless a config option is changed (ShowAdvancedMenuOptions/LegacyDepsCollector).
- Lots of texts in the New Project Wizard have been changed to make it easier for new/unfamiliar users. Explanatory text has been added for the radio buttons.
- A leaked file handle bug concerning Infoplane Override was fixed.
- Tile Instance Locator and Tile Instance Remapper were given shortcut keys.
- Undo's shortcut was changed from Control+Z to Z.
- Palette Copier's shortcut key was changed from X to C, in consistency with the normal Copier.
A Back button for the New Project Wizard has been requested, and would probably be very useful. I'll get to that soon, hopefully.
Also, I replaced the cheap-looking default background image (the one with the Fleex and my name) with something much more impressive:
Wednesday, July 23, 2014
FMod - Minor Longstanding Issues
It came to mind today that it's possible to create a configuration file that causes Abiathar to crash with a stack overflow (or go into an infinite loop) on level load. This can be done by setting the default tool to one that terminates immediately, such as the Resource Accountant or Level Inspector. Before I release v1.5 (wow, this has been a huge update), I will add a read-only property to each tool that lets Abiathar know if it's OK to made it the default tool. If it's not, or if the user sets a non-existent tool ID as the default (which probably causes a crash now), I'll have it set the Tile Tweaker to be the default.
Tuesday, July 22, 2014
FMod - Error Reports are Useful
You know the dependency file processing error reporter I wrote about last time? It's already worth it. I received one of its reports from the Bio Menace modder on the K:M forums, and quickly figured out why he was only able to use Abiathar on Bio Menace 2.
In my initial explanation on what to do with all the steps in the New Project Wizard, I glossed over the opening of the GFXINFOE file because it opens the open-file common dialog; I provided no picture of that because the dialog is unnecessarily huge (thanks, Microsoft). What I did provide a picture of, however, was an example result after pressing the From GFXINFOE button as directed. He had copied down the settings that had been loaded for BM2 and tried to use them for the other episodes. Since they have different EGA layouts, that broke in the "loading graphics" section.
Without the ability to see the attempted dependency file, I never would have figured out what was causing the problem. I made a good investment here!
In my initial explanation on what to do with all the steps in the New Project Wizard, I glossed over the opening of the GFXINFOE file because it opens the open-file common dialog; I provided no picture of that because the dialog is unnecessarily huge (thanks, Microsoft). What I did provide a picture of, however, was an example result after pressing the From GFXINFOE button as directed. He had copied down the settings that had been loaded for BM2 and tried to use them for the other episodes. Since they have different EGA layouts, that broke in the "loading graphics" section.
Without the ability to see the attempted dependency file, I never would have figured out what was causing the problem. I made a good investment here!
Monday, July 21, 2014
FMod - Code Correctness
Since the Bio Menace modder on the Keen:Modding forums is still experiencing problems using Abiathar on Bio Menace 3, I put up a new beta for him today. It includes the error reporter I wrote yesterday, and some other interesting things.
In Bio Menace and other games, there are some infoplane values I do not understand. They're not links, and not sprites, but some other sort of data attached to the tile. Interpreted as links, they usually point inside the level, which makes Abiathar think they're valid links. Therefore, they get adjusted (to point to the same relative location) by the Row and Column Adjusters when you insert or delete rows. Unfortunately, this messes up values that are not actually links. So, I added a setting to control this behavior. The default is still to update links when they have no icon and point inside the level, but there are two new ones: to not update links and to only update links where the foreground tile has one of a few specific properties. The tileinfo-checking one looks to make sure that the special-effect property of the foreground tile is one amenable to links (e.g. doors, keys, switches). It is not the default because it typically doesn't work on the Keen 5 world map - the doors have different properties at edit time - and because it takes a little longer to check every tile with a possible link. The option can be found in the settings for the adjuster tools.
Then, just for laughs, I ran Code Analysis on all the projects in the Abiathar solution. The default rule set found one issue, right in the loading of the non-Carmackized maps: a double disposal of a stream object. The analyzer claims that it could throw ObjectDisposedException, but I've never seen that happen on my machine. On the other hand, it is entirely possible that this was the bug causing trouble for the Bio Menace modder. After fixing that, I tried analyzing with all the rule sets. That didn't work well - apparently I am horrible at naming variables and designing interface contracts - and so I removed all the rule sets except Performance and something else I can't remember - maybe Usage or Reliability. (I had Maintainability in there for a while, but it was just complaining about things I can't fix now, specifically everything having an unacceptable cyclomatic complexity, class binding count, or maintainability index.) Going through Performance found a boatload of methods that could be made Shared, which I did, and also a generous helping of unused variables and methods, which is not terribly surprising given the number of nontrivial changes the code base has gone through. The other rule set helped me discover a lot of IDisposable things that were not disposed - who knew the browser dialogs could cause memory leaks? Of course, it also raised silly complaints about not disposing things before they went out of scope: they were used out of the local scope. After going through most of the issue logs and suppressing the spurious warnings, Abiathar runs a little faster!
And somewhere along the way, I changed a straggler "* 13" to a "* 18" in the New Project Wizard, making the Tile Partitioning step finally use the MAPTHEAD file correctly to get the number of infoplane icons.
In Bio Menace and other games, there are some infoplane values I do not understand. They're not links, and not sprites, but some other sort of data attached to the tile. Interpreted as links, they usually point inside the level, which makes Abiathar think they're valid links. Therefore, they get adjusted (to point to the same relative location) by the Row and Column Adjusters when you insert or delete rows. Unfortunately, this messes up values that are not actually links. So, I added a setting to control this behavior. The default is still to update links when they have no icon and point inside the level, but there are two new ones: to not update links and to only update links where the foreground tile has one of a few specific properties. The tileinfo-checking one looks to make sure that the special-effect property of the foreground tile is one amenable to links (e.g. doors, keys, switches). It is not the default because it typically doesn't work on the Keen 5 world map - the doors have different properties at edit time - and because it takes a little longer to check every tile with a possible link. The option can be found in the settings for the adjuster tools.
Then, just for laughs, I ran Code Analysis on all the projects in the Abiathar solution. The default rule set found one issue, right in the loading of the non-Carmackized maps: a double disposal of a stream object. The analyzer claims that it could throw ObjectDisposedException, but I've never seen that happen on my machine. On the other hand, it is entirely possible that this was the bug causing trouble for the Bio Menace modder. After fixing that, I tried analyzing with all the rule sets. That didn't work well - apparently I am horrible at naming variables and designing interface contracts - and so I removed all the rule sets except Performance and something else I can't remember - maybe Usage or Reliability. (I had Maintainability in there for a while, but it was just complaining about things I can't fix now, specifically everything having an unacceptable cyclomatic complexity, class binding count, or maintainability index.) Going through Performance found a boatload of methods that could be made Shared, which I did, and also a generous helping of unused variables and methods, which is not terribly surprising given the number of nontrivial changes the code base has gone through. The other rule set helped me discover a lot of IDisposable things that were not disposed - who knew the browser dialogs could cause memory leaks? Of course, it also raised silly complaints about not disposing things before they went out of scope: they were used out of the local scope. After going through most of the issue logs and suppressing the spurious warnings, Abiathar runs a little faster!
And somewhere along the way, I changed a straggler "* 13" to a "* 18" in the New Project Wizard, making the Tile Partitioning step finally use the MAPTHEAD file correctly to get the number of infoplane icons.
Sunday, July 20, 2014
FMod - Better Error
"Error creating dependency file", or after the v1.5 unified opening and creating dependency files, "Error processing dependency file" is the most common Abiathar error message. It's also the most useless thing ever, it tells you nothing about what went wrong and what you might do to fix it. Simple things like referencing non-existing files are caught in the New Project Wizard, but there is still a lot than can go wrong (e.g. switching some files around) that I don't want to write a lot of complicated checks for.
So, today, I did something better. Somebody on Keen:Modding suggested that Abiathar generate an error report that could be sent to me when something bad happens. This is already done when the entire program crashes, but it would likely be far more helpful here, since I have never actually seen the program crash, nor has anybody reported it. I added a lot of things to that exception handler to gather details about the environment and write it to an error file if the user so chooses. The report consists of the following sections:
- Stage of dependency file opening at which the exception was thrown
- Name, size, and MD5 of all files in the working directory
- Exception message, source, and stack trace (and those of the inner exception if applicable)
- Metadata of all extensions installed
- Serialization of the core entry in the dependency file
The stage information is gathered by setting an informational string value before entering a new section of the loader, which obviously stops updating if an exception happens. The MD5 calculation is skipped if the file is already open (or if it is Abiathar).
This scheme generates very nice crash reports, which should help me figure out the problem when people receive inexplicable errors.
Friday, July 18, 2014
Resolving the Mysterious Minecraft Missing Texture Issue in Eclipse
I was doing a little bit of messing around on the Wither mod idea, and I ran into a very strange problem. I had added an item texture (than honestly looks pretty awful, but whatever) and registered it with the item, but it was not displaying in-game. Instead, I got the purple-and-black checkerboard of missing textureness. I consulted many tutorials; I had registered and placed it correctly.
No, the issue was something far more obscure. Since I had placed the PNG file manually in the src/main/resources/assets/<mod>/textures/items folder without having the package folder expanded in Eclipse, that resource was not copied into the temporary build directory. This is possibly the strangest of such systems I have ever seen from an IDE, but refreshing the Project Explorer (press F5 with it focused) fixed the problem. Yay, non-obvious and undocumented issues!
No, the issue was something far more obscure. Since I had placed the PNG file manually in the src/main/resources/assets/<mod>/textures/items folder without having the package folder expanded in Eclipse, that resource was not copied into the temporary build directory. This is possibly the strangest of such systems I have ever seen from an IDE, but refreshing the Project Explorer (press F5 with it focused) fixed the problem. Yay, non-obvious and undocumented issues!
Subscribe to:
Posts (Atom)
