Categories
Game Development Personal Development

Thousander Club Update: January 15th

For this week’s Thousander Club update:

Game Hours: 262.25 (previous year) + 4.5 (current year) = 266.75 / 1000
Game Ideas: 616 (previous year) + 0 (current year) = 616 / 1000

Another slow week of development. I spent the little time I did work on figuring out how to handle the explosion effects. I studied a few bits of source code, and I am now rolling my own set of effect classes. It’s not as complicated as I may make it sound, but it isn’t trivial either.

The main reason why I am not working so hard on game development is because I am spending way too much time trying to get MythTV installed using Knoppmyth. So far, I have narrowed it down to a weird-hardware-configuration problem when booting after the install. Basically, it could be anything that a newbie MythTV installer like me would think should just work.

Categories
Game Development Personal Development

Becoming a Game Developer

Steve Pavlina recently wrote about becoming a millionaire by thinking like one. One of the things he mentions is the identity shift needed, which ties into the topic of his recent podcast on faster goal achievement.

When I first heard the podcast, I realized that I am not going to finish making games so long as I continue on the poor results I’ve been posting. I need to change how I act. I need to act more like an actual game developer and less like someone who is hoping to make games in the spare time I can squeeze. I need to be a game developer if I am going to do game development.

In the Thousander Club, I have managed to pull together over 250 hours of spare-time game development. If I was actually acting like a game developer in the past year, though, I imagine that I would have put up stronger results. I shouldn’t be satisfied with only 25% of my goal for the year, and practically speaking, I shouldn’t be satisfied with not having an actual, complete, professional-quality game in all that time. And if I am honest with myself, I know that I am not satisfied.

Maybe a year or two ago, 250 hours working on an ambitious-yet-unfinished component-based game engine, a poorly designed-and-unfinished puzzle game, and a mostly-finished Pong clone would have been fine, but I can’t be satisfied with similar results at the end of this year. It’s not like I don’t appreciate the real-life experience that the past year has given me. I just want to be serious about being a game developer, and I realized that I was being half-hearted about my efforts.

Bottom line: if I want to change anything, I have to change how I identify myself.

It’s going to be hard changing my habits. Even though I’ve identified this problem before, I am still treating game development as a lower priority task, and it is usually the first thing I put on the back-burner when my schedule gets disrupted. How can I expect to make games for a living if I can’t even consider them important enough to make in the first place?
When people ask me what I do, I tell them about my day job, and I sometimes mention that I started my own shareware video game business. I mention my blog, I mention that I reviewed games for Game Tunnel, and I might say that I am slowly programming some simple games. How can I expect to make GBGames into a success when I won’t even acknowledge what I want to do? Did DaVinci say, “Oh, by the way, I also sort of paint”? Did Einstein say, “I work at a patent office. Oh, and sometimes I like to think about physics”?

I am a game developer. Once I can think like one, I can act like one.

Categories
Game Development Games Geek / Technical Linux Game Development Politics/Government

Second Life Client Source Code Released as Open Source

I found this bit of news on LinuxGames.com. Second Life, the virtual world created by the players, has had its client code open sourced. Linden Labs released the client code under the GPL.

I’m excited by this news because it means that progress on the GNU/Linux client might actually move forward, putting it on par with the Windows and Mac clients.

Categories
Games Marketing/Business Politics/Government

Inconvenient Copy Protection or Inconvenient Copy Protection?

I just got the latest issue of PC Gamer, and I was reading the letters to the editor when I came across the complaint of Jon Ferrell. Jon wrote about the annoyance and pain involved in needing to have a CD in the drive for no other reason but copy protection. Besides being inconvenient to have all of your game CDs available if you ever want to play any of them, if any of them break due to constantly being on the move, guess who replaces them? Not the manufacturer!

His letter continues, pointing out that the advent of hard drives eliminated the need for floppies to run all of your software, but then we regressed for the sake of copy protection. In fact, it got worse as we now have automatic, online checks for compliance.

