Log in

No account? Create an account

Previous Entry | Next Entry

Throwing out the bath water

Since I am implementing a new Gnometris rendering engine in Clutter, one of the issues that I've run in to is separating the different input models of GTK+ and Clutter. In the end, I decided to throw GTK+ out the window. That doesn't mean, however, that any of the underlying technologies need to go. In fact, I think a great deal of our stack will continue to survive without a GTK+ UI. Gobject is our baby. And, we're using lots of other things still, like Cairo and Pango--even though the whole UI and game is a 3D canvas.

To replace the top level menu system, I have been experimenting with different approaches. The following are some mock-ups of my thinking. First, none of our Glade files or existing translations are harmed in any way. I can just open up the XML file and walk over it with libxml2 to find out the names of the nodes I need to create and gettext, as usual.

Second, VI users rejoice: the main menu is accessed by pressing ESC.

Moving on, the approach that's stupid-easy would be to implement a linear-slider style menu system similar to the new K menu in KDE 4.x or also popularized by a particular portable music player. There would be a 'back' arrow on the left-hand side.

When a menu option is chosen, the menu animates a slide left revealing the sub-menu. However, two things detract from this approach. First, in localities where text is RTL, the flow would be non-obvious. Second, we're not really innovating and I'm not convinced that this approach is really the best way to do a hierarchical menu system.

Another way to do this would be to have animated, 'fly-in' pie menus that take advantage of muscle memory.

When the user chooses the highlighted menu item, the active pie flies backward to 50% of its size and goes 45% opaque. The new sub-menu flies in from behind the perspective of the observer at 100% opacity.

I haven't worked out the way to do keyboard bindings yet nor a way to easily implement the callbacks stored in the Glade files. Notice the highlight color is picked up from the Gnome theme. Something that's going to be very hard is getting pixel-level precision for the font rendering so that the magic that has been given to the font stack can continue to be taken advantage of no matter how many menu items are on the screen.

What do you think? Which way to go?

(For Luddites, the current 2D UI is not going away any time soon and will continue to be maintained.)


( 14 comments — Leave a comment )
Jun. 8th, 2008 11:30 pm (UTC)
Why not leave the current menu bar as is and just put the clutter in the remaining window space?
Jun. 9th, 2008 01:09 am (UTC)
Please don't go and create your own random UI unless its absolutely necessary. Tetris has just about the most minimal UI requirements of any program you would run; why does it need to be different from every other program on the planet? Also, do you really want to implement input-method support for entering names for high scores in this interface? If not, you have broken the only thing you really need to interact with the UI for.
Jun. 9th, 2008 01:31 am (UTC)
Get rid of the menus too
If you are doing away with the GTK+ menubar anyway, why bother re-implementing the contents? Most of it is stock anyway. Instead of using text, use a ring of icons, like 'Play', 'Settings' and 'Keys'.
Save the clutter stuff for the block effects (tumbling row-collapses, etc.) and translucent score overlays. Maybe also add some elasticity to blocks, so that when they fall hard, they squish a little bit and then bounce back.
Some of the original (licensed) Tetris versions had nice Russian themed backgrounds that would change with each level. That might be nice, and also creates an opportunity for end-user theming.
Jun. 9th, 2008 01:35 am (UTC)
It doesn't look like a GNOME application. I don't understand why you need to drop the GTK+ menu. If this is an application to be shipped with gnome-games, I don't think you can go so radical without having some consistency with the rest of the GNOME Desktop applications.

Jun. 9th, 2008 05:36 am (UTC)
I'm going to have to agree with everyone else. Leave the Gtk+ menubar and just use Clutter for the canvas. The most important thing should be consistency with the rest of Gnome. Otherwise, there are about a million other open-source tetris games.

It just feels dirty.
Jun. 9th, 2008 06:14 am (UTC)
I don't understand why you would need a 3D canvas for Tetris. The only thing you would accomplish (other than having some fun learning Clutter) is to create higher requirements for the game and a non-standard UI. All in all it sounds like a regression to me.
Jun. 9th, 2008 07:17 am (UTC)
Not GNOME anymore.
While this certainly looks nice it does not look like GNOME anymore... more like some random SDL tetris clone. If you go this way, I don't see why you still want to reference the GNOME name in the app title.
Jun. 9th, 2008 08:48 am (UTC)
I wasn't going to comment until I saw the other commenters. While there are usability problems with your approach (how would I know to press escape?), I think you have a good idea in trying to prioritize game-space over interface-space. Anything you do will be different, and thus unacceptable to some people, but it is good (and fun!) to experiment, no?

Maybe constructively my only idea would be to make this functionality more discoverable, somehow. Then if it works for you, you get to tango with the accessibility people for a while ;)
Jun. 9th, 2008 08:50 am (UTC)
If these changes are truly driven by problems with making the input handling of GTK and Clutter work together, isn't that a deal breaker for use in GNOME?

Replacing all GTK UI with custom equivalents does not sound like a solution that will scale to multiple applications very well, and you are throwing out a lot by doing this (IME, a11y, theming, etc).
Jun. 9th, 2008 09:02 am (UTC)
Please don't
GTK+ is more than just a pretty menu bar at the top.

As others have already said you basically got rid of all a11y (you can argue that Tetris is not for blind people but a11y not just about blind people), got rid of alternative input methods and are asking for theming problems (most probably things will break in high contrast themes).

You also make the application harder to use for existing GNOME users ("where did the menu go?").
Jun. 9th, 2008 09:22 am (UTC)
what is the problem with Clutter's input handling? if you mean the lack of focus in the GtkClutterEmbed widget, you can simply set the CAN_FOCUS flag and assign the focus when needed.

-- Emmanuele (ebassi), http://log.emmanuelebassi.net
Jun. 9th, 2008 09:24 am (UTC)
Nice work! The detractors do have a point, but IMHO these are all problems to be solved and we need to start somewhere - basically I think we need an abstract widget set on top of clutter where 'theming' is a mapping from a widget set to clutter actors etc. A11y would be exposed at the widget set level. We shouldn't stop innovating because we already have something that works 'good enough' ;)

-- robtaylor
Jun. 9th, 2008 03:42 pm (UTC)
Re: Detractors
For what it is worth, my point above wasn't "don't use clutter". It was "don't unnecessarily use custom UI".

Now the playing field in Tetris is clearly custom UI, so clutter doesn't sound like a bad choice. For the menus though, things are less clear.

I'd argue that "making Clutter and GTK input play together is hard" is a bad rationale for using custom UI there. I'd wonder why there was a problem (as does Emmanuele, by the look of it).

Secondly, if the aim is to expand use of clutter in GNOME then showing that it can be used in a normal GNOMEish application would seem useful. Having an application where all the UI has been ripped and replaced isn't exactly a good example.
Jun. 9th, 2008 09:08 pm (UTC)
Background Change
Please please please please get a different background. That ugly set of colours on the giant footprint has bothered me so much in the past that I've actually manually replaced it.

Bonus points if you make the whole main game window rounded off on the edges.

Please please please?

( 14 comments — Leave a comment )


color, uphair, smile
Jason D. Clinton

Latest Month

September 2011


Page Summary

Powered by LiveJournal.com
Designed by Tiffany Chow