Rhythm in Game Design

Original Author: Pete Collier

Rhythm is a very primal thing. Right from the very first moment of our existence it is there, our own heartbeat offset against the comforting beat of our mother’s. So to design games without considering rhythm can only be detrimental to your cause. If you want to tap into merriment of the soul then beat should be a fundamental part of player experience.

When I talk about rhythm in game design I’m primarily referring to the players actions. Music is an obvious provider of rhythm, but in an active not passive medium it should only really be an enhancer (unless of course it is part of the game-play! i.e. Guitar Hero). In effect player input provides a beat and the quality of the game determines its suitability as well as the sense of connection the player feels with the experience. You can start to see why relying on music alone to give a sense of rhythm is a hallmark of weak game design.

The best games have a tangible sense of ebb and flow that imitate the natural cycles present everywhere in life. We’re very adept as humans at detecting things that aren’t quite right or broken. Things that are un-tuned or disjointed upset our natural balance. So we naturally gravitate toward things that are harmonious. Especially in this modern age with all its distractions we are calmed and excited by rhythm and the recognition of patterns and beats. They are comforting and give us a sense of control. This sense of control and of tapping into the heart of the game is therefore a critical sensation that you must get the player feeling.

The ease at which player actions fit into the rhythm of a game will affect their enjoyment. It is so important that player actions are not a disruptive force. They should be in-tune and in natural harmony with the game systems. Effectively the player should be the heartbeat of the game, the source of life that makes the system work. The player should have a very tangible grasp of how their input is affecting the game. In game design terms this desirable sense of ‘oneness’ with the game is a direct result of the player feeling an integral part of the experience and certainly not passive or secondary to it.

Empowering the player with rhythm is a massively useful tool in your arsenal as a game designer. You are directly responsible for how the player engages with your game and therefore the connection they feel with it. Creating that sense of wonderment from players really feeling they are bringing life to your game is something special. Rhythm, beat, ebb and flow are universal and essential to the very essence of life. As a game designer you should be considering them with every mechanic you implement.

This article was originally posted on my blog: Rhythm


PixelJunk Shooter 2 SIGGRAPH talk

Original Author: Jaymin Kessler

Here is a semi-accurate reproduction of my SIGGRAPH 2011 talk on PixelJunk Shooter 2.  I worked really hard to make these videos and all I ask in return is that you follow me on Twitter.  I need to hit 1000 followers and I need to do it soon…  or something very bad will happen.  Please show your appreciation for open knowledge sharing and help me out by following me on Twitter.  Thats all I ask.

 

here)

 

Part 1:

 

 

 

 

 

 

 

 

 

 

 

Game Dev Students: REPRESENT!

Original Author: Heather M Decker-Davis

I apologize if this borders on a rant, but there has been something bothering me for a while now. I frequently notice industry professionals exhibiting what could politely be described as an aversion to students… and I completely understand! Getting shaken down for a job opportunity every time you come in contact with a student would certainly snowball into a terrible impression!

In the interest of game development students everywhere, I’m putting out a call to action. Students: step up your professionalism and properly represent yourself and your peers. We need to make the term “student” into something that looks promising, not something that makes people cringe!

To help you, I’ve got some tips and a major resource lined up.

First off, if you aren’t familiar with it, Darius Kazemi has this great blog about Effective Networking in the Game Industry. Greenhorns and veterans alike find this to be an extremely useful resource, so please be sure to read it. In fact, I hereby declare this a required reading for all game development students.

Next, conduct yourself in a courteous manner. My tips probably run the risk of repeating things from the required reading, but based on what I’ve seen, I feel it’s worth reiterating.

Empathize.

Beyond just being polite and respectful, you must be empathetic. Pay attention to who you’re talking to and any signals they might be giving you so you can be accommodating. For instance, if someone is clearly in a hurry or leaving, just let them know it was great to meet them and try to follow up later.

Listen.

Be a sponge. Be humble. You do not have the wisdom these developers possess from years of experience, so take in what they’re willing to share with you. Unless you’ve been specifically asked, don’t ramble on about your projects, pitch ideas, or otherwise waste people’s time. If you have a golden opportunity to learn something from someone, please realize it.

Restrain.

Don’t be over-aggressive about wanting a job. I understand you need to be employed, but being pushy or inconsiderate is going to result in the opposite outcome. When developers are out at events, having a good time, networking, or learning, they’re not looking to hire you on the spot. Realize there’s a time and a place. There’s also a hiring manager, so don’t ask random people from a company to hire you.

Shine.

Be honest and genuine. If you’re truly passionate about game development and know your stuff, these traits will shine through with your overall attitude and the way you carry yourself. Don’t ever exaggerate or fake it to try to impress someone. Again, you’ll just be getting the opposite result.

I could probably go on forever with tips, but I think this is a good starting point. Beyond what I’ve listed here, the vast and plentiful internet extends before you in all directions. Use it. There are more resources available than ever before! Heed the call to action!

 

Do Indie Developers Need a Producer?

Original Author: Amos Laber

During my career as a game coder I have worked in large teams, small teams and also as a sole developer on indie titles. 

Working on my own personal projects, or any project small enough brings a challenge – how to organize time efficiently. This is when I get to feel my own limitations. Not everyone has the skill for organizing a project, and even a small one requires a decent amount of planning. For myself, I usually don’t have a clear task list or a concrete schedule.

Keeping Momentum

For small teams (1-2 developers), or while working on a one man project I find myself losing momentum after a while. Typically when there is no concrete timeline, once the code is halfway through there are distractions: getting the art, modifying design etc. these take me out of focus up to a point that the progress grinds to a halt, and the focus is lost.

Specially when working from home, it means the momentum is lost and this can lead to a long term ‘writers block’. I find that I am not equipped to deal with this situation by myself. while I can handle any technical issue and code myself almost out of anything, this is completely out of my game. Am I expected to code full time and handle this as well?  It’s not even clear what went wrong. We all have our limitations and this is clearly one of mine.

This is the point when I start wishing I had a producer.

Even in small teams this is valuable. This can be a dedicated person, or one of the developers putting on a producer’s hat. The role calls for a responsible, well organized individual that would be in charge of keeping tabs on progress and creating, as well as maintaining, a momentum.

Getting Things Done

For indie projects where the developers are the stake holders, the most valuable resource is time. Using that time efficiently becomes a priority.

Getting things done is the main concern of a good producer, even if there is no official timeline. Also setting up internal milestones, coordinating between artists, deginers and coders and worry about the big picture.

Oh, I am definitely going to want one on my next project.

Travel Tips from an Englishman in Texas

Original Author: Paul Evans

Earlier this year I left the UK to hunt for opportunities in America; specifically in Austin, Texas, USA. The games industry often sees talent moving across borders. I thought some back in Blighty may be interested in a few tips for travelling to conferences and job hunting in the USA. Today I will just concentrate on flying.

Flying

Check-in as soon as you are allowed; default allocated seats are often terrible unless you have high status with the airline. SeatGuru.com can give you a good indication of what a good and bad seat is. Seats nearer the front tend to be preferable; if a connection becomes tight you will want off that plane as soon as you can. A little time can make the difference between gate open and gate closed.

Use e-tickets when you can – print them out and keep them with your passport. If you do not already have a travel wallet to keep that stuff together, consider it a worthy investment. Keep it somewhere you can easily double check when you leave the house, car, taxi, plane, etc.

For a long trip you may want to ask your own bank if they have preferential rates for booking some dollars early and compare the rates + fee to the Post Office. Check if the fees and rate for just taking out money from a cash machine with your debit card are unreasonable, if not you might just want to just wait and see if you need any cash. If you do take out cash abroad, take out enough to see you through rather than across lots of transactions, as there does tend to be a per-transaction fee. Do not wait until the airport to exchange money, their rates can be quite bad.

If you are flying out for an interview double check the dress code expected in the interview. In game industry interviews it might hurt you more to overdress rather than to be too casual as far as “cultural fit” impressions go. However, do not go as far as packing dirty clothes!

For clothes you are expecting to wear at an interview, use dry cleaning bags. If you have stayed in a hotel before you can usually find these in the wardrobe. They help keep clothes wrinkle free, especially if you hang things up when you get to your destination. For smart trousers, use those hangers with the clips. On the way back you can separate dirty from clean clothes with the dry cleaning bags.

Choose an airline you think you will use the most and stick to it, members of frequent flyer programs are more likely to be upgraded. Get a decent carry-on suitcase that is close to the maximum size of your selected airline. Do not go to the size limit, connecting flights may have smaller overhead bins. Go for a midrange or better case; cheap suitcases are often badly designed and made of inferior materials. If you are unsure test it out by rolling it around the shop to get a feel for how it will be like wheeling around an airport (perhaps at speed!)

Pack light. Choose one book and one magazine, you will not have time to read more anyway, no matter your intentions. If you want more to do save up for a Kindle or use another multipurpose device you are already travelling with. Audio books ripped to MP3s are another good concession to your “not enough to read” tendencies.

Only pack one pair of jeans, and pick smart ones. Jeans are great because they can be worn more than once without becoming disgusting, but they are bulky. Be sensible about how many changes of t-shirts and underwear you pack, if you need more, you can buy some cheaply at your destination.

Gadgets – pack only your most slim line multipurpose device. Pack a charger for that and a multipurpose USB charger/cable for your phone, MP3 player, etc. Do not take your desktop replacement laptop if your netbook will do. Make sure you have Skype credit and the application running in the background; some airport Wi-Fi hot-spots allow you to use Skype credit to pay for Internet access. A compact Bluetooth headset can be useful for making calls to just about anywhere via your computer and a Wi-Fi connection – save on roaming fees!

When packing, try and keep one change of clothes within easy access. If something is spilled on you during a flight, you will be glad of it. Even if it’s a particularly uncomfortable flight and you find yourself sticky, a change of clothes can really help you feel not so grotty.

Try to never check any baggage. If something does go wrong you have everything you need with you. You will also be easier to place on alternate flights.

Many airlines let you take a carry-on and a personal item (such as a backpack). Some even allow a laptop case on top of that. If taking a laptop I suggest getting a slim neoprene bag that can fit in your carry-on just in case. Check with your airline first. It would be a shame to check a bag after taking all the trouble to avoid it.

Have the airline’s phone number in your mobile phone. If your flight does get cancelled and you need to find an alternative flight and the queue is long, queue up and phone out at the same time. Often the person at the end of the phone line can help you almost as much as the person you are queuing to see.

If someone on your plane has a cold, you want to do your best to avoid it – the last thing you want is to be jet lagged AND have a cold. For this I suggest Vicks First Defense spray… it actually works really well and can be taken preventatively. If you wait until the first signs, then it can be just as effective.

Eyes tend to get dried out on planes, but there is a kind of eye spray you can pick up from Boots called Optrex ActiMist. You spray it on closed eye-lids and it seems to do just about as well as eye drops you put directly in your eyes. It is expensive but has a longer shelf life then normal eye drops. I have yet to find a good place to get an American equivalent. It is an easy way to feel more refreshed while travelling.

Do not bother with those travel pillows, they can take up a ton of room that can be put to better use. I expect you can improvise something to prop your head with (like an airline blanket) if necessary.

Do take your favorite headache medicine with you. Avoid taking medicine with caffeine on the plane though, you should aim to get as much sleep as possible. Buy a cheap travel shaver (Phillips do a pretty good AA powered one) if you normally wet shave, or just buy a disposable razor when you get there. Remember to keep any creams or liquids (including toothpaste) to travel size.  Keep in mind that if you are staying at a hotel they will have many things you are tempted to pack anyway. Try and fit your creams and liquid containers in to a small transparent resealable sandwich bag before you go; with any luck it will be the correct size or smaller. Keeping them separately in a bag will also help prevent any spills in your luggage.

There are a few ways you can help shift in to the destination time zone temporarily. A few days before you go try getting up and going to bed an hour or two earlier than normal… which might be easier said than done.

One thing that I found out quite recently that works for me to combat jet-lag is to time meals properly while travelling. Your metabolism can give your body clues about what time of day it thinks it is. On the plane refuse meals or eat light for meal times that do not match with your final destination time zone. Again sleeping on the plane helps, though do not use alcohol to induce sleep; that will just leave you dehydrated!

Over to you

I am sure you have your own flying tips, why not share them in the comments?


Stop being the Useless Designer: Programming

Original Author: Claire Blackshaw

Let’s face it, there is nothing more annoying than being bossed about by someone who is useless.

A bit to the left, No a bit to the right. Mmmm maybe if we make it blue?

Let’s face it, there is nothing more annoying than being bossed about by someone who is useless.?

So here are three simple rules.

  • Work with them in the trenches.
  • Everyone in the trenches has to be useful.
  • Supplement don’t Replace?

So acquire some “Hard Skills” fast and be useful. This is a multi-part post for some places to start developing those “Hard Skills”.?

Part 2: Programming Skills

A designer does not need to be a programmer but understanding programming is key.

One of the most valuable but more expensive skills for a designer to acquire is programming. Brenda Brathwaite succinctly makes the point in her post, “Built on a Foundation of Code – Game Edu Rant”.

Where to start? While I would suggest GameMaker, because if, as a designer, you can get to the point of making digital games solo, it will exponentially increase the potential of your learning curve.

While researching this post I discovered Codecademy, a brilliant introduction to programming with interactive. My tweet of my discovery (this was prior to it’s press coverage) spread like wildfire, I can easily say it was my most popular tweet out of the 3000+. This supports my belief that programming is fast becoming a life skill and I expect the basics should be included in schools in the near future. So I shall move past this point to less well covered ground.

Designers should be interested in Logic & Behaviours, not Code

At the end of the day the reason you need to understand code is because it’s the brick and mortar your game is built with. Though you want to continue to interact with it at the Logic and Behaviour level, you’re interested in how your game functions. Don’t get lost in performance or implementation, that is the job of the programmers and you should work with them to achieve the desired effect but not attempt to do their job.

Negotiate Policy with Programmers

Just as Designers don’t want unqualified doodles on their design specs, programmers don’t want the mad ramblings of a half trained programmer clogging up their code-base. You should work with your programmers and find a safe, efficient way of exposing as much game behaviour to the design team as possible in a safe manner which won’t damage the code productivity or quality.

You are part of the team, not an End-User

These solutions don’t need to be over-engineered, sometimes simple policy helps. For example, one of the easiest lo-tech ways to expose a bunch of balance numbers to designers is to have a game_numbers.h. This contains all the game constants in native code which the designer can edit, without fear of damaging everything or polluting the code base.

A similar approach can be taken with game logic. Exposing a function list to designers, and having all the game behaviours in a single code file, means that with a fairly basic programming knowledge the designers can craft complex behaviour systems or logical systems without the need for code support or complex tools.

The important thing is that it is an agreement, a policy and common sense which control these. As a member of the team you are trusted. Yes, under this system a designer could go into the code base and turn it all to goo but they won’t. You are not an end-user, you can be restricted by soft systems (policy).

Programmers like to Provide Solutions

Try to make it easy for your programmers. It’s easier for them to knock-up a basic text interface than a full contextual GUI. That being said good tools are the key and so often quoted in post-mortem. If you ever find yourself doing a repetitive design task, are frustrated with a process or are unable to “get at” the parts of the game you want then talk to your team.

Programmers like to solve problems and provide software solutions. If they have time and can see a way they will provide you with a solution.

Learn the Tools

If your studio has a scripting language, or a toolset which is used in developing content, learn it! It is your job to understand and learn that tool from start to finish. Find the manuals, if they are out of date, you should have them updated, if they don’t exist, get them written. If they have bugs, faults, or areas which need improvement, report them.

Someone has made the effort to build that tool, if you do not learn it and use it then you are wasting their time.

Get your hands dirty and own the tools. If your lucky enough to have sufficient programming skills you might even do a little minor tool maintenance, but ask permission first. The muddier and dirtier you get in the trenches, the more hands on your are with your systems the better you will understand them.

So here is to getting your hands dirty, your systems tuned and your game built.

Footnotes

#Please note: I’m not dismissing high-level design or the need to get an overview on the project but too often useless people use these as shields to hide incompetence.

#You have a team of specialists who will always have more time and expertise than you in many things. Look to understand their work, support them, and refine the design with your increased knowledge but never try do their job.

#Hard in terms of based on solid fact, brick and mortar stuff, as opposed to soft skills like communication and developing a feel for a product which can often be more difficult to master.

Angry Birds and Accessibilty Standards

Original Author: Kwasi Mensah

Alas, I’m still putting the finishing touches on Stem Stumper’s post-mortem. In the meantime I want to introduce the AltDevBlogADay community to a post from a couple months ago on how incorporating accessibility into games makes them more usable for everyone.

Introduction

While trying to look for a set of accessibility standards for Game Accessibility Interest Group. They seem to be working on a gaming specific set of guidelines.

The closest thing I could find are the “Resetting Accessibility in Games” , I’m also going to show how following these standards leads to better usability for everyone.

Scope

I’m not including Angry Bird’s social network menus in this review. I’m only focusing on content you see after hitting “Play”. I’m assuming this is the vast majority of a player’s experience in the game. Also, I’ve only made it up to level 1-21 on my iPhone. I really like the game, I just have next to no free time.

General Gameplay

Relevant Guidelines:
Guideline 1.2: Provide alternatives for time-based media.
Guideline 1.4: Make it easier for users to see and hear content including separating foreground from background.
Guideline 2.1: Make all functionality available from a keyboard.
Guideline 2.2: Provide users enough time to read and use content.

The core mechanic of Angry Birds is using a slingshot to fling birds at green pigs. The pigs can be protected by ice, wood, metal, or other materials. Some birds have special abilities. Like the blue bird that can split into three and the yellow bird that that can boost its speed in mid air.

That’s it. The core of the game is that simple. No time limits or crazy combination of gestures needed. You don’t have to have the “twitch” reaction associated with most modern games. Since “twitch” is something you can only get from other video games, its lack in Angry Birds makes it usable not just for the disabled but by people who aren’t used to gaming at all.

Rovio does a good job off using multiple graphical cues to differentiate birds, pigs and obstacles from each other. By making sure the outlines and sizes of the birds and pigs differ significantly, they avoid confusing the color blind [1]. Even for the non-disabled, the variation helps enforce the difference between these objects.

While not playable by keyboard, the game can be played with only one finger. There’s no need for “chording”, having to press multiple keys/use multiple fingers at the same time. This helps people with mobility related disabilities like cerebral palsy or arthritis play the game. It also simplifies the game and makes it easier for everyone to pick up and play right away.

Lack of VoiceOver Support

Relevant Guidelines:
Guideline 1.1: Provide text alternatives for any non-text content so that it can be changed into other forms people need, such as large print, braille, speech, symbols or simpler language.
Guideline 2.4: Provide ways to help users navigate, find content, and determine where they are.
Guideline 3.1: Make text content readable and understandable.
Guideline 4.1: Maximize compatibility with current and future user agents, including assistive technologies.

Apple’s User Interface tech gives apps the ability to tag buttons, labels and other UI elements with accessibility information. When VoiceOver, the iPhone’s screen reader, is turned on it can then read that information out loud to blind users. This tech has opened up the world of modern mobile devices to the blind. [2]

However, using Apple’s off the shelf tech ties you to iPhone. Rovio, and many other mobile device developers, use their own cross-platform User Interface tech. It makes it easier to not only have a game on the iPhone but also on Andriod and other emerging mobile platforms. Rovio, however, doesn’t seem to use any of Apple’s accessibility tech since nothing in its User interface is tagged to work with VoiceOver [3].

While there is no true cross platform way for providing accessibility information, WCAG suggest always making the following available from code:

Name: The name of the element.
Role: What it does.
Value: The state its currently in

This information lines up nicely with what Apple’s accessibility code expects. Using the sound toggle in the pause menu as an example:

Name: “Toggle Sound”
Role: “Switch Between the sound being off and on”
Value: “Sound is currently off”

Its worth noting that in a game as visually based as Angry Birds, VoiceOver support is the least of its problems. Even if every label and button was tagged and setup properly, the act of pitching a slingshot to hurl birds at pigs behind obstacles is still fundamentally inaccessible to someone with a visual impairment. I’m learning that its better to make a game fundamentally accessible and not to rely on VoiceOver support to save the day. VoiceOver should be the icing on a cake of general accessibility.

User Interface

Relevant Guidelines:
Guideline 1.1:Provide text alternatives for any non-text content so that it can be changed into other forms people need, such as large print, braille, speech, symbols or simpler language.
Guideline 2.2: Provide users enough time to read and use content.
Guideline 2.4: Provide ways to help users navigate, find content, and determine where they are.
Guideline 3.2: Make Web pages appear and operate in predictable ways.
Guideline 3.3: Help users avoid and correct mistakes.

Being a Finnish developer developing for an American market, Rovio must have been very conscious about the need for translating any text in the game. The game’s menu doesn’t rely on text at all but on intuitive symbols.

The text that’s used for level names and numbers isn’t important for understanding the game. Even for crucial information, like the secondary abilities of birds, Rovio relies of descriptive pictures and good level design to teach the player.

The use of symbols instead of text not only makes the job of localization easier but helps players that have trouble reading but can still see well enough to play the game.

Rovio also makes sure to keep the User Interface very shallow. Every important feature is only two taps away. The pause menu only has 5 buttons on it leaving it very uncluttered. Since the levels are small and restarting them is so easy, Rovio doesn’t have to implement “undo” functionality to let players fix mistakes. This keeps the game simple which again makes it more usable for everyone.

Other Guidelines

Guideline 1.3: Create content that can be presented in different ways (for example simpler layout) without losing information or structure.
Guideline 2.3: Do not design content in a way that is known to cause seizures.

I don’t think Guideline 1.3 is relevant. If VoiceOver support was implemented Angry Birds could support the standard VoiceOVer gestures. But given some quirks with how input is processed when VoiceOver or Zoom is on, using a slingshot wouldn’t be convenient. Messing with that core mechanic would make this another game entirely.

Angry Birds doesn’t have any flashing animations which eliminates the risk of seizures. While video induced seizures are relatively rare[4] most people who suffer from them don’t know they’re susceptible until the first attack. [5]

Conclusion

The WCAG seems like a really good starting point for judging accessibility in games. Not only does it contain the main guidelines above but multiple levels of success criteria to judge how well you’ve implemented a guideline. See Web Content Accessibility Guidelines for the nitty gritty details.

One thing that’s lacking on most platforms is screen reader support. Apple has been ahead of the curve in terms of accessibility and hopefully other platform owners will follow. With the advent of motion gaming being used as a way to entice non-traditional gamers, I’d be disappointed if accessibility isn’t on the minds of Sony, Microsoft and Nintendo.

Its also important to note that ease of usability in Angry Birds goes hand in hand with most of these guidelines. Not only can the guidelines be used as a way to accommodate special needs players, but as a way to judge the usability of your game for everyone.

Notes:

All images of Angry Birds were captured from my iPhone and used under fair use.

Cake images taken from Wikimedia Commons. http://commons.wikimedia.org/wiki/File:Gabe-birthday-part.jpg and http://commons.wikimedia.org/wiki/File:Cake_from_WHR%28P%29.jpg

Wikipedia up 10% of American males are red-green color blind. Color blindness is rare amongst women.

getting his iPhone

Accessibility Programming on iOS. The link shows up in Google searches so I’m assuming this doesn’t break iOS NDAs.

Epilepsy Foundation:

“…the annual incidence of visually provoked seizures in the United States general population is estimated to be one in 91,000. Among young people 7 to 19 years of age – a population that is most susceptible to these provoked seizures and among the most frequent users of video technology – the annual incidence may be five-times as high, or one in 17,500. Only individuals who are susceptible, meaning who are photosensitive, are at risk for developing seizures provoked by light.”

Epilepsy Foundation.


Who killed Anti-Portals?

Original Author: Martin Zielinski

Yesterday, I had a small chat with a former coworker that threw me back in time. It was about Anti-Portals.

Yeah, I know, you heard that term back in the days, but as it is so long ago ….

… a small reminder what the hell an Anti-Portal is

An Anti-Portal is just a plane placed in the world, which shows you that everything behind this plane is not visible. To make use of it, you need to generate a plane that goes through the player’s point of view for every edge of the portal. You end up with a frustum that allows you to easily check if an object or scene-partitioning node is occluded or not. Normal Portals are working exactly the same, but they define the visible area instead of the occluded. They were used for doorways and such.

What the hell has happened to Anti-Portals?

After that chat yesterday, I realized for the first time, that this technique disappeared silently and is dead by now. I haven’t heard of anyone using anti-portals since around 2004 or something. Why? Although we have other ways to handle occlusion nowadays, I cannot see what a few well placed anti-portals could harm. But I can see that they could be perfectly used to reject a bunch of objects with almost no cost. This does of course only make sense for large occluders, but hey, why not? You will almost always be able to find some of these.

But now, let’s ask the most important question … who’s fault was it?

Who killed Portals / Anti-Portals? 🙂

If you have any clues that might help to find the murderer, please share them with us. Maybe we can catch that bastard before occlusion queries silently disappear.

Why the hell am I writing this?

First and foremost, to commemorate the fallen ones and to find that reckless criminal. And second, because this topic remembered me instantly of a long forgotten ( at least by me ) internet site. Flipcode!. Although the site is down since 2005, they still have the archives there and it is still a lot of fun to read that stuff again.


The Game Entity – Part IV, Game Systems

Original Author: Michael A. Carr-Robb-John

Continuing a series of posts where I try to detail the past, present and maybe have a glimpse at some possibilities of where the Game Entity might evolve in the future.

Game Systems

You might call them systems or managers others call them modules while others prefer singletons. Whatever your pattern of choice at their core they are all the same, they wrap up a mechanism / section of functionality into a self contained handy package.

The Entity Manager

When you have a collection of game entities you are guaranteed that somewhere there is an entity manager lurking in the background creating the entities, maintaining them, handling their delayed deletion, keeping statistical data for profiling, occasionally prodding an entity when it misbehaves, shouting at the youngsters to keep up and trying to keep the world in harmony.

From the Entity Manager’s perspective it believes that it has ownership over the entities. As far as it is concerned no other system touches its entities, no-other system has influence over the entities except through the normal entity / component update.

How the Entity Manager sees the entity / component connections is like so:

Other Game Managers

What the entity manager doesn’t know is that there are a large number of game systems that are not only talking directly to the entities but they are also passing references between systems, compiling them into lists and making major changes to the game entity itself all outside the normal entity update. Some of these systems might include Player Manager, Squad Manager, GUI Manager, Cut-scene Manager, Task Manager, in your average game there are probably more managers that touch entities than those that don’t.

So what are these managers doing?

Let’s consider the Player Manager, it stores a list of the game controllers connected to the hardware and which controller is controlling which entity. The GUI system might ask the Player Manager which entity “player 1″ is controlling so that it can display the correct HUD information or an enemy entity might ask which entity the player is so that it can focus its attention on the Player. Having the manager store a reference to the player controlled entities means that it can quickly provide the information upon request.

A Squad Manager might contain all the information about each squad in the world, which entities are in each squad and each squad’s alliances, etc. It might also handle the higher level thinking required to achieve the objective or goal, once it has planned the required steps it instructs the members of the squad (the entities) to go and do what is necessary. The squad manager might also contain references to other important entities that it needs to track in order to carry out and execute it’s plans, for example kill this character, retrieve that object, move this object from here to here, activate that switch, open this door, etc.

The point I’m trying to make here is that there are plenty of managers regularly interfering with game entities before, during and after the update frame usually without much constraint or control other than mechanisms / interfaces that might have been built into the entity.

And of course managers are not the only ones that reference entities, entities do it themselves as well. If we were to rebuild the diagram above with all the real connections that are going on we end up with something like this:

Connections

How we make these connections to an entity can be done in a variety of methods, the most basic is a pointer to the entity or component. Obviously the biggest issues with this is if the entity itself is deleted you all of a sudden have a dangling pointer with no way of validating before using it. Although I don’t recommend this you would be surprised how many games have shipped using this method with very few issues (mainly because of some good interface design and a fair amount of liquid pixie dust (that’s luck in English) ).

Other methods that have been employed with success have been Weak Pointers or Smart Pointers on one project I even got to use Unique Id’s which was great but costly doing the lookup of Id to pointer. The only reason great is because it made a difference to me at 2am in the morning and looking up variables that read within a human context, i.e. entity 15 is targeting entity 89, instead of 0x5feabeda targeting entity 0xa3922ef1.

I once encountered GUIDS being used once, and I hope never to see them again!

The Core Managers

Let’s consider for a moment three of my favorite core managers, Rendering Manager, Physics Manager and Audio Manager. These three have evolved from very early on to take advantage of multi-threading and part of that evolution has been to isolate the internal low level data and force any external interactions through an interface or handler.

You don’t get the player manager tweaking the audio sample data as it is being played and you don’t have Entities adjusting their vertex data. This is not just because that data might be shared but because this is a good way to protect against multi-threaded issues.

Next Time…

In part five I’m going to try and bring this series of articles to a close by considering where the game entity is and what its future might be.

Coming up

The Game Entity – Part V, Future Ponderings

Previous Posts

The Game Entity – Part I, A Retrospect

The Game Entity – Part II, The Life Cycle and Processing Architecture

The Game Entity – Part III, Components

An idea for better watch windows

Original Author: Niklas Frykholm

Watch windows suck. I’ve spent a large part of my career looking at them (that’s how those bugs get fixed) and it’s often a frustrating experience.

Visual Studio Watch WIndow

Visual Studio’s watch window is one of the better ones, but it still has many issues that make the debugging experience a lot less pleasant than it could be.

  • Custom data types such as MyTree, MyHashSet and MyLinkedList are difficult to look at. To get to the content you have to understand the internal data layout and expand the links by hand.
  • I like to pack my resource data into tight static blobsfile formats for memory. A simple such blob might have a header with a variable number of offsets into a buffer of tightly packed strings. Such memory layouts cannot be described with just C structs and the watch window can’t inspect them. You have to cast pointers by hand or use the Memory view.
Visual Studio Memory Window

I don’t even see the code. All I see is a hermite curve fitted, time key sorted, zlib compressed reload animation.

  • If I have an array with 10 000 floats and one of them is a #NaN, I have no way of finding out except to expand it and scroll through the numbers until I find the bad one.
  • The watch window can’t do reverse lookup of string hashes, so when I see a hash value in the data I have no idea what it refers to.

Yes, I know that some of these things can be fixed. I know that you can get the Visual Studio Debugger to understand your own data types by editing autoexp.dat. And since I’ve done that for all our major collection types (Vector, Deque, Map, SortMap, HashMap, Set, SortSet, HashSet, ConstConfigValue and DynamicConfigValue) I know what a pain it is, and I know I don’t want to do it any more. Also, it doesn’t help the debuggers for the other platforms.

I also know that you can do some tricks with Visual Studio extensions. At my previous company we had reverse hash lookup through a Visual Studio extension. That was also painful to write, and a single platform solution.

So yes, you can fix some things and will make your work environment a little better. But I think we should aim higher.

Consider this: The variable watcher has access to the entire game memory and plenty of time to analyze it. (Variable watching is not a time critical task.)

Imagine what a well written C program that knew the layout of all your data structures could do with that information. It could expand binary trees and display them in a nice view, reverse lookup your hashes, highlight uninitialized 0xdeadbeef variables, spell check your strings, etc.

The idea

So this is my idea: instead of writing plug-ins and extensions for all the IDEs and platforms in the world, we write the watcher as a separate external program. The user starts the program, connects to a process, enters a memory address and a variable type and gets presented with a nice view of the data:

Variable Watcher

The connection backend would be customizable so that we could use it both for local processes and remote devices (Xbox/PS3). The front end sends an (address, size) request and the backend replies with a bunch of data. So the platform doesn’t matter. As long as there is some way of accessing the memory of the device we can connect it to the watcher.

We can even use it to look at file contents. All we need is a backend that can return data from different offsets in the file. This works especially well for data blobs, where the file and memory formats are identical. The watcher would function as a general data viewer that could be used for both files and memory.

For this to work, we need a way to describe our data structures to the program. It should understand regular C structs, of course, but we also need some way of describing more complex data, such as variable length objects, offsets, choices, etc. Essentially, what we need is a generic way to describe blobs of structured data, no matter what the format and layout.

I’m not sure what such a description language might look like (or if one already exists), but it might be something loosely based on C structs and then extended to cover more cases. Perhaps something like:

struct Data
 
  {
 
  	zero_terminated char[] name;
 
  	pad_to_4_bytes_alignment;
 
  	platform_endian unsigned count;
 
  	Entry entries[count];
 
  };

The program also needs an extension mechanism so that we can write custom code for processing objects that can’t be described using even this more advanced syntax. This could be used for things like reverse hash lookups, or other queries that depend on external data.

Going further the program could be extended with more visualizers that could allow you to view and edit complex objects in lots of interesting ways:

Custom Watchers

I think this could be a really useful tool, both for debugging and for inspecting files (as a sort of beefed up hex editor). All I need is some time to write it.

What do you think?

(This has also been posted to the BitSquid blog.)