# Question
Title: Is Scaleform/Flash used in console games for non-UI, game elements?
I work for Konami as a Flash developer, and got sent some code for a puzzle mini-game from a new, yet-to-be-released Silent Hill game for PS3/Xbox 360. It was a windows executable, but it was made in Flash, and I saw some GFX (Scaleform) libraries in the source. I was very surprised by this, as I thought the extent of Flash's reach into console games was simply for UI. Granted, this was an essentially 2d, UI-centric puzzle minigame, but nonetheless, this was a gameplay useage of Flash/Scaleform in a "next-gen" console title.

My question is, how prevalent is this? I really want to get into console programming, and if this is something that appears elsewhere, maybe I can apply my Flash/Actionscript skills to getting a job working on console titles. Anyone have any thoughts or experiences with this?

Thanks!

# Answer
The question isn't "Is it used?" (it is, even stuff like menus and whatnot are non-trivial bits of AS code in many games), but "How much?". Unless you have some UI/UX experience it may be somewhat difficult to find a job as a dedicated Scaleform person. Even if a team needs to make a minigame like that, it might be a week or two of work at the most, no need to have a dedicated person just for that when their normal UI programmer can handle it just fine. Read up on UX topic, maybe take some classes in HCI, then you will probably be in a better position to leverage your skills.
> 3 votes

---
Tags: flash, software-engineering, console, actionscript
---


# Question
Title: How can I run native code (in a DLL) from UnrealScript in UT/UE1?
I'm seeking an example showing how to create a DLL that can be called from UnrealScript in Unreal Engine 1 or Unreal Tournament.

# Answer
Unfortunately Epic seems to have removed most of the documentation for non-UDK versions of the engine from public view.

Archive.org preserved some documentation from how to do it within UE2 (which is probably closer to UE1 than UE3), but I can't turn up anything official for UE1 anywhere.

UnrealWiki has a Legacy Native Coding page, but many of the links on it are now dead.

Writing native code in many versions of Unreal, as well as writing Native Classes in UE3, requires a source license.
> 1 votes

# Answer
According to the UDN, that function was added to Unreal Engine 3 on December 2009's version, and wasn't made available for older builds. Looks like you're out of luck.
> 0 votes

---
Tags: unreal
---


# Question
Title: What are the typical day-to-day tasks of an entry level games programmer?
What I would like to know is: What are the daily duties of a graduate programmer in the games industry workplace? Is it mostly coding, analysing, designing, or what?

Thank you.

P.S. I am in my second year of University at the moment and am working towards specialising in games programming, specifically gameplay, tools or UI programming.

# Answer
Based on my experience (in the United States, hired out of college onto a project that had just gotten out of prototyping and was a team of about 50, was then cancelled, then we went on to make two more games over the four years I was there with a total developer base of about 200),

* You'll probably spend about 50-70% of your time programming. In this time, I'm including the 'fun stuff' like getting to make a really clever feature, as well as the times you're staring at a memory dump for 8 hours straight trying to figure out what crashed. Maybe 25-50% of that is actual sit-down-at-your-keyboard-and-get-in-the-zone long-form programming.
* Another 15-25% in meetings and administrative tasks, like bug triage, meetings about bug triage, scheduling, high-level documentation for other programmers and producers, email, whole project/company status updates, and so on. This depends on how much autonomy you have - if you have no autonomy, then you'll get to spend more time programming, because you'll spend less time setting your own schedule. If you take more control of your schedule, you might get to work on more interesting things, but then you need to spend time doing this stuff.
* Another 15-25% helping designers/artists, attending creative meetings actually about the game, keeping up to date with game design documents, and so on.

As you go up in pay grade, the time you spend programming is probably going to *go down*. You're going to have to make more administrative decisions, be called upon to help less experienced people on the team, and spend more time doing documentation and code / architecture review. On the plus side, the *quality* of the programming will probably go up; you'll get to work on more interesting features (and more frustrating bugs).

Whether the time you spend in helping designers and artists goes up, down, or doesn't really change, depends on the area you want to work in. If you want to work on UI, tools, and gameplay, expect that time to increase to upwards of 50% as you gain more experience. You'll be sitting down with senior designers to plan and demo new tools and see how they use the existing ones. Unfortunately, this time also comes out of your programming schedule.
> 103 votes

# Answer
Other than the high level discussion points that Joe brought up, there are a few other things you should be aware of.

* You'll typically be using some kind of bug tracking or task tracking tool that your lead will be using to assign you tasks. Sometimes they're the same (i.e. FogBugz). Sometimes your bug list will be through a publisher and your task list is on an internal wiki. You don't just sit down and start doing *whatever*, your tasks are going to be directed.
* Sometimes you'll be asked to estimate your tasks. This is implicit when using systems like FogBugz. Part of your responsibilities will/should/can be to break down a higher level feature into parts that you can use to properly estimate how long it would take for the purposes of seeing how on track you are to finishing milestones, etc.
* A lot of studios have moved to more agile/scrumm style methodologies. Updating burn down charts (i.e. saying you spent X hours on task Y and expect to be done in Z time) is fairly common. Daily standup meetings are probably a little more common. Either way you'll be providing some visibility as to what you're working on.
* You will be using version/source control. The bigger the studio, the more likely they are to use Perforce. You should be aware of the basics of it (checking out files, committing files, being able to resolve your local merge conflicts). You might also be called upon to understand branching and merging branches. Some studios work where all developers get their local branch and you can check in as much as you want and merging when your branch. Other studios (ours) just has a "don't break main" policy, so you have to make sure you update, do a quick test to make sure you didn't break anything, *then* check in. Some studios don't have that policy and people break shit all the time and it's super annoying and you have to learn how to work around that.
* Code reviews are fairly common. Sometimes they're code-department-wide. Our team uses a code buddy approach where it's more one-on-one for reviews on checkins. Either way you should expect to be asked to provide critical analysis of other peoples' code.
> 26 votes

# Answer
I just finished a 4-month internship at working on a very large game. The project was very late stage when I got there, so most of what I did was bug fixing. That probably would have been a decent portion of my time anyways ... using my experience with coding to fix bugs instead of my inexperience with game development to design or develop features.

A lot of what I did was also sort of IT related. Developing internal tools was a big thing -- some to directly help with game dev, some to automate things that were manually done before. And of course, bug fixes for other tools, including Microsoft's Games for Windows Live installer.

Playtesting was another decently large part, and I also was responsible for making some of the builds that got pushed to playtesters. Bugs in the game world are pretty hard to track down and require a lot of work to figure out the cause.

I did not specialize in games or graphics, so presumably any job you did would be more related to your expertise than this. But I hope it gives you an idea.
> 12 votes

# Answer
My final year project is on HTML5 canvas element. I am presently working on an internship for the past two month where I have to port an existing flash game to HMTL5 canvas.

From what I can tell you about my life here, well its tough. The requirements team have very specific demands. What mouse click is supposed to be doing what, how the effects should apply on the game. No matter how tough it gets for the programmer even for the silliest request, it has to be addressed, and after all the requirements are implemented. The bug reporting start. God is that annoying. It really begins to get on your nerves. An offset of 1px for a click can make your life hell, trust me! It can mean new structuring of your entire positioning and interaction space for that you could accommodate to their whims and fancies.

But its also fun! :) The sheer joy of writing that one really smart function, interacting with the community of how you could recreate a function that flash does automatically. All of it. Its times like that you don't regret having that job.. Makes it feel like the best job in the world, and to my nephews the coolest in the world.

So a regular day in my job would be coming over to work implementing a function. Researching and searching for that one function that makes a feature possible. Getting the hell tested out of that code. Fixing that code. Discussing with the community on how that code could be optimized. Then writing what I feel is the best program on earth :P

At the end of the day, mostly am satisfied with what I have accomplished, sometimes still tensed about where I could have done better and what I could have done different and perfecting that. I just in the beginner phase and so I may not be able to advice you on how it gets in the future but as of now.. I do think I have to coolest job :)
> 4 votes

---
Tags: game-industry
---


# Question
Title: What is the purpose of a Direct3D vertex layout?
This tutorial (msdn) gives a description of a vertex layout.

This is an example of a input layout:

```
D3D11_INPUT_ELEMENT_DESC layout[] =
{
    { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
UINT numElements = ARRAYSIZE(layout);

```

It seems to me that it would be easier to bypass this and simply consider data sent to the vertex shader/pixel shader as a block of floats and allow the vertex or pixel shader to interpret it as it wants.

**My question is this:**

* What is the purpose of a vertex layout?
* Is a vertex layout optional in Direct3D 11?

# Answer
> 4 votes
The example reasons why a vertex layout is needed:

> We now have a structure that represents our vertex. **That takes care of storing vertex information in system memory in our application**. However, when we feed the GPU the vertex buffer containing our vertices, we are just feeding it a chunk of memory. The **GPU must also know about the vertex layout in order to extract correct attributes out from the buffer.** To accomplish this requires the use of an input layout.

Take into account that the vertex shader is just a step in the rendering pipeline, so is the responsibility of the GPU to issue the correct data as parameters in the shader. Yes, you could just define a "data size" and receive an array with that size in the shader and then process it, but that would require more code in the shader, and also could disallow GPU internal optimizations.

I haven't work with DX11, but in OpenGl, DX9 and other graphical APIs, you must define some kind of vertex layout

# Answer
> 3 votes
'A block of floats' wouldn't quite work, as

1) GPUs generally deal with vectors, usually 4-element vectors - and a vertex declaration defines how the floats are grouped into vectors (3-element position, 2-element UV set, etc)

2) Non-float data formats can be used, such as a 32-bit RGBA (which gets expanded into a vector of floats). The GPU needs to know about this

---
Tags: directx, directx11, vertex
---


# Question
Title: Which tool combination are advisable for a (MMO)RPG, and which aren't?
Which technologies would you use if you were to write a (MMO)RPG, and why ?

Would that be Java + AJAX + HTML5 + Linux

or ASP.NET + MVC + JQuery + Windows

or PHP + Linux + MySQL

or ColdFusion + Windows + MySQL

or ASP.NET + MVC with mono on Linux

or Perl + Linux + cgi/fastcgi

