Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am in charge of a game development club at my school and I'd like to work on a project this summer that I could use as a tutorial next semester. I have never done anything quite like this so I was wondering if anyone had any guide lines or ideas.

What I want to do basically is make a very simple game. Something like a top-down shooter where enemies come rush in for you to kill them and pick up some loot. However, I want everything to be very easily modified. The people in the club have little game development experience, so if I could set up my game in such a way that people could modify and add functionality with ease, it would be great for them.

Stuff like having an enemy class where the behavior is easy to play with, or making guns shoot differently/adding new guns, and new loot. Even adding new elements to the game. What would be the best way to build the game to allow this kind of malleability?

share|improve this question

closed as too broad by Josh Petrie May 9 at 16:15

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Have a look at this answer over on Stack Overflow. – Andrew Russell Apr 28 '11 at 5:07
Thanks, very good examples in that post! – Benixo Apr 29 '11 at 0:57
up vote 16 down vote accepted

A traditional way to accomplish this goal in game development is to use a data-driven architecture for the game systems.

In essence, this means that code does not implement a particular type of weapon (a gun) with explicitly defined values for its range/damage/penetration rather it populates the generic concepts of a ranged weapon (range/damage/penetration...) from an external (to the code) data source. This external source can vary from parse-able (perhaps XML) files read in from disk, to binary files or database elements generated via tools internal or external to the game engine itself.

Defining something like an enemy, the AI system might be designed to support some number of generic behaviors (aggressive, defensive, support, coward) which are then tweaked by data driven elements.

My New Enemy, starts with the aggressive base AI behavior with data-driven values for: -ignore players > my level + X -pursue players up to X units beyond spawn point -flee when health < X -ranged ability priorities -melee ability priorities (for when players get too close)

A more complicated data driven scheme might allow the definition of specific data points (events) where an AI state transitions (finite state machine) to another state (or even a chance to transition to one of N other states) allowing your users to define a complicated hierarchy of behaviors.

All of this is of course more work than just coding explicitly a behavior, but its a fun challenge to enable users to produce content without modification of the source.

There are bonus points to be achieved:

  • if you can dynamically update data and have the changes reflected within the game engine without restarting the application
  • if you create user friendly UIs over the data allowing users to use an interface to interact with the data rather than directly editing text (xml, or whatever) files

For a tutorial game targeted as a more technical crowd, most of the work is instead in designed classes/objects that expose clean interfaces for the users to extend which in turn may also be data-driven.

share|improve this answer
Nice answer! +1 – AttackingHobo Apr 28 '11 at 3:13
Thanks for your input :)! Would you happen to know any sites that would show me how to implement this kind of code? I've never done games with external sources like that. Although I definitely want them to code in XNA in the club, so I will probably do something more along the lines of classes and objects they could easily inherit in their own classes. But I will definitely look into this, – Benixo Apr 28 '11 at 3:56
A great way to do this requires your own config parser, to allow for very simple data driven structures to be loaded in. Essentially the key to any tutorial, is teaching in chunks, so abstraction is absolutely key. A good exercise could then be, design a simple GUI that allows a user to define and create new weapon types. – dcousens Apr 28 '11 at 9:27
The most common data-driven aspects in games are levels. Even if everything else is hard-coded, the level designs (ie. where the scenery is placed, where the enemies are placed, etc.) are almost always defined in data files that the game loads. His second bonus point describes a level editing tool. – jhocking Apr 29 '11 at 11:05
The process of writing/reading objects to/from disk is known as "de-/serialisation". You might find some useful tutorials under that term. – sarahm Aug 1 '11 at 2:48

If you're looking for a few ideas on how get your project started and build it up step by step so it can be converted to a tutorial, have a look at XNA Game Programming Adventures. The author has several tutorials set up, with explanation and source code that increments step-by-step.

share|improve this answer
nice link, thanks – Benixo Apr 28 '11 at 17:29

I would suggest looking at the Java Game Development tutorial on

It may not be exactly what you're looking for in terms of dudes with weapons and all that jazz, but it gives a nice step by step breakdown of a number of key factors in game developement. The presenter "Bucky" also has a chilled out, just-for-fun style of teaching. Enjoy.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.