Games Politics/Government

Senior Advisor to Governor Responds to My Concerns

Awhile back I had sent a letter to Illinois Governor Rod Blagojevich. I received a generic form letter that didn’t address any of my concerns. I sent a second email to Safe Games Illinois asking someone to answer my questions. I figured I would receive a response from someone other than the Governor, but not the Senior Advisor!

Anyway, here’s the content of the letter (misspellings or other typos are likely mine):

Mr. Berardi:

Thank you for your two letters concerning the Governor’s Safe Games Illinois initiative. Although this administration may disagree with many of the arguments in your letters, we appreciate your interest in the issue.

You outline four broad concerns in your letter and I will try to address them one at a time.

Your first question deals with existing laws that limit minors’ access to materials such as books or movies with violent or sexually explicit content. Illinois law already restricts minors’ access to certain harmful material, as dictated by the state’s Harmful Material Statute (720 ILCS 5/11-21). This law prohibits minors from buying a broad range of sexually explicit material – materials such as pornographic books or magazines. So laws do in fact exist that prohibit children’s access to media other than video games.

Your second concern questions why the Blagojevich administration is singling out violent and sexually explicit material in video games and not in other media that may be potentially harmful to children. It has become painfully apparent that video game retailers are not self-regulating and that they continue to sell adult-rated video games to minors. In October of 2003 the Federal Trade Commission released a study which found that underage teens were able to purchase M-Rated games 69% of the times they tried. A press release for this study is available on the web Last January State Representative Paul Froehlich (R-Shaumburg) sent a 15-year-old boy to 15 retail stores in the Northwest Suburbs and found that this boy was able to purchase M-rated games at 11 stores. Whether such inappropriate purchases are part of a widespread problem or not, this administration thinks that no child should be able to purchase these types of video games without his or her parents’ supervision.

Your third concern is regarding the administration’s efforts to educate parents about inappropriate video game content. One of the critical components of the Safe Games Illinois initiative is to educate parents about the harmful effects that violent of sexually explicit video games have on children. A large portion of the Safe Games Illinois website is dedicated to providing parents with information on particularly violent or sexually explicit video games as well as with links to organizations that consistently monitor and rate the various video games that are arriving on the market. Here are three Safe Games links that you might find useful:

Also, one of the mandates of the Safe Games Illinois Task Force, a body comprised of many individuals who are parents, is to educate parents on the harmful effects that violent or sexually explicit video games have on children. It is the opinion of this administration that if parents are educated about the dangers of these video games and their children cannot legally buy these games without parental permission, then violent video games are less likely to be played by an inappropriate audience.

Your final concern dealt with the wording of the propose Safe Games Illinois legislation and the legislation’s definition of violent. The legislation’s current definition of “violent” video games include those games with:

Depictions of or simulations of human-on-human violence in which the player kills, seriously injures, or otherwise causes serious physical harm to another human, including but not limited to depictions of death, dismemberment, amputation, decapitation, maiming, disfigurement, mutilation of body parts, or rape.

I don’t think any reasonable interpreation of this definition would exclude children from purchasing age-appropriate games – such as Super Mario Bros or Donkey Kong.

If you have further questions about the bill, I strongly encourage you to take a look at the web site for House Bill 4023, maintained by the Illinois Legislature:

Thank you again for your letter.

Sheila Nix
Senior Advisor to the Governor
State of Illinois

I’ll admit that I am ignorant of the laws regarding materials deemed harmful for children. According to Sheila, this law prohibits children from being sold pornographic books or magazines. So, where’s the analogous violent content law that does the same, which is what I was mainly concerned about?

The statistics they were using were presented in a way to insinuate that children are buying violent video games in droves or that it is an epidemic. For example, in this letter “underage teens were able to purchase M-Rated games 69% of the times they tried”. Ok, but how about commenting on studies that say that it isn’t happening that often in real life? That children DO tend to get their parents’ permission or have their parents present when they buy these games?

Another choice quote: “Whether such inappropriate purchases are part of a widespread problem or not, this administration thinks that no child should be able to purchase these types of video games without his or her parents’ supervision.” Ok, and because the motion picture industry is so effective at self-regulation, we won’t pass a similar law to stop the one or two instances when a child CAN get into an R-rated movie? I mean, even if it isn’t part of a widespread problem, doesn’t this administration think that no child should be able to view such movies? Perhaps I’m being petty, but I think the example is analogous.