or C++ + Linux + lighthttp module

or Desktop client-server application

or WPF

or anything else ?

Would you rather use HTML5 or Flash or Silverlight ?

I would argue towards Linux + mono/ASP.NET-MVC + FireBird + Flash/Silverlight

The reason: Linux because it is cheap and customizable, which is a definitive cost advantage if you need to run many servers.

mono/ASP.NET-MVC because one can easily develop quite complicated things in it quite fast, with a defintive speed advantage over PHP.

FireBird because it has more capabilities than MySQL and a better license plus it's free and nearly as fast as MySQL, while PostGre would be too slow in comparison to MySQL/Firebird.

I would rather dispose of HTML/HTML5, because it's very browser specific, and replace the UI with Flash.

Flash because it is more popular than Silverlight and JavaApplets, although Silverlight would probably be better from a .NET developer's point of view.

I'm eager to learn whether somebody has (or thinks he has) a better combination

# Answer
This question isn't really answerable since the ultimate answer depends on so many different variables that are specific to your needs. How many total users are you expecting to support simultaneously, how many users per server are you expecting, how much bandwidth per user do you want, what kind of development environment are your developers familiar with, what kind of response time to certain operations is acceptable to end users, how many different server types are you going to be running.

And that's just for the server. What is your client going to be running? Do you expect a standalone app or do you want it to be a web game? Do you need 3d graphics?

Don't underestimate how much time you can save by throwing money at a problem (in certain situations). Sometimes paid solutions aren't as powerful and flexible as open source ones. It really depends.
> 4 votes

# Answer
The first technology I'd use if I was anywhere near an MMO project would be the technology that went into the pair of trainers on my feet. As I'd be running away from it as fast as I could!

Seriously, if you don't have the resources, finances, talent, and experience of Blizzard, the chance of success are incredibly low. Even if you tackle all the technical obstacles with some level of competence and create a shippable game.

The fact that you're asking this question hints at another programmer thinking 'OK, I've made a Breakout clone, I've made a 2D platformer... now it's time to try an MMO'...
> 1 votes

---
Tags: tools, platform, development-speed
---


title: Is there a leveling guide somewhere?

text:
# Question
Title: Is there a leveling guide somewhere?
I am designing a simple game and am looking for some help designing different level/ranks. For instance, starting from "Novice" to "Intermediate" to "Master". Is there are repository somewhere that records these from various games? For instance, from World of Warcraft, Diablo etc. Any suggestions?

# Answer
> 5 votes
I think what makes a good game is the unique idea and design, so no real "rule" should be copied.

But as @DrDeth writes, there are plenty Wikis and sites dedicated to that. Try to ask more detailed/specific questions in this forum, as we will probarbly be better at solving problems than supplying complete solutions. (hench we all need to to a bit of work ourselfs).

To give you something usefull or idea to something I have the following suggestion for a very primitive level guide (feel free to copy my idea or build upon it, thats why I write it here):

**Experience/levels**

First I would decide an offset-value. Lets call this "offset". Secondly I would figure out some "double up" kinda value. We could call this "factor".

**Here are some sample values to show what I think:**

* offset = 1000
* factor = 1.37

My algoritme would be: level = (previous level * factor) + offset

**This is how the table would look from those numbers (Level 0 starts at 0 exp):**

1. Level (1000 exp) (Level 0=(0 * 1.37) + offset value which is 1000)
2. Level (2370 exp) (level 1 * 1.37 + 1000)
3. Level (4247 exp) (level 2 * 1.37 + 1000)
4. Level (6818 exp) (level 3 * 1.37 + 1000)
5. Level (10341 exp) (level 4 * 1.37 + 1000)
6. Level (15167 exp) (level 5 * 1.37 + 1000)
7. Level (21779 exp) (level 6 * 1.37 + 1000)
8. Level (30837 exp) (level 7 * 1.37 + 1000)

Thats just a sample with sample values, my idea here is that you can replace both offset and factor and use this with any weapon, skill, ability, scroll, shield or monsters or what ever... very easy to calculate and scale for you.

And very easy to put into tables for quick lookup.

Do you find this usefull or? please mark or comment any questions.

# Answer
> 3 votes
For each of the games you've mentioned, there are extensive wikis and sites dedicated to them where you can find info on the rankings, levels and requirements.

However, levels and rankings are usually tied into the base system used in the game and so when designing your own you may find it more helpful to look at role playing systems as a whole.

Here is a good resource to start with: Open Game Systems

# Answer
> 1 votes
Levels give players a sense of achievement that comes in a nicely wrapped box (as opposed to level-less game systems). If you want to include levels in your game design, there are some considerations.

1. **Levels are an achievement**
You should get a fair amount at each level, and every few levels you should be able to unlock new abilities and powers. DnD 4E (this isn't the real one, but I couldn't find the real one)
2. **Levels offer a quick gauge of power and difficulty**
A player with a level 3 character knows he's not going to take down a level 20 monster. This also helps group quest difficulty and tailor suitable equipment for the character.

That being said, a guide to making your own table should consider how long a character should take at a given level to progress, and set the XP values of monsters at that level. Again, DnD 4e has a pretty good example.

The tables themselves often feel a bit arbitrary once you write them down. The important thing is that you tailor the appropriate monsters for the character at that level.

---
Tags: game-design, game-mechanics, level-design
---


title: Problem with arcball

text:
# Question
Title: Problem with arcball
I making graphics viewer, and I want to use "arcball" to manipulate object. I using OpenGL + CML ( for math ). My arcball don't want work, it is skewing not rotating :/ And I don't know why, I use formulas from http://www.csi.ucd.ie/staff/hcarr/home/teaching/comp4004/slides/05\_arcball.pdf .

```
My code:
cml::vector3f u,v;

u[0] = 2.0 - prevX/(0.5f * width());
u[1] = 2.0 - prevY/(0.5f * height());
u[2] = sqrt(u[0]*u[0] + u[1]*u[1]);

v[0] = 2.0 - currentX/(0.5f * width());
v[1] = 2.0 - currentY/(0.5f * height());
v[2] = sqrt(v[0]*v[0] * v[1]*v[1]);

cml::quaternionf qu,qv,q;

qu[0] = 0;
qu[1] = u[0];
qu[2] = u[1];
qu[3] = u[2];

qv[0] = 0;
qv[1] = v[0];
qv[2] = v[1];
qv[3] = v[2];

q = qv * ( qu.inverse());

cml::matrix44f matrix;

matrix.identity();

cml::matrix_rotation_quaternion(matrix,q);

//Drawing

glLoadIdentity();
qlTranslate(0,0,-zoom);
qlMultMatrixf(matrix.data());

```

# Answer
> 0 votes
I will assume you are manipulating the camera, but the explanation applies to objects as well.

The reason it is not rotating on the sphere properly is because you are not assuming that there is a `fixed yaw axis` (which is usually Y). So what ends up happening that with each frame the new yaw axis skews the next frame's calculation a little bit. Over a few frames the camera goes through an unintended motion, which I believe is what is happening in your case.

For proper/predictable arcball rotation, such as the one seen in *Autodesk Maya/Max*, you will have to assume that your `up vector` is fixed for the calculation of the `direction` and `right vectors` (in a 3x3 rotation matrix each column represents the 3 `orthonormal vectors`, and is entirely dependant on how you have setup your co-ordinate system. Usually in OpenGL it is Right, Up, Direction) and then calculate a new `up vector` for the camera to work properly. Every frame, you assume your up vector is unchanging and stays fixed at (for example) **\[0,1,0\]**.

The above poses a problem when looking straight down or straight up, in which case your assumed Up is now parallel with your Director and will make it impossible for you to calculate the orthonormal vectors properly. That is a special case and you will have to get around it. You can restrict the rotation of the camera beyond that point, or you can skip that particular rotation.

---
Tags: opengl, mathematics
---


# Question
Title: What do you need to know in C++ before starting to program with DirectX
I was wondering what do you need to know in C++ before starting to program with DirectX?

I have only been programming in C++ (more for 2D games using SDL and learning the basics) for just over a year, I was wondering what kind of concepts and methods should someone be knowledgeable with or at least have seen before, before attempting to learn how to use Direct X?

# Answer
> 5 votes
Direct3D itself does not require you to know C++. You'll need to understand function pointers and structure layouts from C.

However, to design a good architecture for even a simple game, you'll better be good in C++.

# Answer
> 2 votes
http://msdn.microsoft.com/en-us/library/ee416804(v=VS.85).aspx

I'm assuming if you can follow the tutorials then you know enough.

Link blatantly stolen from an answer in this question: What are the current books for DirectX (w/ focus on 3D)?

# Answer
> -1 votes
You don't need any C++ for DirectX programming, so just use however much or little C++ you're comfortable with.

---
Tags: c++, 3d, directx, graphics-programming
---


# Question
Title: How to create complex Physics scenes with the Havok Content Tools
For example, Havok Content Tools allows you to define physic bodies, properties, connections, etc in Maya, 3d Studio Max, etc.

For creating full scenes/levels is this really the correct approach or is there some better way to do things.

# Answer
> 1 votes
Are you using Havok Content Tools to import your meshes as well or are you importing obj counterparts? How are you connecting them together in your engine? What engine are you using?

In complex scenes, you will find that many objects in the scene are repeating. If you export through `fbx` for example, it converts all instances into objects. And AFAIK the content tools ignore instances when exporting. If your engine supports mesh instancing (which it should) then this is a big performance loss as now you will be creating several objects (for example a bunch of crates) in your engine as separate mesh objects instead of taking advantage of mesh instancing. This applies to movable and fixed objects.

One approach is to model all the objects separately, which will be your meshes and create the physics hulls for them. Although the Havok Content Tools does a decent job of creating that hull for you, you are better of making your own as this will give you more control (this is assuming your object is complex and not a simple shape such as a box or a sphere). Now you have a relatively higher poly graphics mesh, with a lower poly convex hull (both are meshes at this point). The hull is the one that is made into a rigid body while the mesh is not (inside Maya/Max). In your engine, you simply attach the two using a wrapper so that the hkpRigidBody now moves the graphical counterpart.

