Categories
Uncategorized

Ubuntu seems alright

I downloaded the free version of VMWare server and installed Ubutnu onto it, figuring I’d end up deleting it 20 minutes later. As it turned out, Ubuntu is the least sucky version of Linux I’ve seen so far. I even connected to the internet without creating 4 partitions, making a make file, and recompiling the kernel from a console window!

It seems like Google has the right idea. If and when they make a desktop version of Linux based on Ubuntu I’ll buy it.

Categories
Uncategorized

I do my best thinking when sleeping

For the last year, working on the AI, I was never bothered by the workplace enviroment (two people chatting next to me, the vacuum cleaners from the janitors, somebody opening the door) because I rarely had any significant problems to think about. However, now that I’m doing network programming, which sometimes requires deep thought to solve asynchronous problems, it’s a different issue. Sometimes I can’t solve a bug all morning, but solve it 30 seconds during my walk get lunch.

I’m a shitty driver sometimes because that’s one of the few times during the day when I’m alone and can really solve the deep problems to the point where I take a wrong turn on the way home… I use to solve math problems in my head on the way home from college that way.

I think the main reason why I’m so productive at home as compared to work is that I have a door I can close and in the early mornings nobody to distract me. For thought workers, not giving them a place to work with a door is like throwing away half their salary just so you can save a little money on office space.

Categories
Game Development

Effective AI programming

In game programming you need to keep learning to stay effective. When I finish a game, I reflect on what I’ve learned and consider my new skills to be more valuable than the pay I’ve earned (although that’s important too).

For my last two games, Getting Up and Star Wars Ep3, I worked on the AI. Although work on is sort of misleading, because all I really did was support users for the AI code that was already written. The existing AI code was pretty good – lots of code, lots of features, and most importantly anytime anyone else tried to add to it it was invariably worse than what was already there (and often duplicated an existing feature they just didn’t know about). So I didn’t much rewrite or extend it, and honestly there wasn’t that much to learn. In fact, a few months ago I would have said the only thing I learned is what a pain in the ass it is to maintain other people’s code who no longer work there.

On reflection though, I did learn a lesson. Because I’ve been dealing with AI actually since I started in the industry. We had the same AI programmer for every game from my first company, and the AI sucked equally bad for every game that company released. What this has demonstrated is the same thing that the AI code for GU and EP3 has demonstrated: that your AI is only as good as how high level you design it from the start.

In my first game, the design was at the level of pathfinding and movement. Subsequent attempts to add cover pretty much failed, because cover is a higher level concept that takes higher level design. I used to have a teacher that said “You can’t see the forest from the trees” and I never understood what he meant until I worked for a couple of years.

In GU and EP3, the design is at the level of combat and game mechanics, such as triggers, hide points, and gotos. Therefore, these features worked fairly well but there was no higher level planning such as group tactics or fear.

I think in order to have really good AI in a game, you need to design in high level tactics from the start, and fill in lower level concepts such as pathfinding later. Otherwise you will get bogged down in tweaking the existing code to try to compensate and never really succeed.

Categories
Uncategorized

True convergence of games and movies

I have a premonition that the convergence of games and movies is going to be more real than people think.

Consider these points:

  1. Budgets and graphical realism for games keep increasing.
  2. Hollywood is increasingly adverse to investment risks
  3. Game and movie tie-ins are increasing, with many major movies being released at the same time as the game.
  4. Computer animated movies are increasingly popular and make a lot of money

Right now it costs $30-$50 million for an AAA game and from $50 to $200 million for a movie. Lets say 10 years from now games are truly photorealistic and cost twice what they do now. What’s the next logical step?

Rather than make a game for $100 million and a movie for $100 million, make a movie using the game’s graphics engine The movie is in fact just the scripted portions of the game tied together.

Does this sound reasonable?

Categories
Uncategorized

Genius or idiot?

About a year and a half ago, before I got my current job, I had been applying around the industry. While I don’t usually do so, I went through a recruiter and indirectly spoke to Flagship Studios. After they looked at my network library, the recruiter called back and said they didn’t want me because I had UDP experience instead of TCP experience. They wanted to use TCP for their game because WoW does so, and the founders originally came from Blizzard.

If you are familiar with game network programming, you are probably thinking how strange that is. It’s like saying you don’t want someone to drive your automatic because they usually drive a manual. If I wanted change RakNet to use TCP there wouldn’t be much more to it than changing SOCK_DGRAM to SOCK_STREAM, disabling the nagle algorithm, and bypassing my reliable communications layer. Of course RakNet would then suck, losing efficiency, speed, and some features but my point isn’t that but that there’s little substantial programmatical difference between the two THAT I KNOW OF.

And that’s the key point, one I’ve been wondering for a year and a half about. Is the guy who spoke to the recruiter a genius or an idiot?

Idiot:
This guy wrote a UDP network library and we want TCP experience.