And regarding the wording of the law in question, I’ve played games where the main character dies as a result of non-human characters or where the main character isn’t human. Are those allowed to depict death or dismemberment without falling under this law?

Someone in the ASP games newsgroup pointed out that if a law like this is passed, who pays for the rating system? How much would it cost to get a rating on a game to sell it in Illinois? How long will it take to get the rating? A mainstream game might have a million dollar budget and so the publisher might consider the cost to be a drop in the bucket, but an indie title does not usually have the means. Whatever the cost is, it will be significant to the indie. In any case, such a requirement would be harmful to the industry while having only dubious arguments to support it at the most.

Looks like I have another letter to write.

Games Geek / Technical

LAN Par-tay! or Stupid Processor…

This past weekend I went to a LAN party at my friend’s dorm. For those of you new to the term, you basically take your PC to this party and everyone connects to a Local Area Network (hence the LAN part) to play games for hours on end. This party was in the basement of the dormitory, and it started at 2PM on Saturday and ended at 12PM on Sunday. I think. It was a long night. B-)

While my Debian GNU/Linux system has a new video card and has a slightly faster processor than my Windows system, the fact was that we were playing games, and a lot of them aren’t available for GNU/Linux yet. So I took my Windows machine.

I had problems right away. My Windows machine didn’t have as complete a cooling system as my Debian system. I barely use it, so there was never a need. And I have played games on it before. Yet this weekend of all weekends, games would crash to the desktop. At first I thought that it was possibly Windows 98. I’ve refused to install Windows XP for reasons I may go into another day, but at the urging of others, I installed WIndows XP. Luckily I had brought the CD that I got for free for attending some Microsoft seminar on .NET. Still crashed to the desktop when playing games. So rule out the OS.

I opened the system and found that the ATI Radeon 8500 video card was really, really hot. I think the ribbon cables were blocking airflow. Someone had a spare GeForce 2 MX, so I installed that. I still had crashes, so I opened the case to find that the video card was hot after only a few moments in the system. Was it overheating?

My friend let me use his fan to cool my system. It was funny seeing the case opened and a giant fan blowing into the system, but it kept it quite cool. Unfortunately, games would still crash to the desktop. So rule out overheating.

Someone else insisted I should lower the clock speed on my processor. I had a motherboard that allowed me to flip switches to lower the speed, and I didn’t want to do it at first. I paid money for an AMD XP 2100+, so why lower it? Well, it did the trick. Games stopped crashing, and it still ran quite fast to handle games like Alien vs Predator 2 and Unreal Tournament 2004. I’m still upset that I had to lower the speed, but apparently the processor is overheating otherwise. Perhaps the CPU fan isn’t working well anymore.

Me and my computer woes, eh? Two other people had some issues, but we all eventually got to play.

I haven’t been to a LAN party in a long time, and these days it is less likely since I work 40 hour weeks. It was a completely different situation when I just had school to worry about. It was a good time. I think everyone should attend a LAN party. Besides reminding you that playing games is important if you are going to make good games, it also reminds us that gaming is every bit as social an activity as any other. The next time someone tells you to “put down the controller, go outside, and get a life” remind them that playing video games with friends is a bit more healthy than getting overly drunk at bars and smoking. And arguably more fun.

Game Development Games

I’m Making teh Best MMORPG/FPS/RTS Game Ever!

I’m going to be making the greatest MMO game ever! It will be cross-genre, so people who like first-person shooters, real-time strategy games, and role-playing games will all enjoy it.

It will have an amazing story that spans many arcs, but it won’t be linear at all. The entire world will be highly reactive to how you play, just like a paper-and-pencil RPG.

It will also span time, so you can play from prehistoric times using rocks as weapons all the way up to the future where there will be lasers and mechs!

So here’s where you come in. I need someone to help me build this game. I need programmers, artists, musicians (a full orchestral score!), and writers. I can’t pay you since I am doing this for free, but once we get it out there, we can paid based on royalties. Or maybe a publisher might pick us up.

What do you think?

Anyway, thanks for your time. This is going to be so cool.
Perhaps we can discuss this in a private forum? I
remember trying to do something similar in QBasic.
I got pretty far, too, but then I stopped and
looked at it and thought that I could do better.

