Categories
Game Design Game Development

Are Your Game Mechanics Off Balance?

Note: this post was originally published in the January 2012 issue of ASPects, the official newsletter of the Association of Software Professionals.

You’ve been working on your action game for so long that you’re sick of playing it. You have a wide variety of enemies with different strengths and weaknesses, and you’ve provided the player with dozens of different weapons to take advantage of those weaknesses. You’ve tested so many different playstyles, changing variables as you found issues, and you even had your family and friends try it out to make sure that they don’t think it is too hard or too easy. Your game is ready for your first customer!

Except something goes wrong. Someone discovers a way to use a weapon that dominates all of the enemies in your game, eliminating the challenge and fun entirely. Or perhaps there’s a sequence in the game that you find slightly challenging, but to someone who doesn’t know all of the intricacies of the game and hasn’t had the opportunity to practice for months, it’s frustratingly too hard. In either case, the reason why your game isn’t ready is that it isn’t balanced.

A Numbers Game

Balance in a game can refer to many things, but the basic idea is that you are deciding what values and numbers to use in a game. As an example, Tic-Tac-Toe, or noughts and crosses, has two players, nice spaces in a 3×3 grid, the requirement that you can place only one ‘X’ or ‘O’ during a turn, the requirement that each space can only hold one mark, and a victory condition of having three of your marks in a row. Tic-Tac-Toe is a fairly simple game, but you can imagine all of the ways you can upset the balance by changing these values. It would be a completely different game with a 4x4x4 matrix and requiring four in a row for a victory condition.

Balancing a game requires getting the numbers right, but it’s not always obvious what “right” is. Should your strategy game have one type of resource to collect or two? Should a unit that does twice the damage of another unit cost twice as much to produce? What if it has half the armor?

As I was getting my strategy game “Stop That Hero!” ready for release, I tried to make sure that even if someone didn’t play perfectly, they would still be able to win while also ensuring that it wasn’t too easy to win. What I found was that even when I played how I thought was sub-optimal, it was still using special knowledge that I had as a developer, so what was somewhat challenging to me was way too hard for someone else. Having other people play it gave me a lot more information to go on.

The feedback you get with playtesting will be invaluable, but you might find you are making guesses at appropriate values. In my game, the player summons minions such as orcs and dragons to fight off heroes such as archers, knights, and wizards. Summoning costs resources, and it takes time to summon a minion. How much should an orc cost? How long does it take to summon a warlock?

While guesses are good for getting the game up and playable in the first place, the guess-and-pray approach can be tedious and slow when you’re trying to get the game ready for customers. There has to be a better way.

A Little Analysis Goes a Long Way

I found two tools helpful in game balancing work: a spreadsheet and a whiteboard.

In the spreadsheet, I entered as much information about the various entities as I could. Data such as HP, movement speed, and minion costs all ended up in the chart. In the game, resources increase by 1 each second for each castle and tower the player controls, so time is another value to keep track of.

EntityDefinitions

Using numbers such as cost, time to summon, game play time, and the number of towers the player controls, you could answer some questions, such as:
With control of one tower, how many orcs can the player afford by the time one orc is available on the battlefield?
How many slimes can be summoned after 30 seconds of game play if the player has control of one tower? After 1 minute? With two towers?
How many orcs could have been produced during the time it takes to produce one slime?

The answers come fairly naturally from the data. For instance, if an orc takes 3 seconds to be summoned, and a slime takes 6.4 seconds to be summoned, you can produce two orcs and part of a third in the time it takes to produce one slime. Knowing this information, you can determine that the cost of one slime should be just slightly more than the cost of producing two orcs, all other things being equal.

But sometimes the values aren’t equal. In my case, an orc does the same damage as a slime during one attack, but orcs deliver attacks every second while a slime needs to spend a little more than 2 seconds to do its next attack. Also, slimes move at less than half the speed of orcs. On the other hand, slimes have ten times the hit points, making it much harder for the heroes to kill it. So how much is a slime worth compared to an orc now?

