Categories
Games General

Video Game Manifestos

I found A Gamer’s Manifesto at Game Girl Advance. It’s humorous and hits home. I’ve always had Nintendo systems so I never really dealt with long load times before, but PC Games and apparently Playstation and XBox titles are plagued by developers who think that long loading times are great. Another valid complaint is the invisible barrier that keeps you within the game map. With the power of game platforms these days, couldn’t the map itself keep you within its boundaries? If I am going to hit the edge of the map as if it was a normal wall, why not make it a normal wall? Or some other suitable obstacle?

Other famous video game manifestos:

Categories
Geek / Technical

MAKE: 10 Things to Do With Old PCs

People have been fairly excited about the new Make magazine. From the page:

The first magazine devoted to digital projects, hardware hacks, and D.I.Y. inspiration.

They actually have a blog where they post interesting projects. Today I found an entry on 10 Things to Do With Old PCs. I was amused that out of all of the cool things they mentioned, “Install Linux” was simply one option and not a preprequisite for most of them. B-)

I’ve been using a home network for some time and it was a great learning experience. As a gamer, LAN parties are a semi-normal part of life, and setting up LANs is second-nature now. My main system is my multimedia center, and I am interested in making a DVR. I run my own webserver and file server. I even make automated backups across the network.

Sure, none of it “requires” you to use Gnu/Linux. Windows is currently much preferred for LAN parties due to the number of games it has. Still, what’s the point of tinkering with an old box if you aren’t trying to learn something? And isn’t it easier to learn how an engine works when it is visible? When you can take it apart and put it back together again? One of the big things that appealed to me about Gnu/Linux was that it was hackable, meaning that I could mess with it all I wanted without worrying about some violation of a draconian EULA.

Make obviously needs to cater to as many customers as it can, and most people run Windows in some form. Still, I can’t help wondering how much easier it would be to setup a central repository for files or create a personal website for your LAN when running Gnu/Linux. It would also be cheaper since you would technically have to buy a license for Windows in order to run it on the new member of your computer family. You’ll be hard pressed to find an older version of Windows that would run on an older machine, so be prepared for potentially expensive hardware upgrades just to meet minimum specs. Some Linux-based distros, on the other hand, can run on machines that gave Windows 98 problems, and most distros will run on the low-specs described in the article. Since you don’t need a per-machine license, you can even create your own Beowulf cluster if you have multiple old machines.

Categories
Game Development Games Geek / Technical

Out of Touch with Games

I’ve been meaning to post about how I am out of the loop when it comes to mainstream games these days. Wario Ware? I still haven’t seen it, but apparently it is huge. I didn’t see the Nintendo DS in action until a few weeks ago. In fact, I haven’t seen the PSP. Lumines? Wipeout? I haven’t seen the Game Boy Advance SP except in other people’s hands.

I wanted to check out Prince of Persia: Sands of Time a few months ago, but it was sold out. I ended up getting Metroid Prime, which is definitely a fun game, but my keyboard/mouse hands can’t remember how I used to play Goldeneye 64 with a passion. I bought Civilization III months ago because it was at impulse-buy range (under $15). I still haven’t pulled the cellophane off of it. I’m only now considering purchasing Unreal Tournament 2004, which got to the top of me and my friends’ want lists because it was available for Linux out of the box (thank you, Epic! I’ll thank you with my dollars soon).

In the meantime, there has been new a Metroid game, a new SimCity(how did THAT escape my attention?!) and an expansion pack for Doom 3. Nintendogs was out. Nintendo was announcing a new game console. All of these things were news to me way after they should have been.

I used to be on top of Nintendo-related news since I had a subscription to Nintendo Power. Last year I realized that I wasn’t playing Nintendo games as much so I gave it up, but now I find myself surprised that other people know about things before I do. I used to be the GOTO guy for Nintendo trivia and knowledge!

