ksudoku's move to kdereview

Johannes Bergmeier Johannes.Bergmeier at gmx.net
Tue May 8 20:20:38 BST 2007

I did much work on ksudoku the last days, so there 

> 1.  For a Sudoku game, the interface looks very complicated on
> startup.  I think a simple and tidy interface is important not to
> scare away people looking for a distraction ( once you get them
> hooked, they will stay for more ).  Some of this I think can be easily
> remedied:
> - There is a toolbar with the numbers 1 to 9 on it.  Is this really 
This toolbar might be replaced by a listbox on the left of the screen with all 
possible values. It will reflect which value is selected and might get some 
other jobs. (I'm currently working on this)
> - The contents of the "Web" menu can be put in the Help menu
Allready done
> - The "Select Number" menu is in the same situation as the toolbar, I
> don't think it is really very useful because selecting an item from it
> is a slow task to perform ( You have to click on the menu item, scan
> for the appropriate letter, move the mouse to it, select it and then
> rinse and repeat )
Is removed now
> - Can the contents of the "Options" menu be put in the Settings menu?
Moved to settings (and will get it own part in the config dialog when i find 
time for it)
> - The Undo / Redo actions are duplicated in the Edit and Move menus.
> Since these are the only items in the Edit menu, removing them means
> that whole menu can be removed.
Fixed too
> I found the startup screen a little confusing for a couple of reasons.
>  Firstly there are a lot of options and other UI elements ( including
> the toolbar which is not relevant outside of actual gameplay ) on
> screen when you start the application.   I can think of a couple of
> approaches:
> A:  Most games tend to take a "story-board" approach to setting up a
> game, where you select the game options on a series of screens.  As
> opposed to having all the options on one screen.  Each screen is
> typically fairly simple with only one decision available on each
> screen, and only four or five clickable elements on screen.
> So for example, on startup you go through a sequence:
> [ Game Type Screen ] -> [ Difficulty Screen ] -> Play!
> Where the "Game Type" screen would show maybe four or five pictures
> for the different types of Sudoku board available.  The difficulty
> screen would then display three buttons - one for "Easy", one for
> "Medium" and one for "Advanced"
> A welcome screen was recently added to KBattleShip which implements
> this, hopefully you could make use of that code.
> B:  Another approach used in other kde games is to start up and go
> straight into the game using sensible default settings.  In the case
> of Sudoku, probably a straightforward 9x9 grid with an easy difficulty
> level.  The user can then change the game type using the menu.

This was the part, which had most changes... None gave a good result yet...
We had a [Game Type Screen] -> [Options Screen] -> Play! way with only buttons 
on the [Game Type Screen] but they werde too much (each game + start them 
without game given + the download new games button)...

I will try to improve it, when i finished other parts, as i think the current 
version is allready a huge improvement against the older ones.

I think finding a good final solution is rather difficult, as KSudoku will 
have many variants, each variant has some configs and there are other 
settings. And ksudoku is not only a game but also a puzzle solving and 
creation tool.
> 2.  I found all the colored areas drawn as you move the cursor around
> on the game board quite distracting.  There is a strong blue
> background, the current segment highlighted in green and the current
> row in a red color.  This makes it harder to read the numbers in the
> cells.
The colors were more or less a mockup by me. I don't know how o combine 
oxygen-colors to be usefull in a sudoku. Maybe i replace the current style 
completely with another one which would make this easier.
> 3.  I wasn't sure how to enter numbers int cells at first, because the
> cells do not change their appearance when you click on them to
> indicate that you can enter a number.
With the changes in the interface I'm currently working on, it will be much 
easier to understand how numbers get entered.
> 4.  There are some performance problems.  The minor one is the
> perceptible delay after pressing a number before the cell under the
> mouse cursor is filled in ( perhaps 200-300 ms or so ) - especially
> with large games.  I think this delay contributed to (3) because I
> pressed a number key on my keyboard and had to wait a moment before
> the cell got filled in.  I had a quick look using callgrind and there
> was nothing very obviously wrong, and most of the timer spent in
> SKSolver::solve_engine as one might expect.  It looks like you have
> already spent quite some time on this, and Sudoku is a hard problem -
> so perhaps the easiest option is to tweak the user interface such that
> the number appears as soon as you press the key, while any
> computations that it triggers happen in the background.

The problem is only the huge amount of QWidgets :(
> Rendering large ( eg. 25x25 ) Sudoku boards is somewhat slow.
> Looking at your code, it seems that you are using a QWidget for every
> tile on the board.  So for a 25 * 25 board, that means 625 widgets.
> Widgets are heavy resource-wise and not designed to be used like this.
>  The Qt 4 Graphics View framework is a much better fit for what you
> are trying to do.  With QGraphicsView,  you have only one QWidget on
> screen, rendering the contents of a QGraphicsScene.  Each tile then
> becomes a much lighter-weight QGraphicsItem object.  I don't have
> experience converting games over to the QGraphicsView framework, but
> the kde-games developers do - I would suggest asking them about this.
> I think it is very much worth doing though, not only for performance
> but also for the pretty effects and extras that are made much easier
> with it.

I know this since i started my work on ksudoku (I'm not the author of it). 
However other parts were more important to work on. If I find time i will 
port it to SVG or something else.
> 5.  The 3D Sudoku mode is quite interesting - although I didn't know
> >from the game setup screen that is what it was. Perhaps include the
> phrase "3D Sudoku" somewhere?
The list of games is not in its final stage (I started it two weeks ago). The 
final version will have icons for the different versions + a short text 
describing it. The according data are allready in the code.


Johannes Bergmeier
Johannes.Bergmeier at gmx.net
Jabber: joselb at jabber.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070508/263d0e40/attachment.sig>

More information about the kde-core-devel mailing list