So what is the PC Gamer response? “As much as digital rights management inconveniences paying customers, we find it difficult to criticize game makers for taking reasonable steps to protect themselves from widespread piracy.”

The editor goes on to say that now with systems like Steam, online checks make your CD-swapping days a memory…of course, some people don’t appreciate the fact that their limited bandwidth or their privacy are compromised in the name of copy protection. My favorite quote:

“If only someone would come up with an either/or scheme, where you could insert the disk or check in online, then we’d get the best of both worlds.”

WTF? Best of both worlds? Both worlds are pretty messed up, if you ask me, and it is pretty messed up to think that they are reasonable measures to take. It wasn’t too long ago when Stardock made the news for not using copy protection in Galactic Civilizations 2, and I seem to remember reading about it in PC Gamer, too. In fact, around that time, PC Gamer had an entire article dedicated to the problems with Starforce and rootkits. Best of both worlds? I’ll take the world of Stardock’s creation over draconian measures to protect companies from their paying customers , thank you very much.

Categories
Game Development Personal Development

Thousander Club Update: January 8th

For this week’s Thousander Club update:

Game Hours: 262.25 + 1 = 263.25 / 1000
Game Ideas: 616 + 0 = 616 / 1000

On Wednesday, I wrote down an entry in my todo list: Create 384 game ideas.

Months ago, I entered into crunch mode at my day job and neglected a number of things in the rest of my life. I had a ritual of coming up with three game ideas per day, but once I hit crunch, my routine was destroyed, and I never did get back into it.

I thought I could catch up before December was through. After all, coming up with ideas is fairly easy, especially since my game ideas are just one-liners that indicate a concept or theme. It is not as if I am coming up with 500+ page game design documents or anything. In one sitting, I threw together over 100 ideas at once. I figure if I do it a few times this week, I can hit my 1,000 ideas goal and be done with it. Actually, I could probably dedicate an entire afternoon to creating all 384 ideas. Afterwards, I can post the entire list, along with the 161 ideas I had before I started the Thousander Club last year.

Categories
Game Development

The Carnival of Game Production

Juuso announced the creation of the Carnival of Game Production.

What is this Carnival of Game Production?
Simply put: a monthly gathering of game developers and producers at a central location. The idea is similar to those other “Blog Carnivals” – but here we present quality articles dedicated to game production. Anyone wishing to participate in the Carnival is welcome. The Carnival is hosted by a different blog each time.

If you have an article related to game production or game development, go ahead and submit it. If you want to host the carnival one month, contact Juuso.

Categories
Personal Development

The Thousander Club in 2007

Scott Hsu-Storaker founded The Thousander Club about a year ago, and he recently posted a summary of his year in the article Thousander Club Take 2.

For those of you who have no idea what the club is, the idea is to become an expert at something. How do you become an expert at something? Practice. A lot of it.

Let’s recall what was said about how much time is required to become an expert. 10,000 hours over the course of 10 years might make you a master, and that seems like a lot of time to put in. It is, and you’ll note that the experts at chess or dance or baseball or writing invest that time anyway. Of course, if you break it down, it can seem more manageable:

  • 1,000 hours is doable within a year if you work full time, and you can be an experienced expert.
  • 100 hours can be done on the side, and you can still be somewhat of an expert.
  • 10 hours could be a dedicated weekend or spread over a few of them, and you’ll definitely learn enough to be dangerous.
  • Even dedicating an hour to a task will give you practice with the basics.

Can you do 1,000 hours in the coming year? That translates into almost 3 hours per day if you include weekends, or about 20 hours per week. You can easily accomplish it if your full-time job involves becoming an expert at a certain skill, but even a dedicated, part-time effort can get you there.

You don’t even necessarily need to dedicate hours. Scott had a goal of creating 1,000 3D models. I had a goal last year to create 1,000 game ideas. Maybe you’ll try to create 1,000 doodles, or 1,000 songs, or 1,000 pages for a novel.