I am using the Ogre3D graphics engine for example. I use the same technique as above. I can have several instances of the same mesh and it results in a performance boost.

To visualize the placement of the objects in the scene, I place the actual objects (which are in a separate layer) with dummy locators.The locators are then used to grab the transformations that are applied to the object when I import the object separately and place it in the scene within the engine (the objects on the separate layer are ignored when exporting).

There are of course several way to go about it, this is only one of them.

---
Tags: physics, assets, havok
---


title: Line triangle intersection - last bits

text:
# Question
Title: Line triangle intersection - last bits
I'm doing line-triangle intersection. I have found the intersection point (vector) on the plane. All I need to do now is work out whether the point is *inside* the triangle it collided with (not the plane the tri is on)

The line is represented by two 3D vectors, the triangle 3 points and the collision point another vector. If it's any help, I've been reading through this article. I've actually managed to do most of it. I'm just stuck on the last bit which is working out whether the point is inside the triangle.

I've read stuff about summing the angles of 3 internal triangles, but that's extraordinarily slow - can someone help me out?

Thanks,

James

# Answer
> 3 votes
You might be able to use this: `P1, P2, P3` are points on the plane. `R1 and R2` represent a near and far point on the ray. `Vector3f` is a fancy vector that I've got from vmml from equalizer. I use this when I use gluUnproject().

```
/*! @param PIP Point-in-Plane */
bool Channel::testRayThruTriangle( Vector3f P1, Vector3f P2, Vector3f P3, Vector3f R1, Vector3f R2, Vector3f& PIP)
{
    Vector3f Normal, IntersectPos;

    // Find Triangle Normal
    Normal.cross( P2 - P1, P3 - P1 );
    Normal.normalize(); // not really needed?  Vector3f does this with cross.

    // Find distance from LP1 and LP2 to the plane defined by the triangle
    float Dist1 = (R1-P1).dot( Normal );
    float Dist2 = (R2-P1).dot( Normal );

    if ( (Dist1 * Dist2) >= 0.0f) {
        //SFLog(@"no cross");
        return false;
    } // line doesn't cross the triangle.

    if ( Dist1 == Dist2) {
        //SFLog(@"parallel");
        return false;
    } // line and plane are parallel

    // Find point on the line that intersects with the plane
    IntersectPos = R1 + (R2-R1) * ( -Dist1/(Dist2-Dist1) );

    // Find if the interesection point lies inside the triangle by testing it against all edges
    Vector3f vTest;

    vTest = Normal.cross( P2-P1 );
    if ( vTest.dot( IntersectPos-P1) < 0.0f ) {
        //SFLog(@"no intersect P2-P1");
        return false;
    }

    vTest = Normal.cross( P3-P2 );
    if ( vTest.dot( IntersectPos-P2) < 0.0f ) {
        //SFLog(@"no intersect P3-P2");
        return false;
    }

    vTest = Normal.cross( P1-P3 );
    if ( vTest.dot( IntersectPos-P1) < 0.0f ) {
        //SFLog(@"no intersect P1-P3");
        return false;
    }

    NSLog(@"Intersects at ( %f, %f )", IntersectPos.x(), IntersectPos.y());

    PIP = IntersectPos;

    return true;
}

```

# Answer
> 3 votes
http://www.graphics.cornell.edu/pubs/1997/MT97.pdf

This paper provides (apparently) the most computationally efficient means of calculating ray-triangle intersection. Not sure if it directly addresses the question but thought it may be useful here.

Old link to Webarchive: https://web.archive.org/web/20170517125238/http://www.cs.virginia.edu:80/~gfx/courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf

# Answer
> 1 votes
You can probably use the same method as the generic point/shape interior algorithm I talk a little bit about here: In Cocos2D, how do I check for collisions against an arbitrary user-drawn shape?

# Answer
> 1 votes
3 triangle points: P1, P2, P3. 2 line points L1, L2.

The intersection points T. T lies on the line, so there's a real value c so that T = L1 + c * (L2 - L1)

Also, T lies on the plane, so there're 2 real values a and b so that

T = P1 + a * ( P2 - P1 ) + b * ( P3 - P2 )

Now you've got the system of 3 linear equations with 3 variables:

L1.x + c * (L2.x - L1.x) = P1.x + a * ( P2.x - P1.x ) + b * ( P3.x - P2.x )

L1.y + c * (L2.y - L1.y) = P1.y + a * ( P2.y - P1.y ) + b * ( P3.y - P2.y )

L1.z + c * (L2.z - L1.z) = P1.z + a * ( P2.z - P1.z ) + b * ( P3.z - P2.z )

You solve the system (e.g. read wikipedia for "Inversion of 3×3 matrices", if the matrix can't be inverted, the plane and line doesn't intersect, or the line belongs to the plane, or the triangle is 0-area, or L1=L2 ).

If it has the only solution, you find it, and here's your final check that point is inside the triangle: bool isInTriangle = a \>= 0 && b \>= 0 && (a+b)\<=1;

---
Tags: vector, linear-algebra
---


# Question
Title: What are the makings of a good Character
What properties make the main character of a game such that players can easily identify with it? Can the same set properties be used when designing the NPC characters players interact with, or should a different set of properties be considered?

# Answer
Some random things I remember reading and have worked for me:

* a character should be recognisable from just their silhouette.
* Each character in a group should have their own colour scheme.
* Simply-drawn characters are more easy for the player to relate to, because they are less specifically one person, and more of a vessel for the player/reader/viewer to project themselves onto.
* For the same reason as above, characters shouldn't say much - that's the Gordon Freeman effect. Most game characters don't talk, and when they do talk, on spin-off cartoons etc (e.g. Sonic), it's annoying.
* In games you can express a lot about the character from the way they move and interact with the environment.
* For unique costumes, raid the history books for crazy armour, uniforms, hats and dresses, and adapt to fit your setting.
* Don't use anything that is too reminiscent of another famous character, e.g. blue spiky hair, red overalls etc
> 14 votes

# Answer
I'd like to second what Olafur and Iain said, but to add a comment to Iain's fourth point.

Characters can speak, and they can speak a lot, as long as you make sure that their dialouge builds the story, and that story is engaging. A good example of this in a 'male-oriented' game that still really appeals to me as a female, would be Red Dead Redemption. Totally opposite most of my points! But his story is very strong and emotionally engaging, so I still want to get behind him and support him, even if his experience is very differnt from my own.

Beyond that, I'd like to add one of the things I read in the book "Gender Inclusive Game Design" that always sticks with me:

Have a female option for the main character!

Having the option to play as male or female will already help you get your character to appeal to a wider audience, and help the female side of your audience empathize with the story.

If you can only have one character option (as is necessary in some games), try to see if you can make it female instead of male. Given the option, most women prefer to play as women, and a lot of men to prefer to play as women too! (Gives them something nice to look at. :) )

If your concept has absolutely no way it can have women in the character base, then try to make your characters a little more base appealing. Some examples would be: The characters from Team Fortress 2 (Strong silhouhettes, bright colours, good humour and many options), and Link from Legend of Zelda (Androgynous enough that let's be honest, he can be a girl if you pretend hard enough).
> 11 votes

# Answer
You should always have an element that people can relate with. Take for example Fry from Futurama. His main purpose is to be the connection from the 20th century to the 30th century, and without him the viewer would not make much sense from the show.

This same mentality should be used with game characters, since they often live in environments that do not exist in reality.

Another example is with Mario. He is italian, a plumber and wears human like clothing. He is the only human element you see in the Super Mario world, and therefor we connect with him very well.
> 9 votes

# Answer
Gamasutra. "It Builds Character: Character Development Techniques in Games" by Rafael Chandler Inspiring technique to create interesting Game Characters using Tarot Deck.

"Creating Emotion in Games: The Craft and Art of Emotioneering" By David Freeman (ISBN : 1-5927-3007-8):

Chapter 2.1. Emotioneering Techniques Category #1: NPC Interesting Techniques
Chapter 2.2. Emotioneering Techniques Category #2: NPC Deepening Techniques

Freeman describes "Character Diamond" technique:

> Character Diamond - The group of Traits (personality aspects) — usually four, but sometimes three or five—that determine how a major character sees the world, thinks, speaks, and acts. Having a Character Diamond of three to five Traits makes characters dimensional. Character Diamonds make characters interesting, but not deep—unless some of the character's Traits are also Deepening Techniques. Major NPCs, as well as the character played by the gamer, can have Character Diamonds.

Example of Character Diamond - Han Solo:

1. Swashbuckling
2. Brave
3. Have a dry wit
4. A bit arrogant

Example for Gandolf:

1. Magical
2. Mysterious
3. Good
4. Wise

I found this method very simple and useful.
> 7 votes

# Answer
A physical property of characters that can identify what type of personality and interaction they have is their head:body ratio. Typically heroes are 9-10 heads tall, regular folk are 7-8 heads tall and childish, cartoony characters are 2-3 heads tall. This is a valuable property to include when designing your characters and may help with figuring out their personal characteristics.
> 1 votes

---
Tags: game-design, character
---


# Question
Title: Implementing 2D CSG (for collision shapes)?
Are there any simple (or well documented) algorithms for basic CSG operations on 2D polygons?

I'm looking for a way to 'add' a number of overlapping 2D collision shapes. These may be convex or concave, but will be closed shapes, defined as a set of line segments, with no self-intersections.

The use of this would be to construct a clean set of collision edges, for use with a 2D physics engine, from a scene consisting of many arbitrarily placed (and frequently overlapping) objects, each with their own collision shape.

To begin with, I only need to 'add' shapes, but the ability to 'subtract', to create holes, may also be useful.

# Answer
Is this for level designer, or for the engine?

For the level designer - you'll need that code to e.g. combine static objects. Research vector graphic APIs for the solution, the task sounds pretty common for SVG, PostScript, WMF, etc.. First try using CombineRgn Win32 API :-)

For the game engine - I'd suggest you don't do what you want.. You'll spend enormous amount of CPU combining your objects together. You'll spend enormous count of branch mispredictions checking the border conditions, testing whether 2 segments intersect or not, etc.. And, this process must be repeated every frame for the visible portion of your map.

Just do bounding box checks, then collide individual objects. If your object shapes are too complex - simplify them while exporting data into the engine, and use different shapes for collision and drawing.

**Update**: see my C# GDI+ code that does what you want. You can easily write the same in C++: the GraphicsPath class is merely a thin wrapper over the corresponding gdiplus.dll functions.

```
static class GraphicsPathExt
{
    [DllImport( @"gdiplus.dll" )]
    static extern int GdipWindingModeOutline( HandleRef path, IntPtr matrix, float flatness );

    static HandleRef getPathHandle( GraphicsPath p )
    {
        return new HandleRef( p, (IntPtr)p.GetType().GetField( "nativePath", BindingFlags.NonPublic | BindingFlags.Instance ).GetValue( p ) );
    }

    public static void FlattenPath( this GraphicsPath p )
    {
        HandleRef h = getPathHandle( p );
        int status = GdipWindingModeOutline( h, IntPtr.Zero, 0.25F );
        // TODO: see http://msdn.microsoft.com/en-us/library/ms534175(VS.85).aspx and throw a correct exception.
        if( 0 != status )
            throw new ApplicationException( "GDI+ error " + status.ToString() );
    }
}

class Program
{

    static void Main( string[] args )
    {
        PointF[] fig1 =
        {
            new PointF(-50, 0),
            new PointF(0, 50),
            new PointF(50, 0),
        };

        PointF[] fig2 =
        {
            new PointF(-50, 25),
            new PointF(50, 25),
            new PointF(0, -25),
        };

        GraphicsPath path1 = new GraphicsPath();
        path1.AddLines( fig1 );
        path1.CloseAllFigures();

        GraphicsPath path2 = new GraphicsPath();
        path2.AddLines( fig2 );
        path2.CloseAllFigures();

        GraphicsPath combined = new GraphicsPath();
        combined.AddPath( path1, true );
        combined.AddPath( path2, true );
        combined.FlattenPath();

        foreach (var p in combined.PathPoints)
        {
            Console.WriteLine( "<{0}, {1}>", p.X, p.Y );
        }
    }
}

```
> 3 votes

# Answer
I wrote a little proof of concept that used CSG to make scorched earth/worms style game play. I implemented it with gluTessellate. I then mapped the tessellated triangles onto Box2D polygons. I could both add and subtract *dirt* from the simulation as well as make and fill holes.

The largest problem I found using gluTessallate is that it has no problem returning degenerate triangles. I had to filter those out before moving the tessellated triangles into the physics engine.

One of the nice things about gluTessallate is that it is possible determine adjacency from the callback information. I never took it further but in theory you could use the adjacency and SCC to accurately detect islanding.
> 2 votes

---
Tags: 2d, collision-detection, mathematics, geometry, csg
---


# Question
Title: Is there an efficient, available online, algorithm for converting a matrix of squares into a triangle strip?
Imagine having a 4x4 square, with 16 smaller squares inside of it, with associated data on what the squares should look like (ie., opacity, colour, etc...).

Is there an existing, efficient, algorithm, for converting this set of squares into an open-gl compatible triangle strip?

# Answer
> 6 votes
Firstly, I'd suggest that if your primitives (the squares) have different appearances, especially opacity, then tri-stripping may not make sense (i.e. the vertices aren't really shared).

