Wednesday, March 4, 2009

Game Development with Greenfoot: Class Projects

In my high school class we've started developing some games using the Greenfoot framework for Java. We have three teams of four students, each working on one game. We ended last semester with each student creating a proposal for a game and presenting it to the class. After the proposals were given, the class members each voted secretly on the games they would like to develop, listing all the ones proposed from the one they're most interested in working on to the one they're least interested in.
The voting itself was interesting. I was surprised by the number of students who did not vote for their own game as their top choice, or even in their top 6. Only 4 students voted for their own game first, and one other voted for their own as their #2 choice. The rest all voted themselves down below #6.

We had one game that several people liked, but the creator didn't. Otherwise, the games that drew the top votes were only ones that the creator chose as their #1 pick. When I was putting together the teams, it was pleasant that everyone got on a team developing one of their top 3 picks. In fact, 8 of the class members are working on their #1 pick.

Each team is headed by the game's creator, who takes the role of producer in the team.

The games that got selected for development are:

Day 3
Day 3 is planned to be a side-view arcade shooter with stick figure graphics.

Farm Frenzy
Also known as "The Purple Piggy Game", this is an arcade maze game.

Off-Road Xtravagaanza
A side-scrolling motorcycle simulation, this is probably the most technically challenging of the games to implement under Greenfoot.

Each of the teams has gotten off to a good start. As you can see from the links above, two of the teams have gotten development blogs started, and the third isn't far behind (they've had some team members absent, slowing their progress a bit.) We're presently interleaving our work on the games in Greenfoot with lessons on Java and Greenfoot. So far this has been working out well, though we're still at a very early stage at this point.

One of my biggest fears has been poor workload balancing among the team members. So far the teams have been managing this well on their own. Some of the class members combine a "take charge" mentality with strong skills in both programming and art, so my fear was that they'd be doing the work while the others stand around wondering what exactly they're supposed to be doing. Fortunately enough of the class members feel like they've got something to contribute to their projects that they haven't been feeling left out.

With respect to Greenfoot I've been able to largely concentrate on its mechanisms for teaching and developing objects in our class's formal lecture. With the features of the API, I've been able to simply point students in the direction of the API documentation, programming manual, tutorials and videos for Greenfoot and leave the rest up to them.

The Macs we have in the lab have been the most popular systems for development. We only have four, and they get mobbed. Then, at any given time, we have another 4 Windows XP systems in use, as well as 2-3 systems booted with a Ubuntu LiveCD (mostly for running The Gimp.)

Monday, March 2, 2009

Dark BASIC Professional Retail Box

Since my earlier posts on Dark BASIC Professional (here and here), I have picked up a retail box version of it. I was using the trial version from an online download before.

There were a couple of snags on installation, one quite minor, one that became a real problem. The minor problem was that the autorun menu of the Dark BASIC Pro install CD wasn't as clear as it could have been. It gives a laundry list of things it can do, without being clear of which ones directly relate to installing Dark BASIC. There is a choice to install Dark BASIC, but whether any of the other items needs to be done before or after isn't clear, nor whether some of the other menu items install extras or demo versions of other products from The Game Creators.

I'm sure the menu makes perfect sense to someone who already knows what they're supposed to do. This sort of thing is typical of Dark BASIC. A little more work to determine what a first time user sees and thinks would make their products much nicer without a whole lot of extra effort.

As it turned out, the single Install Dark BASIC Pro item (the second item on the list on my CD, after an item allowing the installation of DirectX) was all that was necessary. I've not explored the other items on the CD as of yet.

The system I installed to initially is a netbook, without its own CD drive. I had the CD in my iMac, and was sharing it across my home network. The installation of Dark BASIC went fine this way. Until I got to the point where I needed to validate my copy of Dark BASIC.

Dark BASIC's copy protection keeps it from running unless its been authorized across the network from The Game Creator's authorization server. Having a network connection was no problem for my netbook, but first it had to validate the CD. Validation of the CD failed since I was working across a network share.

I took a trip to the Dark BASIC Pro website, and found that it's possible to authorize a copy of Dark BASIC by copying files from one computer to another. Well, I have an older, rather awful, WinXP laptop that has a CD drive directly in it, and which could probably be tricked into getting onto the internet.

