Saturday, December 25, 2010

Merry Christmas

This is the time of year when  things are the most hectic so I apologize for the lack of progress in Dozen Days of Tiles. I will continue the series next week and plan on releasing the first episode on Blazing Games in March. I am only going to create half the episodes as 2012 will be devoted to a 12 part game. Yes, the end of the world is overused but I want to do a series around that theme anyways. Besides, Alein the Alien has been idle too long.

Merry Christmas (or whatever else you celebrate) and have a happy new year everyone.

Sunday, December 12, 2010

DDTe1 Hour 2 to 4 - Tiles

Creating the tiles necessary for sudoku seems like a simple enough process. After all, only 10 tiles are needed. However, the check mark note system needs to be incorporated into this as well as the hint system. This makes the task a bit harder to accomplish. My decision was to got with 40 tiles. 10 for normal (blue), ten for incorrect (red) ten for correct (green) and 10 for locked (black). I am also considering an additional ten for locked but incorrect but for now am not going to bother with this but may do so later if time permits.

The easiest way of implementing the tiles would be to use text. This would not have the visual impact that I want so instead the ImageLayer class will be taken advantage of to create to display bitmap tiles that can be made as fancy as desired. The tiles were quickly created in fireworks using a nice marble image for the backdrop. This image was created quickly but may be touched up a bit later. Likewise, it will be easy to replace numbers with other symbols if so desired.

Next, the Sudoku.Tile class was created. This holds the state of the tile, the current value of the tile, if the tile is locked, and two arrays of 10 representing the state of the checkboxes. While I could use 9, because all the labelling starts at 1 I figured it would be less confusing to me to have element 0 being unused and elements 1 through 9 representing the actual number. A ImageLayer is used to draw the tile and 9 additional (small) image layers are used to represent the notes.

The combination of the two sets of numbers determine which color to set the note tiles to, if they are displayed. The decision to show them or not is dependent on the value that the tile is set to. If this is a non-zero value, the hint tiles are all made invisible. Otherwise, visibility and color get determined by the two check arrays.

The  next step is to actually make it possible to set the notes and value for tiles. There are no built in user interface components in the HTML 5 canvas so I am going to have to either roll my own or use HTML markup outside of the canvas to handle things. This decision will be the topic for the next post.

Sunday, December 5, 2010

DDTe1 Hour 1 - Planning

As tempting as it was to take the day off and play Recettear, work has finally begun on Dozen Days of Tiles. I happen to be a big fan of the Sudoku puzzles that appear in the free paper that is delivered here so while solving the puzzle in todays paper thoughts of how to create my own sudoku player game started coming to mind. I grabbed a piece of graph paper and spent about an hour planning out the game. This is probably more time than I usually spend planning out a small game such as this. Usually scratches on scrap paper is what my planning for small games consists of. Larger projects, especially when multiple people are involved, require much more planning but a game that can be finished in under 24 hours of development time shouldn't need much planning otherwise you may be too ambitious with your plans. As I am separating the player from the puzzle generator I am hoping that I am not being too ambitious with this project but we will know for sure soon enough.

Even before starting on this project, I had decided to separate the generator from the player. The reason for this is that clearly the generation of random sudoku puzzles is going to be a difficult enough task on its own without the requirement of having a player component as well. The player should be designed so it can easily accept the puzzles generated from the generator, have other puzzles (hand created or from third parties), and even a blank puzzle so the player can be used for playing puzzles from a newspaper without the user having to create some type of data file.

As a player of the game myself, the requirement that I have, one which the computer sudoku games that I have seen often fail at, is being able to easily mark up the blank tiles. I tend to write the possible numbers down and if it is clear that some numbers must belong to one or two tiles (required by a row or column, for example) will underline those numbers.  My thoughts would be to solve this by having a notes block that appears for the currently selected tile. If the tile is empty then the notes will appear as mini-tiles within that tile.

Here is the planned layout for my sudoku player. I think it is clear enough how it will be used, but I am biased. The next step is to start creating the basic tile class which will probably take a few hours.