Secondly, these days you're probably better off with indexed geometry, rather than an actual tri-strip, so consider going that route.

Finally, if you really want to generate a tri-strip, have a look at nvtristrip, which is available from nVidia:

NVTriStrip

(indeed, it will also generate efficient indexed lists, so look at it regardless).

# Answer
> 1 votes
This is a trivial problem if you are able/willing to link strips with degenerate triangles - as most stripping algorithms do anyway.

Each Nx1 row of squares is a very simple triangle strip. For each row, you want to start a new strip.

Simply duplicate the last vertex of strip 1 and the first vertex of strip 2, and that will create a degenerate polygon linking the two strips

(However, if as your question indicates, the vertices are not shared between the squares - different colours/UVs etc, then you don't want to use strips)

---
Tags: opengl, algorithm
---


title: What makes a good educational game?

text:
# Question
Title: What makes a good educational game?
I'm currently creating a game framework/engine for educational games. My hope is that this can be used in elementary schools. It is of course extremely important that the games are both fun and educational.

Any ideas what should be in my initial requirement specification?

What makes a good educational game?

Which platforms should I target?

# Answer
> 9 votes
Avast there fellow Norwegian!

I just have a few ideas:

* Pr. user performance reports. Can be used by teachers to evauluate who needs more follow up.
* Easily customizable/ localizable textual content.
* Good Teacher/student communication.
* Multiplayer. Where the whole class can participate in engaging tasks. This will make it easier for timid children to show off their skills to the teacher. Some ideas for multiplayer games: Quiz, collaborative construction with physics simulation, collaborative puzzle solving.
* Don't underestimate small children's requirements for quality gameplay. Remember they all get their nintendo DS at a small age.

When it comes to target, I am guessing PC would be a good target, since most school children ( at least in Norway, where you're located) have their own.

Best of luck to you!

# Answer
> 3 votes
I did a lot of research into educational games during my first year of university.

The important qualities:

* Engage the senses well (especially colour and sound)
* A lot of breaks (a child's attention span is lower than an adult's)
* Characters they can relate to (perhaps including a permanent "guide" on the screen)
* Game world immersion (and control over too much immersion - keep the education on track)

I was asked to design an RPG that aided children of age 5-6 in their reading exercises. There may be some starting material in it to help you. "Learn to Read with Tremendous Speed!"

Remember to keep the "image" of the game as fun as possible in terms of appearance and direction, as this may become lost in the serious business of marketing of the game itself.

# Answer
> 2 votes
I'll address the third question. I think the iPad has huge potential of educational games:

* Accessible : The touch UI is intuitive and simple enough that most children immediately 'get it'.
* Safe : The Apple walled garden delivers an environment that most parents are comfortable with.
* Mobile : It is pretty clear that mobile educational devices have already enjoyed a great deal of success (Leapster etc...).
* Nascent : There is still a lot of room on the iPad app store for educational games.
* Decent Hardware : The iPad hardware is more than adequate for slick, well crafted educational games.

---
Tags: software-engineering, cross-platform, serious-games, educational-games
---


title: Size of the world and clipping area

text:
# Question
Title: Size of the world and clipping area
I have a 32x32x32 cube (I say 32 because that's the size of the texture).

I can make the vertices of this cube go from (0,0,0) to (32,32,32). This mean the camera will be moving += 1 when ever a key on the keyboard is pressed. This also mean that the far clipping area will be pretty big when calling the CreatePerspectiveFieldOfView function.

Since everyhing is in double, I can also have the vertices go from (0,0,0) to (1,1,1). The camera will be moving += (1/32) and the far clipping area will be much smaller.

Is there a standard into this?
I've read that if the far clipping area is too big it can causes problems.
Since both solution have the same effect, I don't know what is the best one and which one can potentially case a problem in the long run.

# Answer
> 4 votes
The reason a big clipping area is bad is because the Z-buffer uses floating points between 0 and 1 to determine depth.

This means that the only real issue here appears when your clipping plane is FAR beyond the walls of the cube. Say half of your clipping plane is outside your cube, that would make the depth buffer resolution on the objects inside the cube half as accurate as it could be.

Hope this helps.

# Answer
> 6 votes
The other answer doesn't give you the whole story, even with the addition of Tetrad's comment. It's of vital importance to take into account the non-linear distribution of precision for values stored in the Z-buffer. zNear has a much greater impact on artifacts such as Z-fighting than zFar does.

For a better explanation of why, see this article: http://www.sjbaker.org/steve/omniv/love\_your\_z\_buffer.html

---
Tags: xna, camera
---


# Question
Title: What is the basic skill set that a Professional Game Programmer needs to have?
I have a very general question which bothers me but i want to add some details first. I'm a core Java programmer. I have independently created some small games in Java for fun. Now, the more I'm looking into professional game development the more I'm getting confused. This is because, whenever I Google about some game development topics or visit any fora etc., I come across different suggestions.

Some will say C++ is good, while some will say JAVA may be better, while still others will say some other language is the ur-language, like Python, Lua, UnrealScript, etc. Also it is suggested that one ought to have knowledge of game engines like Unreal, Torque, Blender, Panda, etc and knowledge of OpenGL, AI, Collision Detection is required. I have even created a game using Android SDK.

What I want to ask is:

* What is the basic skill set that a Professional Game Programmer needs to have? Is it any 1 Programming Language + 1 Scripting language + 1 Game engine knowledge + OpenGL? (Phew!!)
* If I want to enter into Game Industry as Gameplay Programmer or AI programmer then can I get into it with my current skills and portfolio (as stated above)?
* Is learning one programming language is enough for Game Development?

Any guideline will be helpful.

# Answer
1. You should be proficient and competent with at least one programming language. Doing so will help you to pick up other languages more easily. The type of job you're applying to depends on what language you should probably know before hand. Most triple A titles released on PC and console will most likely be developed in C++. Mobile applications and games on the other hand will most likely be using Java (Google Android and other phones) or Objective-C (iPhone). If you take a look around at job listings for software engineers on developers websites, it usually will mention what language experience you need to have. For example, "Proficient and knowledgeable in C++" or "Experience with C++ for at least two years." Learning a scripting language won't hurt you. It'll only benefit you. Learning always benefits, and never hurts.You don't need to have a working knowledge of any game engine, but if you're applying to a company that uses that specific engine, it'll probably help you're resume. If you're an expert on the Source engine, but you apply to id software and know nothing about the id tech engines, that's not really super helpful (but beneficial cause learning is always beneficial).
2. If you've completed projects from start to finish, and you show that you have, then I think that would help boost you're resume. I'm not sure about a plethora of tech demos though. Lots of people seem to be doing tech demos and they don't have any or few game projects completed. Gameplay programmer tends to be a jr. level position, so yes, depending on your resume you should be able to find a job somewhere.
3. I think that knowing one language and being able to use it proficiently and competently is better than knowing 5 languages and barely knowing how to use them.

Disclaimer: Never worked in industry, these are just my opinions that have been formed after reading several threads and articles about game programming jobs, based on what I thought were the most sensible articles/opinions I've read.
> 6 votes

# Answer
The more I research this topic and talk with professional game developers, the more I think it really comes down to a few things. In no particular order:

* **Ability to work well together in a team atmosphere.** Building games takes an extraordinary amount of people, just reading the credits in some of the AAA games nowadays takes 10+ minutes, if you can't work well with people and your goal is to work with other people to make a great game then I fear this isn't the right industry. This is one of those soft skills that is usually developed over time from working on projects with other people.
* **Find what you like to do.** This is kind of open ended but find out what you like about game development and what skills you need to accomplish this. I know this is kind of the answer you are looking for, but I could rattle off all the skills you might need to be an engine developer, graphics developer or a gameplay developer, but you can find a lot of that information pretty easily online. Your skills are going to need to tie very closely into what you are interested in. Ex: Don't worry about knowing the in's and out's of OpenGL and DirectX if you are really interested in Server side development and vice versa.
* **Be Proficient in a Low Level Language** With the above being said though, I agree with the other posters that a low level language is a good idea to learn. I know when I went from C# to C++ I learned a lot about how the magic of C# works, this is knowledge that gives you a good understanding of how to effectively communicate with a computer regardless of language.
* **Understand computer architecture** \- By this I don't mean that you must have a degree in CE or EE to really understand every part of a computer architecture, but know the basics of how memory, CPU and GPU work. Regardless of the area of game development you go into it will be beneficial to at least have a grasp of how these work. If you want to jump into Graphics programming or Engine programming then you will need to understand even more in this space.
> 2 votes

# Answer
A lot depends on your career goals. If all you want is "a job making games" before doing the requisite 5.5 years and burning out and leaving, then I guess you just look at entry-level job openings and look for what they want, learn it, and apply. Simple. (But then, if your question really comes down to "what's the minimum effort I need to put in to get a job?" then the answer is "if you put in the minimum effort, you're going to get the minimum job!")

But long term, I don't think it's so much about knowing some number of languages, or learning a specific one. The languages change -- ten years ago no one was using Objective-C or XNA or C# or AS3, and ten years from now rest assured that any language you learn today will be obsolete by then anyway.

So one thing to future-proof yourself is to not just "learn a language" but to learn HOW to learn new languages. Once you've become proficient in 3 languages or so, you'll find that picking up a new one is not so bad. Most of the core components are the same, anyway -- every language has variables, arrays, loops, conditionals, and so on, so it's just about learning the syntax.

The other half of this is to understand the core concepts of programming and computer science. Understand memory management, pointers, recursion, and so on. If you understand the concepts, you can apply them in pretty much any language.

If you want to make yourself more marketable, then learn a programming specialty relevant to games, whatever interests you... AI, databases, networking, tools, whatever.
> 2 votes

# Answer
There is another very important skill needed that seems to be a little overlooked. You need to know how to fit in and work with a team of people, going from other game devs, to designers and project managers and stuff. It's not a technical skill, but it's still very important, as you could be the best dev in the house and if you can't get on with people, make large games is going to be a problem!

Also, as ShrimpCrackers kowing one language well is better than roughly knowing 5 languages, and understanding what goes on under the hood of that one language you are goot at is even better, as for games, you need to know how to get the best performance out of the language.

Last but not least, knowing a little about hardware, GPU in particular won't hurt!
> 1 votes

# Answer
For programming social games there are to main skills that are the only ones needed.

1. Program action script (you can use an elipse environment and a svn), this is used for the front end of the game (the webpage)
2. Program java (which can also be done on eclipse an use svn), this is used for the server side actions to take from the requests of the webpage.
> 0 votes

---
Tags: game-industry, jobs
---


title: Help with off-game tasks

text:
# Question
Title: Help with off-game tasks
I love writing video games for fun, and often do that.

I noticed, anyway, that most of the times implementing the gameplay itself doesn't take too much time to me (maybe because I already did that plenty times and know what and how to do for most of the things), but when I try to implement off-game stuff I get lost.

By off-game I mean what is not gameplay: menus, cutscenes between levels, *world map* to choose levels, saving and loading status, managing replays ... Only tried to write a few of these a few times, but always failed; that's why I never really completed and distributed a game.

Are these common problems? And where should I start to do this? Where could I find some books/guides about such stuff?

# Answer
I think I can rephrase the question to something answerable: "My specialty is gameplay programming, i.e. implementing the actual game mechanics. But I haven't learned any of the other parts. How can I finish a game project?"

My answer: it depends, but the good news is there are a LOT of options.

You can team up with another programmer who knows how to do that stuff.

You can teach it to yourself, perhaps finding some open-source projects and looking through their code, or just finding some good game programming books, or just experimenting with small systems on your own until you get the hang of it.

You can download one of the many cheap or free game engines / libraries / frameworks / authoring tools that handles all that stuff for you. If all the back-end stuff is taken care of, then you're free to concentrate on the gameplay programming that you obviously prefer.

You can design games that don't require a lot of infrastructure. Don't know how to save or load games? Then design a game that doesn't need save/load functionality, such as a retro-style arcade game. Don't know how to do graphics? Challenge yourself to see what you can do with text only. Don't know computer networking? Then I guess you'd better make your game single-player (or multi-player hotseat). For every limitation, there's a design workaround, if you fancy yourself a stronger designer than programmer.
> 4 votes

# Answer
I'm not sure I understand. You've implemented gameplay but not menus and levels? Like you've had a sprite jump but you've never created a tiled level or world map and such?

Try to think about creative solutions to problems. Try not to think, "How do professional game programmers do it? I want to do it exactly like they do." Try to think, "What are several ways I can do this? What is the best way of the choices I have?"

For example, for a world map to choose a level, you can blit an overview map image to the screen. Then blit a dot image or some other object which can represent the level. When the player moves the mouse over the dot and clicks it, you enter that level.

Menu buttons. Just render a text surface or an image of words. When mouse is over the button or the down key is pressed, highlight the button. When enter or left mouse-click is pressed, execute some function.

And so on. Just try to think about how they COULD be done. Not how they are specifically done by a specific person.
> 3 votes

# Answer
Regarding the menu at start, what you need is a variable that tracks "Game State". In your main game loop you will then have something like:

```
switch (GameState) {
    case Menu: ...
    case MainGame: ...
    case EndScreen: ...
...
}

```

This way, the block of code that is actually executed is completely different depending on the "Game State". You can then develop the Menu part as if it was a whole application on its own which exits by changing the value of GameState. The main game code that you already have would only execute in the MainGame case. And you can even add other states, like "Worldmap", or "Cutscene". This can be used every time you need to manage the input differently or halt the regular update of the game (for example, "Paused").

Of course, this "switch" statement might also be needed inside the "keyPressed", "mouseDown", or other functions.
> 2 votes

# Answer
Think of a large open field with a single tree in the middle. The tree comprises the things you said you get lost on, and the bedrock is the actual game world. You've handled the tough bit already, so think about the architecture when designing the links between menus etc as being like a tree's branches, or if you prefer, its roots.
> -1 votes

---
Tags: planning
---


title: MUD Games ideas

text:
# Question
Title: MUD Games ideas
I am a huge MUD games fans. Though, MMORPG's rising popularity gives text-based games a strong opponents that they can't match.

I started my own MUD engine (codebase) a while ago and I'm now looking for various ideas or features you guys have encountered in various games.

I have come across various ideas so far :

1. A kind of GTA's wanted stars systems. Guards of different strenghts will comes for you.
2. The MUD game I'm familiar with do not have the abilities to attack someone in a room foreward. This could be fun when playing a ranged/spell caster class.

Please note that I'm looking ideas for a medieval/fantasy theme MUD.

What else ?

I am aware that there is no good answer for my question and I'm not allowed to post Community Wiki yet.

# Answer
**Please include a good crafting system!**

I find fighting to be boring and crafting to be somehow entertaining. I know many people feel the opposite, thus the popularity of MMOs like WoW and Guild Wars which focus almost entirely on combat. But please don't neglect to have a nice crafting system in your MUD for people like me. I know I'm not alone! It's just so rewarding to take raw materials and make useful things out of them, even if it's just a game and the actual action of making something might just be a click or a word.

I don't have quite enough MUD-playing experience to know for sure though. Maybe crafting wouldn't be the same in a MUD. If that's the case then just ignore me. :)
> 4 votes

# Answer
I could post quite a few ideas for you to try. Here are two.

### Ditch Fantasy

I know that you said that you are looking for ideas about medieval/fantasy, but I would suggest that you don't. If you don't like the topic for which you hobby program, you are not likely to finish it. So I am not telling you to ditch fantasy if it is your favorite thing.

I simply recommend not doing fantasy because it has been done upwards and downwards; especially in the mudding community. Not to mention that there are now plenty of mmorpg's that trod up and down the fantasy path. It will be hard to stand out even a little with so much background noise. Even if you decide to go with a fantasy route, put very unique hooks in to the mix. Then make sure that those are readily apparent.

### Meaningful Player Content Creation

I can't stress this one enough. If you create ways for players to create and change the world, then they will feel more invested in the experience. I don't just mean player houses. I am talking about things that the players feel change things.

* Player driven economies. ie, the best potions, armor, spells are player crafted.
* Player effected areas. Have ways for players to change areas people interact in.

So that seems a little vague. I will give you an example of what I mean.

A medieval castle building game. All players are given an empire upon start of the game. It is each player's mission to create a flourishing civilization. Everyone's civilizations are reached through a player hub. You increase your civilization through many ways. These include personal questing, reinvestment of settlement resources, and interactions with different people's civilization. Give people a reason to care about their own area. Then give people a reason to seek out the areas of others. Make it so when you see someone elses area, their personality and decisions show.
> 2 votes

# Answer
Many of the MUDs I've worked on or played have had a basic aggressive/not-aggressive system. Adding faction-based aggression might add an interesting dimension (i.e. maybe Orcs are indifferent to you unless you've killed \>100 of them, making you a famous villain to them).

Allowing characters to build castles or strongholds and defend them, or to take/defend in-game strongholds or resources could be interesting if done right. Dark Age of Camelot had an interesting system in that your "side" could get bonuses if they controlled more strongholds than others.

Automappers are often appreciated by players. Advanced MUD clients like ZMUD already have them but they don't always work well. If you have one built into your game engine you could be creative with it.

A scarcity system could also be interesting -- have prices drop on items that are commonly farmed, while the value of items that are not commonly sought out by players goes up. This will encourage players not to always camp the same items.

It's not a new idea, but a "trophy" system where a player gets less experience when they repeatedly kill the same type of creature could encourage people to explore more areas. Most of the MUDs and RPGs I've worked on have had players settle into a comfortable safe area and not bother exploring if they can level easily in one place.

Get rid of Midgard but build a good tutorial zone. Most stock MUD codebases use some version of the "Midgard" zone for players to start in. Having that zone gives veteran MUD players a sense that you're just "another stock MUD", but it's also daunting for people to learn a new game, so give players the option of starting in a "newbie" zone full of tutorial info when they create a character.

If you're doing PvP, it would be nice to have a bounty system: If players annoy one another, let them put a price on each other's head and the other players can take them out for a reward.

Keep score of lots of things and rank them. Every player wants to be the best at something. Maybe Ralik has killed the most Trolls in the game while Elgarin has cast more fireball spells than anyone else. Many of the people who play MUDs are drawn to statistics, so being able to present things that they have done in the game in interesting ways will keep them interested. This has manifested itself in "achievements" in the various online game scoring/tracking systems.

In the vein of the paragraph above, keep track of the quests, zones, or mobs that a player has finished and let them know how much progress they have made toward conquering the game.
> 1 votes

# Answer
Don't try to do the same things that a MMORPG does, because you'll be no match. Try to be different.

1) no real time action: that's really horrible in a MUD, people will run away; do everything turn-based

2) a lot of roleplay and narration will help

