Sunday 26 April 2015

Thoughts about tools

This time I want to share a little bit of my thoughts about tools. There won't be so much technical stuff more polemic about how we design tools and what we do wrong ( I will mention examples of mistakes I done in editor). But let's start from simple facts :

People who use tools love them. Programmers often hate because of boring UI code.

I wasn't different. In my first projects tools weren't so important. I were of course writing them. But most of the time by hacking rendering and adding some debug information. Of course there was a lot of shortcuts mentioned only in code.

I was happy that I don't need to spend a lot of time on them and could focus on project. With time I started to write a lot more tools. "New Dawn" had developed full editor because we had a lot of artists and they don't like to modify scripts. Probably if not them we would never started developing it.

Of course this was just begin which in the end resulted in creation of: White Rabbit Toolset. Writing this tools shown me few things:

We programmers often don't understand what we doing.
Yes we don't know how to use tools. That's why often we do stuff in "programmers style". How to recognize it ? There are few ways:

  • Just seeing it make you want to close it. 
  • There is no obvious way to do things.
  • You need press few buttons before you can do anything. 
  • After 5 min you probably still don't know how to use it.

Probably everybody who work on custom tools seen something like this. Of course any tools is often better than none. But only as long as you use it all the time. Take month or two break from using it and try again. I assure you that in a lot of cases you will forgot all shortcuts that are not described in UI. You will forgot order in which you need to press buttons and fun will start :]

Of course in a lot of cases this is not problem for us (programmers) because we use this tools only when we need to add something or fix bug there. But for final user it's different story. He don't have any choice. I learned this hard way. I'm programmer and final user and right now I understand why good UI with nice flow and descriptions is really important.

This is obvious
There is nothing obvious. If inside list of elements only way to remove selected item is [del] key. I really recommend creating context menu (the one under right mouse button) where you have option delete with shown shortcut. You know this key most probably because you programmed it, somebody told you or just had luck.

If you create shortcuts you need to add them in tool tips, status bar or to context menu. I learned that when I returned to movie editor after month. I forgot all combination shift/alt/ctrl + mouse buttons that were there and needed check them in code. First thing that I done was adding info to status bar which change depending of situation so I would never need to check code again when I want to use movie editor.

We programmers often don't "really" test our tools
Some may disagree. But I don't talking about checking of code or checking if it work. To give you example: when I first wrote my assets system there were list of files with previews of what is inside. In my tests it worked great.

But then in next months I increased amount of assets in game and problems started. Each icon needed to be prepared manually, accessing of folders from widget started to be slow and filtering started to be problematic. Everything because I test my tools on small set of data.

I should have create dummies assets by copying few of them and check how everything work. The real test case are important. Well I made mistake then and needed to resolved them because it was impossible to work efficient. So I introduced:

  • auto generation of previous (I need to recover this functionality after changes I done recently), 
  • when you enter any folders previous are loaded asynchronous so there is no waiting time when you navigate.
  • finally I added wildcard search with option to search locally in folder and global search in whole file system 

Of course this is not extreme case like combo box or list with hundreds of element and none search option. This one are scary but I try them avoid in first place.

Other problem here is amount of operations you need to do to archive something. If you have list of objects that you can preview  You can create list and bellow button "Preview". But if this operation is done really often why not connect it with double click on list item? This small change improve usability a lot. Of course with time I learned that other nice thing is to add tool tip in button which would look like this: "Preview of selected object from list. Do the same as double clicking on list element." Just in case that somebody don't notice this double click.

Writing tools is boring
Yes it's not programming of some nice low level code or gameplay feature. But contain problems of completely different types which can be also really interesting.

You can create unique UI to edition of each objects type or you create some system which will simplify this or maybe even unify. I try to save my time that's why I share code wherever I can. Right now in my solution I have seven plugins:

  1. Canvas - widget to connect rendering of UI with engine
  2. CurveEdit - widget to edit/display curves
  3. FileList - asset browser widget
  4. NodeEdit  - widget to edit/display nodes 
  5. ProgressBar - custom dialog with progress bar
  6. Properties - widget for properties edition.
  7. Timeline - widget use for timeline with strips (I use it in movies editor)
When I started writing them they were really specialized but with time I change them in generic plugins which don't have almost any connection with my engine code. I like doing them this way because for each 10 min more I spend more on some new features I save hours later when I use them.

Writing good tools is hard and complicated
Personally I don't see writing of tools as just creation of UI. I think this is biggest mistake that we do right now. To make really good tools you need to prepare for them whole system. You need to design your engine with tools in mind. 

Without this tools became just code that is stick to engine. With time it's became over-complex, hard to manage and supporting of all it's features take a lot of time and effort.