Thursday, March 31, 2016

Video Game Design: Intro

This is the beginning of a new series on video game design.  I teach Intro to Video Game Design at BYU-Idaho, and as part of revising and honing my course, I have decided to take my lectures out of the classroom, to make more time for hands-on learning in class.  This series will cover everything currently taught as in-class lectures.

Because I am using this series as a learning material for my students, the posts will be subject to revision as I find necessary.  At any time, I may remove things that I discover to be unnecessary for my students, and I may add things that I find to be important for effective learning.

I do value feedback, so feel free to comment on any post that you find lacking.  Please explain the problem and suggest a resolution.  In most cases, I will not publish these comments, but I will read them and consider the value in following the suggestions.  Don't be offended if I do not always do what is suggested.  This series must be tailored to the class and the students, so a good suggestion for a general purpose post may not be suitable for this series.  I may occasionally publish suggestion comments instead of revising the post in this situation, if the information is of considerable value outside of the context of my class.

If you enjoy this series and you want to leave feedback saying that you enjoyed it, please +1 the posts you liked instead of commenting.  That will save me work, and it will avoid comment clutter.

Thanks you for your interest, and I hope you enjoy!

Monday, March 28, 2016

Game Design: The Challeneges of Real-time Strategy

I am a game designer, so I spend a lot of time thinking about how to improve on ideas found in modern video games.  I have never been very good at playing real-time strategy (RTS) games though.  I am getting better at StarCraft 2, with practice, but without a very specific set of principles I learned a few years ago, I would still be pretty bad at it.

Over 20 years ago, I was introduced to the RTS game genre.  I enjoyed games like WarCraft, WarCraft 2, and Command and Conquer.  I got good at beating computer players, often by using cheat codes, and then slowly weening myself off of them.  When I played against friends, I did fairly well, largely because when I started playing, these games were several years old, and my friends were out of practice because they had moved on to more recent games.  Once the original StarCraft got down to $20 in a package that include the expansion, I bought that.

StarCraft was the most popular RTS game for over a decade and a half, so my friends had not moved on by the time I started playing it.  They had 3 or 4 years of experience, while I had none.  I got destroyed a lot when I played against them.  In addition to this, I could only rarely beat computer controlled opponents, and once I improved, I would regularly end up in stalemates against computers.  I assumed that I was just not very good at the game, though I still enjoyed playing it.

One day, a few years ago, I came across a translation of Sun Tzu's Art of War.  Sun Tzu was a renowned military strategist in ancient China.  He was also a philosopher, and he wrote a book, the Art of War, on war strategy.  It is quite comprehensive, and it is read by modern war strategists.  I read about half of it (I need to finish it), and I learned why I was so bad at RTS games.  The problem was with the games, not with my strategy.

Popular RTS games are not realistic.  Real life war strategy does not work for them.  My war strategy was almost flawless, according to the book, but it did not apply to how war works within the game mechanics of StarCraft and other RTS games.

Since then, I have analyzed all of the flaws in these RTS games, because I plan to make at least one of my own.  The first flaw in StarCraft is that the defensive buildings are too weak.  In real life, a fortified city can take an army many times the size and skill of the defending army to capture.  In StarCraft, the defensive structures are so weak that they should only be relied upon as support for mobile units.  They exist not as primary defenses, but as obstacles to slow enemies down.  Sun Tzu's Art of War advocates strong defenses.  Armies don't win by sweeping through taking out cities.  In real life, armies win by jumping from one city (or base) to the next, targeting the weaker cities, and improving fortifications of captured cities whenever possible.  The enemy then wears its forces down trying to recapture well fortified and defended cities, while the friendly army spends its time resting and training in well stocked cities, defending only as needed.  In most RTS games, it does not work this way.  The only good defense is a good offense.  Camping in fortifications just does not work.