3) user-created content will be a key feature
> 0 votes

---
Tags: game-design, mud
---


# Question
Title: Disposing only certain resources in XNA?
The ContentManager in XNA 4.0 only has one Unload() method that Unloads all Assets.

I want to have some "global" Assets that are always loaded, but then I want per-Level Assets which should be Unloaded when the level is changed.

Should I create a second Instance of the ContentManager as part of the Level.cs Class? Or should I use Game.Content and then call .Dispose on the Assets I load? Or should I create my own ContentManager on top of the ReadAsset function as outlined here?

# Answer
> 12 votes
**Create a second instance of `ContentManager`.**

You should ***never*** `Dispose()` of things you load from a ContentManager (using the default implementation), as these instances are shared and reused.

Creating your own version of ContentManager is kind of orthogonal. Either way you'll be creating a second instance of ContentManager (or a class derived from it). So if the existing implementation suits your purposes - then use it, otherwise override what you want to change.

Of course, if your game is relatively small - then it won't really matter if you just use the one ContentManager and not bother unloading content between levels.

---
Tags: xna, xna-4.0
---


title: Alternatives to Singletons / globals

text:
# Question
Title: Alternatives to Singletons / globals
I've heard countless times about the pitfalls of Singletons / globals, and I understand why they're so often frowned upon.