The main idea is that by practicing a lot, you can’t help but become an expert. So will you join the Thousander Club and gain expertise in your chosen skill?

Like Scott, I didn’t hit my Thousander Club goals for the year, but I am going to continue towards my goal of 1,000 game development hours. I will keep track of my hours for this year separately from last year’s hours, but I will total them to count towards my goal. After all, the main point is to do many hours. Doing them sooner rather than later is ideal, but doing them at all is better than not.

Categories
Personal Development

Resolutions for 2007

Last year’s resolutions didn’t all work out. I have to admit that I forgot about them, and a week or so ago I remembered that I had written a post listing my resolutions for the year.

I did actually form a formal company, but it took me months later than I originally planned. Instead of Oracle’s Eye, I finished Pong and will finish Space Invaders. I played a number of games over the course of the year, including games that I never had a chance to play when they were originally released such as Mega Man and Prince of Persia: Sands of Time. Once again, I didn’t read 52 books for the year, but there was a period of time towards the end of the year when eating and breathing were all I could do between sleep cycles.

But what about for the coming year?

  • I want to sell my first game.
  • I want to create a backup system to replace the one that died last year.
  • I want to become proficient with autotools, such as autoconf and automake.
  • I want to be able to walk up multiple flights of stairs without feeling winded.
  • I want to form at least one good, productive, and/or useful habit per month.

I will try to post about my plans to accomplish each of these resolutions later in the week. I am keeping these resolutions in a list that I will check daily instead of keeping them solely in this blog post. B-)

Happy New Year!

Categories
Game Development Personal Development

Thousander Club Update: December 25th

For this week’s Thousander Club update:

Game Hours: 262.25 / 1000
Game Ideas: 616 / 1000

Target: 1008

Merry Christmas! Apparently I was off a bit in my calculations, as there is almost another week to go before the year’s end…hmm…

In any case, I managed to hit over 25% of my goal for the year, which isn’t too bad. It’s not very good compared to actually doing 1,000 hours, but it wasn’t bad.

Space Invaders is playable as a real game, but I am amazed at the long list of things I have left to do! There is no real animation to speak of, there are no menus or text, there is no way to get to a game over state, and you can’t restart from in-game.

Still, you can continue to shoot enemies for as long as you have ships left. There is no indicator, but you start with the standard three ships. If you lose them all, you need to shutdown the game and start it over if you want to continue playing.

Categories
Geek / Technical

Interesting Results from Testing Random Number Generation Assertions

Taking Ken’s advice from my previous post, I decided to write a small test program to verify that the RNG method touted as the best really was the best.

To recap, there are three methods:
The first method involves using the modulus operator: int pickedNum = rand() % range;
The better method involves some trickery to get past the low-order bits problem: int pickedNum = rand() / (RAND_MAX / range + 1 )
And the best method involves a loop discarding the values that are not within the range:

int randDivisor = RAND_MAX / MAX_RANGE;
unsigned int numPicked;
do
{
numPicked = rand() / randDivisor;
}
while (numPicked >= MAX_RANGE);

I wrote up some code to seed the C++ random number generator, run through the loop for a certain sample size for each method, and then output the results. I was expecting that the best method described in the article would show a better, more even distribution. My test checked the distribution over a range of numbers. I had a vector that stored the number of times a value within that range was picked. That is, if the RNG method output a value of 3, I would increment the value in the vector associated with 3.

I also stored the start time and end time for each loop. Besides accuracy, I think speed would be important for game developers.

I ran it with different sample sizes and different seeds, and each time I seem to come to the same conclusion.

The supposedly “best” method was actually slightly worse than the “better” method.

How did I define what was good and what was bad? I already think that the method described in the article was simpler to write and understand, which means that it wins when it comes to readability and maintainability. Of course, this code will likely be written once and left in some utility class, and the other methods are fairly easy to understand, so we’ll look at other criteria.

