Archive for the 'Game Programming' Category
Moving to Maccyland
Ryan (he of the inestimable fame) Clark suggested that since my professional and my hobby projects were on the iPhone, that I make the Mac Mini my “home” computer for a while.
So I did it. This is how they get you, you know.
The Mac Mini felt sluggish to me in development, and I knew it probably wasn’t because of the processor – it was probably due to the fact that the poor thing only had one gig of RAM.
I also must must MUST have two monitors when developing. (I’m now spoiled and cannot go back.) The video ports on the back of the mini are tiny and they are both different, requiring not only one adapter to run a monitor but a second, completely different adapter to run a second monitor. I only had one of the magic adapters and so could only run one monitor.
So the job this morning was to run out and get another gig of RAM and another video adapter for the Mac Mini.
This little sojourn began with me taking the thing apart. The Mac Mini is basically the guts of a laptop crammed into a cute little box. But unlike a lot of laptops, the thing is not designed to be user-expandable. You’re supposed to take it to an Apple Store (c) and let a Certified Apple Genius (c) work on your Mac Mini (c).
So the day started with me taking the thing apart. I’d already done it once when David shoved two DVDs into the drive at the same time, causing it to do nothing but attempt to read the discs over and over and over forever. To the device’s credit, after I removed the top of the DVD drive and took the discs out, it worked fine again.
But this was different. I was venturing into the dark heart of the machine, where no end-user is meant to go. The RAM sits on the very bottom level of the machine, underneath the drives and other guts, on the motherboard itself.
The thing about doing this type of disassembly is that there are lots of clips and pins holding the top half of the machine onto the bottom. So when you unhook the Airport antenna and take out the screws holding the top half of the computer to the bottom, it’s easy to unhook something and not realize it. Fortunately, I was looking very closely at what was happening as I opened the computer up and saw that I’d unhooked two pins from their clips.
But the bottom of the computer was finally exposed and I could fish out the single RAM chip. I took it with me to Best Buy to make sure I got absolutely the right memory (I think I’ve already established how with Apple, you play by their rules or you get kicked in the nuts).
So I go up to Best Buy. They don’t have Mac Mini RAM but it’s obvious that the MacBook uses exactly the same RAM, so I buy a two gig stick (all they have). I also get the second display adapter.
Got back and installed both RAM chips back into the computer – so yes, this computer now has three gigs of RAM in it. Got the clips put very carefully back into place, and boy are they finicky little suckers. Got everything reassembled and the machine works fine.
Time to get the second monitor hooked up. What the – the adapter goes right on the end of the VGA cable, which plugs right into the port on the Mac mini and starts working with no problems?! That’s not how things are supposed to work with Macs! I guess I got lucky.
So now I’ve got an upgraded Mac Mini with two monitors, a machine that is probably at least as good as my PC. World of Warcraft runs fine, and WoW is pretty much my benchmark for whether a machine is usable or not.
And hopefully I’ll be posting a progress report on Inaria soon.
4 commentsPulling the Trigger
Today I registered my sole proprietorship, which means I can now do business using the name “Viridian Games”. Before this it was just the name of my blog, but now it’s the name of my company – something I rarely thought I’d ever have…
Tomorrow I’ll pay the $100 to become an official Apple developer and fax them the registration form. Then I’ll be ready to submit Inaria when it’s done.
I will tell you what I’ve learned over the last eight months – never have a single revenue stream. I wish I’d learned this when I was twenty.
8 commentsBrad Wardell
It’s been a while since I’ve done an in-depth story on a developer I admire. So let’s fix that!
Brad Wardell, as you probably know if you read this blog, is the president, founder and CEO of Stardock, a software development company that specializes in two different types of software: operating system customization software and games.
Brad’s entry into software development was almost accidental. His first serious business foray was into hardware – in 1990 he started building computers and selling them pretty much out of his house (a la Michael Dell). He called his company “Stardock Systems”. In 1992 OS/2 was released and Brad felt that he could gain a competitive advantage by preloading OS/2 onto the computers he sold. In doing so he became quite familiar with OS/2.
In 1993 he realized there could be a market for an OS/2 game. He had never programmed before, so he bought two books: Teach Yourself C in 21 Days and OS/2 Presentation Manager Programming, and using the information in just these two books, he wrote Galactic Civilizations.
As you can see, GalCiv was a bit primitive graphically. At the time, Brad only knew how to create windows and icons, so everything you see in GalCiv consists of one of these two features. But it was a critical success (and not just because it was practically the only OS/2 game at the time). It was well-designed and had some excellent AI. Now, I recall being at Origin at the time and watching GalCiv top lots of “Game of the Year” lists for 1994…a lot of us at the time couldn’t understand how Origin games had lost out to an OS/2 game that…well, looked like that.
But as good a game as it was, Brad made almost no money on it. He was ripped off by his publisher and couldn’t afford a lawyer to fight back. He learned a very valuable lesson the hard way – a lesson that almost sank Stardock.
But what the publishers couldn’t take away from him was the name Stardock on the box. While the success of GalCiv didn’t profit Brad, it did raise the profile of his company. Brad was able to profit by writing an expansion to his own game called Shipyards, which sold well enough to keep him going for a bit. IBM came to Brad hat in hand asking if Brad could create a special version of GalCiv for the IBM OS/2 game pack. Brad did, which he titled Star Emperor.
Brad had always been intrigued by the idea of customizing the OS/2 operating system, and in 1994 became convinced that an OS customization tool for OS/2 could be profitable. This lead to him teaming up with fellow OS/2 enthusiast Kurt Westerfield to release OS/2 Essentials, the software that would eventually become Object Desktop.
And Brad was also able to get the rights to the “Galactic Civilizations” name back and republish the game (with improvements) as Galactic Civilizations 2 for OS/2.
And at this point, he figured the game was over and he’d won. By twenty-four he was a millionaire and Stardock was not only selling tons of copies of OS/2 Essentials and GalCiv 2 but publishing other people’s OS/2 software as well.
And then he made his second mistake – he allowed his zealotry for OS/2 to nearly wreck his business.
IBM quietly dropped support for OS/2 in 1995, and Microsoft released Windows NT 4.0 (the one with the much more usable “Windows 95″-style interface) in 1996. Windows NT 4.0 quickly captured OS/2’s core market. There were lots of people (including some of my friends at Origin (Hi, J. Allen!)) who believed that even if IBM’s support of OS/2 was a bit spotty, the superiority of the platform plus user advocacy and support could make the platform a success.
Needless to say, it didn’t work. Soon Brad began to realize that something was wrong, but Stardock continued to release OS/2 software until 1998. This could easily have been the end of Stardock, but two things saved his company.
The first was an employee, Mike Duffy. Mike was the lead developer on Entrepreneur and decided he would write a low-level, cross-platform library that worked on both OS/2 and Windows. This enabled Stardock to finally start making the transition from OS/2 to Windows.
The second was customer loyalty. Stardock at this point had a whole bunch of customers who didn’t just buy their software – they were fans of the company. They wanted to see the company do well. So they actually bought subscriptions to Stardock’s online ObjectDesktop.Net service before it was actually ready. Because of this, while 1998 was the worst year in Stardock’s history they managed to pull through, and by 1999 they had begun to release Windows products.
By 2000 things were looking up again. Brad’s focus on desktop customization software was paying off, with WindowBlinds, ObjectDesktop and DesktopX all selling well. Stardock avoided the dot-com crash of 2001 by actually being profitable and having a business plan, and by 2002 Brad decided that the company was ready to get back into games again. The first had to be a version of the original Galactic Civilizations for Windows.
But development of GalCiv for Windows slowed when the launch of Windows XP approached. Because Windows XP had more customization features “out of the box”, Brad was concerned that people would feel they didn’t need Stardock’s customization software any longer. In fact, the exact opposite happened – Windows users who had never been exposed to desktop customization before saw it in Windows XP, experimented with it, and then turned to Stardock when they ran up against the limitations of what the built-in customization could do. Needless to say, this was a great relief for Stardock.
In 2003, Windows finally got a version of Galactic Civilizations. This edition included everything from the OS/2 versions of Galactic Civilizations, its expansions and its sequel (thus, GalCiv for Windows is equivalent to GalCiv 2 for OS/2). Plus it now looked like this!
At the same time, Stardock had been beefing up their digital content delivery system. Galactic Civilizations for Windows was available at retail and online on the same day. Retail boxes included a code that could be entered into Stardock Central, which registered the user’s copy and allowed them to download the latest version.
Stardock Central quickly expanded to allow digital delivery of any product Stardock published – and Stardock had gotten back into the business of publishing other software.
And in 2006, Stardock released Galactic Civilizations 2, and Brad briefly became the focus of the DRM debate when he stated that GalCiv 2 had no DRM and never would. This caused some criticism from DRM providers (indeed, a Starforce employee actually posted a link on their forums telling people where they could pirate GalCiv 2) but Brad’s decision does not seem to have affected GalCiv 2’s sales, which have been excellent.
And in 2008 Stardock updated the perfectly functional but kind of hoary old Stardock Central with a flashy new version called Impulse. Impulse is quite comparable to Valve’s Steam in that it’s a system designed to allow people to buy and digitally download software from a host of different companies, but is different in that Impulse doesn’t require an internet connection simply to play games, but only when purchasing a new game or using other online features.
Brad long ago returned to millionaire status and has stayed there since. His strategy of cultivating a loyal fanbase and shipping excellent software while staying out of debt has allowed Stardock to grow into a major online presence and allowed him to overcome his missteps.
Brad has developed a rather…unique online persona. During his stint on the Poweruser.tv podcast, he effectively acted as the “comic” to host Kristin Hatcher’s “straight man”, saying and doing outrageous things simply to get her reaction.
Brad has also been at the core of several flamewars about OS customization, routinely insisting that the customer is not always right – especially when catering to certain customers would hurt his business. At one point he exclaimed in a forum post, “I’m too old and too rich for this shit.”
His political views seem to lean toward the individualist, and he has a particular hatred of taxes, seeing them as good money given to the government who will then give it to people who haven’t earned it and probably won’t deserve it.
Overall, I think Brad is a great guy who had to overcome incredible disadvantages to succeed. If I had the chance to work for Stardock I’d probably jump at it. Despite having to move to Michigan.
4 commentsGame Coding Complete, Third Edition
After I mentioned Mike McShaffry’s Game Coding Complete in an earlier post, a lot of people were complaining that the only copies they could get were used ones for $100 or more.
Well, despair no longer! Not only is the book available again, it’s in a spiffy new edition. This time, Mr. Mike has collaborated with other programmer/writers on various subjects. It’s almost like an edition of Game Programming Gems, but it covers game engine creation from the ground up.
And Amazon currently has it for less than $40.
If only I weren’t completely broke…
2 commentsiNaria
Because two people demanded it!
Yes, it’s true. My new current project is Inaria for the iPhone. I was greatly encouraged to do this by my good friend Ryan Clark, who has just been incredibly supportive during my entire time of trouble. He even lent me the Mac that I’ll be doing the development on. (And that I’m currently posting from.)
Porting it to the iPhone probably won’t take long; the hardest part will be making sure the new interface works well (and finding some music and sound effects I can use with the game). I will be adding some extra content – new maps and a much better leveling system. I hope to have the project done by the end of May.
And now I finally have something to blog about on this blog again!
4 commentsEmbracing the Bottom
I recently read two very different and excellent articles on independent game development.
The first was from Owen Goss of Streaming Color Studios, in which he detailed the sales figures (so far) of his iPhone game Dapple. He expressed frustration with the fact that although Dapple cost $32,000 to make, it has only made $535.19 in its first available month.
The second was from Jeff Vogel of Spiderweb Software in which he detailed the sales figures (so far) of his PC/Mac game Geneforge 4. Geneforge 4 cost $120,000 to make and after six months has only made back $111,412.
Neither of those sound very good, but Jeff is actually pretty happy with how Geneforge 4 is selling (although he admits that these sales are unexceptional). Within another month or two at most, Geneforge 4 will have made back its costs and everything it makes from then on will be sweet, sweet, gravy.
So what’s the difference? I think the difference is that (despite his protests to the contrary) Owen was hoping to strike it rich in the iPhone gold rush. As soon as his app fell off the front page of the Apple Store his sales dropped to near zero, and getting articles about his game on Kotaku and Slashdot generated exactly 21 new sales.
Owen’s claim in his follow-up post that he desires to build a software company slowly over time doesn’t really match up with the type of game he made. While Dapple is a clever little game (especially the two-player mode) it looks very generic – because it is. It’s a color-matching game. There are tons of color-matching games available for every conceivable platform. The gaming industry is awash in them. You simply cannot stand out in that genre, especially if you’re an indie.
Jeff has chosen a different route. He makes turn-based, single-player RPGs. This is a market that the big game companies aren’t serving sufficiently. The lack of cutting-edge graphics has never hurt his sales – indeed, it makes his games very older-hardware/laptop friendly. He has found an underserved market and intends to keep serving it until it goes away…which, since Jeff’s been in business for fifteen years now, it doesn’t look like it’s ever going to do.
Jeff also understood that when he chose to take this path, he would have to be in it for the long haul. It’s taken six months for Geneforge 4 to make its costs back, but now every time it sells (and it will sell, for years) it’s gravy for Jeff. And since he now has fifteen games out there, each one selling away, his overall income is high enough that he can make a living. In his inimitably cynical style, he calls this “bottom feeding”.
Now, Jeff got lucky, true. He found a market that he loved but wasn’t being served. He finished his first game and started selling it just as the internet was getting started. His development cycle (make a game in eight months, then spend two porting it to the PC) allows him to make a ton of games – at least one new one every year. And the games outsell their costs, leading to profit.
But it can still be done nowadays – indeed, it can probably be done easier, because when Jeff started he was having to advertise his games on bulletin boards and over AOL. There are plenty of underserved markets out there. You can still stand out, make your mark, and make your money.
You just can’t do it with a color-matching game, which is what Owen found out. I truly do wish him better luck next time.
6 commentsBadonkadonk.
I must travel to Sweden and drink of the water there, because there is obviously something in it. After finishing up HouseGlobe the OxEye guys had a couple days left, so they whipped out a demake of Fallout called Fillauth.

