Archive for April, 2009

Kolf: More editor interface (now with screenshots)

Last time I did not include any screenshots, but I know that only from screenshots derived a magical force called “buzz”, so here comes a screenshot of what I did this evening:

kolf-editorscreen2

First, note that the rectangle (which is in fact a cuboid block) appears in green, and the line at the right (a simple wall) seems to glow in a similar color. These are new interactors which I added to the editor interface. When you hover an object, a translucent overlay appears (like on the wall here). And when you click on this shape, the overlay will become more opaque, can be dragged to move the object, and more handles appear to manipulate the object’s geometry.

Second, please also note that the rectangle is rotated a bit. I was astonished how less changes were required in the Kolf codebase to make this happen.

Another usability improvement (though not visible here) is that objects cannot be shrunk below a certain size anymore. This prevents you from making objects so small that you cannot click them anymore. The creation of objects with an arbitrary size will become possible later when a property editor will be added.

In other news, I have quite detailed plans on how to implement data persistency in Kolf. That may not mean anything to you, but it means that we could have undo/redo and save functions in the Kolf editor very soon (perhaps by the end of the week).

Leave a comment »

Kolf: Quick updates on the editor interface

This is not only to SoC students: Think about the internal design of your project thoroughly. It may be hard sometimes, but it surely pays off.

For example, the design of the complete game engine in Kolf 2 relies on merely seven base classes and one helper class. The rest (two thirds currently, and counting) are specific implementations (e.g. Kolf::Object has subclasses for the rectangle block, the circle block, the wall, the hole, etc.). It has been quite hard in the beginning because it takes a while before you get results. In this phase, it certainly makes it easier if you like well-done generic algorithms for their elegance and compactness (like I do).

Considering the interaction between editor interface and game engine, this part seems to be done now for me. Today, I implemented mouse-based overlay activation (as in: when you click on an object, its editing overlay is shown, and any other overlays are hidden), and that took me only one hour of coding. As I said, coding becomes a breeze if you rely in good foundations.

More interesting from the technical side is the fact that games can now contain actions. For any readers that are not developers: “Actions” in Qt/KDE-speak define tasks that can be done. They are accumulated in the KActionCollection of a window and then converted into menu entries and toolbar buttons. This is done by the KXmlGuiFactory which belongs to the mainwindow. Now (and that is the interesting part) one can simply insert KXmlGuiClient instances into this factory to dynamically add or remove actions from the toolbars and menus (or even complete toolbars and menus). This allows you to adjust the toolbar and menubar layout very dynamically to your application’s current context.

The problem with both new features is that they’re not very visible on simple screenshots, so I’ll leave the screenshot out for now. Checkout kolf-ng from trunk/playground/games if you cannot wait.

Leave a comment »

Summer has begun for kdegames!

It’s that time of the year. The planet’s filling up with SoC posts, and now it’s my turn. I’m pleased to announce that this is the first SoC for kdegames (apropos: kudos to our SoC administrators for improving the internal selection processes to make this happen). We could accept three projects:

  • Marwan Hilmi will be working on Parsek, a client to the Thousand Parsec framework which was started last year, but never really finished. Expect another Konquest-type game to arrive in kdegames this fall!
  • An entirely new game will be created by Mahfuzur Rahman: Mancala is a family of board games played mostly in Asia and Africa (if I recall correctly). I’m really looking forward to this as the current selection of KDE games has yet to improve on cultural diversity.
  • Last but not least, I’ll be looking after Huan Zeng, who will be implementing landscape objects (slopes, puddles, etc.) in Kolf 2. That sounds easy, but requires a good combination of 2D graphics programming, data structure handling, and a rock-solid internal design.

Good luck to the students and their mentors, and many thanks to Google for making all of this possible!

By the way, the kdegames team is always looking for good programmers and artists. Making a game with kdegames’ libraries is really easy if you know some C++ or Python or such. Painting a nice theme is a breeze if you know Inkscape or some other SVG editor. Come to #kdegames on Freenode IRC, or get in touch with us at the kde-games-devel mailing list on kde.org.

Comments (1) »

Future of the KDE commit digest?

Every day I visit the dot, I’m sad to see no new commit digests. The last digest is one month old, and refers to two-month-old developments. I appreciate very much the work that Danny has done for the commit digest, but he also notes that the current method does not scale to the future. KDE is growing every day. We’re welcoming a new contributor nearly each day (according to SVN account numbers, not counting patch writers), and a new e.V. member about every two weeks.