If you can come up with appropriate formulas, you can gather some statistics to help in balancing. Figuring out the relationships between all of these numbers is key, and this is where a whiteboard can come in handy.

STH_BalanceChart

This chart represents all of the interacting systems during a game session. You can see how player resources are influenced by play time, the structures owned by the player, and resource chests collected. More resources means more minions can be summoned, which decreases resources and increases the number of entities. Some entities can capture towers, which helps increase resources. Combat is represented by the weapon-related boxes at the bottom of the chart, which all impact HP, which impacts whether or not a given entity exists. Speed can be impacted by a slow status effect, which means heroes take longer to move, which means the player has more time to gain resources and summon minions.

Even with only a handful of numbers, you can see that the relationships between them and across systems can get complex. Still, this chart helps us find our way to some interesting statistics. For instance, we can determine how many orcs it takes to kill a one guard. Let’s say that guards have 250 HP and do 33 HP of damage every 1.2 seconds, and orcs have 100 HP and do 17 HP of damage every second.

Orcs take (250 HP / 17 HP damage) x 1 second = 15 seconds to kill a guard. Guards take (100HP/33 HP damage) x (1.2 seconds) = 4.8 seconds to kill one orc. Since guards kill orcs at a rate of 0.208 per second (1 / 4.8 seconds), it takes 15 seconds x 0.208 = 3.125 orcs to kill a guard. In game terms, three orcs will die before the guard’s death blow is dealt by the fourth orc.

STH_MinionKillRatesByHero

Knowing this information, we should make sure that the player is capable of summoning at least four orcs for every guard in the game world, or else it will be impossible to withstand the onslaught of the heroes. If orcs cost 7 resources, and if one level is designed to produce four guards from the nearby village, the player should be able to have 7 resources per orc x 4 orcs per guard x 4 guards = 112 resources before those guards arrive.

You can also see what happens if you change a number. If an orc does twice as much damage, it would take 250 HP / 34 HP damage) x 1 second = 7.4 seconds to kill a guard, so it would take only two orcs to kill a guard (7.4 seconds x 0.208 orcs killed per second = 1.5 orcs).

By studying the relationships between numbers, you can determine what information would be useful, and then simple mathematics can get you that information. Spreadsheets also help you by making it easy to tweak values to see what effect a change might have on other values. You still need to playtest as much as you can since it is only by playing that you can determine if the game is entertaining enough, but this article should have demonstrated that you have tools to aid you in balancing the game.

Categories
Game Development Marketing/Business Personal Development

See Me Present at StartupCity Des Moines on May 29th

StartupCity Des Moines

NOTE: If you couldn’t make it, the presentation is available online.

Des Moines, Iowa has a coworking community called StartupCity Des Moines. It’s a pretty neat place, and there’s a lot of exciting things going on there. It’s the only entrepreneur hub I know of in the area.

Over a month back, I went to a lunch and learn on entrepreneurship given by one of the founders, Christian Renaud.

About halfway through his talk, he mentioned the idea of sharing your failures with the community. While successes are great to share, giving a post mortem for failed business also helps make the entire community of businesses better for the future.

“I would strongly encourage you, just for the betterment, to not make central Iowa suck for startups over the next 20, 30, 50 years. Till that back in. All the good things you learned, all the bad things you learned. Till them back into the soil, because God knows we need them.”

Since then, I’ve been thinking that I have something to share from my experience running GBGames full-time and failing to get it self-sustaining before running out of money.

I’ll be presenting at the end of the month:

Playing the Long Game: The Vital Importance of Purpose, Mission, and Vision to Your Business

Gianfranco Berardi will share the major lessons that can be drawn from his experience running an independent game development business full-time.

He’ll explain what happened between the time he delivered his two weeks’ notice to his day job in 2010 until 2012, when a lack of funds forced him once again back to part-time business owner status. See how a lack of strategic planning resulted in a business with no focus and a business owner feeling out of his depth. More importantly, learn how doing the hard work of identifying your Why, How, and What pays off both immediately and in the long-term.

WHEN:
May 29th, 2014 at noon