And regarding PC games: I just don’t have the time to play all the games I currently have, let alone buy new ones. I loved Homeworld Cataclysm, but I wasn’t going to buy Homeworld 2 since the demo didn’t impress me that much. Dungeon Siege? Sounded cool, but I wasn’t really compelled to play it. Black & White’s expansion didn’t end up in my collection even though I loved the original.

Am I really capable of making good games if I don’t even play many of the existing games? You can’t become a good writer without reading a lot of books, and I think you can’t make good games without playing a lot of games. The good games will inspire, and the bad ones will acts as sign posts, warning the intrepid developer about what not to do and where not to go.

Clearly, I have some improving to do.

Categories
Personal Development

It’s My Fault I Bought A Bad Product

I talked previously about how I enjoyed listening to the audio book “100 Ways to Motivate Yourself” by Steve Chandler. I really liked how much I learned from listening to a tape while driving. So I recently bought another audio book called “Develop a Super Memory Auto-matically”. I didn’t know about it previously, but I saw it when I was at Barnes & Noble. I’m interested in learning how to remember things more consistently and clearly.

This audio book, however, was not one I should have bought. Here is a break down on how the tape runs:

  • “Hi, welcome to the tape. First, to increase your memory, stop saying you have a bad memory. You need to believe you can have a good memory.”
  • Lame music with positive affirmations you’re supposed to repeat to yourself.
  • “Forgetting someone’s name isn’t because of bad memory but because you weren’t paying attention or focused.”
  • Lame music with positive affirmations you’re supposed to repeat to yourself.
  • Fake conversation with other host: “I can remember student names within the first hour of a new class.” “Wait a minute, Bob, are you blah blah blah blah seriously?” “Why, yes, Diedre, blah blah blah I’ll give you the secret but first let’s have more positive affirmation time.” “Ok!”
  • Lame music with positive affirmations you’re supposed to repeat to yourself.
  • “The secret…No, wait, just a description of the secret’s results. Let’s take an affirmation break.”
  • Lame music with positive affirmations you’re supposed to repeat to yourself.

And so on. I plan on finishing the tape, even though the big secret isn’t really a secret. I’ve read about associating a number with a specific item, such as 1=T/Tea, 2=N/Noah, 3=M,May, etc. And I’ve read that making absurd images and using other senses help you to remember. If anything redeems itself, it is the fact that the tape talks about this “memorizing lists” technique in a more natural pace than what I’ve read. I can actually see myself making use of this technique.

Still, it’s an audio tape. If I feel the need to reaffirm that I have the ability to remember things, I’ll rewind to listen to an “affirmation break” from the beginning. I don’t need it strewn throughout the tape, interrupting the flow of learning. What really ticked me off was hearing the author say something like, “We usually use 30 items, but due to time constraints, we’ll only use 16.” Time constraints?! Maybe if you didn’t waste most of the tape with affirmations, you would have more time!

I’m fairly upset about it, but I have to realize that it is my fault that I wasn’t informed. In an age where reviews of any product by anyone in the world are easily available, I made a reckless purchasing decision. I would have seen that other people were also turned off by the repeated and mostly unnecessary affirmation breaks. I say mostly because I can see why the affirmations would be useful. Believing you can remember things well is necessary to learn how to remember things well. Still, did we really need to go through the affirmation breaks so many times?

I will no longer make impulse purchases without knowing something about the product first. I will probably pick up Mega Memory next time.

Categories
Geek / Technical

Stupid Hypotheticals While in Line for Star Wars

While I was waiting in line for the new Star Wars movie last night, I posed this joke of a question: who would win in a fight, Voldemort or Vader?

Funny, right?

Well my girlfriend and our friend started discussing it. Seriously discussing it. They concluded that Voldemort would win since he only had to say something to kill Vader. I protested that Vader would do his patented choke-from-across-the-room Force move, rendering Voldemort speechless.