The second flaw in StarCraft and most other RTS games is the low value of units.  The only incentive for avoiding the death of units is cost.  Low cost units are literally throwaway units.  Expensive units that take a long time to build come with incentive to protect (usually with throwaway units as canon fodder), but only because they are expensive and time consuming to replace.  No unit has value beyond its original construction cost in time and resources.  In real life war, every soldier has value.  When the decisions must be made that almost guarantee lives will be lost, they are carefully considered, and often made with trepidation.  Even when the general is a tyrant who does not actually care for the individual lives, recruits are limited, deaths reduce morale, and then there is the issue of veterancy.  Throwing away soldiers is just plain bad strategy in real life, no matter how poorly skilled they are.  If enough men die in a senseless war, the rabble might rebel.  Obviously though, a good leader should care about every life under his or her command, and even when soldiers must die, it is with regret.  While most of these things cannot really be well represented in video games, veterancy can.  Real life soldiers gain skill as they fight.  A soldier with 20 years of experience will be far more valuable than a new recruit, and even a few months of combat experience can make a difference.  Knowing this, a good general will put a great deal of effort into avoiding needless deaths, because this will maximize the number of survivors that have improved skills from their experience.  Veterancy is an element in several RTS games, but not in anything mainstream (WarCraft 3 heroes use a veterancy system, but that hardly counts, since only hero units have it, and they can be resurrected without loosing their experience).

There are more flaws in most RTS games, but many of the flaws exist because it is not feasible to be that realistic in a video game.  Even things like realistic defenses prove challenging.  An RTS game called Stronghold models defensive structures more realistically.  I have played Stronghold 2, which is a reasonably well designed game, but the problem with realistic defenses is clear.  Games take a lot longer when you have to breech strong defenses to win (it's resource economy is a bit bloated as well).  There are ways to mitigate this, but the style of the game will be changed significantly by doing so.  While I consider the weak defenses in StarCraft (and SC2) to be a flaw, I recognize that it is a deliberate flaw that is part of a necessary tradeoff.

Modern RTS games have no excuse for not having veterancy.  Veterancy does require more memory and processing power, but modern computers can handle it.  I remember having to upgrade our 486 from 4MB of RAM to 8MB of RAM to play WarCraft 2.  In that game, you could have a lot of units without running out of memory.  In the original, the unit limit was 600.  In the Battle.net edition, which required 16MB of memory, it was raised to 1,200.  Modern computers have thousands of MB of memory.  Assuming that all of the memory was used for units in the original game (which was definitely not the case), each unit required about 14KB of memory.  On a 10 year old computer with 2GB of memory, that could be expanded to 3,495KB, which is far more than enough to hold veterancy data (in fact, even 100KB would be far more than enough).  So, why does StarCraft2 require 2GB of memory, but it still does not have veterancy?  Simple, instead of using the additional memory to improve actual game quality, it is being used for improved graphics.  This is not all it is used for.  StarCraft 2 is a far more complex game than WarCraft 2, but it is not so much more complex that it needs that much more memory.  Most of the additional memory is being used for graphics.  It would not take much of a reduction in graphic quality (and SC2 has far more than enough to spare) to free up enough memory to add veterancy.  Yes, it would complicate the game.  That is a good thing.  Currently, the game is so predictable that in tournaments, viewers can often accurately predict who will win quite early in the game.  A well designed veterancy system would add just enough complexity and strategy to the game to make it less predictable.  Further, SC2 already has the most memory consuming element of veterancy: It keeps track of kills for each unit.  A real veterancy system would need more than that, but with part of the mechanic already existing, it would be pretty easy to add.

My plans for an RTS game will include both stronger defenses and veterancy.  To mitigate the time problem with stronger defenses, expanding territory will not be as important as it is in most RTS games.  My graphics will be better than those from WarCraft 2, but they will not be anywhere near that of StarCraft 2.  I plan to spend more resources on game quality than graphics, because I believe that even a game with bad graphics can be worth playing if it is well designed.

Designing RTS games comes with a lot of challenges.  In general, game design has to be a balance between realism and fun.  It is easy to forget that awesome graphics cannot make up for a low quality game.  Most modern RTS games strike a reasonable balance, but they often miss some very valuable components.  As a game designer, I can understand this, but I won't take "hard" as an excuse for doing a sub-optimal job myself.