WHERE:
StartupCity Des Moines
317 6th Ave, Suite 500, Des Moines IA, 50309
p: 515-868-0473
e: info@startupcitydsm.com

It’s a free event, and I’d love to see you there. Register for it at https://tikly.co/-/2510.

Categories
Game Development Politics/Government

Public Domain Jam Next Weekend #PDJam

Copyright law is kind of messed up. Actual copyright law is actually a combination of codified law and legal rulings to clarify or provide exceptions for such laws. For a primer on copyright law for indie game developers, see What an Indie Needs to Know About Copyright.

The Copyright Clause of the U.S. Constitution states that Congress is empowered “to promote the Progress of Science and useful Arts, by securing for limited Times to Authors and Inventors the exclusive Right to their respective Writings and Discoveries.”

That is, copyright is a tool to promote science and art, and it does so by providing a temporary monopoly for creators.

It is NOT meant to provide monopolies for creators as an end in itself. It’s just the means to an end.

Once the temporary monopoly’s time period expires, the work in question enters the public domain.

The public domain is the set of all creative works that are available to the public. There are no licenses required, no fees to pay, and no patents to worry about. That is, someone was able to benefit immediately from creating it, and in exchange, for the rest of posterity, everyone can benefit from it and build upon it. That’s the way it should be.

The nature of creation isn’t completely independent invention. Instead, a new creation tends to rely on existing creations. For example, the invention of the electric motor relied upon the knowledge produced earlier on the nature of electric currents and their interactions with magnets. Another example is the popular BBC television series “Sherlock” which is based upon writings of Sir Arthur Conan Doyle from the late 1800s.

Unfortunately, copyright law keeps extended the “temporary” monopoly indefinitely and there doesn’t seem to be an indication that it will stop, which means the public domain has been frozen in place for decades. So while, for example, Disney was able to build an empire off of freely available public domain works, such as the story of Snow White and the seven dwarves, no one has been allowed to build off of Disney’s works in turn. Basically, some people got some advantages from free culture and aren’t returning the favor, and what’s more, they are actively lobbying to ensure they won’t have to.

Lawrence Lessig is the author of Free Culture, which explains more about how copyright law used to work and how it no longer does. I highly recommend reading that book if you want to understand the vital importance of a healthy and constantly replenished public domain.

But what are we doing today? The public domain that exists, as stuck as it is, still has plenty of great works to build upon. And yet, when it comes to games, are we seeing a lot of unique work?

We have the ubiquitous space marines (including Relic’s Space Marine), zombies, and military shooters. We have the Tolkien-esque fantasy games, the interstellar wars with hostile aliens, and the dudebro hero’s journey.

And yet, there is so much more out there to build games upon.

Enter The Public Domain Jam.

Gritfish explains:

I announced the Public Domain Jam a month ago as a reaction to the over-use of some themes in the indie game scene, but since then, I’ve been flooded with nothing but enthusiasm from people over their love of works in the public domain.

The tagline for the jam is “Because there’s more out there than zombies.”

To encourage the publication of games that immediately contribute to free culture, “Nothing to Hide” creator Nicky Hide has donated a $1,000 prize to be awarded the top rated game published under a Creative Commons Zero license.

There are a number of other incentives, including free art and sound assets, free licenses for cross-platform game engines, and more.

I think it sounds like a fantastic idea. The only concern goes back to my assertion at the top of this post: copyright law is messed up.

Years ago, I wrote about Zorro, the public domain, and derivative works. The Curse of Capistrano is the first story to feature Zorro, and it is in the public domain. The Mark of Zorro was the 1920 film about the story. It’s also in the public domain.

Except, copyright law is different from one country to another, which means that while you can make your game based on this story in the United States, you might not be able to distribute your game in some countries where the story is not yet in the public domain.

Moreover, even though the copyright for some stories about Zorro are in the public domain, the trademarks for Zorro do not expire.

Which is why Zorro Productions is able to exist. If you want to make a Zorro-based film, TV show, comic, game, or book, you probably want to license the rights from them to avoid legal trouble. The claim is that the original story does not describe Zorro the way people expect to see him today. Characters such as his horse Tornado are introduced later in works not in the public domain.