Fun and cool with cool ideas! Maybe the main character can have
ocular implants, so you can see in the dark or through walls?
Oops, I’m saying too much in public. I don’t want someone
looking here and stealing my ideas.
So long!

Geek / Technical

My Computer is Back and Badder Than Ever!

Last time I mentioned how my Debian GNU/Linux system needed to be upgraded due to a malfunctioning video card.

I am happy to say that my system is running quite fine now. Here is a listing of some of the upgrades and changes:

  • nVidia GeForce2 GTS to nVidia GeForce FX 5500
  • Linux kernel 2.4.24 to Linux kernel 2.6.11
  • Deprecated OSS sound drivers to the new standard ALSA
  • A restrictive hard drive partition scheme to a less restrictive one

The video card runs amazingly well, although my true test is to verify that Quake 3 Arena will run on the system. So far, Tuxracer and Frozen Bubble runs fine. The 2.6 kernel is a good iteration over the 2.4 kernel since it allows the system to respond faster and has more supported hardware under its belt. The OSS sound drivers, for example, have been deprecated in 2.6, but I’ve always used them before since ALSA was iffy at best, requiring a separate download and kernel recompile. Now ALSA is actually part of the kernel, and I am pleased that my system is so much more up to date. Debian is the distro that people make fun of for being less than on the cutting edge, but it makes up for it by being stable.

The hard drive partition scheme I had before made it difficult. I had a lot of space for my home directory, which is where I keep data files and the like, but less space for /usr, which I need for programs, and /tmp, which made installation of new programs difficult. The new scheme doesn’t differentiate between /usr and /tmp, and they share a LOT more space, since I have a bigger hard drive to store any data anyway.

So my system is faster, more convenient, and more compatible with what’s new in the world of technology. Games that were out of reach before are now playable. Not bad for an emergency repair.

Geek / Technical

Stupid Video Card…

Long story short: I don’t have a working GNU/Linux system at the moment.

Long story long:

Two days ago, my Debian GNU/Linux system worked fine.

Yesterday, the video card was acting up.

The display was a little off, as if the monitor cable was getting interference. I switched cables with the Windows 98 machine I have, so I eliminated the monitor and the cable as the culprits. The GeForce2 GTS that I had won in my first ever eBay auction years ago had finally started to fail.

Just to make sure, I tried to reinstall the Nvidia drivers. For those of you who don’t know, driver installation on a Linux-based system is not a matter of downloading an executable and running it. Nvidia actually does provide something like that, but the drivers have to be made part of the kernel, usually by making a module, and you do that by compiling it.

Well it complained that the compiler used to make the kernel isn’t the same as the compiler I currently have on my system. It’s been awhile, and I’ve upgraded Debian a few times, so that made sense. I decided to try to recompile my kernel since I haven’t done that in a long time and I have been meaning to get some extra features such as USB drive support anyway.

Recompiled, rebooted, and voila! I upgraded the kernel from version 2.4.24 to version 2.4.27, and I was surprised that it only took a few minutes to do so since I’ve had older/slower machines take a half hour or more. It turns out that it was a good thing it was so fast. I apparently forgot to add network support for my onboard ethernet. Whoops.

I attempt to recompile, but then I get strange errors about modules not existing, even though I did the same exact steps to recompile. So I try to install one of the older kernels since I still have some of the packages I had created in the past. Still no network support? ARGH!!

I’ve been meaning to do a fresh install of Debian on this machine anyway. The hard drive partition scheme is more limiting than I had originally anticipated years ago (who thought it was a good idea to make /tmp only 50MB?!).

Since the video card was failing, I decided it was time to get a new one. So I went to Fry’s which was 20 minutes away from my house. I bought a GeForce FX 5500 (w00t!), as well as a Western Digital 160GB drive and some quieter case fans. I bought the drive because I don’t want to end up like Lachlan Gemmell. I already have a 120GB drive that holds a lot of my files. Some of it is backups from my main drive, but a lot of it is made up of data that doesn’t have a copy anywhere. I would hate to lose the .ogg files I’ve ripped from CD or bought from Audio Lunchbox, the games I’ve reviewed for Game Tunnel, pictures of me and my friends, and of course my Subversion repositories for the projects I have been working on. I opted for a second huge hard drive since it would be easier and faster to make at least a second copy of my data. I can decide to get a DVD burner later.

And the fans? My system sounded like a jet engine starting up. I’ve been meaning to fix that problem as well.