Without going into all the details, I went through several iterations of trying various combinations of network connection, system, and CD and got nowhere for several hours. My older laptop didn't have a version of Windows Explorer that the server at The Game Creators was happy with (it apparently didn't support the correct procedures for talking to their server) attempts at upgrading only made things worse for the system itself, and at the end of over 4 hours of dinking around I still didn't have an authorized copy of Dark BASIC Pro.

Finally I decided to try one more idea with the netbook since using the old laptop on the network wasn't working out. If that didn't work out I would have been contacting The Game Creators directly. The last thing I tried on the off chance that it might work was connecting to the shared CD on my network by mapping it to a drive on the netbook, rather than connecting to it as an ordinary share.

This worked. The authorization program for Dark BASIC Pro was able to see that the CD was a valid CD and provide me with an authorization code for Dark BASIC when the CD was mapped as a drive.

With that hurdle out of the way, I was able to move on to using a full version of Dark BASIC Pro.

I've mentioned the manual in my earlier posts, but I hadn't really had a chance to look at it in detail. One of my students has the retail Dark BASIC, and I've glanced at his manual briefly, but not had time to do more. Now that I have my own copy, I can really see just how awful it is.

It's too bad, because the language itself isn't so bad.

Now where do I start on what's wrong with the manual? Let's start with alphabetization. It isn't.

The command lists have the commands listed in an order that suggests they appear in whatever order someone happened to think of them. As if that's not bad enough, a flip to the back of the book to the index shows that nobody bothered to do an alphabetic sort there, either.

A look at the "P" section shows:
PRINT
PREVIOUS
PERFORM...
PASTE IMAGE
POINT
PASTE SPRITE
PLAY
PERFORM...
PATH...
PLAY
PAUSE...
PLACE...
PERFORM...
PITCH...
and so on.

You have to scan every item in every list all through the book, and some of those lists are more than a page long. Somebody at The Game Creators needs to learn how to alphabetize their lists. Or how to hire someone else to do it for them.

Then we look at what should be the meat of the manual, the information on the commands in DBPro. There we find that the commands are listed, again, in an "eclectic" order, and that there are no useful examples given, most egregiously when the command is built to be used along with some other command. Multiline commands are split into multiple entries (e.g. DO and LOOP are two separate entries with the text cut and pasted between them.)

There are a multitude of other problems as well. Overall the manual reads more like an early draft than something that belongs in print in a retail box.

On the other hand, I do have to say that the inclusion of a printed manual, however rough, is a nice thing. The manual is difficult to use, but far from useless. It'll be of some use to experienced programmers. It'll be a source of confusion to beginners. It's also easier to mark up corrections in a print manual than in a PDF. So, kudos to The Game Creators for including a print manual. I'd like to ask them to please alphabetize their command lists and index, at least, in future printings.

The language itself is quite nice for what it does. If you're an experienced programmer you'll be able to write short pieces of test code pretty quickly and get some things going. There are some bugs and omissions in the language, though. The language itself is also quite inconsistant. Overall it's something like the manual. It seems to have grown up in pieces, and there hasn't been any oversight toward keeping the language consistant with itself. These problems coupled with the poor documentation means that you'll be writing a lot of test code before you get down to the real task at hand.

There are after-market books, but I've yet to find any of them at major retailers. They're available online, and while I've yet to see any it wouldn't take much to improve on the provided documentation. The forums at The Game Creators provide help as well. Most help seems to be provided in the form of example code. This is helpful to experienced programmers, less helpful to new programmers who aren't used to reading code yet.

While Dark BASIC Professional has a lot, and I mean a lot of rough edges, it pretty well does what it claims and it's quite inexpensive for a commercial product. The retail box runs $70-80. If you're completely new to programming, I wouldn't recommend it until you've spent some time learning the basics with something else that has better documentation. A free basic like Chipmunk BASIC or SmallBASIC (there's a different Small Basic especially for Windows) would probably be a better place for someone new to programming.

Then, once they get to where they need the features unique to DBPRo, they could pick it up.

Overall Grade: 78%, C

Pros:
Inexpensive for what you get.
Does what it claims.
Easy to get rolling for experienced graphics programmers familiar with current technology, but not wanting to deal with a non-procedural language like Java or C++.

Cons:
Poor manual.
Language provides poor abstraction for many graphics operations--a good knowledge of the underlying technology is required to use it properly.
Not a good language for new programmers.
There was an error in this gadget