How did I get sucked into arguing about this?! It was a joke! I was poking fun at the die-hard fans who would ask such questions! After a few calls, we had three people for Voldemort and two for Vader. Whatever.

So then I said, “Dumbledore or Yoda?” That one I left alone, and I don’t know if they concluded anything. But “Luke Skywalker and Harry Potter? No, they’d fight on the same side!”

Oh, and the movie was great.

Categories
Geek / Technical Linux Game Development

Wine Talk

This Thursday I am giving a talk on using Wine to run Windows applications on Linux. Wine stands for Wine Is Not an Emulator. It is an implementation of the Win32 API, which means applications run at a normal speed compared to running them in actual emulators like VMWare.

That is, if they run properly. Wine is still not at version 1.0, which means that nothing is expected to work. Still, a great many apps are available as can be seen in the Application Database.

My first test was to install Starcraft. I found a few how-tos, but they aren’t terribly consistent, and it seems that the authoritative document is years old. Fortunately it wasn’t hard to install and run. The only problem I’ve found is that Battle.net isn’t usable. I get a black screen and the mouse cursor disappears so I can’t join in games. Cedega is a fork of the Wine code that was made into a closed source app. It was previously called WineX. It’s database lists Starcraft as highly rated and doesn’t mention the Battle.net problem. Still, I am not ready to shell out $5/month just to have Windows games I’ve already paid for running on my Gnu/Linux system, especially when some months I don’t get to play said games, and especially when there are plenty of native apps already. Also, it seems that newer versions of Wine tend to break the feature whenever it is available. I’ll wait.

My next test was Wizardry 8. I love the Wizardry series, and I feel bad that I haven’t played 8 very much. It works perfectly according to the Wine application database, so I set out to install it. I had forgotten how long it took to install this game! This is one of those 3 CD games which take up a lot of space on my hard drive. At 50% I had already added 1GB to my home directory (well, including Starcraft and the rest of Wine, but still).

Unfortunately when I try to run it, Wizardry 8 thinks I am running a debugger and wants me to stop doing so. I ended up having to find a no-cd crack in order to play this game, which goes to show you how annoying copy protection can be for legitimate owners of games. In the end, I managed to get it to play and aside from a few sound cracks during the opening video, it ran flawlessly. I am very pleased but I wish I didn’t have to go looking for a No-CD crack to play. Still, it shows a legitimate use of what would otherwise be considered illegal under the DMCA.

And Total Annihilation’s setup program wouldn’t even run on the version of Wine that I was using (20050310).

Wine just isn’t ready yet, but then no one pretends it is. Still, I have the ability to play one game as it was meant to be played, and another one works fine in single-player mode. Total Annihilation was possible at one time, so I can look forward to it in the future, I’m sure. Not bad for an incomplete project.

I’ve updated the Wine-Wiki for Wizardry 8, Starcraft, and Total Annihilation. Someone else already added their own comments about Starcraft. Wikis rule.

Categories
General

Day[24]; // off by one errors

When I was really young, I remember the first time I learned that the first hour of the day started at midnight. It was weird realizing that time moved in this sequence: 10PM, 11PM, 12 AM, 1AM, etc. Thinking about it for awhile, I realized it made sense.

To this day, the border between one day and the next throws people off. I like to think of it as an array of hours.

hours Day[24];

So now I have an array of hours called Day. The first hour is hour 0, and the last hour is hour 23. Translated into actual time: if it is after 12AM, you have entered into the next day.

Why am I bringing this up? Because I recently bought tickets for the latest Star Wars movie, and I bought them for opening night. My ticket says very clearly “Wednesday 12:01AM 5/18/2005”. I haven’t been paying attention to when opening night was supposed to be for the world, but I thought that I could trust my ticket. I received a call from my girlfriend today. She informed me that the movie is tomorrow night and not tonight. I think it is absurd, but she worked in a movie theater before and insists it is true.