Last night I installed the fans, and it was definitely a lot quieter. I decided to leave off the video card and hard drive until today since it was getting late and I needed to figure out how to setup the drive in the first place.

So at the moment, I have a system that can’t connect to the Internet. It still can’t display anything, so it is rendered useless for the most part. All because I tried to fix it when the video card acted up.

The good thing is that I’ve made it quieter, and when I am through with it, it will be even more powerful than before. Doom 3 and Unreal Tournament 2004 are now more easily within my grasp. And I will finally get around to designing an automated backup system. Phoenix rising, indeed.

Game Development

Learning Kyra: Attack of The Clones

The third entry in the Learning Kyra series. The series to date:

  1. Learning Kyra
  2. Learning More Kyra

Last time I was able to create a non-interactive moving body with a head attached. It simply walked from the top to the bottom of the window. Fairly simple, just like the graphics created for it.

In this entry, I will describe how I tackled the following tasks:

  • Adding multiple characters to move around at once
  • Adding interactivity
  • Adding collision detection

I began with trying to add multiple characters to the program since it seemed like the simplest task. I did run into some problems, but in the end I managed to accomplish what I wanted.

To start, I needed to create a new character. I decided to make a clone of myself, goatee and all, as I described in the first part of this series.

I figure that as a clone he didn’t need his own body, so I can just reuse the existing one. Kyra allows you to change the colors on the fly, so I could always tint his appearance later. For now, he also gets a blue shirt with brown pants.

Kyra creates sprites based on resources. I already had two resources: gbHeadRes and gbBodyRes, both of which can make the sprites gbHead and gbBody. I simply used similar code to create the first clone: I grabbed the new resource gbCloneHeadRes and created gbCloneHead from it.

I then created a new sprite from gbBodyRes called gbCloneBody. For all intents and purposes, it is a copy of the already existing gbBody, but Kyra needs to know about each sprite. I then added the gbCloneHead as a child of the clone body. I set the position of the clone so that it would start a little higher than the regular character. This way, it will look like he is chasing him.

It actually turned out decent. I then tried to add multiple clones. I thought they would be great in a triangle formation, chasing after the poor original. It was at this point that I started having problems. I thought that since the head would be the same I could probably just add it as a child of all of the new bodies, but Kyra didn’t like that since it would seg fault when I run it. I just created multiple heads to go with the multiple bodies. I then found I had an off-by-one error. I wanted to create a triangle of characters, but I forgot to actually count how many I would need. I needed six, but I only created five, but then I was trying to set six, and so I kept getting seg faults until I figured this one out. /me smacks self in head for that one.

Still, I was victorious in, as you can see:

Objective accomplished! Now onto the next.

Interactivity is the stuff that games are made of. Up until now, I’ve only had an animated graphics demo. Once I get it to be interactive, I’m that much closer to making simple game demos. w00t!!

Kyra did not provide facilities to handle input, so I just followed the demo’s lead and used Simple Directmedia Layer to do so. Since I didn’t want to create multiple images just to have the body move left, right, and up, it would be fairly simplistic. I wanted to make it so the user can press the arrow keys left and right, and the main character would move accordingly while running down the screen.

It was actually fairly simple to implement, and I managed to get it working quite quickly. I simply added a variable for the movement speed and then if SDL detects that the left or right arrow is pressed, I would set the movement speed accordingly. For example:

// These will control the movement based on input
int moveX = 0;
int moveSpeed = 6;