There have been a number of lawsuits, including one last year involving a musical based on the public domain works that Zorro Productions claims is a violation of their trademarks and copyrights. The creator of the musical sued them, and it will be interesting to see if this case plays out in its entirety instead of being settled out of court like they usually do.

So, again, the Public Domain Jam sounds great, but copyright law is complex, and everyone should be careful because otherwise public domain works might have certain organizations asserting they own some piece of it. And in the case of international distribution, they might be right in some cases depending on the laws of certain countries.

But remember, the entire point of the Public Domain Jam is to get us away from building “Yet Another Game About XYZ”. The rich variety of source material available in the public domain should provide plenty of innovation and without as much legal risk.

Categories
Game Design Game Development

Accessibility and Inclusion in Games: #AccessibilityJam Starts This Weekend

Access for skinny wheelchairs only

I just learned about Accessibility Jam, which is running from May 11th through June 1st.

The goal of this jam is to raise awareness, giving developers knowledge and experience of how to make mainstream video games accessible to gamers with disabilities, to provide good examples of what’s possible, and move accessibility towards being widely accepted good practice in the game design process.

The idea isn’t to make niche games that cater specifically to gamers with disabilities. The jam is meant to raise awareness and increase the accessibility of the kinds of games that are already being made.

I’ve written in the past on designing games to account for color-blindness. I recalled a beta test for a game in which one person complained about how hard it was to see the green vehicle on the green grass. This complaint confused me at first because the vehicle in question was blue. I eventually changed it to look significantly more interesting and give it a different color. Without that beta test, I would have inadvertently ignored a significant chunk of my audience.

Ok, so you can easily accommodate a color-blind player by using more than color to differentiate important aspects of your UI. You just need to be conscious about it and know about the tools of shape and size.

But what about players with other vision impairments, including those who have difficulties with reading? Or people who have hearing, cognitive, or motor impairments? Accessibility is a big topic, and you can’t possibly be expected to spend the time and effort here when you are trying to focus your attention on making the best game you can, right?

Well, the jam provides some awesome accessibility resources and tips, which features a number of useful links, such as the Includification Guide provided by the AbleGamers Foundation. This PDF is only a little less than 50 pages and offers practical checklists, advice, and examples, as well as numbers to indicate that there is a significant market you can reach with your efforts in accessibility.

Another link is Game Accessibility Guidelines, “a straightforward reference for inclusive game design” broken into basic, intermediate, and advanced topics. This site is a treasure-trove of information, and more importantly, it shows how easy it is to address accessibility. Basic considerations include using easy-to-read fonts and font sizes, especially as reinforcement of audio cues. Such a small effort means not just a more accessible game but a better game for everyone.

An example of an intermediate consideration is providing options in game speeds. Offering game speed configuration and the ability to prepare actions while the game is paused are some easy ways to assist those with motor and cognitive impairments. As a side-effect, it means accommodating people with different preferred play styles.

Once while demonstrating my casual real-time strategy game, Stop That Hero!, to someone, he requested that I add a game speed slider. While I’ve had requests for a way to increase speed when you just want to get your orcs across the map quickly to see what happens, this player wanted something more like a turn-based game.

Pausing the game but still allowing player interaction meant that he could take his time to make decisions about what minions to summon and where to summon them. I’m afraid I never got to that feature before I put the game on the back-burner, and while I initially didn’t like it as I thought it might ruin the feel of the game I was creating, I have since realized that allowing players to enjoy the game at their own pace allows for a much better experience for more players. That it means the game would be much more accessible to people who might not otherwise be able to enjoy the game is an exciting prospect.

So, are you planning on participating in Accessibility Jam? It sounds like a great opportunity to learn and practice ways to make your game more playable by a wider audience.