So I walk to the theater. I ask a few of the desk workers if it is true that the movie isn’t playing tonight but is instead playing tomorrow.

“Yes.”
Why?
“Because it is Wednesday.”
But TONIGHT is Wednesday. TONIGHT is when it is 12:01AM on Wednesday.

At that point, one of them claims to have warned some manager about people getting confused about this issue. The other workers just apologize and say that it is meant to be Thursday morning, Wednesday night. As if them telling me that makes it alright now. One apologizes because that’s how the computer printed them out. As if some person didn’t make the computer do that. One reassures me that I’ll be able to get in tomorrow, as if that was my concern.

The ticket says one thing, but they “meant” another. I’ve been fairly upset about it all afternoon. I drove in today instead of taking the train since I knew I wouldn’t be back at a reasonable hour. I planned on using tomorrow to work on my presentation. Now because I was supposed to just know what they meant, I can’t work on the presentation tomorrow, and I didn’t get started on the presentation today until I got home hours later than I normally would have.

So tomorrow I will be going to a movie a day after what the ticket says. Imagine if the bank or your job worked this way. Direct deposit goes through on Friday? Nope. It’s actually Saturday. Father says to daughter, “Be home by midnight” only to find out that she is gone for a day longer than he thought she should be.

If the movie is 12:01AM on a Wednesday, it means I need to leave my house on Tuesday to make it in time. Unless you’re the movie theater, in which case it means you need to leave on Wednesday night, almost a full day after 12:01AM. GAH!

Categories
Geek / Technical General

DePaul Linux Community Install Fest

May 14th, this Saturday, will be the DePaul Linux Community Install Fest. It’s open to everyone, so if you’re in the Chicagoland area, check out the information on DLC’s website. Here’s a handy map to the event.

Categories
General

Learning Kyra: Hit Detection

The Learning Kyra series to date:

  1. Learning Kyra
  2. Learning More Kyra
  3. Learning Kyra: Attack of the Clones
  4. Learning Kyra: Tiles and Z-Ordering

I covered collision detection already, but it was in a limited capacity in Attack of the Clones. Basically, I checked if a sprite was colliding with a specific object. But what happens when I want to check for collisions with objects that have been added dynamically and prevent me from anticipating them at compile time?

The code below creates a number of sprites from the same resource. Kyra comes with the Grinning Lizard Utilities, so those are prefaced with Gl. I think that it makes it confusing if you want to mix your code with OpenGL, but whatever. One of the utilities is GlDynArray, which acts very much like the C++ Standard Library’s vector class. While it is in the provided demo code, I couldn’t find any mention of it in the documentation. I simply followed along with the demo in shooter.cpp. I created an array and added 10 ghost sprites to it. In the code below, MAX_GHOSTS is equal to 10. I also add those sprites to the tree.

KrSpriteResource* ghostRes = engine->Vault()->GetSpriteResource(GHOST_ghost);
GLASSERT( ghostRes );

KrSprite* ghost = new KrSprite( ghostRes );
ghost->SetPos( GHOST_START_X, GHOST_START_Y - 64);
engine->Tree()->AddNode( midgroundTree, ghost );

GlDynArray< KrImage* > otherGhost;
for (int i = 0; i < MAX_GHOSTS; ++i)
otherGhost.PushBack( new KrSprite( ghostRes ));
for (int i = 0; i < (int)otherGhost.Count(); ++i) {
otherGhost[i]->SetPos( GHOST_START_X, GHOST_START_Y );
engine->Tree()->AddNode( midgroundTree, otherGhost[i] );
}

So now I have a bunch of ghosts bunched up in the center, which is where GHOST_START_X, GHOST_START_Y sets them. I placed the player’s ghost about two tiles higher. Since I was going for simplicity, and I mostly hacked out this code without designing it first, I just made the sprites in otherGhost move around randomly. Another utility is GlRandom, which provides random number generators that are superior to rand() provided by C++. The following code demonstrates how I used it:

GlRandom random;

...
//the following is in the main loop
for (int i = 0; i < otherGhost.Count(); ++i) {

...
otherGhost[i]->SetPos( otherGhost[i]->X() + (random.Rand(3) - 1) * moveSpeed , otherGhost[i]->Y() + ( random.Rand(3) - 1) * moveSpeed);

...
}

So now each of the sprites in otherGhost move in random directions. I move the original ghost much the same way as I moved my clone sprite in previous Learning Kyra entry. Well, there is movement for the player and other objects, but what about collision?

if (engine->Tree()->CheckSiblingCollision(ghost, &hit, 0) ) {
for (int i = 0; i < (int)hit.Count(); ++i) {
engine->Tree()->DeleteNode(hit[i]);
int j = otherGhost.Find(hit[i]);
otherGhost.Remove(j);
}
if (otherGhost.Count() < 1 )
done = true;
}

Very simply, if the main ghost collides with any of the other ghosts, those ghosts disappear. When the last one disappears, the main loop ends, and since I hacked this out instead of designing it, so does the program. Still, it is game-like. I experimented with other options to see what else I could do.

Instead of removing the ghosts from the tree, you could make them stationary, sort of like in Freeze Tag. As they get hit, I remove them from the otherGhost vector to keep them from moving about, but I also added the following to fade them a bit:

KrColorTransform color = hit[i]->CTransform( 0 );
color.SetAlpha( 50 );
hit[i]->SetColor(color, 0);

While it isn’t fun or polished in any way, I don’t think I can expect too much more from this specific project, at least not without struggling through painful changes. I didn’t set specific goals so the project simply evolved. I’ll consider this project complete and move on to a new project that will benefit from my new experience and some better design. You can download the project as it stands from one of the links below:


KyraGame-r1.tar.gz
KyraGame-r1.zip
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.

Categories
Geek / Technical

Snapback2 How-To

Not too long ago I created my own automated backup script. Shortly afterwards, helpful people sent me links to other, more robust scripts that have been written. One of those was called Snapback2.

Snapback2 is a backup script based on rsync and hard-links. I could explain what that means, but why reinvent an already well invented wheel? Again?

My original script was alright, but it worked by making an exact copy of everything each time it ran. For my 4 GB home directory, backing it up weekly over the course of a month would result in a backup directory that is 16-20 GB in size! That’s a lot of wasted space, especially when some files don’t change at all.

Snapback2 uses hard links and only stores changes between one backup to the next, which means that if I only changed files that were 30MB in size, then the next backup will be 30MB as well. If no changes were made, then no space is wasted at all. Clearly this method is superior to what I have written.

Setting up Snapback2 is supposed to be very simple, but I found that the documentation assumes you know what you’re doing. The following is my Snapback2 How-To:

You can download Snapback2 at http://search.cpan.org/~mikeh/Snapback2-0.5/ for the latest version as of this writing. Technically you should be able to use Perl to download it from CPAN, but I didn’t. Most of the prerequisites should be on your Linux-based system already. According to the documentation, you’ll need:

Gnu toolset, including cp, rm, and mv
rsync 2.5.7 or higher
ssh
Perl 5.8 or higher
Perl module Config::ApacheFormat

On my Debian Sarge system, I have rsync 2.6.4, so your distribution will likely have at least 2.5.7. Similarly, I have Perl 5.8.4. The one thing that you need to do is get and install Config::ApacheFormat. To do so, make sure you have root privileges and run:

# perl -MCPAN -e 'install Config::ApacheFormat'

If it is the first time you’ve used CPAN through Perl, you will be prompted to configure it. If you aren’t sure, you can simply cancel the configuration step and it apparently grabs some defaults just fine. Any and all dependencies will also be installed.

Once you have all of the prerequisites, you can install Snapback2. Again, you could probably do the same thing above to grab it from CPAN, and it will probably grab Config::ApacheFormat for you, but as I didn’t do that, I won’t cover it here.