Genius:
There are many complex lessons from TCP game programming that only come from experience, and only he and a select few (excluding myself) know what they are.

An idiot would think there is some huge difference when there isn’t one while a genius would know of some huge difference that nobody else does.

I can’t figure it out. What do you think?

Categories
Uncategorized

Library packaging

Wow, it’s been since Oct. since I’ve updated? Time really flies.

So lately some Linux users have been going after me for including dependency libraries in the RakNet download, rather than telling them to go download it themselves after downloading RakNet. They make the argument that this is the only way to use up-to-date dependencies and that it also cuts down on the download size.

About a year ago I was trying to make a game using SDL. Since that’s a Linux oriented library, it had many dependencies, and some of those dependencies had dependencies. At one point I downloaded this library that had SIX different dependencies. Of those six libraries, how many do you think

A. Were still available for download?
B. Were still supported?
C. Worked with the library I was trying to use, as well as each other?

The answer is two. So like a dependency graph with a broken node, that ultimately affected my ability to use SDL and I had to find something else.

This is why I include all dependencies with RakNet. And with good cause: when I last went to upgrade speex, RakVoice no longer worked. I’m fixing that now, but in the meantime nobody would have been able to use RakVoice.

Just to drive the argument home, even if all dependent libraries were available and functional, who wants to spend the next 30 minutes downloading other libraries and figuring out where or how to unpackage or install them? When people download RakNet, they want to use RakNet, not necessarily Speex or zLib.

Categories
Game Development

Why design patterns are a good thing

So here I am for the third game needing a text manager class. Something to hold text strings for periods of time, display them in an ordered list, and handle text wrapping.

The first game that needed this used DirectX so I had lots of DirectX code in the text manager. It would compute the length of strings, edit the list of strings to split them up, etc.

This was useless for my second game because it used a different graphics engine. I copied some parts over, but a lot was changed. One of the biggest changes was that fonts were now in a separate class, where DirectX handled them as part of the graphics engine. Also DirectX took the strings to render directly where this new engine had a manager. So a lot of code was changed.

Now for my third game I look at what I did for the second game and again see that it is useless. Faced with the prospect of rewriting something that has the same functionality for the third time I decided enough was enough. Time to actually apply some engineering principles. Browing the web and remembering what I learned in college I decided to try out a factory class with a model / viewer pattern.

At first I was hesitant to do this because it didn’t seem to solve any problems. At best, I would split up the viewer into two classes that I could have done with a simple if statement. However, as I wrote more I began to see the wisdom behind the architecture.

First, I wrote the factory. This forced me to think about what parameters I would use in advance and whether they belonged in the model or the viewer.

Second, I wrote the model – which is just a list of text strings. This was completed much faster and easier than I had done in my prior implementations because I didn’t have to think at all about how the strings would be displayed. The model is totally independent of the graphics engine.

Third, I wrote the viewer. Some parts of the viewer, such as accessors for data, have nothing to do with the graphics engine. Some parts do. So in a flash of inspiration I had the viewer Irrlicht implementation derive from the viewer base class. I then modified the factory to return an instance of the Irrlicht implementation.

Presto! Now I can use this in future games. All I have to do to switch graphics engines is to derive a new viewer. I don’t even have to change the game code because it got an instance of the base class rather than the Irrlicht Implementation. I can just change the factory for the graphics engine I want. I could even support multiple graphics engines by passing different parameters to the factory.

Categories
Game Development

The devil is in the details

I just finished adding the ability to read double clicks. There’s a lot of little things you have to consider:

  1. You have to click the same button twice, not two different buttons rapidly in a row
  2. You have to account for mouse drift of a few pixels from the last click location
  3. Triple clicks should not count as two double clicks

The reason this is noteworthy is that it’s a good example of how trying to write TDDs that handle every detail of the code is impossible because normal people don’t think at that level of detail. I was watching this show about autistic people and how some of them remember all the small details they see if you let them glance at a room. A normal person doesn’t because they are bombarded with information and the brain filters out most of it.

This is why I take the approach “Write what you know, refactor what you don’t.” This is totally opposite the concept of high level design.

It’s also why, when you ask for a spec from a customer, the spec invariably misses out on details. Programmers are trained to do this sort of work and forget things. What can you expect from a customer who probably barely knows how to open Word? Extreme programming accounts for this by involving the customer in the design and implementation process which sounds like a good approach.

Categories
Game Development

Table Widget done

I wrote a table GUI widget today. It supports highlighting and selecting elements. It populates the fields through derived classes that calls the owner state.

Doesn’t sound like much but it’s a lot of work. I can reuse it later on for lots of things such as player lists.

Tommorow I will handle chatting and connecting to unset servers to setup the game state. If I have the energy I will also implement part of the game state.

Categories
Game Development

Manifesto games