Judging from the comments on earlier commit digests, many people like the commit digest. (The concept has also been adopted by the Gnome project, recently.) Still, nobody seems to really care about its future. I’m already fully loaded with “the future of …” projects (most notably “the future of Kolf” and “the future of my academic studies”), but here is what I would imagine for the future of the commit digest. Perhaps, I can inspire somebody to make up something, or just start a discussion about this.

The model of a commit digest made by one person does not scale well, as one can currently observe (of course, I understand that Danny’s normal life is more important than the commit digest). The most important point from Danny’s view (as he explains in the blog article linked above) is that nobody actively writes stories for the commit digest. Many developers tend to write extensively about new features on the planet, but nobody writes articles for the commit digest.

(Disclaimer: In this paragraph, “nobody” means “virtually nobody”. The exception proves the rule. I did write articles for the commit digest proactively, for example.)

As a developer, I might want to add the problem that one person never knows how to judge commits properly, one single man does simply not know what is important to note in the digest, or whether some given commit fixes a bug or is an optimization or a new feature (unless one can conclude this immediately from the commit message).

I would like to have some community-driven site for preparing the commit digest. A developer (or an interested user) could rate commits on a scale between “ground-breaking new feature” and “uninteresting plumbing in internals”, and categorize them into features, bug fixes, optimizations, documentation updates, translation updates, move operations (from or to kdereview, for instance). If such metadata is available, it should be a trivial task to create even specialized digests. For example, some user from Bangkok might find a digest on updated Vietnamese translations very interesting. Or some student of computer science might want to filter all optimization commits to learn some useful tweaks for his C++ course.

It would also be nice if one could group commits together. For example, many developers like to distribute the several steps in implementing a feature into several commits:

  • introducing some methods in related classes, or preparing the layout of related classes
  • implement the new feature
  • make the new feature appear in the user interface
  • fix bugs in the feature and regressions introduced by the feature
  • make it compile on Windows, again

One should be able to reflect this workflow in the commit digest.

To reduce the entry barrier to writing commit digest articles, there should be a simple option to insert blog posts into the commit digest. Many people are probably not reading the planet because there is too much noise. (There is more noise on other planets, but still.) It would be nice to find relevant blog posts, categorized by some topics such as “new features”, “community events”, or such.

Now I hear you asking when a normal developer should do all that. Rating commits, grouping commits, categorizing commits, adding blog posts. First, we have systems in place to integrate similar commit-related tasks with the normal coding workflow. (For instance, a KDE developer does not need to close a bug in Bugzilla manually after having commited a bugfix, he just appends some magic sequence to the commit message and have it closed automatically, with some commit description attached to the bug report.)

Second, such rating tasks do not take long. Again talking from my experience, I have moments when I’m simply not up for coding, when I do just do some smaller tasks that have piled up over the week. Rating the commits you did in one week should not take more than ten minutes, and it’s a great opportunity to recapitulate and reevaluate one’s design decisions and such.

Last but not least, the rating does not have to be done by the same developer. I for one could imagine to rate everything that is going on in kdegames on a regular basis. Other users might also be eager to contribute to KDE in an easy and productive manner, this could be a nice entry point. Of course, we would need some kind of validation for all ratings and such. The easiest way would be to prioritize developer ratings (their identities can be proven by the sysadmins), but I’m concerned what could be done to ensure the quality of input from non-developers.

Wow, that article has grown much too long. I hope that it fulfills its purpose to start something (at least a discussion).

Comments (6) »

Kolf: Building an editor

I’ve started to build the editor interface for Kolf 2. This is actually very nice for my current schedule, as this task can be divided into many chunks which one can complete in one to two hours of spare time. Building on what is already available in the codebase, I built a simple main editor class derives from Kolf::Game. Basically, it’s just a game without players that toggles editor overlays. Today, I added some logic to the classes that define the objects’ geometries, to let them generate outlines. These outlines can then be used to toggle the editing overlays on objects when the mouse is near, or if one clicks on an object. Currently, I do only render the outlines in debug colors. (As you see, today’s work was mostly plumbing in the internals.)

First parts of an editor interface

First parts of an editor interface

Obviously, much work has to be done until release quality is reached, but the first steps are always the hardest one (I hope at least).

Leave a comment »