Blocku Editor

Leave a comment

So, for the past 10 days or so I’ve been working on the board editor for Blocku. The editor is a tool that will let teachers, parents, or even students create their own boards to play in Blocku. The editor is currently in a quasi alpha-beta stage, and will hopefully be completed within the week. There is an SVN repo set up for the editor at: http://blocku.sourcefortsmod.com/svn/. Downloading/updating is open to everyone, but a login is needed to commit. The editor is written in C#/XNA – downloads for both XNA 4 and Visual Studio Express can be found online, for free (VSE 2010 or Visual Studio 2010 is needed for XNA 4).

Features

Currently, you can choose to create either a square board or a free-form board that you design yourself. At the moment, you can only create a 3×3 board from the menu (you can change the size of the board in the Game1 class, line 25). In a future release a screen will be added to let the user choose what size board to create.

Once you select the board type, you are taken to the next screen. If you selected a square board, the blocks will have already been generated; if you selected free-form, you will be given a blank slate to work upon. In both versions you are given an “Add Block” button, so if you choose a square board then decide you want more blocks, you can add more without having to re-do all your work.

The save button at the bottom of the screen will create a text file containing all the necessary information about the game. These files can then be put on the XO and, when loaded, will show up in-game exactly as they looked in the editor, including block color and position. The file format is as follows:

total # of blocks
Xpos Ypos BlockHeight NorthTextbox SouthTextbox WestTextbox EastTextbox R G B

Currently, only one text file at a time can be saved – the editor will overwrite an old board if it is still present. Saved boards can be found at BlockuEditor\BlockuEditor\BlockuEditor\bin\x86\Debug\testFile.txt. If you want to save multiple boards, simply copy the text file somewhere safe and rename it.

One last feature worth mentioning is the textbox. There are 4 of these on each block, and one at the top of the screen for the teacher to put the answer in. As noted above, the editor is written in XNA. While XNA is a very powerful and accessible language, it is missing some things. Of importance to the editor is the absence of controls you might be familiar with from Windows Form applications – like buttons, labels, and, most importantly, textboxes. This meant that I had to create a textbox control for the editor from scratch.

This actually turned out to be a very interesting exercise. One of the things that I’m aiming for with the editor is to make it as easy to use as possible. Part of that goal is what I would call ‘system continuity.’ In a Windows environment (although this is pretty similar across any desktop environment), there are certain ways you expect a textbox to behave – being able to delete characters, being able to use the arrow keys to navigate through your text, that little blinking cursor that appears after whatever you just typed. When you create a Windows Form app, controls are included in Visual Studio, so you don’t have to worry about them behaving differently from one application to the next.

For the editor, I’ve done my best to replicate these behaviors, and to make the editor as intuitive as possible. When you click on a textbox, it becomes highlighted, so you know where you’re typing. A blinking red cursor will show you where to type, and all the keys work – even when holding down shift. You can also navigate through a textbox with the arrow keys, and insert and delete characters at any point. As of now, the textboxes in Blocku feel very similar to the ones people are used to using in their everyday activities.

Future

The editor is far from complete. Below is the ‘Must-Have’ list:

  • Screen to choose what size grid to spawn
  • Finished interface – a background for the actual editor part, which will match the in-game background
  • Ability to specify a file name and location when saving boards
  • Package the editor to an executable that can be easily downloaded and installed

Luckily, there isn’t much more needed to get the editor to a deploy-able state. There are a few features in the works for future releases, that may or may not be finished by the end of the quarter.

The first is block movement. Currently, if you drag a block into another block, they will get ‘stuck’ together at the point where the mouse entered the second block. While the blocks can be pulled apart, this is somewhat annoying, and can mess up a board if the user is not aware of this behavior. This should be a pretty easy fix.

The second is the ability to select multiple blocks. Take a look at the screenshot below of a board I tried to build in the shape of a pyramid.

It looks good, except for one thing – the top block is cut off at the top of the screen. I built this board from the bottom up, and actually ran into this problem a couple of times, and each time I had to move every block in order to make it fit. It would be really helpful to be able to draw a box around several blocks and move them all at once – like moving icons on your desktop.

The third is with regards to the textboxes. Currently, when you click a textbox, the cursor will appear where ever it was when you last used it, regardless of where in the box you actually clicked. This isn’t too bad for the textboxes on blocks, since those will only be a few characters long. It does get kind of annoying having to hit the arrow keys several times in the Answer textbox at the top of the screen though. Luckily, this isn’t too big of an issue, and can wait to be fixed.