What I don't understand is what the elegant, non-messy alternative is. It seems that the alternative to using Singletons/globals always involves passing objects a million levels down through your engine objects until they reach the objects that need them.

For example, in my game, I preload some assets when the game starts up. These assets aren't used until much later when the player navigates through the main menu and enters the game. Am I supposed to pass this data from my Game object, to my ScreenManager object (despite the fact that only one Screen actually cares about this data), then to the appropriate Screen object, and anywhere else?

It just seems that I'm trading global state data for cluttered dependency injection, passing data to objects that don't even care about the data except for the purpose of passing it on to child objects.

Is this a case where a Singleton would be a good thing, or is there some elegant solution I'm missing?

# Answer
> 19 votes
Don't conflate singletons and globals. While some kind of global variables are usually necessary, the singleton is *not* just a replacement for a global variable, but *primarily* a way to work around problems of static initialization order in C++ (and FQA). (In other languages, it's a way to work around different language deficiencies, like the lack of global variables and bare functions.)

If you can just use a global pointer instead of a singleton, and make sure it's initialized (manually) before anything needs it, you avoid the function call and branch overhead, the lame syntax to get at the object, and you can actually make a second instance of the class when you need to for tests or because your design changed.

For the few global variables you want (common examples being audio output, list of open windows, keyboard handler, etc.), I recommend the service locator pattern. It makes it easy to replace things with different implementations (e.g. real vs. null audio device), and collects all your globals into one structure to avoid polluting your namespace.

# Answer
> 1 votes
If you don't/can't have one part of the code magically "know" about some data, then it will need to be passed in somehow. However that doesn't mean it must necessarily by passed only through arguments.

In your example case, could you not have some kind of "AssetManager" which would load and store the assets, and then the ScreenManager would only need to be given a reference to that (probably at creation)? In that sense you're passing the references to the assets wrapped up in another object, and you can pass that once, at initialisation, rather than pass it down to the leaf function when it's required.

Now IMHO that AssetManager, being the kind of thing you only want one of, might as well be a singleton. Provided you understand the pitfalls, and code specifically to avoid them (assume that singleton will be accessed simultaneously from multiple threads and stab yourself with a fork any time you do something that needs to block), then knock yourself out.

# Answer
> 1 votes
I think Jason D is absolutely right - this is how I would handle it:

Game has an instance of AssetManager, an object from which you can get any asset by name.

In Game:

```
assetManager = new AssetManager();
screenManager = new ScreenManager();
screenManager.assetManager = assetManager;

```

In ScreenManager:

```
screen = new Screen();
screen.assetManager = assetManager;

```

In Screen:

```
myAsset = assetManager.getBitmp("lava.png");

```

Now all screens have access to any assets they need. This is not any more complex or crazy than using globals or Singletons, and you have an option of having 2 instances of Game running in the same application without clashes. I once had to make a game that was made up of 8 mini-games, all sharing the same base classes / framework. I had to refactor all my globals/singletons to use this reference passing style, and I've never looked back. The only things that should be globals are things that can only physically exist once, such as audio, networking, i/o etc.

# Answer
> 0 votes
You could use the Factory pattern to replace Singleton. Then the factory class has the control over how many instances you can create, which you can easily change later when you find you need more than one `AssetManager`. As stated in this article:

> It gives you all of the flexibility of the Singleton, with nowhere near as many problems.

---

Another, rather limited, possibility is to make the class static (which I don't think is feasible for an AssetManager and only possible in languages that have static classes at all). But that works only if you don't need inheritance/polymorphism. It's a very inflexible solution:

> static methods are as flexible as granite. Every time you use one, you're casting part of your program in concrete. Just make sure you don't have your foot jammed in there as you're watching it harden. Someday you will be amazed that, by gosh, you really DO need another implementation of that dang PrintSpooler class, and it should have been an interface, a factory, and a set of implementation classes. D'oh!

This is about static methods, but it can be applied to static classes, too.

---
Tags: architecture
---


# Question
Title: How many people are needed for making a good (MMO)RPG?
1) RPG? 2) MMORPG?

I'm talking more about good content here.

**Update:** Because it is said here that volume of information is low in my question, and because there was too much to say, I created an extension question

# Answer
> 10 votes
Well Warhammer Online was made by somewhere between 300 and 400 people depending on who you ask and it is slowly tanking. Kingdom of Loathing has a dev team of about 4 or 5 and is awesome. Are either of those numbers useful? Not in the slightest.

# Answer
> 3 votes
100+ people for our project http://allods.com/ . It was really hard to gather so many high skilled people together in one place.

# Answer
> 2 votes
Well, what makes a good RPG/MMORPG?

Personally I have enjoyed Torchlight a lot (single player action RPG) and it was created by a rather small team of roughly 26 people.

If you look at a game like World of Warcraft, the numbers are entirely different though.

# Answer
> 1 votes
You don't have nearly enough information.

Is it 2D or 3D? How much character customization? How many creatures? How many textures? How much music/sound? How big is the world?

I could go on forever with thousands of questions you need to ask yourself before you can even attempt to figure out how many people it will take. Short answer is; anywhere from 1 to 1000 people.

# Answer
> 1 votes
We've made our MMORPG game in team of few friends, less than 10 people ( http://www.margonem.pl ): only 2 programmers, few artist and some content creators. But you need to consider 2 main things: time and cost. With good team, lot of money and time you can beat 10 times bigger teams with no funds. Smaller teams are also easier to maintain.

# Answer
> 0 votes
I think it depends on the scale of your MMORPG, and the level of graphical and control fidelity you expect. The smallest "AAA" MMO team I can remember was at EA and about 80 people, but it flopped. On the other hand, Puzzle Pirates succeeded (in its modest way) with about a dozen developers.

In general I suspect the number of backend engineers you need grows logarithmically with the number of expected users.

# Answer
> 0 votes
RuneScape Classic: two brothers (Paul and Andrew Gower) and a couple years. Very inspiring, if nothing else; of course, nowadays the current RuneScape game is managed by a large staff of which I could not find a number.

---
Tags: mmo, project-management
---


title: Free ebooks about game development

text:
# Question
Title: Free ebooks about game development
Are there good free ebooks on game development? I don't care if they are theoretical or technology specific, I want to start reading one free book that worth it.

# Answer
**Game Design**

**Programming**

**Art**

**Culture and Studies**
> 62 votes

# Answer
The Real-Time Rendering website has a good list of free books. They're mostly about writing shaders, including books from the GPU Gems and ShaderX series.
> 5 votes

# Answer
I have never read it myself, but I keep seeing it mentioned.

http://inventwithpython.com/

I believe it is mostly text games, but near the end it covers pygame.
> 5 votes

# Answer
The creator of Sirlin Games has posted a great book on-line called Playing To Win. It comes in three forms, a book from Lulu, an e-book from Amazon (not free), and on-line as HTML. So even if it's not a free e-book as in the OP, it's still free to read (and you could download all the HTML pages if you really wanted to read if offline).

It's purely the psychology of *competitive* game design, no code. Definitely worth reading.
> 4 votes