(Photo: https://www.flickr.com/photos/drdul/210641686 | CC-BY-SA-2.0)

Categories
Game Design Game Development

Game Design Pro Tip: Don’t Ban Specific Activities

Fishing ban!

In Ban the ban: essential game design advice (with examples), Nick Bentley talks about the cognitive dissonance of establishing rules and then creating special “but you can’t do X” rules to prevent problems.

Why do such rules exist? The most common reason is, during play-testing, the designer discovered players want to take an action that would hurt the experience – for example, a too-powerful action every player would take every turn if allowed. The most obvious fix is to ban it.

He then goes on to explain how doing the most obvious fix is a bad solution.

Banning otherwise-expected actions means the rules become harder to learn and the game play itself becomes awkward as you are constantly checking your planned actions against the rules.

Bentley’s post is a fascinating bit of insight into how a design problem can turn into a design success. By not banning actions, you have to allow for them. The entire point of banning a move is because it is unbalanced or otherwise ruins the game, so how do you allow it without the game suffering?

Interestingly enough, the answer can sometimes mean a much deeper and more compelling game.

Basically, take the action that you deem is too strong and assign a huge cost to it.

Bentley gives a couple of examples and a counter-example to see when it makes sense to include a ban, but the result is a choice that makes sense within the rules and can sometimes result in a more strategic game.

While Bentley is talking about boardgames, you can see how it would be applied to video games.

For example, if your game has inventory, you could limit the amount that could be carried. If a player with a full inventory comes across some new loot, the choice is to get rid of something to carry the new thing or not pick it up. Think Diablo or Minecraft.

NetHack, however, allows you to carry whatever you want, but it balances it with an encumbrance penalty. The penalties get more and more severe as you collect more things. You start off with penalties to speed and attack ability. If you carry too much, the penalties include not being able to walk up or down stairs, getting hungry faster. Carry even more, and you start taking damage for each move you take, and eventually you can get to the point where you can’t move at all.

Instead of arbitrarily deciding that a player can’t carry that much inventory, you turn it into a strategic choice. Do you want to struggle to carry all of the groceries from the car into your apartment so you can do it in one trip, or are you going to make multiple trips so it is easier?

You can see how this method of balance would apply in terms of limits on the number of units in a real-time strategy game. Some games add an upkeep cost which increases after you add so many units. Now I can choose to have too many units in my army temporarily if I’m willing to pay the cost, say for a large offensive push or to defend against the same.

“You can’t perform this quest. You don’t have a sufficient experience level.” No, by all means, try to perform the quest, but it is going to be incredibly punishing. The balance is already built in here!

Sometimes limits are technical in nature, such as the number of units you can have in your army at once. Still, you can see how allowing the player to decide if a decision is a poor one or a good one despite the cost means a deeper play experience than it would have been if you were limiting things arbitrarily.

(Photo: https://www.flickr.com/photos/jo-h/6009234100 | CC-BY-2.0)

Categories
Game Design Game Development Geek / Technical

Explore Game Mechanics Interactively At This New Site

Flocking on GameMechanicExplorer.com

If you’re new to game development, or even if you are a veteran making a game of a type you’ve never made before, you might find yourself doing research on how to best implement the mechanics. Whether it is figuring out how best to implement ballistics or how to move a rocket ship, it’s not just the math but the approach you might be looking for.

For instance, last year I made a Frog and Flies clone called Hungry Frogs for One Game a Month. I remember spending quite a bit of time on the jumping mechanic as this was the closest I’ve ever come to implementing a platformer. In the end I wasn’t completely happy with what I had. My main complaint was that it wasn’t easy for me to identify the maximum height of the frog’s jump without tweaking variables and seeing what happens. But considering the few hours I spent on it, I delivered something that worked well enough.

Still, if GameMechanicExplorer.com had been around then, it would have saved me some time.

The site offers you a list of common game mechanics, each of which has at least a handful of examples with an in-browser demo and a JavaScript code example written using the Phaser framework.

Each example focuses on one concept and includes the source code for the implementation. They aren’t meant to be extremely polished or to represent a complete game. They aren’t highly optimized. They may not even be the best way to implement the mechanic being demonstrated! (They’re certainly not the only way.) They are written for clarity so that it is easier to understand the underlying concepts and apply them to your own work in your own engine. I expect that some of these examples will evolve as I gain experience. But hopefully you’ll find them useful and you can use them as a jumping off point for your own games.

At the time I am writing, there are examples for bullets, spaceship movement, following, homing missiles, raycasting, lighting, effects, easing movement, and even walking and jumping.

Line-Of-Sight on GameMechanicExplorer.com

The walking and jumping examples start out by showing you the naive approach, which has the on-screen character either stationary or moving at full speed. It’s functional, but it doesn’t feel right. The next example introduces the concept of acceleration to make the movement smoother, but it identifies a problem that is introduced. The next example introduces the concept of drag.

The next few examples take you through basic jumping mechanics, including double jumps and variable jump heights, the latter of which I needed for my hungry frog game.

I enjoyed spending time exploring different mechanics, such as seeing how various easing functions compare to each other, or how to use raycasting to do line-of-sight checks. I remember someone once posted a comparison of jumping mechanics of Mario, Meat Boy, and Mega Man among others, but I can’t find it today. GameMechanicExplorer.com is filling that void nicely.

I’m looking forward to seeing the implementation of some of the upcoming mechanics, including camera controls and the advanced platformer ones.

John Watson, you have provided aspiring game developers a great service.

Categories
Game Development Marketing/Business

95% Off for Game Development Course Bundle

A colleague told me about a deal he found online: 95% off for a bundle of game development courses.

After learning how to replicate Flappy Bird and Candy Crush, this bundle will give you an education in developing for both Android and iOS, a beginner’s guide to HTML5 game development, and a quick-start guide to creating a game with Stencyl.

Some people are turned off by the focus on essentially cloning two very popular games, but if you think about it, artists learn to create great paintings only after they all learn how to paint bowls of fruit.

I don’t plan on getting the courses myself, but then I’m not starting from scratch. I’ve made games, and I have in fact worked with Stencyl, and many of the topics I see covered are things I can look up on my own, such as how to sell apps.

Still, the idea of focused courses on topics related to making games that look very much like “real” games and even learning how to sell them is appealing.

But what do you think? Is it a good deal for beginners?

Categories
Game Development Geek / Technical Personal Development

Learning Game Software Architecture

Note: I wrote a significant amount of this post in 2011, back when I was actively working on Stop That Hero!, and enough still resonates today that I decided to publish it.

It’s only in the last few years that I’ve started to appreciate the importance of software architecture, and especially as I write the game engine for “Stop That Hero!” Before “STH!”, I haven’t had much experience with writing entire programs from scratch. Most of the code I’ve written professionally fit into an existing framework or architecture, so high level architectural work wasn’t something I had to worry about in my day-to-day work.

Beginner Programmer Woes

When I first learned how to program, I was focused on getting the syntax correct. Programs, even if they were completely original and not copied out of a book or magazine, were simple. More complex programs usually didn’t get finished before I lost interest. Any non-trivial programs that were successfully completed were the epitome of what we in the biz call “spaghetti code,” which means I was lucky to get something working at all. See my Pac-man clone in QBasic as an example of what teaching yourself how to program can result in.

Then I got to college, and I learned C++, and concepts such as recursion and stacks and objects. I was still using QBasic as a hobby, and my new code was definitely cleaner, but I struggled with putting everything together in a cohesive whole. And programming on a modern OS required a message pump, which meant I had to change the way I did things drastically. You couldn’t add empty loops if you needed a delay anymore.

Ok, so most likely, you’ve been there before, too. My story above isn’t unique. Lots of programmers went from DOS to a multitasking OS. The thing is, I think I fell behind in terms of learning how to program in this new world order. When I stopped using QBasic, I didn’t write a lot of C++ code outside of class requirements until I nearly had my degree. It turned out that I learned C++ wrong at first, which is why I didn’t enjoy programming in it as much as I did with QBasic. Once I read Accelerated C++ by Koenig and Moo, it made a lot more sense and was a joy to work with. That book is a great way to learn C++ for a beginner. Even though C++11 has since been released, I still highly recommend the book today.

Program Design Is Hard

But it still didn’t change the fact that larger applications were hard to make. If I knew what class or function was needed, I could write the code just fine. It was determining what class or function was needed that was the hard part. Or to put it another way, I struggled with “where should this code live” questions. Basically, software architecture was hard, and I didn’t know it was even a thing to be concerned about. Heck, years ago, I was concerned with how to put together a basic game loop. Solving that problem means I had everything I needed, right?

What I knew about game engines is based on what I read. Countless books and articles broke down the anatomy of a game engine by talking about its subsystems: audio, video, input, networking, etc. At the time, I believed this subsystem knowledge was enough to make a game. If you had a way to render to a screen and detect input, you had the bare basics to make a game. It’s just a matter of implementation, right?

Since I taught myself QBasic, and my first projects we isolated endeavors, I thought I knew how to put a piece of software together. I was able to put together an entire game, so how hard could it be? After all, they don’t give 70% reviews to just any QBasic games, right? I’ve even managed to put together complete Ludum Dare entries.

Why Is Everyone Else So Much Faster?

But I was also aware that some of the other Ludum Dare participants were able to make their entries way more impressive within hours of starting than my games end up by the deadline. Ludum Dare was historically a “write your game from scratch” competition, so it’s not as if they had full game engines available (although that’s changed with Unity entries). What was I missing?

Well, experience, for one. Some of those impressive entries are made by people who have been making games for way longer than I have. Even if we started at the same time, I haven’t been working on as many games as they have. They might have worked in the game industry and so know how to make games on a deadline. Even if they didn’t have game dev experience, they might have worked on financial software. Either way, they’ve likely written a lot more code than I have, so putting the software together to implement their game designs is possibly second nature.

Another thing people seem to have is boiler-plate code, such as code for menus, buttons, and sprites. XNA users have a huge advantage here, and Unity users are practically cheating. As I run and deploy to GNU/Linux, neither option is available to me, and since I work in 2D, there aren’t a lot of game engines available. A lot of the libraries that I could piece together also don’t fit my needs. Either they do things in a way I don’t want to do (GUIchan versus IMGUI), or they are not cross-platform. Instead, since my first Ludum Dare, I’ve written a lot of boilerplate code as I needed it. Each competition, I created more and more base code to leverage for the next project.

But I was oblivious to some of the fundamental architecture needs of a game engine, and so I still struggled to put together a finished, playable game in 48 hours. After all, the subsystems were everything. Just tie input to what’s happening in the game, and make sure the player can see feedback on the screen. Why is this so hard?

Learning Software Architecture

Most people will tell you to get a copy of the book Design Patterns by the Gang of Four. It’s a great book and features a number of patterns. Now, if you want to refresh yourself on what a pattern entails, it’s fine, but it isn’t great for learning about them in the first place.

I found Head First Design Patterns to be a great, easy-to-read introduction to major patterns.

But patterns knowledge isn’t enough to know how to organize a major software project. If I want to be able to provide a single interface to a bunch of disparate pieces of code, the Facade pattern is what I need. But what about determining that I need a single interface to those pieces of code in the first place?

And Test-Driven Development is supposed to be about code design. By writing tests, you already have a user of the code you’re writing, so you know how to design the functions and interfaces. TDD can help you design a single class, but it’s not going to help you drive the design of a full application. More and more, I realize that my lack of experience with writing larger applications is making my TDD efforts more of a struggle than they need to be. Uncle Bob Martin wrote about this topic in TDD Triage (the link has since died):

Here’s the bottom line. You cannot derive a complete architecture with TDD. TDD can inform some of your architectural decisions, but you cannot begin a project without an architectural vision. So some up front architecture is necessary. One of the most important up front architectural activities is deciding which architectural elements can be deferred and which cannot.

So patterns and TDD aren’t enough. Some architecture decisions are necessary, and I hadn’t made any. No wonder I had trouble in the past!

Conclusion

Ok, it’s 2014 again. Since 2011 when I first wrote this post, I’ve learned quite a bit about software architecture and designing software. Experience is one of the greatest teachers.

I’ve learned to focus on the data flow. Where does data come from, and where is it heading? I’ve learned to focus on what large pieces I need and worry about how to hook them up to each other later. I’ve learned how to separate the GUI from the internals, and that each has their own massive design decisions to worry about. I’ve learned that software architecture is less about the overall design of a software project as much as it is about the constraints on it.

I also learned that software architecture concerns don’t come into play as much if you are hacking together quick prototypes, but addressing the major software constraints can be huge if you intend to have a reusable set of code to use from project to project.

I’ll write more about the specifics in a later post, but it seemed important to document to struggle, especially as I did not identify my lack of knowledge about software architecture as an issue at first.

If you’re an indie developer, what were your major insights into software architecture? Do it come into play for you, or do you find that it isn’t anything to be concerned about in your day to day?

Categories
Game Design Game Development

The Indie Interview Series

Interview recording equipment

During the last half of 2013, Ben W. Savage conducted The Indie Interview Series “to inspire those who are considering game development” as well as those game developers looking for practical advice.

He asked the same series of questions of everyone, and prominent indies such as Christer “McFunkypants” Kaitila and Chevy Ray “Chevy Ray” Johnston spent anywhere from five minutes to a quarter of an hour answering. The topics ranged from how to get started in the game industry to who were major influences and what are major mistakes new developers make.

Adam “Atomic” Saltsman, creator of Candabalt, suggests that taking too big of a bite is a common problem. “Learning how to do a project is its own discipline … Start small, learn about the process, and then refine. That’s the key.” Nina “[insert nickname here]” Freeman of Code Liberation Foundation agrees in her own answer to the same question, repeating “simple prototypes, simple prototypes, simple prototypes” and suggests working in steps.

These are bite-sized nuggets of wisdom, and I wish there were more.

What’s your favorite interview? Did any of the answers resonate with you?

(Photo: https://www.flickr.com/photos/39781145@N00/254759786 | CC BY 2.0)

Categories
Game Design Game Development Games Linux Game Development

November #1GAM Entry: Raking Leaves

November’s One Game a Month entry is uncreatively-named Raking Leaves, a leaf raking simulator chock full of leaf-raking action!

Download Raking Leaves for Linux 64-bit (1.2 MB tar.gz file)

The object of the game is to rake all of the leaves into a single pile. The wind will blow the leaves around, however, and if you lose too many leaves off of your lawn, the game is over.

I had a lot going on this month, and so I didn’t dedicate a lot of time to making a game. Still, I wanted to make something for #1GAM. What could I make?

I recently bought a house, and with home ownership comes the oh-so-fun task of raking leaves. I decided to make a game out of that experience, and raking leaves is usually done in the Fall, which goes along with the optional theme of “Change”, so it was a perfect concept.

I started out making leaves and randomly throwing them about the yard.

November #1GAM

I then added a rake, which replaces the mouse cursor:

November #1GAM

I wanted to capture the frustration of raking leaves, and so when you click and move the rake, the leaves will move, albeit a bit slower than the rake. This means you have to go rake the same leaves over and over to move them a long distance. I was pleased that it was working as well as I had planned.

November #1GAM

I had some funny bugs, such as this accident which features the level resetting over and over, except it wouldn’t reset the number of leaves but merely add to them. It looks like a giant set of orange hedges.

November #1GAM

Another funny moment was after I added wind. I wanted early levels be less windy, while later levels would get more wind. Here is what it looks like to rake in a hurricane:

November #1GAM

Wind affects leaves in a radius around it, and the farther away the leaves are from the center of the wind, the less of an impact the wind will have. It works very well, but out of curiosity, I set the level to 1,100, which has over 20,000 leaves in it and has winds every second. It resulted in some cool visual effects, as you can see in this video:

Eventually I think I achieved a good balance, complete with a scoring system to let you know how well you’ve done compared to your best raking.

November #1GAM

Considering I worked less than seven hours on this project, I’m pleased with what I came up with. I had plans for rocks, bushes, trees, and other obstacles, as well as a child running around jumping into your pile and scattering the leaves. Having sound would help, too, but for now, I think I’ve got one of the best games about raking leaves out there.