I’ll be wrapping up my work on the editor pretty soon (hopefully). At that point I’ll get back to working on the actual game, as we try and have a playable build by the start of next week.

Advertisements

Hours Breakdown

Leave a comment

Below is a breakdown of the time we estimate each future milestone will take to reach. Roughly 10-15 hours have been put into the previous milestones.

Milestones

  • Working on teacher editor – Week 8
    • A .net application that lets teachers create their own game boards for students to play on XO.
    • Cross-platform compatibility: The created boards are simple text files that work everywhere.

    Estimated hours: 15-20

  • Game completion logic – Week 8
    • Two types of solution checking:
    • For a randomly generated grid, the game will check all of the blocks to make sure they add up to the correct answer.
    • For teacher-created boards, the game will check the blocks’ original position to make sure the board has been completed as to the teacher’s specifications

    Estimated hours: 3-5

  • Block rotation & basic menu functions – Week 9
    • Main menu allowing navigation of start game, instructions, load random, or load teacher board.
    • Design and implement a system for rotating individual blocks with the mouse

    Estimated hours: ~5

  • Game modes & Sugarizing – Week 10
    • Sugarize the game so that it runs on the XO
    • Implement different game modes:
      • Normal – User has unlimited time and unlimited moves to solve the puzzle
      • Time Attack – User has a limited amount of time to complete the puzzle
      • Puzzle Mode – User has a limited amount of moves to complete the puzzle
      • Adventure Mode – Teacher can create multiple game boards and link them together, and the students will follow the teacher’s path. This allows the teacher to come up with a whole lesson plan within the game.
  • Estimated hours: 5-10

    Humongopost

    Leave a comment

    There’s been quite a bit going on with Blocku the past few weeks, so let’s get started:

    Milestones and Goals

    Here’s the abbreviated milestones and goals from our presentation to the Rochester Pythonistas on 10/14.

    Goal

    • To produce a fully functioning prototype by week 10

    Milestones

    • Have blocks snap to grid – Week 6
      • Each block of the grid is now its own object. This lets us have the blocks snap to individual grids, making it much easier for the user to position their answers.
    • Blocks w/ answers generate on their own – Week 7
      • The game can generate a board based on an answer and the length of one side of the square (currently, addition only).
    • Working on teacher editor – Week 8
      • A .net application that lets teachers create their own game boards for students to play on XO.
      • Cross-platform compatibility: The created boards are simple text files that work everywhere.
    • Game completion logic – Week 8
      • Two types of solution checking:
      • For a randomly generated grid, the game will check all of the blocks to make sure they add up to the correct answer.
      • For teacher-created boards, the game will check the blocks’ original position to make sure the board has been completed as to the teacher’s specifications
    • Block rotation & basic menu functions – Week 9
      • Main menu allowing navigation of start game, instructions, load random, or load teacher board.
      • Design and implement a system for rotating individual blocks with the mouse
    • Game modes & Sugarizing – Week 10
      • Implement different game modes:
        • Normal – User has unlimited time and unlimited moves to solve the puzzle
        • Time Attack – User has a limited amount of time to complete the puzzle
        • Puzzle Mode – User has a limited amount of moves to complete the puzzle
        • Adventure Mode – Teacher can create multiple game boards and link them together, and the students will follow the teacher’s path. This allows the teacher to come up with a whole lesson plan within the game.

    Division of Labor

    • Matt – UI Design and Game Logic
    • Kai – Usability and User Interaction
    • Lorin – Documentation and Game Organization

    Mockups

    At the moment, Blocku doesn’t really have an interface. I mean, it obviously has an interface, but it’s not really a good one. The game doesn’t have a defined art style yet either. Below are the first drafts of what Blocku might look like once it’s complete.

    The first image is the title screen, what the users will see when they first open Blocku. The buttons are large in order to make them easy to hit on the XO.

    The second and third images are what the board could look like. I tried to use bright, distinct colors for the board. This will hopefully help attract the kids’ attention more easily. The blocks are also easy to distinguish even if the user is black/white color blind. The screen has room for a timer and a score counter if desired – these would probably be placed in the upper corners.

    The third image is what the game would look like when the user finishes a puzzle. The idea here, as with the rest of the design, is to make it as easy for the user to understand what is happening.

    State of Blocku

    When we inherited Blocku, there was very little in the game. And by very little, I mean there were two blocks that spawned on the screen. And you could move them.

    At this point, I’ve written an algorithm to randomly generate a board based on an answer and the length of one side of the board. For instance, if you call GenerateAddition(3, 10) a list of blocks will be returned that form a 3×3 board, where adjacent numbers have to add up to 10.

    Next up is the game completion logic. As noted in the milestones above, we’ll have two types of solving.

    The first is for when the board is randomly generated. In this case, the game will loop through all of the blocks, and check to make sure that adjacent answers add up to the correct answer.

    The second is for when a teacher creates a board. Since the teacher might want the students to do more than simple addition or multiplication, Blocku will have an editor which will allow them to create boards that fit their curriculum. A teacher could, for instance, have adjacent answers fit the form ((x^2) + (1/3)(y^3)) = 44 (OK, that might be a bit advanced for 4th graders, but you get the point). To avoid having to worry about the exact form of the answer the teacher wants, the game will check the position of the blocks. When the teacher creates the board, the editor will save the original positions of the blocks. When loaded into the game, the board will have grid spaces at those positions, allowing us to ensure that the blocks are in the exact position they are meant to be when we check the board. When the user then hits “Check Answer” the game will check the current position of the blocks against their original positions, and report back whether or not the board is solved.

    Work has already begun on this part of the project, and we’re hopeful that it will be done by the end of the week.

    Blocku Editor

    As mentioned above, Blocku will come with an editor. The editor is only about 30% complete at this point – I’ll have more on that in a post in the near future.

    Work for this week

    This week will be spent (at least for me) on the Editor. I’ve put about 15 hours into it this weekend, and it’s off to a good start. Another 10-15 hours during the rest of the week and it should be completed.

    Blocku

    Leave a comment

    So the activity I ended up going with is Blocku, an educational math game.

    The objective of the game is to figure out different ways to solve various math problems. The problems are presented in the form: ? + ? = X, where X is some number, and the ?’s are two numbers which when combined with the operator in between them, equate to X. Various numbers are put on the four sides of the blocks, and the user has to put the sides of the blocks together that solve the problem.

    There isn’t a whole lot in the game at the moment – just two sample blocks that you can move, and a static grid. There’s a lot to add, most notably the ability to display a problem, as well as to check whether or not the user has solved it. The interface also needs an overhaul, but that will come later.

    I’ll be working on an algorithm to generate the numbers on the blocks randomly, while ensuring that the puzzle is still solvable. I imagine this will have something to do with computing the required number of times the question must be answered (dependent upon how many blocks there are), and checking to make sure there are at least that many pairs of numbers which solve the problem on the board. I’ll also be doing a few mockups of a better interface, but improving the look of the game will come towards the end of the quarter.

    Sugar Activities

    Leave a comment

    Three interesting Sugar Activities:

    1) Typing Turtle – An app that helps teach touch typing. Looks like it’s a pretty popular activity, and according to the review it’s very well made. What interested me most was the opportunity for expansion, especially the suggestions that reviewer harriska2 had: the ability to upload reports to a teacher, track the student’s progress, and require a student to retake a lesson if they don’t score high enough.

    2) Physics – Who doesn’t love a good physics simulator? This looks like a really interesting activity, and one that looks like it has room to grow. It’s hard to say what it needs without having actually played it, but it sounds like it could use some polishing, and maybe a bit more purpose.

    3) Listen and Spell 2 – Sounds like an interesting idea, and one that could really be a good way to teach spelling. However, it doesn’t seem like it was implemented very well. I’d definitely like to take a look at the project and see if there’s any way to fix it. Never worked with a speech synthesizer before either, might be cool to take a crack at improving that too.

    Hello Open Source World!

    Leave a comment

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet ipsum id ante ullamcorper congue. Maecenas sit amet sem et diam hendrerit fermentum. Nullam sit amet lectus sit amet orci suscipit blandit a nec justo. Ut dapibus magna id mi ultrices in consectetur risus semper. Praesent ac odio eget elit euismod feugiat. Nunc non odio eros, nec sagittis augue. Sed mollis quam vitae eros scelerisque et iaculis urna sollicitudin. Duis fermentum orci vitae dolor luctus et dictum libero consequat. Proin a nulla sapien, molestie pretium enim. Aenean nisl sem, tincidunt at sollicitudin et, aliquam vitae felis. Integer id elit augue. Quisque nisi lacus, eleifend nec tristique vel, facilisis id libero.