If you grabbed the tar.gz file from the link I provided above, you should run the following:

# tar xzf Snapback2-0.5.tar.gz

It will create a directory called Snapback2-0.5. The README tells you what to do, but for completeness, here are the next steps:

# cd Snapback2-0.5
# perl Makefile.PL
# make
# make test
# make install

Snapback2 should now be installed on your system. If it isn’t, you should double-check that you have all the prerequisites. The fourth line in the previous list runs tests before installing. If something failed, you should know why from the test results. Even if you did install it successfully, it isn’t going to do anything yet. You now need to make a configuration file.

You can read the documentation setting up the configuration file in the man page for snapback2, but you can also view it online.

Here is my file, snapback.conf:

Hourlies 4
Dailies 7
Weeklies 4
Monthlies 12
AutoTime Yes

AdminEmail gberardi

LogFile /var/log/snapback.log
ChargeFile /var/log/snapback.charges

Exclude core.*

SnapbackRoot /etc/snapback

DestinationList /home/gberardi/LauraGB

<Backup 192.168.2.41>
Directory /home
</Backup>

I didn’t change it much from what was in Snapback2-0.5/examples. I installed Snapback2 on the machine called MariaGB. MariaGB will connect to 192.168.2.41, which is the IP address of my main machine called LauraGB. This is why the DestinationList refers to LauraGB. If I wanted to backup another system, say BobGB, I would keep those backups separate in their own directory called BobGB. Normally, the ssh/rsync request would ask for a password. When I setup the backups to run automatically, it won’t be useful to me if I need to be present to login. You can do the following to create a secure public/private key pair:

$ ssh-keygen -t rsa

The above line will create keys based on RSA encryption, although you could alternatively use DSA. You will be prompted for a passphrase, which is optional. Still, a good passphrase is much better than no phrase at all. Using the defaults, you should now have two files in your .ssh directory: id_rsa and id_rsa.pub. The first one is your private key. DO NOT give it to anyone. The second one is your public key, which you could give to anyone. When setting up key-based authentication, you will append the contents of this file to the server’s .ssh/authorized_keys file. Next time you login, instead of being prompted for a password, you will find yourself at a prompt, ready to work. For more detailed information, read this document about using key-based authentication with SSH.

So now, if I run the following command on MariaGB:

# snapback2

It will backup any changes from LauraGB’s /home directory to MariaGB. If, however, it hasn’t been an hour since the last backup, it won’t do anything.

Still, manually running this command isn’t very useful, and while I could install a cron job to run snapback2, I will instead make sure that snapback_loop is running. It acts as a daemon, checking to see if a file gets created in /tmp/backups. Now I can create the following entry in my crontab:

# Create file for snapback_loop to run
0,30 * * * * touch /tmp/backups/snapback

So now, every 30 minutes, I create the file /tmp/backups/snapback, which snapback_loop will take as its cue to delete that file and run snapback2. Then snapback2 will make a backup if there has been enough time since the last backup was made.

Now, I have automated backups that run regularly. Some caveats:

  • Verify that snapback2 is in /usr/local/bin. On my system, snapback2 would run manually, but snapback_loop would output errors to /tmp/backups/errors that weren’t too clear. I had to create a symlink to /usr/bin/snapback2 in /usr/local/bin in order to get it to run.
  • Make sure snapback_loop is running with root privileges. It has to call snapback2, which will need access to files in /var/log and other directories which will have restricted access. If you run it as a regular user, you may get errors. You could also change the location of the log file, but /var/log is a standard spot to keep such output.
  • Because you are running it with root privileges, you’ll need to make sure root is the one with the public key in authorized keys rather than your user account. Otherwise, you’ll get errors like “permission denied” when rsync tries to connect to the other machine.

If you don’t use a second computer, you can always use a second hard drive instead. Either way, you now have an effortless system for automating your backups!