Here’s a video of their map editor in action:
At this point, I’m betting on demonic powers. It’s demonic powers, right guys? Come on, spill it, your secret is safe with me.
On a similar topic, I’d like to thank Jeb from the OxEye Games Forums for taking the time to answer some of my multiplayer programming questions.
And, you know, now that I think about it, it might be a good idea to link to all the submissions for the Demake Competition, since I’ve talked so much about it. Jeez, you’d think I didn’t know how to run a website.
No commentsI Hate the Internet
Why? Because it keeps showing me stuff like this…
If that game looks oddly familiar, it should. It was made for the TIGSource Demake Competition, which is all about taking a game and “demaking” it for an earlier platform. Thus, Silent Hill 2 for the PS2 becomes Soundless Mountain II for the NES…

Portal for the PC becomes SUPER 3D PORTALS 6 for the Atari 2600…

And Homeworld for the PC becomes HouseGlobe, for 256 color VGA…
HouseGlobe in particular is very impressive. It’s got silk-smooth two-player multiplayer over the internet or a LAN, and despite a small tech tree and number of units supports several different strategies of play. It’s a great little 2D RTS, and the guys who made it pumped it out…in ten days.
That’s why I hate the internet. It keeps showing me how much I suck. At some point, you know, I thought I’d become a developer who could make pretty cool stuff pretty quickly. But that somehow has never happened. Frankly I wonder why I’m still employed.
(EDIT: The Demake competition was hosted at TIGSource, not Retro Remakes. Oops.)
5 commentsYou Should Call Me Mario
Because I just got one-upped. I thought writing a game in one page of source was good, but the last time I tried to write an RPG in one page of source, I concluded that it probably wasn’t possible.
But now the Temple of the Roguelike is having an ongoing competition for people to write Roguelikes in one kilobyte of source; that’s less than one-fourth the size of a one-page game. Most of the entries so far have been pretty simplistic, but now a true challenger has emerged, called A Journey to Hell.
Here’s the complete source code (compiled on Linux using GCC and curses):
#include#define W(c)while(c) #define F(v,h)for(v=0;v 0?1:0) #define r rand() int x,y,S=24,T=60,c,d[90][90],L=1,b,k[]=L"$`*$.@?$?>",f,g,z,h,i,l=9,p=20,e=46, v,u=96;m(f,g){G-64?M-64||(l-=G-u)>0||(M=e):(M^62||L++&&(L^7?N():(G=e)),M^u||(p +=L,M=e),M^42||(l=p,M=e),M^36||(v+=x%9*L+L,M=e),M^63||(M=r%6?k[r&1]:97+L),M>u& &--M);M-e?M-35||(g&&m(f,0),f&&m(0,g)):(M=G|256,G=e);}E(t){W(d[x=r%T][y=r%S]-e) ;G=t;}N(){D(G=35)x=y=9;F(b,S){f=r%58+1;g=r%22+1;W(f^x||g^y){G=e,r&1?(x+=Z(f-x) ):(y+=Z(g-y));}}F(b,10)E(k[b]);F(b,L*2)E(98+r%L);}main(){srand(initscr()); raw();start_color();F(c,8)init_pair(c,c,0);N();W(c-81){D(G-64||(f=x,g=y)) clear();D(b=1;W(G^k[b]&&b<7)b++;h=x;i=y;c=0;W(c++u&&G<123&&m(Z(f-x),Z(g-y)) )D(c<49||c>57||G-64||m((c-1)%3-1,1-(c-49)/3))D(G&=255)}endwin();}
Here’s a screenshot.