if (event.key.keysym.sym == SDLK_LEFT) {
moveX = -moveSpeed;
else if (event.key.keysym.sym == SDLK_RIGHT) {
moveX = moveSpeed;
else {
done = true;

moveX = 0;

I then modified it so that the SetPos for the gbBody would always modify the X coordinate by moveX. Then, just to add some useless complexity, I made it so that two of the clones would also move as you moved. The two middle clones will separate and move together as you move from left to right. It was here that I experienced the issue of z-ordering. Kyra will draw the sprites in the order that you added them to the engine, so while the top row would rightly be behind the second row, the second row would walk over the head of the first clone! To correct this issue, I simply added the clones from front to back.

But what happens when I want to make a sprite run in multiple directions? For example, the Kyra demo shows the Bug Eyed Monster program where the creatures can walk around in a circle, which means that a creature that might be closer to the viewer must be drawn on top of the other creatures, but that same creature can move to a point where another creature will become closer. The demo obviously handles it correctly, so dynamically changing the z-order is clearly possible. I’ll save learning this task for another day.

For now, another objective can be stricken off my todo list. It may not be very complex, but it’s a start.

Time to tackle collision avoidance. At the moment, the clones in the middle row can walk through each other, which is not something I want them to do. I found that the shooter demo makes use of collision detection, so I tried to follow what it did. Unfortunately it wasn’t very clear to me how it was handling it:

KrSprite* newMonster = AddMonsters();

// Flush the changes to this point and then look for
// collisions between the bullets and everything else.

GlDynArray< KrImage* > hit;
// Can we keep the monster we just added -- or did it collide?
if ( newMonster && engine->Tree()->CheckSiblingCollision( newMonster, &hit, mainWindow ) )
engine->Tree()->DeleteNode( newMonster );
newMonster = 0;
else if ( newMonster )
// This add will not be collision detected.
StatusAdd( newMonster );

So it creates a creature, but somehow it is able to determine if there is a collision even if it didn’t set its position? I plan on asking about that on the Kyra forums. (NOTE: I have since discovered that AddMonsters() actually sets the position, so nevermind) For now, I was able to determine that I needed to use the Walk() function to set the tree to check for collisions. I also needed to compare what I had to what was in the list of collided sprites returned by CheckSiblingCollision(). I spent a bit of time here because I was unfortunately trying to grab the wrong information.

I was trying to do this:

if (gbCloneBody[2] == (KrSprite*)(hit.ItemPointer(i))

but I was supposed to do this:

if (gbCloneBody[2] == (KrSprite*)(hit.Item(i))

It turns out that Item() already returns the pointer I needed, so I was getting a pointer to the pointer, which is why I couldn’t detect the collision. Once I figured out this part, I was able to add code to move the clones away from each other if they intersect. They now bounce off of each other, which is closer to what I want.

So hours later, the third task is solved. Mission accomplished!

Recap: Today, I learned how to create multiple characters and display them on the screen simultaneously. I learned how to reuse existing sprites to make new composite sprites. I learned how to add interactivity to my project while also adding some crude collision detection. What does it all mean? It means that I can not only have the clones avoid walking into each other, but I can also check if they intersect other objects, such as powerups or projectiles or anything I can throw at them. I’m excited about the possibilities, and my own demos are fairly crude.

Next time:

  • I want to learn about dynamic z-ordering.
  • I want to create tiles and backgrounds.
  • I want to make a simple game using what I’ve learned, probably something like Pac-man or Lock-n-Chase.

For now, I’ve accomplished enough to go to the Chicago Indie Game Developer meeting on Sunday with pride. B-)

You can download the updated version of the code:
Kyra Source in .tar.gz format
Kyra Source in .zip format

NOTE: You will need Kyra v2.0.7 to use this code. Also, the comments in the code weren’t all updated to reflect the fact that I’ve changed it. It is licensed under the GPL or LGPL as specified.

Game Development

Learning More Kyra

I’ve decided that I should probably create a Learning Kyra series. You can read the first one to get some background:
Learning Kyra

When I last worked with Kyra, I managed to get my head floating on a black background. Since then, I found out why lines like #include “SDL.h” are preferred, so I updated my code to reflect that change. I’m definitely becoming more aware of the issues I’ll encounter in development, much more than I was a month ago. Good. It means I’m learning. My goals for my next iteration in development:

  • I want to make the head’s background transparent.
  • I want to make the head move.
  • I want an animated body to go with it.

Geting the head transparent was weird. I was under the impression that Kyra’s sprite editor would actually pick a color to make transparent based on which corner I told it to use, but apparently I was mistaken or there is a bug when it uses something other than certain graphic file formats. I switched to using .tga files from .png, and I also found that I could set the transparency within The Gimp. First task: completed.

It didn’t take me long to get the head moving. I didn’t even have to change my code since I already programmed it to move. The data file just didn’t have the information to know how to move it. To change it, I entered the Kyra editor and set it up so that the head would move a few pixels in some arbitrary direction each frame. It was quite easy to do, and I even experimented with creating multiple frames. With only one image, it wasn’t very good looking, but it was good progress. A Black Triangle, if you would. Second task: completed.

Once I accomplished movement, I set out to create a cartoon body. I fired up The Gimp again, and was able to create three images for the body. The total walking package is below, and as you can see, I should stick to programming:

After getting the data encoded properly, it only took a few tweaks of the code to get the walking body on the screen. Check it out:

So now I have a walking character. He only moves in one direction, but he walks. Third task: completed.

So I managed to accomplish what I set out to do, and it was much easier than I expected. I managed to get more familiar with the mechanics of Kyra’s sprite editor and the code itself. I learned how to use The Gimp for more than just capturing screenshots and cropping photos. I also am learning that content development will probably require a lot more planning than I originally thought was needed.

My goals for my next iteration:

  • I want interactivity: the character should walk in the direction indicated by input.
  • I want multiple characters at once.
  • I want them to practice collision avoidance: a character shouldn’t be able to “walk into” another

You can download the updated version of the code:
Kyra Source in .tar.gz format
Kyra Source in .zip format

NOTE: You will need Kyra v2.0.7 to use this code. Also, the comments in the code weren’t all updated to reflect the fact that I’ve changed it. It is licensed under the GPL or LGPL as specified.

Games Politics/Government

Governor Blagojavich’s Video Game Censorship Laws

I recently got a letter from the IGDA regarding Illinois Governor Blagojavich’s proposal to censor video games.

I have to say: it’s about damn time the IGDA said something.

I sent a letter to Blagojavich months ago regarding this issue. Weeks later I received a form letter that did not address my concerns or questions, and I suppose that’s expected, but why ask people for their opinions and then not do anything about them? So I went to the Safe Games Illinois website and submitted a comment where they explicitly ask for comments. The form didn’t appear to work since I got database errors when I tried to submit it. Apparently it did work, as I received an email from them, but they could not read my letter since the URL was malformed by their stupid form. I responded, so I hope to hear a response that actually addresses my concerns.

Anyway, the IGDA letter points out that the Illinois House passed the bill last week, and the Illinois Senate will receive it in early April. I decided to write to my Illinois State Senator Don Harmon:

Dear Senator Don Harmon,

Recently the Illinois House passed HB 4023 by an overwhelming majority.

Governor Blagojavich claims that these laws are necessary to protect the children. I sent him a letter asking for clarification on just how children can be protected, but I received a generic form letter that did not address my concerns. You can read my letter to the Governor on my website:

I urge you to oppose this bill when it arrives in the Senate in early April.

I do not believe these laws will be effective at protecting children from violent or sexually explicit games. Children get access to games because a parent or other adult already buys the games for them. Just because a child can buy a violent game, as demonstrated by a crime task force in recent months, it does not mean that they ARE buying games. My letter has a link at the bottom that cites a study that finds a majority of children get access to games through their parents.

I do believe that the games industry is being unfairly targeted. Even Governor Blagojavich cites claims that it is not just video games but any media that can have an effect on children. Why make a law that targets James Bond-themed video games while ignoring the James Bond-themed books and movies?

The laws will also require labels to be placed on games, yet the games industry already has a rating system in place. The MPAA has a motion picture rating system in place that has been used for years, and no one has needed a government enforced rating system for that industry. I believe that a second video game rating system will only serve to confuse the people it was meant to serve. Imagine going to a movie that is both rated PG-13 and rated I.G.E.T. or something similar. You would not know whether or not it was appropriate anymore.

Video games are being treated differently than other forms of media. Is there a reason for such treatment? No studies cited by Blagojavich claim that video games are alone in their impact on children, and yet no other media is being targeted by these proposals.

I urge you to oppose Governor Blagojavich’s laws on the basis that they are unfair and would actually hurt the public more than they would help.

Thank you for your time, and I look forward to your response.

Gianfranco Berardi

Now, I personally think that violent video games aren’t the scourge that Blagojavich and others claim. If they’re so horrible, why is it that people don’t kill others more often? Statistically, with millions of video games having been played over the past two decades, why aren’t there more incedents of people killing others if video games affect them so?

It’s because they don’t. I am not sure what to think about these laws. Is Blagojavich just trying to get a quick approval jump from families who are afraid of something they don’t understand? Is this a strategic move, where he knows he doesn’t have to actually DO anything to make said families think he is? Does he actually believe in what he is doing and is just misinformed?

I don’t know. What I do know is that video games have always had a bad rap. The following may be a bit off-topic, but I want to get it out there. Even before they were considered an evil that promotes killing, video games were unfairly associated with the antisocial. How many of you gamers have ever been told, “Why don’t you just put down the stupid games, go out, and get a life?” Last I heard, even the earliest video game consoles had two controllers at least. Why is a board game or a card game (or for that matter going to a bar to drink and smoke) considered healthy and social, but playing Super Mario Bros or Quake 3 Arena considered antisocial behavior?

Movies. Books. Those are ok. Being a bookworm used to be insulting, but it really isn’t. Neither of those mediums promote interaction with others much, and that’s fine. But play a video game, and besides being considered antisocial, you’re now promoting murder simulators. It’s absurd, and yet people have no problem making this leap in logic.

If you live in Illinois, please urge your Illinois State Senator (in your Senate District, not the Federal Senate) to oppose Governor Blagojavich’s video game censorship laws. I also plan on contacting my State Representative and ask her why she voted yes.

Game Development

Learning Kyra

Today was my first Monday without worrying about homework in a long time. Sunday will be the Chicago Indie Game Developer meeting, and I want to make sure I can say I’ve accomplished something.

One of my goals was to program 5 hours per week at the minimum. While I wasn’t able to do it consistently, I did program on my own projects much more often than I did last month. I even managed to fix up my Tic-Tac-Toe game so that it is a completed project under my belt. I’ve been learning, but now that school is no longer a worry I can accomplish much more in the coming month.

Another goal was to learn how to use Kyra. I haven’t touched it since I got the demo running on my machine. The demo was quite impressive and showed the power of the Sprite Engine. So I set to work, but I had some issues.

I created a directory in my Projects directory called KyraTest. I setup a Subversion repository and setup my documentation, source, and resource directories. Kyra comes with a tutorial, so I started there. The tutorial involves using a few images together. I wanted to start simply, so I cropped a photo of my head and shrunk it. I figured I could later add a cartoon body to it and have a bunch of characters running around on a screen. For the moment though, I just had this head.

I was able to create the .dat and .xml files from the sprite editory provided. I then copied one of the tutorial code files into my source directory and edited it to make the references to my own data. For some reason the file was written as if you wouldn’t have Kyra or SDL actually installed. It would have lines like:

#include "SDL.h"

All well and good, but why not use the system include instead of a local one? If you know, please let me know why the first way would be preferable.

Anyway, once I got that part squared away, and fixed the bugs I introduced when I edited the file, I got it to compile. Unfortunately it wouldn’t run because it couldn’t find I found that it was installed on my Debian system, but there wasn’t a link created in the standard location for libraries. Once I created the link, it worked fine.

The end result: A black background with an image of my head in the middle. B-)

It was what I set out to do for today before going to bed, but it was kind of frustrating getting to that point. I sent an email to the author explaining the issues I had and how I fixed them, and I also asked for explanations on some of the code decisions.

My goal for this week: I want to make an application where a bunch of clones (with goatees, of course) are chasing after the real me (sans-goatee) before the meeting on Sunday.

And for the code collectors:
Kyra Source in .tar.gz format
Kyra Source in .zip format

NOTE: You will need Kyra v2.0.7 to use this code. Also, the comments in the code weren’t all updated to reflect the fact that I’ve changed it. It is licensed under the GPL or LGPL as specified.

Game Development Games

Postmortem: GBTTT-CLI

Awhile back, I gave myself a goal of trying to create a simple Tic-Tac-Toe game within a week. I didn’t want to just copy the ubiquitous code out of a book, though. I wanted to take a project from intial design to implementation on my own. This project was not meant to be something commercial quality, nor is it meant for public consumption. It was just a way for me to test my rusty programming skills as well as practice using some of the tools I was experimenting with before, such as Subversion.

I did it. I called it GBTTT_CLI, which stands for GBGames Tic-Tac-Toe Command Line Interface. No graphics. No sounds. Just a simple Tic-Tac-Toe game. You decide who goes first, and each player will select one of the spots to place his/her piece, either an X or an O. At the end, the game will tell you who has won. Simple. B-)

What Went Right:

  1. It was not made with just one code file.

    Tic-Tac-Toe is a very simple game. It doesn’t need to be object-oriented, nor does it need much in the way of content. Still, I wanted to separate elements, such as Players and the Board. For the most part I succeeded. I could replace the Player with an AIPlayer at a later time easily. I could probably change the implementation of the TicTacToe game class so it can be done over a network without changing much of the other code, if any.

  2. Development went along fairly quickly.

    GBTTT_CLI was the first project I have worked on while using a safety net. Revision control tools are amazing and I wish I would have known about them years ago. I used Subversion, and while I rarely needed to backtrack, especially in a small project like this one, it was useful to go through my log to see what changes I made before. There was also a time when I made a LOT of changes only to get nowhere with them. It was easy to revert all the code back to the way it was before the changes were made. It saved a LOT of time for me when I could have otherwise just been trying to make changes to get back to a stable state. With a single command, I was there.

    Another thing that helped was the ease I had with actually coding. I underestimated my coding abilities because I thought I was starting from scratch with C++. The truth was, I could program, and I just needed to learn C++’s syntax correctly. There were a few things that I got tripped up on, such as NULL instead of null as in Java, but a quick look at my reference material showed me where I was going wrong.

  3. The game got completed.

    It was a project that I was able to finish. It may not be much, but it is more than what I had before, and I am proud of that fact. It’s also shows that I have the ability to work on my own designs.

What Went Wrong:

  1. It took me too long to get here.

    My goal was to get this program done in a week, and in total programming time, I did way better than that. Unfortunately if you count the days from when I first posed this goal to myself until I finished it, it was way longer. When I started coding, I got a lot done within a few hours. Then nothing for days until I tried to work with it again. Then I got some strange error. Nothing for weeks. Then finally I finished it. So I had a few hour spurts of productivity followed by long periods of nothing. To be fair, it was not like I was just avoiding the project. I had other responsibilities in my life, such as homework. But to be brutally honest, I wasn’t making the time for this project either.

  2. I overdesigned the classes.

    It is Tic-Tac-Toe. How do you overdesign it? I did. I thought that if I created the classes first, they would be useful as tools to build the actual game. I still think that it would be good to design the project this way, but my problem was in designing in specific features. The Player class has a Record member. The Record class holds the Win/Lose/Tie records of that Player. I wrote the classes in this way because I originally envisioned a single game session letting you play multiple rounds. In the end, I decided not to implement that since it did not need to be done to accomplish my goals. So now a Round is useless in the project. I didn’t spend too much time making it, but there are other elements that were made but not used. For instance, I also thought this would be a great way to learn network programming, so I tried to anticipate it by making Boards unique. I could have saved time and effort by deciding to add such things later or in a new project.

  3. The code is ugly.

    When I originally programmed in QBasic, I had no concept of code structure and variable naming. When I learned C++, I thought it made sense to follow what C++ did: variable and function names would look_like_this. Then I learned Java. Java programming practices are clean looking. A class name looks like: ClassName. A variable looks like: variableName. When I went back to C++, I got it in my head that I probably should keep it looking like C++, where standard library naming conventions have the underscores as mentioned above. That is when I started the project.

    Then I found a C++ coding convention guideline. Apparently Java-like style has its place in C++, too. Well, I did not want to go back and rename everything, so when I continued to work on the game, I kept using the same style rather than confuse everything, me included. The end result is commented, cleanly separated, but somewhat hard to read. A sample:

    // switch to next player
    // keep asking for input until value is legal
    int move = player_current->get_move(board);
    bool is_legal_move;
    is_legal_move = board.isLegal(move);

    Huh. Well as you can see, I did not succeed in keeping the style uniform. Board::isLegal() should be changed to Board::is_legal() to accomplish that. Still, it’s hard to read because of the style.

I know there is normally 5 of each in a postmortem, but come on, it’s Tic-Tac-Toe!

What I Learned

  1. Practicing programming is important. I should treat it as such and make the time for it rather than hoping I have an opening in my schedule. There won’t be one if I leave it up to everything else.
  2. Iterative programming is useful because I can avoid overdesigning something that won’t get used
  3. Programming is still fun, just like I remember it.

Even though I am disappointed in how some things turned out, I am satisfied. It’s a completed project! I was originally going to leave it in a state of incompleteness and start working on a more attractive project idea, but I decided to be “great” rather than “good enough”. If I keep that attitude with these smaller projects, it will be a good habit to have when I tackle larger ones.

I think I will post the code at a later time. I originally did not think it would be something I would publish, but I figure it has to help someone besides me. I’ll need to add a proper README and installation/compilation instructions first.

EDIT: Hey, I delivered. B-) And in two forms: