# Question
Title: What are the restrictions of 3g online games
I am looking into make a 3g online multiplayer game for the iphone. Multiplayer is my main focus but I have noticed all game apps require wi-fi. Dose anyone know if this is simply an issue with the speed of the 3g network or dose apple put restrictions on their 3g network that prevents developers from doing this?

# Answer
> 2 votes
I don't know of any specific limitations Apple imposes regarding 3G. The communication medium would still be TCP/UDP or HTTP POST/GET.

In terms of network limitations, cell networks like your 3G service certainly have a unique set of characteristics. 3G networks are notorious for having horrible latency, it isn't uncommon to see round-trip times of up to 700 ms. In terms of bandwidth, 3G isn't that bad once the data starts flowing.

If you are looking at a multi-player action game where every second counts, having spikes of 0.7 seconds would be pretty bad. This is one reason why you would use Wifi. However if it's a Mafia Wars type game, you would be ok.

I may be remembering this incorrectly but I seem to remember there being an issue establishing a client/client session between two 3G users - like there was a firewall that prevented any incoming ports over 3G. For this reason you would either need a centralized server to match clients or use Wifi.

# Answer
> 1 votes
Phones using 3G networks typically (not always, but mostly) operate behind very restrictive NATs. UDP packets from the same source socket to two different destinations will typically appear from the device using two different IP addresses. This makes it very difficult to create peer to peer connections.

Network conditions such as latency and packet loss are more common than home ADSL or cable connections. However if the user has a very good signal then bandwidth can be higher than ADSL or cable.

You can usually use TCP and UDP. However if you're using UDP then I would recommend using a library that can cope with poor UDP performance. I've used ReplicaNet with great success on networks with poor network performance. The reliable UDP connections it uses seems to be very stable and recovers from packet loss well.

---
Tags: iphone, software-engineering, networking, multiplayer
---


# Question
Title: cocos2d: syncing CCAnimation frames with Box2d Shape manipulations
my cocos2d game currently has a ccsprite attached to a box2d body. during the game i apply different CCAnimations on my sprite, i would like to perform certain manipulations to the box2d body according to the frame currently displayed by the sprite (change rotation of the body, etc.) my current idea on implementing this is to subclass ccsprite and change the setDisplayFrame implementation but i thought somebody here probably did the same and already has a solution, so any suggestions on how to implement this?

thanks!

# Answer
> 1 votes
I think you couple the wrong components when you do this. What you should do is implement a custom CCAnimate where you not only update the animation frame of your sprite but also the "animation frame" of your physics box. Otherwise you are coupling drawing and physics components directly.

---
Tags: physics, animation, box2d, cocos2d
---


# Question
Title: Separation of drawing and logic in games
I'm a developer that's just now starting to mess around with game development. I'm a .Net guy, so I've messed with XNA and am now playing around with Cocos2d for the iPhone. My question really is more general though.

Let's say I'm building a simple Pong game. I'd have a `Ball` class and a `Paddle` class. Coming from the business world development, my first instinct is to not have any drawing or input handling code in either of these classes.

```
//pseudo code
class Ball
{
   Vector2D position;
   Vector2D velocity;
   Color color;
   void Move(){}
}

```

Nothing in the ball class handles input, or deals with drawing. I'd then have another class, my `Game` class, or my `Scene.m` (in Cocos2d) which would new up the Ball, and during the game loop, it would manipulate the ball as needed.

The thing is though, in many tutorials for both XNA and Cocos2d, I see a pattern like this:

```
//pseudo code
class Ball : SomeUpdatableComponent
{
   Vector2D position;
   Vector2D velocity;
   Color color;
   void Update(){}
   void Draw(){}
   void HandleInput(){}
}

```

My question is, is this right? Is this the pattern that people use in game development? It somehow goes against everything I'm used to, to have my Ball class do everything. Furthermore, in this second example, where my `Ball` knows how to move around, how would I handle collision detection with the `Paddle`? Would the `Ball` need to have knowledge of the `Paddle`? In my first example, the `Game` class would have references to both the `Ball` and the `Paddle`, and then ship both of those off to some `CollisionDetection` manager or something, but how do I deal with the complexity of various components, if each individual component does everything by itself? (I hope I'm making sense.....)

# Answer
> My question is, is this right? Is this the pattern that people use in game development?

Game developers tend to use whatever works. It's not rigorous, but hey, it ships.

> It somehow goes against everything I'm used to, to have my Ball class do everything.

So, a more generalized idiom for what you have there is handleMessages/update/draw. In systems that make heavy use of messages (which has pros and cons as you would expect) a game entity grabs whatever messages it cares about, performs logic on those messages, and then draws itself.

Note that that draw() call might not actually mean that the entity calls putPixel or whatever inside itself; in some cases, it could just mean updating data that is later polled by the code responsible for drawing. In more advanced cases, it "draws" itself by calling methods exposed by a renderer. In the tech I'm working on right now, the object would draw itself using renderer calls and then every frame the rendering thread organizes all calls made by all objects, optimizes for things like state changes, and then draws the entire thing out (all of this happening on a thread separate from the game logic, so we get asynchronous rendering).

The delegation of responsibility is up to the programmer; for a simple pong game, it makes sense that each object handles its own drawing (complete with low-level calls) completely. It's a matter of style and wisdom.

> Furthermore, in this second example, where my Ball knows how to move around, how would I handle collision detection with the Paddle? Would the Ball need to have knowledge of the Paddle?

So, one natural way of solving the problem here is to have every object take every other object as some sort of parameter for checking collisions. This scales poorly, and can have weird results.

Having each class implement some sort of Collidable interface and then having a high-level bit of code that just loops over all Collidable objects in the update phase of your game and handles collisions, setting the object positions as needed.

Again, you just have to develop a sense (or make up your mind) on how responsibility for different things in your game needs to be delegated. Rendering is a solitary activity and can be handled by an object in a vacuum; collision and physics generally can't.

> In my first example, the Game class would have references to both the Ball and the Paddle, and then ship both of those off to some CollisionDetection manager or something, but how do I deal with the complexity of various components, if each individual component does everything themselves?

See the above for an exploration of this. If you are in a language that supports interfaces easily (i.e., Java, C#), this is easy. If you are in C++, this can be... interesting. I'm a favor of using messaging to solve these issues (classes handle messages they can, ignore others), some other folks like component composition.

Again, whatever works and is easiest for you.
> 10 votes

# Answer
I recently made a simple Space Invadors game using an 'entity system'. It's a pattern that separates attributes and behaviours extremely well. It took me a few iterations to fully understand it, but once you get a few components designed it becomes extremely simples to compose new objects using your existing components.

You should read this:

http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/

It's updated frequently by an extremely knowledgable guy. It's also the only entity system discussion with concrete code examples.

My iterations went as follows:

The first iteration had an "EntitySystem" object which was as Adam describes; however my components still had methods- my 'renderable' component had a paint() method, and my position component had a move() method and etc. When I began to flesh out the entities I realized that I needed to start passing message between components and ordering the execution of components updates....way too messy.

So, I went back and re-read T-machines blog. There is a lot of information in the comment threads- and in them he really emphasizes that components do *not* have behaviours- behaviours are provided by the entity systems. In this way you do not need to pass messages between components and order component updates because the ordering is determined by the *global* order of system execution. Ok. Maybe that's too abstract.

Anyway for iteration #2 this is what I gleaned from the blog:

EntityManager - acts as the component "database", which can be queried for entities which contain certain types of components. This can even be backed by an in-memory database for speedy access...see t-machine part 5 for more info.

EntitySystem - Each system is essentially just a method which operates on a set of entites. Each system will use component x,y and z of an entity to get it's work done. So you would query the manager for entities with components x,y and z then pass that result to the system.

Entity - just an id, like a long. The entity is what groups a set of components instances together into an 'entity'.

Component - a set of fields....no behaviours! when you start adding behaviours it starts to get messy...even in a simple Space Invadors game.

**Edit**: by the way, 'dt' is the delta time since the last main loop invocation

So my main Invadors loop is this:

```
Collection<Entity> entitiesWithGuns = manager.getEntitiesWith(Gun.class);
Collection<Entity> entitiesWithDamagable =
manager.getEntitiesWith(BulletDamagable.class);
Collection<Entity> entitiesWithInvadorDamagable = manager.getEntitiesWith(InvadorDamagable.class);

keyboardShipControllerSystem.update(entitiesWithGuns, dt);
touchInputSystem.update(entitiesWithGuns, dt);
Collection<Entity> entitiesWithInvadorMovement = manager.getEntitiesWith(InvadorMovement.class);
invadorMovementSystem.update(entitiesWithInvadorMovement);

Collection<Entity> entitiesWithVelocity = manager.getEntitiesWith(Velocity.class);
movementSystem.move(entitiesWithVelocity, dt);
gunSystem.update(entitiesWithGuns, System.currentTimeMillis());
Collection<Entity> entitiesWithPositionAndForm = manager.getEntitiesWith(Position.class, Form.class);
collisionSystem.checkCollisions(entitiesWithPositionAndForm);

```

It looks a little weird at first, but it's incredibly flexible. It's also very easy to optimize; for different component types you can have different backing datastores to make retrieval faster. For the 'form' class you can have it backed with a quadtree to speed access for collision detection.

I'm like you; I'm a seasoned developer but had no experience writing games. I spent a some time researching gave dev patterns, and this one caught my eye. It is in no way the only way to do things, but I've found it very intuitive and robust. I believe the pattern was officially discussed in book 6 of the series "Game Programming Gems" - http://www.amazon.com/Game-Programming-Gems/dp/1584500492. I haven't read any of the books myself but I hear they are the de-facto reference for game programming.
> 5 votes

# Answer
There are no explicit rules you -have- to follow when programming games. I find both patterns perfectly acceptable, as long as you follow the same design pattern all over your game. You'd be surprised that there are many more design patterns for games, several of which are not even on top of OOP.

Now, onto my personal preference, I prefer separating code by behavior (one class/thread to draw, another to update), while having minimalist objects. I find it easier to parallelize, and I often find myself working on fewer files at the same time. I'd say this is more a procedural way of doing things.

But if you come from the business world, you're probably more comfortable around writing classes that know how to do everything for themselves.

Once again, I recommend you write what you feel is most natural to you.
> 1 votes

# Answer
the 'Ball' object has attributes & behaviors. I find it makes sense to include the object's unique attributes & behaviors in their own class. The way a Ball object updates is different from the way a paddle would update so it makes sense that these are unique behaviors warranting being included it the class. Same with drawing. There often are unique difference in the way a paddle is drawn vs a Ball and I find it easier to modify the draw method of an individual object to suit these needs than work out conditional evaluations in another class to resolve them.

Pong is a relatively simple game in terms of number of objects & behaviors but when you get into the dozens or hundreds of unique game objects you might find your 2nd example a bit easier to modularize everything.

Most folks do use an input class whose results are available to all the game objects through either a Service or a static class.
> 1 votes

# Answer
I think what you're probably use to in the business world is separating abstraction and implementation.

In the game dev world, you usually want to think in terms of speed. The more objects you have the more context switches will occur which may slow things down depending on the current load.

This is only my speculation since I'm a wannabe game developer but a professonial developer.
> 0 votes

# Answer
No, it's not 'right', or 'wrong', it's just a simplification.

Some business code is exactly the same, unless you're working with a system that forcibly separates presentation and logic.

Here, a VB.NET example, where "business logic" (adding a number) is written in a GUI event handler - http://www.homeandlearn.co.uk/net/nets1p12.html

> how do I deal with the complexity of various components, if each individual component does everything themselves?

If and when it gets that complex, then you can factor it out.

```
class Ball
{
    GraphicalModel ballVisual;
    void Draw()
    {
        ballVisual.Draw();
    }
};

```
> 0 votes

# Answer
From my experience in development, there is no right or wrong way to do things, unless there is an accepted practice in the group you work with. I have met with opposition from developers who are averse to separating out behaviors, skins etc. And I am sure they will say the same about my reservation to writing a class that includes everything under the sun. Remember you have to not only write it, but be able to read your code tomorrow and at a future date, debug it and possibly build on it in the next iteration. You should choose a path that works for you (and team). Picking a route that others use (and is counter-intuitive to you) will slow you down.
> 0 votes

---
Tags: game-design, xna, cocos2d-iphone, design-patterns
---


# Question
Title: Push or Pull Input Data In the Game Logic?
In the process of preparing my game for networking I'm adding a layer of seperation between the physical input (mouse/keyboard) and the actual game "engine"/logic. All input that has any relation to the game logic is wrapped inside action objects such as `BuildBuildingAction`.

I was thinking of having an action processing layer that would determine what to do with the input. This layer could then be set up to either just pass the actions locally to the game engine or send it via sockets to the network server depending on whether the game was single- or multiplayer.

In network games it would make sense that the player's actions should be sent to the server, but should the game logic be pulling (polling?) the data through some sort of interface or should the action processing layer be adding the actions to an input queue in the game logic code?

# Answer
What type of game is it? How dynamic are the objects?

If it is the type of game that waits for each player to post their turns then that kind of network model will do.

But if the game is realtime players running around then it won't really do because you can't have players waiting around for the server to get all movements before allowing the movement to be sent back.
> 1 votes

# Answer
Assuming that your 'action processing layer' spits out data like 'move-right' or 'turn-around', I don't think that it makes any difference whether you push to a queue and read that queue or let the game poll the action processing layer repeatedly. All that happens both on client- and server-side since, of course, both sides need to keep track of user actions.

So I don't see why this would be a network related question. In both cases fresh actions need to be transmitted to the server asap.
> 0 votes

---
Tags: architecture, networking, input
---


# Question
Title: How to implement a component based system for items in a web game
Reading several other questions and answers on using a component based system to define items I want to use one for the items and spells in a web game written in PHP. I'm just stuck on the implementation.

I'm going to use a DB schema suggested in this series (part 5 describes the schema);
http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/

This means I'll have an items table with generic item properties, a table listing all of the components for an item and finally records in each component table used to make up the item.

Assuming I can select the first two together in a single query, I'm still going to do N queries for each component type. I'm kind of fine with this because I can cache the data into memcache and check there first before doing any queries. I'll need to build up the items on every request they are used in so the implementation needs to be on the lean side even if they're pulled from memcache.

But right there is where I feel confident about implementing a component system for my items ends. I figure I'd need to bring attributes and behaviors into the container from each component it uses. I'm just not sure how to do that effectively and not end up writing a lot of specialized code to deal with each component.

For example an AttackComponent might need to know how to filter targets inside of a battle context and also maybe provide an attack behavior. That same item might also have a UsableComponent which allows the item to be used and apply some effect onto a different set of targets filtered differently from the same battle context. Then not every part of an item is an active part, an AttributeBonusComponent might need to only kick in when the item is in an equipped state or when displaying the item details page.

Ultimately, how should I bring all of the components together into the container so when I use an item as a weapon I get the correct list of targets? Know when a weapon can also be used as an item? Or to apply the bonuses the item provides to a character object?

I feel like I've gone too far down the rabbit hole and I can't grasp onto the simple solution in front of me. (If that makes any sense at all.)

Likewise if I were to implement the best answer from here I feel like I'd have a lot of the same questions.
How to model multiple "uses" (e.g. weapon) for usable-inventory/object/items (e.g. katana) within a relational database

# Answer
> 4 votes
It looks like you are using relational modeling. There is an alternative method: property/prototype modeling, which Steve Yegge used to create his "ultimate extensible" MMORPG, Wyvern. Basically, each game object is stored as a single blob (only one query per object) which is then parsed into a property list after retrieval. The flexibility of property lists allows different game objects to have different sets of properties as needed.

Yegge's The Universal Design Pattern goes into depth about property/prototype modeling. Steve's blog posts tend to be quite long, so I will try to point you to the relevant sections and summarize the points relevant to your question:

1. Wyvern uses an implementation of the Properties Pattern. A game object is basically a bag of arbitrary properties. Any object to can serve as the prototype for any other object, resulting in amazing open-ended flexibility.
2. Persisting property lists. There are various methods of serializing and saving property lists. Wyvern uses a database, "shoving the XML-serialized property list into a text/clob column, and denormalizing the twenty or thirty fields ... needed for queries into their own columns."
3. The datastore of property lists now needs a method of making queries on them. Steve makes several suggestions. Simple text-based queries don't work well for hierarchical data. XML databases or JavaScript/JSON + jQuery might be answers to this problem.

# Answer
> 4 votes
I would implement a hook system (a mechanism by which callbacks to specifiable functions can be added to and removed from an object when events occur) on the container, and have components set up the appropriate hooks when added and tear them down when removed. For instance, the AttributeBonusComponent might use `atEquip` and `atUnequip` hooks to add and remove its bonus, the AttackComponent could provide values to `pollForTargets` and `pollForAttackBehaviors` hooks, and the UsableComponent could talk to `pollForUseBehaviors`.

So the container winds up only having an abstract understanding of the kinds of information that can be requested of it and ways it can be interacted with, and the components are responsible for defining how they interface with those.

# Answer
> 2 votes
It sounds like you're missing the point of this kind of entity system. If you're "loading all components every time" then you'll get almost no benefit out of it.

You should be setting it up so that all the data needed for a particular class of operation (e.g. for "resolving attacks") is bundled into a single component.

Essentially, imagaine that you have to write the main code for some part of your game, complete with the main special cases, and you want to specify which data it needs from the start of that code to the end. That's one component (you could split it into smaller components, but only if you need to because some parts are (re)used later by other code).

Then, when you have special cases, you have the choice to edit your main component (generally: don't) or to invent extra components that allow all the existing entities to keep working, and all the existing code to keep working, unchanged.

# Answer
> 1 votes
Remember the rules for optimization!

1. Don't.
2. Don't Yet (for experts only).

> For example an AttackComponent might need to know how to filter targets inside of a battle context and also maybe provide an attack behavior. That same item might also have a UsableComponent which allows the item to be used and apply some effect onto a different set of targets filtered differently from the same battle context. Then not every part of an item is an active part, an AttributeBonusComponent might need to only kick in when the item is in an equipped state or when displaying the item details page.

Is it really a problem if you load all the components (AttackComponent, UsableComponent, AttributeBonusComponent) even if all but one go unused?

# Answer
> 1 votes
> "I feel like I've gone too far down the rabbit hole"

Yes, exactly. Component-based systems are still in the 'fad' phase where there is no agreement on how best to use them. Several knowledgeable and competent people have posted articles suggesting their use, but each tends to disagree over how you assemble them, how they communicate, and so on.

My personal opinion is that the relational model you've linked to is far too abstract for everyday use.

Instead, I would look more closely at your own design and see which common aspects of functionality can be factored out to form interchangeable components. That will probably be much more fruitful than trying to wedge your game into a preconceived notion of what components should be.

# Answer
> 0 votes
As I understand the referenced series of articles on Entity Systems, your "item" is loaded with components. And a Component is a list of references. Following through with your example: AttackComponent will include references to how the "item" attacks; the AttackTargetComponent will include references to mechanisms to get list of targets; and so on. Therefore when your "item" attacks a target or targets - it is uses the AttackComponent and the AttackTargetComponent or triggers an external method based on the item (and its components) Thanks for sharing these articles.

---
Tags: architecture, web, component-based, php
---


# Question
Title: How do I draw a point sprite using OpenGL ES on Android?
> **Edit:** I'm using the `GL` enum, which is incorrect since it's not part of OpenGL ES (see my answer). I should have used `GL10`, `GL11` or `GL20` instead.

Here's a few snippets of what I have so far...

```
void create()
{
    renderer = new ImmediateModeRenderer();

    tiles = Gdx.graphics.newTexture(
        Gdx.files.getFileHandle("res/tiles2.png", FileType.Internal),
        TextureFilter.MipMap,
        TextureFilter.Linear,
        TextureWrap.ClampToEdge,
        TextureWrap.ClampToEdge);
}

void render()
{
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    Gdx.gl.glClearColor(0.6f, 0.7f, 0.9f, 1);
}

void renderSprite()
{
    int handle = tiles.getTextureObjectHandle();
    Gdx.gl.glBindTexture(GL.GL_TEXTURE_2D, handle);
    Gdx.gl.glEnable(GL.GL_POINT_SPRITE);
    Gdx.gl11.glTexEnvi(GL.GL_POINT_SPRITE, GL.GL_COORD_REPLACE, GL.GL_TRUE);

    renderer.begin(GL.GL_POINTS);
    renderer.vertex(pos.x, pos.y, pos.z);
    renderer.end();
}

```

`create()` is called once when the program starts, and `renderSprites()` is called for each sprite (so, `pos` is unique to each sprite) where the sprites are arranged in a sort-of 3D cube.

Unfortunately though, this just renders a few white dots...

I suppose that the texture isn't being bound which is why I'm getting white dots. Also, when I draw my sprites on anything other than 0 z-axis, they do not appear -- I read that I need to crease my zfar and znear, but I have no idea how to do this using libgdx (perhaps it's because I'm using ortho projection? What do I use instead?).

I know that the texture is usable, since I was able to render it using a SpriteBatch, but I guess I'm not using it properly with OpenGL.

# Answer
Figured out the answer, here's how you render textured point sprites, using alpha test and depth test:

```
create()
{
    renderer = new ImmediateModeRenderer();

    tiles = Gdx.graphics.newTexture(
        Gdx.files.internal("data/tiles2.png"),
        TextureFilter.MipMap,
        TextureFilter.Linear,
        TextureWrap.ClampToEdge,
        TextureWrap.ClampToEdge);

    Gdx.gl.glClearColor(0.6f, 0.7f, 0.9f, 1);

    Gdx.gl.glEnable(GL10.GL_TEXTURE_2D);
    Gdx.gl.glEnable(GL10.GL_DEPTH_TEST);
    Gdx.gl.glEnable(GL10.GL_ALPHA_TEST);
    Gdx.gl.glEnable(GL11.GL_POINT_SPRITE_OES);

    Gdx.gl10.glAlphaFunc(GL10.GL_GREATER, 0);

    Gdx.gl11.glTexEnvi(
        GL11.GL_POINT_SPRITE_OES,
        GL11.GL_COORD_REPLACE_OES,
        GL11.GL_TRUE);

    Gdx.gl10.glPointSize(s);

    tiles.bind();
}

render()
{
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

    renderer.begin(GL10.GL_POINTS);

    // render 3 point sprites at various 3d points
    renderer.vertex(-.1f, 0, -.1f);
    renderer.vertex(0, 0, 0);
    renderer.vertex(.1f, 0, .1f);

    // ... more vertices here if needed (one for each sprite) ...

    renderer.end();
}

```
> 0 votes

# Answer
If you are using orthogonal projection, then chances are you called `Gdx.gl.glOrtho()` at some point. The last two arguments are your near and far distances.

By the way, you should call `Gdx.gl.glClearColor()` *before* `Gdx.gl.glClear()`. It's not dramatic in your code, you will only get the first frame wrong, but be careful about similar errors.
> 0 votes

---
Tags: opengl, textures, sprites
---


# Question
Title: Calculating the "power" of a player in a "Defend Your Castle" type game
I'm a making a "Defend Your Castle" type game, where each player has a castle and must send units to destroy the opponent's castle. It looks like this (and yeah, this is the actual game, not a quick paint drawing..):

Now, I'm trying to implement the AI of the opponent, and I'd like to create 4 different AI levels: Easy, Normal, Hard and Hardcore. I've never made any "serious" AI before and I'd like to create a quite complete one this time.

My idea is to calculate a player's "power" score, based on the current health of its castle and the individual "power" score of its units. Then, the AI would just try to keep a score close to the player's one(*Easy* would stay below it, *Normal* would stay near it and *Hard* would try to get above it). But I just don't know how to calculate a player's power score. There are just too many variables to take into account and I don't know how to properly use them to create one significant number(the power level).

Could anyone help me out on this one?

Here are the variables that should influence a player's power score:

*Current castle health, the unit's total health, damage, speed and attack range.* Also, the player can have increased Income(the money bag), damage(the + Damage) and speed(the + speed)... How could I include them in the score?

I'm really stuck here... Or is there an other way that I could implement AI for this type of game?

Thanks for your precious time.

# Answer
I'm not positive how easy this would be to tell, but trying to find out how important each variable is is probably the place to start (if you gain 50 health, you can last 10 seconds longer; if you gain 5 damage, you can destroy 50 health 10 seconds faster; etc...). After that, trying to normalize the abilities might be worthwhile (50 health is the same as 10 speed is the same as 100 income).

I imagine an easy way to find some of this is by just running simulations. Keep one player at a single level, and then start adjusting individual variables to how they scale.
> 4 votes

# Answer
First of all, I wouldn't include short-term goodies such as income or speed upgrades into account - I think players expect that these things help them for a while, not that the AI adapts immediately and gets stronger as well.

And for the rest: try it out. Start with a power formula that seems reasonable to you (nimbus57' response should be a good starting point) and then develop your formula and the AI iteratively.

Last but not least, try to make sure that the underlying formula cannot be exploited by the player to gain unfair advantage etc - it also shouldn't be too obvious how it works, so pull in a bit of randomness.
> 3 votes

---
Tags: game-design, ai
---


# Question
Title: Designing rules to fight smallpox in Civ-style TBS games
**TL;DR:** How do you design a ruleset for a Civ-style TBS game that prevents city smallpox from being a profitable or viable strategy?

**Long version:** Civ-style games are pretty great. Bringing a civilization from cradle to grave is a great endeavor, and practicing diplomacy with hard-line human players is fun and challenging. *In theory.*

*In practice*, however, many of these games has, especially in multiplayer, exactly one viable strategy: City smallpox, a.k.a. infinite city spread, a.k.a. covering all available space with 1-citizen cities, packed as tight as they will go. I suppose this could count as emergent gameplay, but still; it could hardly be considered to be in the spirit of the class of game.

The Civilization series, of course, is stuck in their more or less fixed rule sets, established with Civilization. Yes, there have been major changes in some respects, but the rules pertaining to city building and maintenance have stayed pretty similar.

So the question, then: If you build a ruleset for a TBS from the ground up; what rules should be in place to prevent Infinite City Sprawl from being a viable strategy?

Or *should* ICS be a viable strategy?

# Answer
ICS could be a viable strategy, but the problem is that

1. It is usually much much much more powerful than non-ICS. This gives the player no choice as the challenges become larger.
2. It places an unusual strain on the player because he needs to manage 10-20 times as many cities as in a non-ICS scenario.

You can try and combat ICS the "civilization way", with the stick. I do not think this has worked particularly well so far, but these are the popular measures.

* Efficiency. More cities means more lost revenue.
* Unhappiness. For every city you add more people become unhappy.
* Wonders that require you to build building X in every city.

I think it's better to tackle the root causes that encourage ICS in the first place.

The main reason for ICS is that many essential resources are city-based. You have one build-queue per city for units. You can only have one of a certain building (and associated bonusses) per city. Resources needed for city growth scale super-linearly, it takes more food to get from 10 to 11 than to get 4 cities from 1 to 2.

I think that the real solution to eliminate ICS is to eliminate these special properties of cities. De-couple build-queues and cities (let them build "workshops" directly on the map as improvements?), allow multiple buildings of the same kind in a city (but not more than 1 per square?) etc. With these mechanics in place, the user does not need to ICS. The reason to found another city is dictated more by strategy and geography (as it should!) than resource min-maxing.

Another (better?) option is to get rid of cities all-together and just have squares that can be improved, yield resources and can populated (perhaps as an additional resource). But this requires re-engineering pretty much the entire genre.

Whatever you do, DO NOT add mechanics that actively encourage ICS by giving away free resources/buildings to every city. See "The Cloudbase Academy" for Alien Crossfire as a way to completely wreck any non-ICS strategy. This wonder basically allows empty cities to grow and thrive using only resources from the player's civ-wide satellite constellation.
> 5 votes

# Answer
It's not unrealistic to have lots of little cities, but civilization games are supposed to be about the major cities. So it seems the best way to combat ICS is to strongly encourage larger cities. Ways to do that might include

* As mentioned above, make a single city with 4 population give significantly more resources than 4 cities with 1 population (Civ generally has the opposite becuase of the free resources from the city tile)
* Make buildings have minimum populations that are required to build. You can't man a factory in a rural town.
* Make buildings have effects that scale with population. A colosseum isn't going to have much effect unless it is in a big city.
* Make small cities a liability in conflicts. They aren't very defensible, and maybe there is a strong penalty for losing a city. Or maybe small cities can be annexed by nearby larger cities, with the population and buildings being added to the larger city.
* Give empire-wide bonuses based on the number of "large" cities you have, or give bonuses to the player with the largest city.

Basically, try to imagine a country where no town had more than 5,000 people, and think what that country would be missing versus countries with major metropolises.
> 3 votes

# Answer
You can add value to empty space. Perhaps give cities a bonus depending on how close they are to an unclaimed "countryside" space, to represent folks' desire for nature or their needs for agriculture. Or maybe allow population to be assigned to some sort of non-city entity that offers a bonus too good to be turned down.
> 3 votes

# Answer
The root of the problem is basically a positive feedback loop. Each city gives resources, more resources allow for more cities, that give yet more resources, ad nauseum.

To solve it, the feedback loop must be broken^ that is, cities should *stop* giving resources after a while. (Or not give them in the first place.. but that kinda defeats the purpose).

Civ IV tried to break the loop by increasing maintenance exponentially with number of cities, and it worked to an extent. I haven't played Civ V yet, but from what I heard they deal with ICS in t better than in IV.

Instead of simply increasing maintenance, you can try to break the loop by making small cities progressively less effective (i.e. the more/larger cities you have, the less resources you obtain from a new small city).

Another way to approach this is to keep ICS as a viable strategy, but add another loop, where few large cities give about the same amount of resources as a lot of small ones. However, this is really hard to balance, because even a slight shift in balance will grow exponentially during the course of the game.
> 1 votes

# Answer
Real cities don't work a linear fashion, it's more gaussian. The number of civilians that a city can support should increase with advances in technology and medicine (and thus the amount of resources output). But cities also need some kind of minimal population, which also increases with technology. (you need XW to run the bio-chem plant, but only YW workers for the farm).

few workers = less resources `if (#W < CivMin) +1W = +0.75R - 0.1R*W`(upkeep of pop)

More workers = more resources. `if (#W < CivLimit) +1W = +1R - 0.1R*W`

Too many workers = drain on resources. `if (#W > CivLimit) +1W = +1R - 0.5R*W`

And if you really want to get fancy, migratory workers usually add less upkeep to a civ than a natural born citizen does (no flames, please!) and work for lower rates. Have implement natural migration where if the `#W > CivLimit` then workers migrate to locations where the ration of `W:R` is better.

Caveat: Never played Civ (shame, I know!) but those are just my thoughts.
> 1 votes

# Answer
I have only played freeciv, but here are a few suggestions:

Remove the "bonus" production square every city gets. Without that bonus production square, four cities of size 1 will have as many production squares as a size 4 city. (Today the four small cities will have a total of 8 production squares vs 5 such for the size 4 city).

Make city growth linear so it costs as much food to get from size 10 to 11 as it takes to get from size 1 to 2. *Also* allow for a city that produces enough food to grow several sizes in one turn.

Allow a big city with a lot of production capacity to produce multiple items from it's production list during one turn.

I think the above would go a long way to even out ICS vs non-ICS but I then have a final suggestion which is a direct punishment of ICS: Tweak city walls, coastal battery and SAM batteries so they get a relatively weak defense bonus when the city is small and a relatively strong defense bonus when it is large enough. But that is *really* going for a deliberate punishment of ICS...

The above changes might come with an interesting price though, that growth of a city suddenly "runs amok" and it suddenly in one turn leaps from peaceful to severe civil disorder. Of course, careful planning of buildings might aleviate that to some extent.
> 1 votes

---
Tags: game-mechanics, turn-based-strategy
---


# Question
Title: Pros and Cons of making geometry not only leaf in scene heirarchy
I was wondering why most game and graphics engines prefer to make geometry/mesh class only as a leaf in the scene hierarchy; more precisely they are not allowed to have children. So what are the pros. and cons of making it able to have children from performance and software design point of view?

# Answer
I quote the Ogre justification, from the book "Pro Ogre 3D Programming"

> The decision to decouple the scene graph from the scene contents was probably one of the most brilliant, yet underappreciated, design features in the entire Ogre project. This is such a simple design to understand, yet one of the hardest to comprehend for those used to more “traditional” scene graph designs. Traditional designs (as used in many commercial and open source 3D engines) typically couple the scene contents and the scene graph in an inheritance hierarchy that forces the subclassing of content classes as types of scene nodes. This turns out to be an incredibly poor design decision in the long run, as it makes it virtually impossible to change graph algorithms later, without forcing a lot of code changes at the leaf-node level if the base node interfaces change at all (and they usually do). Furthermore, this “all nodes derive from a common node type” design is, in the long run, inherently inflexible and nonextensible (at least from a main- tenance standpoint): functionality invariably is forced up the inheritance hierarchy to the root nodes, and myriad subclasses are required, and typically end up as minor adjustments to base functionality. This is, at the very least, a poor object-oriented design practice, and those who adopt this design philosophy almost always end up wishing they had done it a different way in the beginning. Ogre did. First of all, Ogre operates on its scene graph(s) at an interface level; Ogre makes no assumption as to what sort of graph algorithm is implemented. Instead, Ogre operates on the scene graph only through its signature (its methods, in other words) and is completely igno- rant of the underlying graph algorithm implementation. Second, Ogre’s scene graph interface is concerned only with the graph structure. Nodes do not contain any inherent content access or management functionality.
> 5 votes

# Answer
It really depends the hierarchy is the only structure you're using. I often use a tree-like structure for logical separation of scene elements but I use other structures, such as BSP trees, quad trees and the like to store instance batches. That's the important bit for performance: How quickly can you determine which batches of instances to render together. If you've got some logical hierarchy someplace else it won't have any impact on performance (other than extra memory use) but it's important to have quick access to potentially visible sets of data in a form that is graphics card and cache friendly.
> 2 votes

---
Tags: scene-graph
---


# Question
Title: OpenGL VBOs are slower than glDrawArrays
So, this seems odd to me. I upload a large buffer of vertices, then every frame I call glBindbuffer and then the appropriate gl\*Pointer functions with offsets into the buffer, then I use glDrawArrays to draw all of my triangles.

I'm only drawing about 100K triangles, however I'm getting about 15FPS.

This is where it gets weird, if I change it to not call glBindBuffer, then change the gl\*Pointer calls to be actual pointers into the array I have in system memory, and then call glDrawArrays the same, my framerate jumps up to about 50FPS.

Any idea what I weird thing I could be doing that would cause this? Did I maybe forget to call glEnable(GL\_ALLOW\_VBOS\_TO\_RUN\_FAST) or something?

# Answer
> 2 votes
glBindBuffer is expensive, but not so much that you can expect a noticeable impact from a single bind (or several dozen of them, for that matter).

Did you check that you have the right usage flags when creating the buffer storage with glBufferData? For your scenario, GL\_STATIC\_DRAW is the ALLOW\_IT\_TO\_RUN\_FAST flag. If you accidentially use the wrong flags, it might do silly things with your buffer.

I've seen performance drop of nearly two full frames worth on a readback into a PBO once only because I used the wrong flags. When you get that one wrong, it is a "wtf, this cannot possibly take 30 ms???" experience.

# Answer
> 1 votes
I think its a code specific problem not problem with VBOs..

* make sure you are not copying VBOs every time.
* make sure you are not misusing VBOs functions (I think there is a small difference between using VBOs in openGL 3.0 and previous versions).
* make sure that openGL is not generating an Error.
* debug your openGL code using gDebugger.

---
Tags: opengl, performance, optimization
---


# Question
Title: Recommended RPG game that can be used to learn game Modding?
I would like to learn game development via game modding. RPG/MMORPG is one of my favorite genres. Could someone recommend me a good and recent ( I would like to play the game as well) game to learn game modding. Something with the likes of Neverwinternights 2.

Thank you very much for the responses. Appreciate it.

# Answer
For RPGs, you might look at:

M&B is more recent than Oblivion, but both are still played (and worth playing). For MMOs, Edward83's recommendation of Lua is good, however - for World of Warcraft, you would only be using Lua to write add-ons, not full mods.

To clarify, when you make a mod for a game like Oblivion or Neverwinter Nights, you're actually changing the full game experience - you could make a science-fiction version of Oblivion, for instance. But with Warcraft/Lua, all you would be doing is making changes to the *interface*, not the game itself. You couldn't, say, add a new *item* to Warcraft, or change the skins to be Klingons.

You can do a lot of cool things in WoW addons (and you can learn programming with Lua), but if you're interested in eventually making a full *game* \- it's not quite the same as developing a *mod*.
> 19 votes

# Answer
In addition to the games Cyclops mentioned, *Fallout 3* and *Fallout: New Vegas* use the Oblivion engine and are highly moddable.
> 7 votes

# Answer
Elder Scrolls is a great start, but I found the best RPG engine to get people really started modding is the Neverwinter Nights Aurora engine, simply because they have the largest collection of public tools for modding, and you can really get a feel for what it feels like to work on a game with their tools.

http://nwn.bioware.com/developers/
> 7 votes

# Answer
World of Warcraft supports scripting on Lua. Is it what you need?

Also check Mods for Games tutorials and engines;
> 4 votes

# Answer
Dragon Age: Origins includes the toolset for modding. Recently, Bioware released the Ultimate Edition with all of the DLC up to this point. I think this would satisfy your requirements of a good, modern game that can be modded.
> 4 votes

# Answer
The Garden of Eden creation kit for FallOut 3 is pretty cool.

http://fallout.bethsoft.com/eng/downloads/geck.html
> 4 votes

---
Tags: mmo, level-design, modding, rpg
---


# Question
Title: Are there legality issues using a company's name in a game?
I'm working on an RPG of sorts where the character has a "day job" that determines how much money they make each time the day cycles and other things like that.

Are there any legality issues with using the names of companies like "Barnes & Noble" or even "Apple"?

# Answer
> 6 votes
I am not a lawyer.

But almost certainly the answer is "yes."

"Apple" is a registered US trademark of Apple, Inc. for example (and presumably so is Barnes & Noble and the names of almost any other major company you can think of), and many companies may have trade or service marks registered in other countries as well. Usage of those marks is subject the constraints of the relevant trademark law. In some cases, depending on what you want to use, there may be copyright issues involved as well.

See here and here for more information US patent, trademark and copyright law.

# Answer
> 2 votes
In short: "Yes!"

In medium-length: "Don't do that!"

In long form:

There are at least several issues with legal ramifications that you should consider:

* **Unauthorised use of trademarked - or otherwise protected - names**: There are companies that sue for such use as a matter of principle, in order to protect their trademarks - in some countries they are actually required to do so, lest they set a precedent. While there *are* fair use clauses in the laws of most countries and you *may* win a court case, such companies can throw what - to most people - is unbelievable amounts of money to their lawyers and cause you *lots* of trouble just by suing. Can you compete with that?
* **Offensive use of their names**: The trademark law is usually more tight and companies prefer suing for trademark infringement, but should they chose so, they can also sue for offensive use of their names. For example, if in your game a character working in company X is routinely overworked and harassed by the superiors, the company might find grounds to sue for defamation.
* **Embedded advertising**: In some countries you are not allowed to do anything that might be received as covert advertising, sometimes depending on the target group of your own product. For example, you may not be allowed to have *any* Real-Life products or companies in a game inteded for young children.

That said, I am not a lawyer, and you should probably ask one with expertise on trademark and related issues for an answer with more weight.

Or you could just avoid using such names in your game. Keep in mind that paraphrased names or photographic descriptions can also get you into trouble in some cases - for example having a software company named "Minisoft" and presided by "Gill Bates" is pretty obvious.

# Answer
> 0 votes
That depends. Wikipedia has an excellent quote

> The owner of a registered trademark may commence legal proceedings for trademark infringement to prevent unauthorized use of that trademark. However, registration is not required. The owner of a common law trademark may also file suit, but an unregistered mark may be protectable only within the geographical area within which it has been used or in geographical areas into which it may be reasonably expected to expand. (http://en.wikipedia.org/wiki/Trademark)

This entails that even though the company name it isn't a registered trademark you can still get sued - even if you did not publish your game in the country where the company resides!

---
Tags: legal
---


# Question
Title: Is flash game development not considered 'proper' game development?
I've come across this a couple of times. That flash game development is not 'proper' game development when compared to XNA or even Unity. Mentioned here: Need guidelines for studying Game Development

Also here in some comments : Where to start with game development?

This judgement also befalls java, according to some. Is it because in flash its so easy to draw graphics and to import and add on to the stage any element we want and also because flash needs a 'container program' to run and others don't?

But flash is by far way easier to 'distribute' than any other of those mentioned above. Maybe except for iphone or android games.

# Answer
I've been involved in flash game creation, and it's absolutely pure game development, if done well. It has larger user base than each of the other platforms mentioned, so I would care mostly about that.

> This judgement also befalls java, according to some. Is it because in flash its so easy to draw graphics and to import and add on to the stage any element we want and also because flash needs a 'container program' to run and others don't?

When I have worked in a team developing flash games, we did it using solely AS3 programming, the graphics production had a custom pipeline(we did not use the Flash editor), as happens in several developments out there(so, no import into stage, and not even using the "standard way" of doing flash...). The result was quite eficient in performance, although if there is a difference, is indeed that matter: performance in the flash player plugin is very far from what you get by doing native binaries with other languages. Also, it's clearly something initially started/thought for just multimedia content addition, not for games from start, and suffers a lot from that. But actually, this makes developers work even harder, so saying doing flash games is not making real games, or not "the real thing", etc...That would far from true.

Anyway, the average earning with those games, can be way lower than getting a publishing deal in console games, etc. (unless being very lucky) And it's getting crowded.

It'd be also false the same statement said about java (being it not 'propper' game development,e tc). It's more about how you deal with it, market considerations, etc.
> 3 votes

# Answer
Some people, when presented with the phrase "game development", assume AAA games. Maybe even to the point of thinking console games. And any other kinds of game making isn't worth studying or putting effort towards.

Of course this is a false dichotomy. Granted, there are very different skill sets and resources required to actually produce flash games vs. console games, but the fundamentals are the same.

Related: http://www.gamasutra.com/view/news/33363/GDC\_2011\_Social\_Game\_Developers\_Direct\_Their\_Rage\_Outward\_Inward.php
> 7 votes

# Answer
I think Flash can be considered "proper" game development. The problem is that the barrier of entry to make Flash games is extremely lower than C++ games, so there are lots more shitty Tetris clones made in Flash than in C++.

Put it another way, making shitty games in Flash is much easier than making them in C++, therefore there are tons of shitty Flash games, and that drives the average down.

But (at least) since ActionScript 3.0 I'd argue it's possible to make games as complex than those in C++. As an exercise, I wrote a semi-automated C++ to AS3 converter, ported my whole ~150 KLOC C++ framework (used in many casual-AAA titles) to Flash, plus a game, and it run perfectly. That's scientific proof :)
> 3 votes

# Answer
I think that creating a drinking game with your friends, rules for skipping rocks, and making up a card game as kids are all game development. Game can have many definitions:

* a contest with rules to determine a winner; "you need four people to play this game"
* a single play of a sport or other contest; "the game lasted two hours"
* an amusement or pastime; "they played word games"; "he thought of his painting as a game that filled his empty time"; "his life was all fun and games"

source: http://www.google.ca/search?sclient=psy&hl=en&q=define%3A+game&aq=f&aqi=&aql=&oq=&pbx=1

You don't have to be coding in C++ to be a game developer. Whomever invented chess was a game developer.
> 2 votes

# Answer
In my humble opinion, any game or whatever development is worthy as long as you find players/users to use your software.

There are plenty of Flash games Internet-wide. In my point of view, Flash games stand for online games that can be played within a community, or else, simple single-player games that one can find amusing to play.

As previously mentioned, the skill set isn't quite the same, and Flash addresses a need, while XNA, C++ and other game development technologies and platform address another. For instance, I wouldn't like to play Final Fantasy in using Flash, but some other perhaps more simple games, I don't know. Perhaps this could be pretty interesting nevertheless.

In the end, it all depends on what are the targeted objectives and kind of player you wish to target. To illustrate the idea, you wouldn't develop a game using Flash for the PS3 or the iPad, you would more considerably plan on using C++ and Objective-C respectively, because of the targeted platform, that is, if you target the Web or so, I suggest using Flash.

I hope this grain of salt does help!
> 1 votes

# Answer
Game development is about creating an experience to the player, and the language of choice is merely one of the tools to help create that experience.

In the beginning, games were coded in assembly because that was the only tool available. Many big budget console and PC games embed flash for their UI (using Scaleform), because it's a better tool than C#/C++.

To me, the "proper" game development is one that gets a good game shipped.
> 1 votes

# Answer
I think you'll find two types of attitudes that would say Flash isn't "real" development.

First is from hardcore (C++ or similar) programmers, saying that ActionScript is scripting rather than "real" programming, because it abstracts away so much and as a result has a bit less power, and lets you get away with understanding less about how to program properly. I would tend to say this is true to the extent that "scripting" and "programming" are two related but different skill sets, so it's important to make the distinction between them, even if we leave the snobbery out of it.

Second is when looking at AAA game development aimed towards the "core" market as the "real" industry, and everything else as peripheral. This is an old attitude that derides not only indie and small-scale development but also casual games, serious games, social media games, smartphone/mobile games, and so on as somehow being on the outside. I think this attitude is slowly changing, in particular with the massive success of some Facebook games (like it or hate it, FarmVille has more players than any console game out there) and the number of game industry veterans that are transitioning to that space, Flash is getting a lot of use by people who formerly only worked in C++.

Personally, I think Flash is just as valid as anything else (heck, I've even seen some mighty impressive Game Maker games) so I wouldn't write off any game as "not proper" just because of its development platform. But I write this response so you can get a sense of where this attitude is coming from, so you can take those comments in context.
> 1 votes

# Answer
I think that the skills involved in flash game development are real enough - ActionScript is an imperative programming language like any other and the logic skills required are the same. The fact that flash has a very nice vector graphics editor as part of the framework means it's much easier to get things running on screen than in another language that has more choice about how to display graphics. When you use flash (or Unity or whatever else) you are sacrificing control for ease of development. In truth, all developers do this whether internally or externally - not everybody is involved in writing the innards of the graphics engine or working out how to effectively parallelise code over heterogeneous processors. Also, flash graphics are usually simpler for artists to create - they don't have to create complex maps for multiple levels of sub surface scattering or crank out zbrush for megabytes of normal maps. That said, making things look good with only gradients is also a hard skill. Many flash games don't succeed in making things look good with gradients.

Many great games have already been written in flash so why do some people think it's not 'proper' development? My take on it is cost: so many flash games are given away for free based on the perception that people won't pay for a game based in a browser. No matter if you and/or your team spent a week or a year developing the game, if you give it away there's a lot of people who will take that as meaning it is worthless.

This is an error of judgement on their part but unfortunately this is the way many people view the world, lacking the expertise to form meaningful value judgements regarding things they do not fully understand.

So, make good flash games and figure out how to make money out of them and people who don't understand what you do will start to respect you for it.

I think its important that we don't undervalue the work we do - I would like to continue making money from creating games and then selling them to people who want to play them, rather than creating games and getting paid a pittance by an advertising agency (if I'm lucky).
> 0 votes

# Answer
Of course flash game is proper game development. If you are skilled and dedicated, it doesn't really *matter* what you use for developing your game, it is *still* proper game development. Enough talent and hard work will even make developing a game based only on sticks and stones on a back yard to be proper game development.

These kinds of discussions emerges in all kinds of areas and professions be it music, art, software development etc. People defend the value of what they do (be it C++ game development) by trying to attach "not proper", "not real", "not valuable" to other things (be it flash game development) they feel is competing for attention, credebility and other kinds of rewards.

Maybe I'm a cynical and oversimplify things but I think this kind of elitism is 1.) a resistance against large scale systematical changes in whatever industry you are part of and 2.) an attempt to maintain your own value in relative terms not by increasing the value of your own efforts but by decreasing the (perceived) value of other people's efforts.

Maybe elitism in rare cases actually is a matter of really trying to preserve some sort of valuable knowledge and competence, but from my anectdotal experience this is seldom the case. Elitism usually serves the purpose of protecting some person or group's interest at the expense of the larger community, as I see it.

(Just compare it with the discussions some IT professionals had in the beginning of the 1990ies when they were worried by the fact that web browsers allowed people *without* "proper" IT skills to efficiently access information on the internet)
> 0 votes

---
Tags: flash
---


title: Help me choose an engine

text:
# Question
Title: Help me choose an engine
So far i've been trying to make a RTS in pygame but, i feel like 2d is not enough and pygame has me do a lot of stuff that i would not like doing. What i would like doing is working on the AI gameplay and such and not worying too much about how to display stuff,physics and the like too much.

So far Unity has boo which is supposed to be similar to python i wonder if that could work. How similar is it to python should i use this? Other options as far as i can see are ogre3d python bindings and UDK.

Which would best suit my needs?

# Answer
First of all, if you don't want to worry about other aspects EXCEPT graphics (physics, etc), forget about using Ogre. It's a graphics engine, not a *game* engine.

Unity has all of the aspects that you want already in there and can offer you a quick turnaround time.

The UDK is a good one, but it does involve a bit more work to get up and running before you can focus on the AI and gameplay aspects.

If your aim is to get something up and running in a very short amount of time, go for Unity. If you don't like Boo (which personally I have no experience in whatsoever), you can always use the C# and/or Javascript alternatives.
> 5 votes

# Answer
It sounds like what you want is to just do the actual meat of your game. To use the smallest amount of boilerplate, I would use Unity.

Boo seems a mixture of C# and Python, to me. It shouldn't be difficult to pick up (and there's always Javascript too).

If you don't want to go to Unity or UDK or another editor-type program, there is this question about RTS engines (though this is C++)
> 2 votes

# Answer
see Spring RTS, it is a good engine with a lot of games runing over it (that means a lot of examples), it is open source and written in C/C++ with LUA over it.
> 0 votes

---
Tags: python, rts
---


title: Change from Bullet/OgreAnim to Havok?

text:
# Question
Title: Change from Bullet/OgreAnim to Havok?
I have been working on a game in Ogre for the last 6 months or so. It started as a learning project, and after a few rewrites it actually turned into a real game project. Physics scared me, and using Bullet with its lack of documentation was a nightmare, but I was able to atleast get some basics added and learned a lot. So as of now I am using Ogre with its default animation system (fairly basic) and Bullet Physics.

I had always wanted to use Havok when I started out, but due to lack of integration information on the Ogre forums, and lack of tutorials on the net, I decided against it. Now that I am actually at the point where Bullet is just too much of a headache to proceed with (staring at forum threads praying someone answers) and the Ogre animation system is so basic, I am considering switching to Havok for Physics and Animation.

The Physics system looks extremely polished and easy to use. The animation system looks incredible with the retargeting/blending/etc. The documentation is incredibly detailed as well (I guess when you come from Bullet, any documentation looks amazing)

So my question is, as I am still somewhat of a 'newbie' to game development, should I just stick with what I am using now or should I make the switch over to Havok? The physics looks like I could get my project back to where it is now with minimal effort, and be able to expand much faster. The animation aspect looks extremely daunting as far as integrating it with Ogre.

# Answer
(Disclaimer: I work for Havok)

There is a binary-only version of Havok Physics and Animation for Win32, available through Intel here. It's been a while since I read through the licensing agreement, but IIRC, essentially it's completely free if you're selling your game for less that 10 USD, and free but subject to an approval process if the price is more than 10 USD. The longer explanation is here.

Intel has a forum that's dedicated to supporting the free version. Havok support engineers read and reply on the forum regularly (plus an occasional guest appearance by yours truly).

As for the animation component, you could initially keep most of your decompression/playback/blending in Ogre, and just convert the final pose to Havok format for ragdoll driving. Once that's working, you could switch the animation format and your toolchain over to Havok if you though it was worth it; otherwise you could just stick with the Ogre tools/format.
> 6 votes

# Answer
From my point of view the main difference between bullet/ogre and havok configuration is licensing. While ogre/bullet comes with open source code, need for self effort and time, havok comes with a licensing cost. So this decision is based on your purpose. I would always prefer gnu,gpl,zlib like licensed products for my development environment as long as I want to be free on distributing or selling or sharing my products.
> 3 votes

# Answer
I can't say whether or not it's a good idea, but you could ask Havok if you could evaluate their package to see if it is as easy to integrate as you think. Then if you're ready to give them many thousands of dollars (it was $75k last time I knew anything about that aspect) you can get some of the source code too.

The nice thing about Ogre and Bullet is that they are open source so you get all of the code. The code is always the most certain place to find the answers to questions as other documentation may be out of date. I don't remember Havok's documentation but I never really spent a lot of time with it.
> 2 votes

# Answer
Go on with Havok boy, it's the number one in the world if you want to blend ragdoll with animations, it's well documented, performing, and has so many features that a life is not enough for discovering them all.

Regarding the license now it's totally free of charge on the PC platform, even for commercial projects.

Of course we are talking only about havok physics and animation, because you would have to pay for cloth, ai, behavior, script and destruction.
> 0 votes

---
Tags: c++, ogre, havok
---


# Question
Title: Server-side Architecture for Online Game
basically I have a game client that has communicate with a server for almost every action it takes, the game is in Java (using LWJGL) and right now I will start making the server.

The base of the game is normally one client communicating with the server alone, but I will require later on for several clients to work together for some functionalities.

I've already read how authentication server should be sepparated and I intend on doing it. The problem is I am completely inexperienced in this kind of server-side programming, all I've ever programmed were JSF web applications.

I imagine I'll do socket connections for pretty much every game communication since HTML is very slow, but I still don't really know where to start on my server.

I would appreciate reading material or guidelines on where to start, what architecture should the game server have and maybe some suggestions on frameworks that could help me getting the client-server communication.

I've looked into JNAG but I have no experience with this kind of thing, so I can't really tell if it is a solid and good messaging layer.

Any help is appreciated... Thanks !

EDIT:

Just a little more information about the game. It is intended to be a very complex game with several functionalities, making some functionalities a "program" inside the program. It is not an usual game, like FPS or RPG but I intend on having a lot of users using these many different "programs" inside the game.

If I wasn't clear enough, I'd really appreciate people that have already developed games with java client/server architecture, how they communicated, any frameworks, apis, messaging systems, etc.

It is not a question of lack of knowledge of language, more a question for advice, so I don't end up creating something that works, but in the later stages will have to be rewriten for any kind of limiting reason. PS: sorry if my english is not perfect...

# Answer
Unfortunately, I'm not aware of any (good) online resources or books on this topic. And I don't know Java. However, seeing that there are no answers yet, I'll share a few tips from personal experience.

First off, you need a *fast and reliable* RPC, or at least message queue, mechanism. This is what shall be used for both client-server and server-server communication. I don't know if there are any ready-made solutions for Java. With .NET we'd always made our own custom one, as this mechanism is really important. Most commonly a lightweight binary message protocol over TCP is used, but other options may be better depending on the type of game. A turn-based strategy might be better with XML or SOAP, and a fast-paced shooter may warrant UDP.

The absolute minimum for messaging system is the ability to reliably invoke remote actions, *while guaranteeing their order*. A really helpful addition is support for request-answer pattern, where a remote action may return some kind of result to its initiator. This is not required, but can make your life much easier.

Once you have your messaging, think about partitioning your server. Most probably, a single server machine will not be enough to host the game for all players. You need to carefully consider what tasks can be independent of each other, and thus can be delegated to different servers. Authentication and login is the most obvious candidate for this partitioning. Among others are statistic and rating calculations, database communication (a server to act a specialized DB cache). The problem with MMO games, as opposed to web apps, is that they tend to be highly stateful, with lots of data needed for each player. And most operations require access to all, or almost all, of this data.

Even if you use a single server, you pretty much have to take advantage of multiple processors. Any MMO server is a highly concurrent program (our current server has about 30 concurrent threads). To have any hope of solving synchronization problems, you have to *isolate* different threads. Like different servers, they'll have their own data, and will communicate using some kind of message-passing interface. Possibly even the same RPC that you network uses, if it's fast enough.

Then you have your database. MMO players usually do a lot of things and generate a lot of chages to the game world, that have to be saved in the database. All the servers I worked with did not save these immediately - instead, changes were accumulated in memory and then saved in bulk every 5 minutes or so. This allows the game to progress more smoothly, at the cost of possible delay when writing takes place. This delay is the main reason to have a separate machine for database communication.

Usually MMO games use relational databases as their data backend, but I believe that NoSQL databases might be better. Usually, you have a bunch of data in your DB for each character, load it all when said character logs in, and very rarely, if ever, do any complex queries. This mode of operation seems to be the forte of NoSQL. That said, I've yet to use a NoSQL DB with an actual MMO server, so I might be wrong here.

Another database-related thing I want to warn you about is this. Many developers, especially early in production cycle, are tempted to store "game-design" data in a DB. I'm talking about things like items' and NPCs' parameters, abilities, and other stuff like that. Don't do that. These things are actually static data that does not change unless there's a server update; and this data is always needed by the server. Normally, you won't be doing any queries against it except a `SELECT * ...` at server startup. Thus, you don't actually need a database, and having these things in a DB has a lot of drawbacks. For one, you can't put a database under source control.

These are three main components for a MMO server architecture: network communication, logic partitioning and database access. All logic using these three is probably very game-dependent. I might have some more advice if you ask more specific questions and tell us more about the game.
> 12 votes

# Answer
You probably want to look into sockets-programming. Here's a basic introduction that will help you getting started.

Or just perform a Google search for *java sockets* and you'll find plenty of material.
> 0 votes

---
Tags: architecture, java, client-server
---


# Question
Title: x axis detection issues platformer starter kit
I've come across a problem with the collision detection code in the platformer starter kit for xna.It will send up the impassible flag on the x axis despite being nowhere near a wall in either direction on the x axis, could someone could tell me why this happens ?

Here is the collision method.

```
  /// <summary>
    /// Detects and resolves all collisions between the player and his neighboring
    /// tiles. When a collision is detected, the player is pushed away along one
    /// axis to prevent overlapping. There is some special logic for the Y axis to
    /// handle platforms which behave differently depending on direction of movement.
    /// </summary>
    private void HandleCollisions()
    {
        // Get the player's bounding rectangle and find neighboring tiles.
        Rectangle bounds = BoundingRectangle;
        int leftTile = (int)Math.Floor((float)bounds.Left / Tile.Width);
        int rightTile = (int)Math.Ceiling(((float)bounds.Right / Tile.Width)) - 1;
        int topTile = (int)Math.Floor((float)bounds.Top / Tile.Height);
        int bottomTile = (int)Math.Ceiling(((float)bounds.Bottom / Tile.Height)) - 1;

        // Reset flag to search for ground collision.
        isOnGround = false;

        // For each potentially colliding tile,
        for (int y = topTile; y <= bottomTile; ++y)
        {
            for (int x = leftTile; x <= rightTile; ++x)
            {
                // If this tile is collidable,
                TileCollision collision = Level.GetCollision(x, y);
                if (collision != TileCollision.Passable)
                {
                    // Determine collision depth (with direction) and magnitude.
                    Rectangle tileBounds = Level.GetBounds(x, y);
                    Vector2 depth = RectangleExtensions.GetIntersectionDepth(bounds, tileBounds);
                    if (depth != Vector2.Zero)
                    {
                        float absDepthX = Math.Abs(depth.X);
                        float absDepthY = Math.Abs(depth.Y);

                        // Resolve the collision along the shallow axis.
                        if (absDepthY < absDepthX || collision == TileCollision.Platform)
                        {
                            // If we crossed the top of a tile, we are on the ground.
                            if (previousBottom <= tileBounds.Top)
                                isOnGround = true;

                            // Ignore platforms, unless we are on the ground.
                            if (collision == TileCollision.Impassable || IsOnGround)
                            {
                                // Resolve the collision along the Y axis.
                                Position = new Vector2(Position.X, Position.Y + depth.Y);

                                // Perform further collisions with the new bounds.
                                bounds = BoundingRectangle;
                            }
                        }
                       //This is the section which deals with collision on the x-axis
                        else if (collision == TileCollision.Impassable) // Ignore platforms.
                        {
                            // Resolve the collision along the X axis.
                            Position = new Vector2(Position.X + depth.X, Position.Y);

                            // Perform further collisions with the new bounds.
                            bounds = BoundingRectangle;
                        }
                    }
                }
            }
        }

        // Save the new bounds bottom.
        previousBottom = bounds.Bottom;
    }

```

# Answer
> 0 votes
I have changed

```
 if (absDepthY < absDepthX || collision == TileCollision.Platform)

```

to

```
 if (absDepthY <= absDepthX || collision == TileCollision.Platform)

```

---
Tags: xna, c#, collision-detection
---


# Question
Title: What's a good way to check that a player has clicked on an object in a 3D game?
I'm programming a 3D game (using C++ and OpenGL), and I have a few 3D objects in the scene, we can say they are boxes for this example. I want to let the player click on those boxes to select them (ie. they might change color) with the typical restriction like if more than one box is located where the user clicked, only the one closest to the camera would get selected.

What would be the best way to do this? The fact that these objects go through several transforms before getting to window coordinates is what makes this a bit tricky.

One approach I thought about was that if the player clicks on the screen, I could normalize the x,y coordinates of mouse click and then transform the bounding box coordinates of the objects into clip-space so that I could compare then to the normalized mouse coordinates. I guess I could then do some sort of ray-box collision test to see if any objects lie as the path of the mouse click. I'm afraid I might be over complicating it. Any better methods out there?

# Answer
First off you need to convert your mouse coordinate to a ray (a position and direction vector combo). This process is called 'un-projection' and the way I do it is to take the mouse x/y coordinate, convert it into screen space (-1 to +1 in both axes) by adding half the dimensions of the screen and then dividing by the screen dimensions and then construct two points (x, y, z, w): p(xi, yi, 0, 1) p1(xi, yi, 1, 1)

where xi and yi are screen space coordinate points (-1 to +1 rather than 0 to 'pixel\_size\_of\_display') now multiply these by the **inverse** of the projection matrix and then divide the x,y,z components by the final 'w' component that you get after the matrix multiplication, i.e:

p.x = p.x / p.w; p.y = p.y / p.w; p.z = p.z / p.w;

You should now have two points: p and p1. Your ray will be formed from the point 'p' and the normalized vector between 'p' and 'p1'.

Finally, rotate the whole ray by the **inverse** of the **view** matrix and you have a ray that you can use to intersect with any primitive in the scene.

Test that it works by drawing the ray and constructing a new view of the scene from a different angle - this is pretty essential if you're testing visibility or intersection code anyway.

Next, Look up ray/sphere and ray/aabb intersection algorithms. I'd list ray/sphere here but this post is getting a bit long! Ray/Sphere intersections are quicker than ray/box intersections and generally I do a ray/sphere before final checking of a ray/box or ray/polygon mesh.
> 7 votes

# Answer
Usually, the mouse click co-ordinates are unprojected into world space, and then a ray intersection is performed. There are samples in the DirectX SDK but I wouldn't know where to find one for OGL.
> 5 votes

# Answer
Depends if you need this to be 100% accurate or not. If you want perfect accuracy then you have two answers already. However, if you want it fast and simple but less accurate you can project each object's bounding box on the screen and check if the mouse click is within it. Object's distance from the camera will be the third component of a projected vertex. You can perform the usual optimisations and this method is essentially free if you're already drawing some sort of selection box around objects your camera points at.
> 0 votes

---
Tags: c++, 3d, input
---


# Question
Title: A game community equivalent to IMDb Pro?
Is there one resource that tracks and lists games in development, similar to what IMDb Pro does for films in development? MobyGames is good for post-mortem, who did what, but what about a resource that gives you intel on what games are in production?

# Answer
While I doubt you will find anything that lists games that are in production stages. (The Industry usually remains a bit more tight-lipped about such things than the film industry does)

The rest of what you are looking for is handled relatively nicely by MobyGames

EDIT: Almost forgot, GiantBomb Also has the same sort of Data.
> 5 votes

---
Tags: business, publishing, intellectual-property
---


title: irrlicht for android

text:
# Question
Title: irrlicht for android
I was just wondering after noticing that moblox was.built with irrlicht if there is an android port of it? Or did the dev make his own port from scratch?

From my research I noticed a port project on github but it seems far from ready.-

# Answer
I'm a developper of Iopixel (formely Ellismarkov). For moblox, we use my own port of Irrlicht for Android for code base but we rewrite parts of Irrlicht for better performance and better iOS/Android compatibility:

* OpenGL ES Save/Load contexts
* Texture management
* many changes in driver API with two drivers
    + OpenGL 3.x for Desktop (used for tests)
    + OpenGL ES 2.x (Android, iOS)

I tried to backport modifications but it is now two distincts Pipelines. My port of Irrlicht is not complete but usable. Other developers have used it on market.

As i said to Irrlicht developers, it will be better to use NativeActivity for an official port (available with 2.3 devices).
> 5 votes

---
Tags: android, opengl-es
---


# Question
Title: How do I render only part of a texture to a point sprite in OpenGL ES for Android?
Using the libgdx framework, I've figured out how to render a texture to a point sprite. The problem is, it renders the entire texture to the point sprite, where I only want a small part of it (since it's an isometric tile image).

Here's a snippet from some demo code I wrote...

```
create()
{
    renderer = new ImmediateModeRenderer();

    tiles = Gdx.graphics.newTexture(
        Gdx.files.internal("data/tiles2.png"),
        TextureFilter.MipMap,
        TextureFilter.Linear,
        TextureWrap.ClampToEdge,
        TextureWrap.ClampToEdge);

    Gdx.gl.glClearColor(0.6f, 0.7f, 0.9f, 1);

    Gdx.gl.glEnable(GL10.GL_TEXTURE_2D);
    Gdx.gl.glEnable(GL11.GL_POINT_SPRITE_OES);

    Gdx.gl11.glTexEnvi(
        GL11.GL_POINT_SPRITE_OES,
        GL11.GL_COORD_REPLACE_OES,
        GL11.GL_TRUE);

    Gdx.gl10.glPointSize(s);

    tiles.bind();
}

render()
{
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

    renderer.begin(GL10.GL_POINTS);

    // render 3 point sprites at various 3d points
    renderer.vertex(-.1f, 0, -.1f);
    renderer.vertex(0, 0, 0);
    renderer.vertex(.1f, 0, .1f);

    // ... more vertices here if needed (one for each sprite) ...

    renderer.end();
}

```

# Answer
With OpenGL ES 1.x, i gess there is no solution. With OpenGL ES 2.x, you can use gl\_PointCoord in fragment shader to select a part of your texture.

A typical PointSprite Fragment shader:

```
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D tex0;

void main()
{
    gl_FragColor = texture2D(tex0, gl_PointCoord);
}

```

So, you can modify it for 16 square textures in one texture:

```
    gl_FragColor = texture2D(tex0, gl_PointCoord*0.25+displacement);

```

One last word, if you are developing for mobile devices, keep you fragment very short and don't use branch.
> 4 votes

---
Tags: opengl-es, textures
---


# Question
Title: How to balance a non-symmetric "extension" based game?
Most strategy games have fixed units and possible behaviours.

However, think of a game like Magic The Gathering : each card is a set of rules. Regularly, new sets of card types are created.

I remember that the firsts editions of the game have been said to be prohibited in official tournaments because the cards were often too powerful. Later extensions of the game provided more subtle effects/rules in cards and they managed to balance the game apparently effectively, even if there is thousands of different cards possible.

I'm working on a strategy game that is a bit in the same position : every units are provided by extensions and the game is thought to be extended for some years, at least. The effects variety of the units are very large even with some basic design limitations set to be sure it's manageable.

Each player choose a set of units to play with (defining their global strategy) before playing (like chooseing a themed deck of Magic cards). As it's a strategy game (you can think of Magic as a strategy game too in some POV), it's essentially skirmish based so the game have to be fair, even if the players don't choose the same units before starting to play.

**So, how do you proceed to balance this type of non-symmetric (strategy) game when you know it will always be extended?**

For the moment, I'm trying to apply those rules but I'm not sure it's right because I don't have enough design experience to know :

* each unit would provide one unique effect;
* each unit should have an opposite unit that have an opposite effect that would cancel each others;
* some limitations based on the gameplay;
* try to get a lot of beta tests before each extension release?

Looks like I'm in the most complex case?

# Answer
I'd throw away the first two of your bullet points. It might be a good idea to get some units designed, but isn't going to really help you for balancing.

Really what you're going to have to do is just play the game a lot and keep a analytical mind (or set of minds) looking at the problem at all times. Design is a very soft art, there is no iterative way of saying whether or not a game is balanced.

On the other hand, these are the kinds of things genetic algorithms are pretty good at weeding out. It won't replace having a large beta test and human feedback, but it might catch some edge cases you won't normally think of.

---

Speaking of Magic, here are som other things it does to help its balancing

* Cost based balancing. You may get some cards, but playing them or using their abilities requires a tweakable amount of mana
* The luck of the draw. You don't start with your perfect set of 7 cards, and you can have at max 4 of the same card in your deck (sometimes less depending on the card). Keeps people honest.
* General purpose counters. Even if you can't fight a unit or ability directly, you might be able to use your finite resources to prevent something from happening against you in the first place.
* Constantly updating ruleset. You might want to go ahead and implement some kind of extensible rule system to ban or limit certain units
> 11 votes

# Answer
Actually, M:tG has gone through ups and downs where some expansions were overpowered and some were underpowered. For example, most of the expansions around 3rd and 4th edition were fine but the Tempest expansion made a lot of earlier cards redundant. Maybe they're more careful now but they were still making significant balance 'mistakes' (or deliberate changes to encourage card purchases, if you're cynical) quite some way into the cycle.

The key thing here is to watch for obsolescence. If 2 objects have the same effect but one costs less than the other, the more expensive one is 'dominated' in game theory terms and thus worthless. To prevent domination of one object or strategy over another, each needs to have a situation where it is worthwhile. For example, one unit might be stronger than a second at the same price, but maybe the second has an extra ability, or more subtly, maybe the second can be used in conjunction with a third in a way that the first cannot.

Often people suggest some sort of 'rock/paper/scissors' approach here, but beware - although this does mean that no strategy dominates the others, it also means that no strategy has any particularly interesting features either. M:tG improved on RPS by having qualitatively different approaches for each of the 5 colours instead of the typical circular relationship of X beats Y, Y beats Z, Z beats X, etc.

So it's usually easy to ensure that none of your objects are completely dominated and worthless. But it doesn't necessarily mean that they are going to be judged as 'balanced', especially if the situations where they shine are quite limited. To do this, you probably need to ensure that you understand each of these potential situations. In M:tG, at least back when I played, you had a few standard types of strategy: direct damage, lots of small creatures/speed, a few large creatures, control/countermagic, etc. If you have a list of strategies like this, it is possible to see how each of your game objects might fit into one or more of them. eg. A medium-sized creature of average cost is not interesting for the two creature-based strategies above, but if it happened to use the same resources as the direct damage or countermagic approaches did, it would help round out that strategy.

Testing is a good idea. But player-driven beta tests should be your last resort of testing, not your main method. Firstly, you should be numerically analysing your game objects. You control the rules, so you can know exactly how many resources are available and therefore how quickly attacks can be launched, etc. You can work out maximum bounds and averages for these, compare them between strategies, and adjust objects to reduce massive disparities.

Secondly, from a very early stage you should have AI systems that are able to play many games against each other at a rapid speed and learn from their mistakes. You can start them with strategies the designers devised, or have them pick random ones, and evolve between them by seeing what works and what doesn't. Leave them grinding overnight, gather the statistics, and see what they're telling you. You'll probably find they converge on one or two strategies that always win, which gives you something to adjust.
> 6 votes

# Answer
It's going to be hard to balance things when the set of things you're balancing is open-ended. That's kind of the nature of the thing, and why we call it "balance". Adding one new unit can have a dramatic effect on other ones.

If your game is already multiplayer and socially-oriented, one possible solution is to crowd-source it: let players rate the relative strengths of different units, and then aggregate that to give each unit its score. Then, when building their troops, set a cap for total unit strength of all troops.

Or you could otherwise leave it up to the players to have control over this by letting them define game requirements that allow or disallow certain units.

You can't shirk all of the work onto the players. No one will bother to spend the time ranking things if the game is so unbalanced that it isn't fun to play. But you may be able to give them the ability to fine-tune.
> 3 votes

# Answer
Normally the term is "expansion" not "extension", FYI.

Best way to do this is to understand the cost curve for your game. If you know that all of the cards (or units, or whatever) in your game have the same cost/benefit ratio, and that it is balanced, then you can theoretically come up with as many other things as you want, and as long as they fall along the same cost curve they will (theoretically) be balanced with what has come before. This isn't how Magic does it, but most other CCGs I've worked on have done something like that. As a bonus, knowing the curve significantly reduces the required time it takes to playtest for balance in future sets, so it saves you development time/money.

Here's the down side: it's really hard to know the cost curve up front. Usually this is something best discovered after the release of the base set and maybe another set or two after that... at which point, you've already got a bunch of (unintentionally) unbalanced stuff. With computer games you can always release a patch that balances the old stuff later, provided you can handle the fallout from the player community (they tend to get uppity over any change to their beloved game, even if it's a positive change, unless they are carefully managed).

Of course, this won't get you ALL of the way there. Sometimes you make cards or other effects that are just so far out there that they can't really be directly compared or balanced with anything else, so you just have to go by feel with your instincts. But if there's only a few of those, you can spend the bulk of your time working on balancing those by hand, and leave the rest to the automated math.

There is one other problem you will run into eventually which is not balance related, and I think this (and not balance) is the main reason why Magic started using "Type 2" and other limited formats: eventually the card pool just gets too large to manage. Sure, players who have been there from the beginning who are incrementally adding one set at a time to their knowledge of the game, they can manage indefinitely... but for NEW players, coming into a new game and suddenly realizing you need to memorize a thousand cards is a massive barrier to entry, and you'll find that without some kind of restricted card pool to draw from, your game is effectively closed to new players entirely. So have a plan in advance for how you're going to handle that, irrespective of balance issues.

If you're interested in cost curve balance, I've written up a tutorial here: http://gamebalanceconcepts.wordpress.com/2010/07/21/level-3-transitive-mechanics-and-cost-curves/ (The rest of that blog is devoted to other topics on game balance that you might find interesting as well, but this particular post is directly relevant to CCGs.)
> 3 votes

# Answer
I have a strategy game in a similar situation: superhumans with a diverse array of powers. I'm not explicitly planning on expanding the character list, but it's an obvious way to expand on the game if it's well-received.

The term I've used to describe the game rules is "exception-based", which I'm pretty sure I've heard elsewhere in reference to M:tG. Powers mostly operate by acting as exceptions to a set of common rules rather than by introducing new rules. Where new rules are introduced, they are typically coupled directly to the powered character itself.

My game is neither finished nor released, yet. That said, here's what I've applied to balancing so far:

K.I.S.S. - Each power has just one effect, expressed as simply and concretely as possible. As the powers are themselves exceptions, I keep them free of exceptions and special cases. Where characters interact, it is always clear whether their powers interact or not and if so, which one dominates. I created a large spreadsheet comparing each power to each other to map out unclear interactions. Although this design work wasn't really 'balancing', keeping things clear let me identify different ways of grouping the powers to look for common issues and solutions.

Exceptions to what? - Every character is modeled on a base set of attributes and actions. Together the basic attributes and actions define what I call a 'pawn-level' character. When characters lose their powers, they still have this to fall back on. Also, given the limited focus of the powers, any given character is 90% pawn-level outside of their specialty. Regardless of how powerful a character is, each one has at least one pawn-level Achilles heel.

90% Dominance - The KISS and pawn-level aspects come together to create my 90% Dominance plan. Each power exception maps to one or more of the pawn-level Achilles heel aspects. Given the distribution of powers, this means that each character can dominate 90% of the other characters within their own area of expertise. In many cases this also limited the number of powers that needed to be balanced against each it: only a subset of all the powers would interact with it. Only a subset of *those* interactions didn't have a clearly dominant power. With around 100 unique powers, each one required direct balancing against around 5 others.

The game is designed about as far as it can be without a lot more playtesting. Playtesting is super important, especially for a game with as many combinations of things as mine (and yours from the sound of it) has. There is no degree of solo designing and balancing I can do that doesn't show up all sorts of inadequacies once people actually play it.

Leaving you with a link to a site I haven't seen linked-to around here yet. Balancing Multiplayer Games, Part 3: Fairness by David Sirlin. There's plenty of useful info there, but be warned that he is dogmatically committed to the idea of Playing To Win (might not seem like something worth warning about, but just keep it in mind).
> 0 votes

---
Tags: balance, strategy, extension, evolution
---