In this screenshot, the purple ‘@’ is the player (of course). The yellow ‘$’ represents money on the ground. The blue-green ‘?’ represents a chest. The white ‘b’ is a monster; the letter of the monster represents how hard it is to kill, from a (weakest) to z (flee in terror). The red quote mark represents a soul left behind by a monster I just killed; picking this up raises my maximum hit points.
Here’s what that 1K of source gets you:
* Guaranteed traversable levels
* Line-of-sight on the player
* Colored graphics
* Combat with monsters
* Ability to pick up gold and souls (dropped by defeated monsters; powers player up)
* Chests (which can contain gold, a monster or a soul)
* Ability to go down the stairs (generates a new level with tougher monsters)
* Win condition (beat the seventh level to win the game)
Of course his platform gives him a couple of advantages. My library to write colored graphics to the screen and poll the keyboard and mouse under Windows takes up almost 1K of code by itself; the curses library is much more space efficient. Also, GCC supports “default int” on both functions and parameters, meaning that Jakub can declare a function as “m(f,g)” and GCC will assume that ‘m’ is a function that takes two integer parameters, f and g, and returns an int itself. Visual C++ 2005 will not allow such shenanigans (though 2003 was not as strict).
Still, it’s an incredible amount of stuff for less code than it takes to initialize DirectX. I can only imagine what the author, Jakub Wasilewski, could do with the unending expanse a full page of source would provide him.
3 commentsPlanitia Update 30: MULTIPLAYER GET!
That’s right. After weeks of work and a near-full engine rewrite I have multiplayer working in Planitia. Now, right now everything has to be hardcoded – number of clients, the IP addresses, everything. So I can’t release a demo yet. I’ll need to at least bang in some code so that clients and servers can find each other on a LAN before I do.
I’m just terribly, terribly excited. I did a ton of research for this (and of course I’ll be Writing An Article) and it paid off tremendously – everything is working exactly like I expected it would once the system was implemented.
Now, that’s not to say it’s perfect. The system is updating an average of six times a second, which means that right now units jump across the map and there’s a bit of lag between clicking a button and having something happen in the world. Both of these can be made to look better with interpolation and prediction, though they don’t actually change how the game plays.
If you guys want to get a leg up on finding out how I did the multiplayer, you can read the following articles:
For making your engine multiplayer ready:
Instant Replay: Building a Game Engine with Reproducible Behavior
For implementing network multiplayer in an RTS:
1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond
“Real-Time Strategy Network Protocol”, Game Programming Gems 3 page 496 or Best of Game Programming Gems page 459, by Jan Svarovsky
Teehee! I’m so excited!
Oh, and the next installment of Let’s Play Starflight will be delayed a day. For some reason.
1 comment