How flat is the distribution? If an RNG picks one number much more often than the rest, then it wouldn’t be very good. We would ideally like something that was truly random, so the method that gives us the distribution that was closest to random would be best. Now, I am no expert on statistics, but my check was to subtract the maximum number of times a value was picked from the minimum number of times a value was picked. For an ideal distribution, the answer would be 0. If one distribution’s min to max range is closer to 0 than another, then we can probably assume that the method used to create that first distribution is closer to truly random.

How long does it take to compute a result? If a method produces superior results but takes multiple seconds to calculate each time, it won’t really be useful in a video game which generally tries to calculate results within milliseconds.

So those were my two criteria. If you are very familiar with statistics, perhaps you have already seen a flaw with my test. Please let me know because I would rather have the truth than be correct.

Here are the results when run over a range of 10000 numbers and a sample size of 100000000, using a seed of time(NULL) (the same value was used for each method, so the seed value was created at the start of the program):


Time to finish first method: 9
Time to finish better method: 8
Time to finish best method: 12


Diff between min and max values:
First: 10398 - 9641 = 757
Better: 10414 - 9626 = 788
Best: 10416 - 9621 = 795

I ran it multiple times, and the Best method seemed to always have a large range between the minimum and the maximum number of times a value was picked. It also consistently ran 2 or 3 seconds slower than the other methods.

And using a seed of 0:


Time to finish first method: 9
Time to finish better method: 8
Time to finish best method: 11


Diff between min and max values
First: 10445 - 9629 = 816
Better: 10409 - 9586 = 823
Best: 10395 - 9621 = 774

I ran the test using a much smaller range of values. Instead of 10,000, I used 10.


Time to finish first method: 9
Time to finish better method: 8
Time to finish best method: 10


Diff between min and max values
First: 10006453 - 9992621 = 13832
Better: 10001752 - 9998124 = 3628
Best: 10001752 - 9998124 = 3628

Over a smaller range of values, it seems that the Best and Better methods have the same difference between the minimum and maximum number of times a value was picked. Best was still consistently slower, though.

So what do these results mean?

The trick of dividing by RAND_MAX uses the high order bits of a random number produced by rand(), thus alleviating the old problem of poor rand() implementations with non-random low order bits. But as I said, these days that problem has been largely fixed by library vendors, so the only thing you have managed to do is make the code more complicated. It buys you nothing, and before you start thinking that doing the same thing with floating-point will help, I assure you that it will not.

Well, it seems that according to my tests it buys time, but then the article does mention using a uniform deviate from the random number. I then added that version to my test, and recomputed the results.

For a small range, I found that it ran at the same speed as the first two methods while also providing the same difference between minimum and maximum number of times a value is picked as the Better or Best method.

For a very large range (100000 values), however, I got the following results:

Time to finish first method: 11
Time to finish better method: 11
Time to finish best method: 13
Time to finish deviate method: 11


Diff between min and max values
First: 1178 - 860 = 318
Better: 1140 - 238 = 902
Best: 1135 - 861 = 274
Deviate: 1142 - 865 = 277

As you can see, the uniform deviate method was computed at about the same speed as the non-looping methods. While being only slightly worse at flattening the distribution as compared to the Best method, it blew away the Better method.

However, I also would like to note that the original method, which was supposedly so bad, seems to have a fairly flat distribution, too. Of course, once you get to a smaller range of values, it got much, much worse. If you only checked a range of 10 values, the first method came back with over 3 times the difference of the other methods, and the deviate method worked about as well as the Best, coming back with the same flatness in distribution.

Apparently which method you use depends on what range of values you are checking. If you are checking a small range of values, then you would do well NOT to use the First method. If you are checking a large range of values, it doesn’t seem to matter as much. In any case, the “Best” method is not named right, but the uniform deviate does correct its speed problem.

Potential Problems with These Tests:
Subtracting the minimum number of times a value is picked from the minimum number of times a value is picked might not really give me a meaningful value like I think it does. If you can think of a better way to handle this test, please feel free to correct me.

If you would like the C++ source, you can download it:
randomtest.tar.gz
randomtest.zip