I was looking at Manifesto Games yesterday. It’s a publisher for independent developers. That sounded pretty odd to me. The point of starting an independent developer, in fact its very definition, is that you are independent of publishers.

A publisher brings three things to the table: up-front funding, distribution, and advertising. For a large game this makes sense. Very few people can afford millions of dollars to fund their own game. Very few people have the connections or money to distribute and advertise their games. You might be looking at an upfront cost of $20M to develop and $10M to publish and advertise an AAA game. If the game sells a million copies you make a nice profit. Otherwise you take a loss. The publisher model is based on gambling. Take this risk many times. Most risks will fail while a minority of blockbusters will pay for the failures. It’s actually a tax-advantage for them because the losses are written off against the profit from the successes.

With independent games, you fund yourself. Distribution is easy – let people download the game. It’s not that hard to rent a server and put up a hyperlink. So the only thing left that a third party can offer is marketing. I wrote to the CEO of Manifesto, Greg Costikyan, asking about this.

Kevin:

We’re very early stage, but hopefully, we (eventually) bring a number of things to the table:

1. Exposure to a community of indie game enthusiasts to whom you might not otherwise be exposed.

2. Yes, you can do your own promotion and marketing, but this isn’t something that most independent developers are good at, because it’s not a core competence; we think we can do that more effectively than (most) indie developers by themselves.

3. We don’t ask for exclusivity–if you want to sell it yourself off your own site as well, feel free. The question then becomes: Does selling through Manifesto cannibalize my sales, or does it provide incremental sales I wouldn’t achieve otherwise?

That’s a judgment you’d have to make, but I think we will be able to demonstrate that we can help partners achieve larger sales than they would otherwise.

Like he said, the question is will the marketing they provide offset the unspecified portion of your sales they take? It’s hard to say.

According to “Marketing without Advertising” (and I agree or I wouldn’t cite it) word of mouth is the cheapest and most effective form of advertising. Sending out ads to disinterested parties is the most expensive and least effective form of advertising. Large companies do this because they already have covered the other forms of marketing have the excess cash to do it. Because large companies are so large, the cost per unit to advertise is relatively small.

As a simplistic example, lets say McDonalds runs a 5 million dollar ad in the US and they have 500,000 stores. Then each store only pays $10 for ad. Even if 99% of the people who saw the ad didn’t care about it, it will still be financially viable to run the ad. 1% of all the TV watchers in the US is a lot of people and will make more than $10 in profit for each store.

For an independent game developer your sales will probably range from a few hundred copies to 10,000 copies if you are a huge success. It costs from $2000 to $10,000 to run a banner ad on a site for a month. I’ll let you do the math, but consider that banner clickthrough rates are generally less than 1/10th of 1%. Of people who click on your banner, most will not buy the game. I won’t bother making up numbers but I will say that at small levels there are much better ways to get returns on your investement. For example, spending that $4000 on some nice new music or ship models will more likely generate better retention and sell-through rates and greater total sales.

The other thing to be aware of is that getting more eyes to see your game early on is NOT necessarily a good thing. When I released RakNet I had more unique visitors in the first month than I ever had since then. All those people that looked at the initial release of RakNet now have an opinion formed about the library and it’s unlikely they will revisit the library just because it’s now at version 2.4. Yet version 2.4 probably does not have a single line of code the same as in version 1.0 and has many times more features. It’s more stable, literally thousands of times faster, and takes something on the order of 25X less memory. So again, when we are talking about low budgets it is much more sensible to spend all your money improving your product than it is getting more people to see your initial release.

That is not to say that marketing is not important. It is, and there are ways to do it that make sense. One is building up your business. Find what the customers of your first game like and try to sell them your second game. Another is a newsletter. People who like the kind of games that your company make can get periodic updates of news games that you release. Another is in-game references to other games, such as showing a list of games in your exit screen or putting links to your other games in the startup menu.

A lot of this information comes from my favorite pair of websites:
A pyrogon Postmortum

which is commented on by
A shareware Life

This kind of marketing is effective, but is not something a third party would be able to do.

What can a third party do?

One option is nearly free advertising (such as hitting up review and news sites). I used to run a gaming website and know that connections do matter. It makes the difference between your game release posted on the front page of Blues News to being some unknown entry on Game Hippo.

The other option is the portal model. Suppose that Manifesto advertises 100 different games, and that they have some standards for what they will advertise. A site with 100 different good games is a pretty good draw to people, especially if that site advertises itself and puts its own promotions before that of the developers, such as Real Arcade. The problem with this is that your game only succeeds if the portal markets it. And according to the Shareware Life:

By putting their entire destiny in the hands of the portals, Pyrogon put the success or failure of their business into the hands of people who simply did not care whether their business succeeded or not. The entire burden of selling their product was put into other people’s hands

In summary, if you want EXTRA sales from using Manifesto as an advertising source, for a game that has already been released, AND they give you all the customer information it may be worth doing.