# Answer
Not a book but an online place to start possibly http://udn.epicgames.com/Three/DevelopmentKitHome.html
> 2 votes

# Answer
Action Arcade Adventure Set by Dianna Gruber is a very detailed introduction to game development. Source code for a full-featured 2d side-scrolling game is developed over several chapters. Several more general topics are also covered, like marketing and the history of side-scrolling games.

The book is now freely available online, but here is the Amazon link for reference.
> 1 votes

# Answer
If you're looking to do game development for the new **Windows Phone 7 Platform** there is a Free E-book it covers both Silverlight Development (for Applications \[but could be used for games\]) and the XNA Game Framework.
> 1 votes

---
Tags: books
---


# Question
Title: How is a moving object like a platform represented in a 2d Tilemap
I'm having trouble understanding how I would implement a moving platform in the actual map file. Lets say its a file of character's and maybe the letter 'P' would stand for Platform. Then, how would the game know which direction it moves, how far it's suppose to move before returning, what size it is, etc... Am I even suppose to represent it in the map file?

I'm coming from the approach of making the game handle the maps as dynamically as possible, where you could basically make a new map file and play it in the game without having to hard code any special information for that map.

# Answer
Well obviously you need more than just a single character for your moving platform. Try just putting a chunk at the end of the file for all your dynamic objects that need more data. Maybe it's a block of XML or JSON for easy parsing. Then you just need to say "there's a moving platform at X,Y that looks like Z and moves to Z,W over Q seconds" or whatever data you need.
> 3 votes

---
Tags: 2d, tiles, moving-platforms
---


title: Ogre vs. Irrlicht

text:
# Question
Title: Ogre vs. Irrlicht
I've experimented a bit with the Ogre (http://www.ogre3d.org) and Irrlicht (http://irrlicht.sourceforge.net) engines, both of which are open source and are trying to fill similar niches. From what I've seen so far they're both well-written and easy to use.

I could use an informed compare-and-contrast of the strong and weak points of those two game engines and the engine-specific challenges related to going from start to released product. I'm interested in anything from asset management to configuration tools to audio/network/videoplayback framework integration to rendering/polygon constraints.

# Answer
> 18 votes
Ogre3D and Irrlicht are both rendering engines. As such they will not help you with audio, networking etc. There are other engines for sound and networking such as OpenAL, FMOD, Irrklang, RakNet that you will have to integrate (or use a framework that is already wraps up the engines).

As for the compare-contrast, this has been asked many many times and instead of repeating them I will refer you to the following links

1. http://www.nuclex.org/blog/2-gamedev/24-seven-engines-you-should-know
2. http://www.blitzbasic.co.nz/Community/posts.php?topic=73978
3. http://www.ogre3d.org/forums/viewtopic.php?t=33791

When I started I wasted quite a bit of time asking the same question and reached no conclusion. If engine A has a weak point discussed in one thread, in another, Engine B will have the same weak point. It is all based on opinion.

However, there are *some* differences that are repeated, such as Irrlicht running faster on older hardware as it does not utilize modern techniques whereas Ogre3D is optimized for the latest hardware.

I personally chose Ogre3D after spending a few days trying both engines through their shipped examples and trying out various tutorials of both the engines. I chose Ogre3D based on my constraints and personal preference, I highly suggest you do the same instead of relying on conclusions based on other people's opinion.

# Answer
> 5 votes
Both engines are going to provide you with some challenges. Mainly, because learning/using a new engine *is* a challenge.

I have only used Ogre so far, so I might be biased. Since Ogre is purely a rendering engine, you'll have to look for third party libs to cover audio, video and networking. You won't have problems integrating these things though, since lots of other people have done so also.

When comparing similar engines like this, I'd pay attention to the following:

* How good is the documentation?
* Is there an active community where I can ask specific questions?
* Does the coding-style and the philosophy of the engine match my preferences?
* Is the engine open-source or at least easily extendable? If its a commercial product, can I get custom extensions for it (if yes, what are they going to cost?)
* Has the engine/lib been used in commercial products or mature open source projects?
* What's the update interval of the software? How many developers are actively involved in the project?

You might also consider comparing the metrics on a site like ohloh.net, eg. Irrlicht on ohloh and Ogre on ohloh

Some of the above points might be less or more relevant to the decision you have to make. Then stick to the engine that matches your needs as closely as possible. If both engines are a viable option, throw a coin :)

# Answer
> 4 votes
I have made a wrapper that lets me swap between both. Ogre: * runs a bit faster with large numbers of draw calls so I usually use Ogre. Irrlicht is: * far, far more portable (less dependencies) so great for multi-platform * has better debugging tools (menus and things); Ogre basically has no graphical debugging.

---
Tags: ogre, irrlicht
---


title: Converting DirectX 9 code to DirectX 10

text:
# Question
Title: Converting DirectX 9 code to DirectX 10
Preface:

I purchased Programming an RTS in DirectX recently, and I know the code uses DirectX 9, but it has fantastic reviews and is apparently one of the best books you can get on beginning DirectX.

Question:

To my understanding, DirectX is just a means of displaying graphics to the scene. I will still have to code any games in C++ using game logic code, input, etc. Was I naive in thinking I could read the book with the MSDN tutorial site open for DirectX 10, and convert all of the samples to DirectX 10, or is that gonna be extremely difficult for me to do? Also, is DirectX 9 still relevant, or would it really behoove me to go about converting to DX 10?

Thanks!

# Answer
It is important to note that the DirectX API is independent of the DirectX Hardware. That is to say that a DirectX 11 video card can still be accessed through the DirectX 9 API.

Much legacy code still uses the DirectX 9 API, and as I recall, Direct X is a backwards compatible API, so your code targeting DirectX 9 should run on a machine with DirectX 11 installed.

To asnwer your specific questions, DirectX is an API to facilitate running high performance graphics and sound on the computer. You will still write your game logic in C/C++, as I recall DirectX has some classes for dealing with user input as well. With respect to API changes between 9, 10, and 11 I do not really know, but I cannot imagine that a good programmer would have difficulty figuring it out, given a well written book and MSDN. I should also mention here, that I don't do much native DirectX programming, so take my words about API changes with a grain of salt.
> 3 votes

# Answer
While I haven't read the book in question, you're absolutely right (IMHO) that one graphics API can be fairly easily substituted for another without seriously impacting all the other stuff you need to do.

As to whether DX9 is relevant - there are a lot of XP users around still... really depends on your audience. If it's mostly just for personal consumption, I'd say go with DX10/11.
> 2 votes

# Answer
To the best of my knowledge, there is no fixed function pipeline in DirectX 10/11. That means the way you interact with the API has changed very dramatically on some levels. If your book delves into the the ins and outs of vertex and pixel shaders and programmable hardware, then it might not be that big a difference. But if your book is mainly based on utilization of that fixed function pipeline, you're in for a general shift of paradigms when/if you make a transition.

If you really want to stick to this book, it won't do any harm to just pull all the stuff off using DX9 because learning is never a bad thing. But if you really want to make a transition towards DX10/11 further down the road, be ready to invest quite some time.
> 2 votes

---
Tags: software-engineering, directx10, directx9
---


# Question
Title: Tips for communication between JS browser game and node.js server?
I am tinkering around with some simple Canvas based cave flyer game and I would like to make it multiplayer eventually. The plan is to use Node.js on the server side.

The data sent over would consists of position of each player, direction, velocity and such. The player movements are simple force physics, so I should be able to extrapolate movements before next update from server.

Any tips or best practices on the communications side? I guess web sockets are the way to go. Should I send information in every pass of the game loop or with specified intervals? Also, I don't mind if it doesn't work with older browsers.

# Answer
> 10 votes
I recently made a asteroids/geometry wars crossover with Node.js / JavaScript:
http://github.com/BonsaiDen/NodeGame-Shooter

It has a fat Server which processes the game and thin clients which are basically just views. The client does some interpolation and things to make it look smooth.

You may want to look at these two files, which contain the underlying networking logic, as well as the actor and client models:
http://github.com/BonsaiDen/NodeGame-Shooter/blob/master/client/nodegame.client.js
http://github.com/BonsaiDen/NodeGame-Shooter/blob/master/server/nodegame.js

The whole game is based on Actors which handle their "update events"(the stuff that gets send to the clients) on their own, for the most part. It's also possible to hide actors from specific client to implement, for example, invisibility.

One can also record games and just feed the messages into the client to play them back.

As far as the tech goes:
WebSockets are the way to go here. I also did a custom binary encoding for JS that, while giving up on things like more than 2 decimal places on floats, is about 50% smaller than JSON(and is 2x as fast under V8 than *native* JSON encoding)

# Answer
> 8 votes
I'd suggest to keep things apart.

In Stendhal which is a 2D MORPG written in Java, we did the following things and it works out pretty fine:

* The client uses a fast loop for drawing. It does smooth animation and some predictions to minimize lag.
* The server uses a loop to process all the game logic. In our case it can be a lot slower than the drawing loop. While the clients make some predictions, the server always wins.

Communication between client and server is done using actions and perceptions:

* *Actions* done by the users like "move up" are sent to the server when they occur. The server queues them up and processes them in its own loop.
* *Perceptions* are sent from the server to the client to update their view of the world.

We did some "tricks" to gain additional performance:

* We have two kinds of perception messages: A full one used on login and players joining a zone. And incremental updates used after that. This saves a lot of network bandwidth.
* We split perception messages into a public and a private part: All players in the same zone share the same public part so we save processing time because serialisation turned out to be a bottle neck on Java (not JavaScript).

# Answer
> 3 votes
Use socket.io, it's a handy WebSockets abstraction library that provides fallbacks for browsers that don't support it.

Also, if you are going for an online model like that, I would recommend moving game processing to the server. That way you only need to communicate graphical changes and mouse/keyboard input. It also helps quite a bit to prevent cheating.

---
Tags: networking, multiplayer, javascript, client-server, node.js
---


# Question
Title: How can I get the WAV data from the whole song?
I'm using FMOD (with C++ syntax, not C) and I'm having trouble getting the wave data of a whole sound file.

Channel::GetWave() only gets the wave data of the area on which it is currently playing.

The documentation says:

> Do not use this function to try and display the whole waveform of the sound, as this is more of a 'snapshot' of the current waveform at the time it is called, and could return the same data if it is called very quickly in succession.
>
> See the DSP API to capture a continual stream of wave data as it plays, or see Sound::lock / Sound::unlock if you want to simply display the waveform of a sound.

Unfortunately, the Sound::lock and unlock functions are pretty confusing, at least to me.

Lock:

```
FMOD_RESULT Sound::lock(
  unsigned int  offset,
  unsigned int  length,
  void **  ptr1,
  void **  ptr2,
  unsigned int *  len1,
  unsigned int *  len2
);

```

> offset
>
> Offset in bytes to the position you want to lock in the sample buffer.
>
> length
>
> Number of bytes you want to lock in the sample buffer.
>
> ptr1
>
> Address of a pointer that will point to the first part of the locked data.
>
> ptr2
>
> Address of a pointer that will point to the second part of the locked data. This will be null if the data locked hasn't wrapped at the end of the buffer.
>
> len1
>
> Length of data in bytes that was locked for ptr1
>
> len2
>
> Length of data in bytes that was locked for ptr2. This will be 0 if the data locked hasn't wrapped at the end of the buffer.

Unlock:

```
FMOD_RESULT Sound::unlock(
  void *  ptr1,
  void *  ptr2,
  unsigned int  len1,
  unsigned int  len2
);

```

> ptr1
>
> Pointer to the 1st locked portion of sample data, from Sound::lock.
>
> ptr2
>
> Pointer to the 2nd locked portion of sample data, from Sound::lock.
>
> len1
>
> Length of data in bytes that was locked for ptr1
>
> len2
>
> Length of data in bytes that was locked for ptr2. This will be 0 if the data locked hasn't wrapped at the end of the buffer.

But as I said, my goal is to be able to get the wave data of the beginning of a song to the end.

# Answer
> 2 votes
The way I read it, the last four parameters are *output parameters*. So you basically pass in 4 variables of the requested type and after the function has finished, these are populated with the data you need.

What you do is something along these lines:

```
void  *pointer1;
void  *pointer2;
unsigned int length1;
unsigned int length2;

// lock the buffer
mySound->lock(0, lengthOfYourSoundInBytes, &pointer1, &pointer2, &length1, &length2);

// when we're here, pointer1, pointer2, length1 and length2 will be populated.
// do something with the sound data found in pointer1.
// the sound data will have a length stored in length1

// unlock the buffer once you're done
mySound->unlock(pointer1, pointer2, length1, length2);

```

From my understanding you won't need `pointer2` and `length2` at all. The only thing you'll have to figure out is the length of your sound data (see `lengthOfYourSoundInBytes` above). Once you locked the buffer, you'll get a pointer to the data and you can do whatever you want with it.

---
Tags: c++, fmod
---


# Question
Title: How do I apply A* to a complex and dynamic 3D environment?
I've looked a bit at Breadth-First and Depth-First search algorithms and I think I've got a pretty good idea of how they work.

Now I am here : Link

The problem is I don't see how a 2D grid can help with a 3D game. I suppose that wouldn't be a problem if the 3D game didn't have the AI explore multiple levels of a building, but since that is most often what occurs, I am not sure how I would "simplify" my static level geometry and my physics-dynamic changing scene into a structure that can be easily be traversed to determine a path to a goal node.

# Answer
A\*, BFS or DFS all search graphs. It doesn't have to be a graph with equidistant nodes as in a 2D Grid. It could also be a graph like in the following image (from Wikipedia):

Now imagine that the nodes of that graph lie in a 3D environment. They would have a position (X,Y,Z) and using that you can also calculate the distance to the neighbor nodes, which in turn can be used for the heuristic function in A\* (for speed, simply use the squared length and skip the sqrt). Of course the graph can also be changed dynamically.

Maybe you'll even have to use several graphs. One that just models connections between rooms (fast calculation of: can I get from here to this other room?) and one fine-grained graph for the actual movement. There are also 3D "flood-fill" algorithms that can create such a graph for you, given some 3D data. These are rather CPU heavy though and you shouldn't run them during game.

For dynamic objects, I would probably use steering behaviors to avoid them (eg. a barrel or a chair in the way). There's usually no need to update the graph for objects like this.
> 9 votes

# Answer
It might help if you think of the connections in tiles as literal connections.

They can be between squares like in a tilebased game, or between polygons or level chunks.

Astar only cares about a heuristic of movement from one node to the end, and the ability to ask for 'all my neighbors' so you can add them to the open list.

Try implementing 2d Astar with that in mind, I tend to create my array, and then do a second pass creating links to all the neighboring tiles. The advantage of doing this, is it is only a simple task to change to 8 way movement, and even adding teleporters that Astar respects (add a connection to far away tiles!)
> 3 votes

---
Tags: 3d, ai, path-finding
---


# Question
Title: Apple Game Center - Sharing Data between 2 SKUs possible or not?
Question: Is it possible to access the same leaderboards and achievements via GC from 2 versions of a game (i.e. 2 different SKUs, one for iPhone/iPod and another for iPad. Where both are actually the same game in terms of game modes and features. For instance to be able to have different pricing)

Or: is this impossible and there is no other way than having 2 separate Leaderboards, Achievements -or- one universal binary.

Thanks in advance

\*edit: typo and added remark about universal binary

# Answer
> 1 votes
Honestly I'm just guessing here, but I'm pretty sure all the Game Center stuff is per app ID. So if you have a regular and an HD version that use two different app IDs, you're probably SOL. You'd more than likely have to make it a universal binary if you want your iPad and iPhone users competing.

---
Tags: iphone, ipad, game-center
---


title: Optimizing Octree Rendering

text:
# Question
Title: Optimizing Octree Rendering
Say I have an octree and at a certain level I store VBOs in that octree. I know the dimensions of of the nodes that own the vbo so I can do basic frustum culling. That works nicely because everything outside of the screen is never rendered.

However my world is quite big and I currently also draw things behind already drawn octrees. What would I use to not draw nodes that are occluded by other nodes and how would I go about that?

I saw some mentions of occlusion culling in the OpenGL superbible but I fail to see how I can utilize that when I don't have a clear distinction between occluders and occludees.

# Answer
> 6 votes
One of the features of the octree is that it allows you to render your octree nodes in front to back order. Just doing this will help performance a lot since it allows the graphics hardware's EarlyZ implementation to be more effective (you run fewer shaders, do less raster work, etc.)

The benefit of using occlusion queries to query the visibility of octree nodes is that it can save you from rendering occluded highly complex geometrical objects. The (opaque) objects in your scene are your occluders, and your octree nodes (and by implication, their contents) are occludees. As Samaursa said, it is really hard to get this right, so please check out this paper before trying it (stalls will kill performance if not treated carefully). Also, make sure that geometric complexity is actually your performance limiter otherwise you will likely be wasting your time.

# Answer
> 2 votes
OpenGL natively does not support occlusion queries but you can use extensions such as ARB\_occlusion\_query. The link has a project and a nice `PDF` that explains how to use it. Be careful though, sometimes the occlusion queries end up to be more costly than simply drawing the geometry. This is especially true if you geometry is not very complex.

If you provide more information regarding your scene (screenshot), a better solution could be provided.

# Answer
> 0 votes
I currently went just with ordering my vbos by distance to the camera. This seems to help the most. Unless I fail to understand occlusion queries it slows down my code and gives weird results instead of actually helping. So unless I see some more performance issues along the way, I stick with what I have.

---
Tags: 3d, opengl, octree
---


title: Where can I find fonts for my game?

text:
# Question
Title: Where can I find fonts for my game?
Where can I find fonts (preferably free, but a reasonable fee is acceptable) that I can use in my for-pay/commericial game?

# Answer
You can find many free and cheap fonts on MyFonts.com, including the Larabie Font Collection (many of which are free for commercial use)
> 20 votes

# Answer
Two good places to find free fonts are Font Squirrel and The League of Moveable Type.
> 11 votes

# Answer
If you're building a web game, Google has provided free fonts here: https://www.google.com/fonts This is a great service for web developers, because web licenses for fonts can be a gray area. They have only a small fraction of the fonts you can find on sites like others have suggested, however.
> 5 votes

# Answer
I always head to dafont.com, although the range is similar to Font Squirrel and MyFonts.
> 4 votes

# Answer
The League of Movable Type has a few fonts for free use, under a very permissive license.
> 3 votes

# Answer
As far as I can tell these XNA fonts from Microsoft are free to use (released under the MS-PL):

Redistributable Font Pack
> 2 votes

# Answer
Fonts from Canada Type have a reasonable license, and I plan on using at least one of theirs in my next iPhone game.
> 0 votes

---
Tags: assets, fonts
---


# Question
Title: Where can I find some "must see" game development portfolios?
I am trying to put together a website/portfolio and it would be great to see what others have done.

# Answer
The first thing I'd do is read "Your Portfolio Repels Jobs" by John Jones. He covers what he looks for in a portfolio, and how to ensure people actually get to the content you want them to see. Check it out here =\> Your Portfolio repels jobs

Don't scrimp on your design. Do. Not. If web dev isn't your thing, jump on wordpress and get a nice magazine theme. It really makes a difference. Google is your best friend here, and no - you don't have to fork out for premium themes to make an impact :)

Here's some examples to get you started - Top 14 Free Wordpress themes 2010 - wpbloghost dot net/free-wordpress-magazine-themes

Rick Pierce's portfolio is what you should aim for. Do not aim lower!

I'm also a massive fan of Pior Oberson's CV (pioroberson dot com). It was good enough to get him a job at Blizzard, so he's done something right.

I hope that helps! It certainly helped me get my foot in the door as a 3D artist.

N.B. Sorry about the spelled-out hyperlinks; new users aren't allowed to post more than one
> 5 votes

# Answer
Even though not exactly an example, this discusses some DOs and DONTs of demo reels and portfolios for programming positions. It also discusses a few examples of existing portfolios and what was good about them and what wasn't.

How to Make a Game Programming Demo Portfolio
> 2 votes

# Answer
John D. Carmack's portfolio :D
> -2 votes

---
Tags: web, portfolio
---