# Question
Title: Where can I find resouces for developing an "Intro to Game Development" class at a Community College?
I am an adjunct professor at a technical College in South Carolina. I currently teach courses in .Net programming and Oracle PL/SQL. We’ve noticed an influx of students who want to learn more about computer programming and game development in particular. Their main interest stems from their experiences with video games. I am a pretty good programmer and have done some simple 2D games in the past.

Now I have been asked to look at possibly developing an "Intro to Game Programming". The state actually allows the topic to be covered as an accredited course, just hardly any of the schools offer or have faculty that can instruct in the class. So, I am looking for advice/resources on how to structure the class. My initial outline is the following.

I plan to use Visual Studio Express C# Edition with XNA Game Development. The XNA platform is very popular and allows a familiar environment for students and it is FREE! I am personally a fan of Torque, but my students will all have been introduced to Visual Studio (via prerequisites) by the time they take this class, and I believe Torque will incur extra fees for them if they want to take work home and work outside the lab. Keep it simple – Input with Controls, 2D side scrolling, character and object animation, pong type games, basic sound effects and simple collision detection problems. Being an Intro class and students having to learn C# as they go, I can’t see trying to make this too intensive.

So, now the heart of my question – has anyone done this? What is the best book to use to teach XNA in a class room setting?

Should we try to write from scratch at the very beginning or go with a basic working game and teach the parts and then have them modify and improve as the semester goes along?

I also feel I need to make it team oriented and make the teams compete with a final demonstration of their games to be voted/reviewed by random selection of students and faculty.

Also, does anyone know of a program/business partnership where I could possibly be lent or given free hardware to use? Over 90% of my students are full financial aid (Cheraw, SC is very economically depressed) so I need access to game controllers, etc. Also, the computers we currently have (and budgets keep getting trimmed ) currently run Windows XP and not looking to be upgraded for at least another 2 years. So an opportunity to borrow some higher end machines would be great along with maybe and Xbox 360!

Also, I am open to using a platform other XNA, but I don’t want to get technically deeper than XNA – therefore going straight against DirectX with C++ is out of question. Also, it has to be free at least for educational usage.

# Answer
> 2 votes
Here is what I use in the class I teach: http://www.hipergames.com/palomar/CSIS240/textbook.html At Palomar College we are part of the Microsoft educational program which allows access to Visual Studio for free to faculty and students alike. Hope this helps! Alexander Ehrath

# Answer
> 2 votes
For a classroom setting, I haven't come across any book in particular that I thought would be good to teach a course with, but I'm no teacher either. About writing from scratch or starting with a basic game...

I think you should absolutely start with a basic working game and teach the parts. Rank them so that you've got a good idea of which you want to focus on, and have the students rip out the parts and re-code them knowing what their purpose is, what they're trying to accomplish by improving the part, and how to test it properly. If it's team oriented, then different students can take over different parts of the game toward the end of the class and try to bring their modifications together.

As far as your equipment goes, I'd start at one of Microsoft's Education pages and see what you can find. Get in touch with a representative as soon as possible.

# Answer
> 2 votes
The International Game Developers Association (IGDA) has a suggested framework for game development curriculums.

# Answer
> 1 votes
While I was a student, I successfully petitioned to get an intro to game programming taught at my university, WSU. The course was taught by Scott Wallace, an associate professor at the Vancouver campus. Most of the students myself included took the class at WSU Pullman (the main campus) via video streaming.

The web pages from the classes are still up. I believe 2006 was the only year the class was taught on both campuses. It's been taught off and on at the Vancouver campus since 2004. Do some url hacking, their sites are still up.

Computer Game Design 2006

I'm sure Dr. Wallace would be willing to answer some questions and give some pointers about your own class. He may be willing to share his basic course template as a starting point.

Dr. Wallace did his graduate work at UMich under John Laird. His course is based on a similar course Dr. Laird teaches: Computer Game Design and Implementation.

# Answer
> 1 votes
While doing a BS in CS at a California State University there was only one game development course which was group based where each group was to deliver a complete game from scratch in 10 weeks. Each group consisted of 4 programmers. This single game was worth 100% of the grade.

It was straight C++ and OpenGL with weekly deliveries from all groups. One of the hardest classes I've ever had but at the same time we learned everything about how game engines really work. Rarely do students learn this anymore since most are spoiled with engines or frameworks that abstract all the "hard" stuff away.

My professor published a paper about the class in **37th ASEE/IEEE Frontiers in Education Conference 2007**

**Student Teamwork: A Capstone Course in Game Programming**

The game my group created
**Images from my Portfolio**
**Video of the game from another teammate**

---
Tags: education
---


# Question
Title: How does one measure and reward social aspects in virtual worlds?
Well this sounds like a pretty vague question but please bear with me.

I know of how Gaiaonline gave gold to people who participated in forum posts.

I'm curious if in theory these could be applied to social aspects of games like Second life or Sims Online.

The question what would be specific quantifiable actions/interactions could be measured tracked for rewards and achievements that would help build a community?

(this'll probably end up as community wiki though)

# Answer
There are many in-game social actions that can be tracked trivially, because they're already going to be database transactions:

* Joining a team, and leading a team.
* Joining a guild, and founding a guild.
* Putting items up for auction.
* Creating public spaces for other players.

Additionally, your game systems can provide some affordances for socially-driven players:

* Contests - costume contests, minigame (e.g. fishing) contests, point-to-point races. Players will host these events anyway. If you provide even minimal systematic hooks for them, you can track and reward them.
* Newbie help zones / tutorials.
* Community approbation (Stack Overflow's approach). Most games have some way to "downvote" other players. Provide a way to "upvote" them too.

As for rewarding, a key point missed by many designs is that you need to award like with like to motivate people. Reward the players that progress in your combat with the +5 sword; reward the players that create your social spaces with socially-visible items like titles, clothing, or emotes.
> 4 votes

# Answer
So first of all, most "pure social" games still have a lot of economics going on so there's a lot of economy-related stuff you could give achievements for. But assuming you mean the more social-type things, you could give achievements for:

* Participating in a poll
* Upvoting/downvoting something X number of times (I remember A Tale in the Desert had challenges where, for example, a player had to get their sculptures voted favorably by denizens of the world -- this would reward voting for that thing)
* Joining the forum
* Posting to the forum **and having that post upvoted/thanked** (to address the spam issue brought up by Lo'oris)
* Karma-type rewards that can be bestowed by other players

Honestly, you would do well to look at the Badges system on this very website, as well as karma systems in places like Reddit.com. They do a relatively good job of encouraging users to be social in constructive ways.
> 4 votes

# Answer
I don't know how Gaia online does, but beware that doing such a thing you might actually make both the forums *and* the game a worst place: people will spam the forum (ruining it) just to get gold in game, where they will have an unfair advantage over other people (ruining the game too).

You must be careful to give this kind of rewards somehow only if you did something to earn it, not just farming posts or stupid things like that.

Moreover, you will probabily want not to give actual game gold, but nice stuff, like the pet companions in wow that have no effect on gameplay but are cute.
> 2 votes

---
Tags: game-design, community-management
---


# Question
Title: Why is my hitTest() not working every time?
I have a code segment in which I use `hitTest()` a couple of times but at a particular section the `hitTest` stops working. It doesn't test the collision of body `a` and body `b`.

I tried using `_level0.exit.hitTest(ourcar._x,ourcar._y,true)`, along with `exit.hitTest(ourcar._x,ourcar._y,true)`, but both don't work. Why?

# Answer
you can use these function

```
hitTestObject(obj:DisplayObject):Boolean
Evaluates the display object to see if it overlaps or intersects with the obj display object.

hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.

```

http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html
> 1 votes

# Answer
This is a very specific problem and is very hard to answer without some knowledge about your code. I'm not sure if gamedev is the right place for this kind of question?

My guess is that your entities aren't located in the same coordinate space. Is the `ourcar` entity placed in the same *level* as the `exit` entity? If `exit` is on `_level0`, then `ourcar` needs to be on `_level0` as well. Otherwise you'll have to convert the coordinates of `ourcar` to the coordinate-space of `_level0` and then perform the hit-test using these coordinates.

**Edit:** Sorry, it has been a long time since I last used `hitTest`. According to this page, the x and y coordinates must always be global coordinates. So you have to make sure the `x` and `y` coordinates are relative to the global coordinate space. You can use localToGlobal to calculate these.
> 1 votes

---
Tags: flash, collision-detection, actionscript
---


title: How to properly protect a flash game?

text:
# Question
Title: How to properly protect a flash game?
If I understand correctly, the main point of protecting a single player flash game is to keep it sitelocked. How to do this right and are there any other reasons to do this?

# Answer
> 5 votes
The best solution for site locking is to make sure the start of the url matches your allowed url:

```
if (stage.loaderInfo.url.indexOf("http://www.kongregate.com") == 0)
{
    trace("OK!");
}
else
{
    trace("stolen!");
}

```

# Answer
> 4 votes
Don't. People *will* steal your game, no matter what you do. Trying to sitelock a flash game smells of DRM to me (OK, it's not quite DRM, but it's pretty close), and you can read all about why DRM isn't going to work. That's not to say you shouldn't use any protection system at all, just not something that you have to visit their site a particular way and do the hokey pokey to play the game.

# Answer
> 3 votes
Sitelocking keeps honest sites honest, and is useful when, for example, you've got an exclusive period on a site but plan to distribute the game afterward. It's not going to stop someone dedicated enough, and I agree that it's better to put in MochiAds or something to take advantage of the distribution.

One case in which sitelocking is vital is when you are selling non-exclusive licenses after you've done a primary license. In that case, sitelocking ensures that the nonexclusively-branded version doesn't spread, since the sublicensing sponsor is paying less and you've already promised the primary sponsor all of the viral traffic. Yes, the sublicensor can circumvent it, but if you don't trust them, you shouldn't do business with them in the first place.

# Answer
> -1 votes
Buy an encoding software, so reverse engineering softwares won't work. They cost like 40-50 bucks and since game development is a long and tedious process, it really worth investing.

Example: http://www.dcomsoft.com/

# Answer
> -1 votes
you can see this topic it may help

Protect Your Flash Files From Decompilers by Using Encryption

---
Tags: flash, distribution
---


title: Developing an RPG Encounter System

text:
# Question
Title: Developing an RPG Encounter System
I'm in the middle of an encounter system for an XNA RPG. The idea is, you walk around a dungeon, and certain tiles are makred as RandomBattleTiles, and you have an area in the map defining what monsters can be encountered. What I need is a way to layout the way a monster levels and how it's stat's increase. I was thinking something along these lines:

```
<Species>
    <Name>MonsterA</Name>
    <ID>001</ID>
    <SpriteName>monstera_sprite</SpriteName>
    <Levels>
       <Level>
          <LevelID>1</LevelID>
          <Stats>
              <Attack>12</Attack>
              <Defense>10</Defense>
              <Speed>20</Speed>
          </Stats>
          <Moves>
               <Move ID="1" Level="2"/>
          </Moves>
        </Level>
     </Levels>
</Species>

```

Would this be proper? Moves would follow a similar definition pattern.

# Answer
> 5 votes
I've seen this type of XML database used in a few roguelikes.

I suggest you store the species and the random encounter tables separately.

You don't need to put a separate set of stats for every possible level. Just use one for minimum level and one for maximum. Your game should interpolate between them to get the monster's stats according to its level.

```
<Species>
    <Name>MonsterA</Name>
    <ID>001</ID>
    <SpriteName>monstera_sprite</SpriteName>
    <Levels>
       <!-- Monster's stats at level 1 -->
       <Level>
          <LevelID>1</LevelID>
          <Stats>
              <Attack>12</Attack>
              <Defense>10</Defense>
              <Speed>20</Speed>
          </Stats>
       </Level>
       <!-- Monster's stats at level 100 -->
       <Level>
          <LevelID>100</LevelID>
          <Stats>
              <Attack>1200</Attack>
              <Defense>900</Defense>
              <Speed>15</Speed>
          </Stats>
       </Level>
    </Levels>
    <Moves>
        <!-- Monster's possible moves, according to its level and the circumstances of battle -->
        <Move Name="Slash" MinLevel="1" MaxLevel="25" AiRestrictions="Always" />
        <Move Name="Heal" MinLevel="15" MaxLevel="100" AiRestrictions="HP<25%" />
        <Move Name="Poison" MinLevel="25" MaxLevel="100" AiRestrictions="Enemy.Status!=POISON" />
    </Moves>
</Species>

```

Then, separately, create the random encounters:

```
<RandomEncounters>
    <RandomEncounter>
        <ID>100</ID>
        <Probability>3</Probability>
        <ExperiencePoints>3600</ExperiencePoints>
        <Gold>1000</Gold>
        <Monsters>
            <Monster Species="1" MinLevel="17" MaxLevel="20" />
            <Monster Species="2" MinLevel="11" MaxLevel="12" />
            <Monster Species="2" MinLevel="11" MaxLevel="12" />
        </Monsters>
    </RandomEncounter>
</RandomEncounters>

```

---
Tags: software-engineering, xna, levels
---


# Question
Title: Can Google App Engine communicate with a stand alone program?
If I create a client program using say C#, or develop something for the Android or Iphone, can I use Google App Engine for the server and communicate with the client application mentioned above?

# Answer
Google App Engine communicates in the way that any other web server would. Your C# client can access Google App Engine-hosted websites and use them as a basis for communication. C# makes this fairly easy and straightforward to accomplish using System.Net.WebClient.

(On the other hand, it is more difficult to have Google App Engine "push" messages out to your clients, if they aren't polling (or "pulling") them. One strategy is to use App Engine's XMPP/Jabber support.)
> 0 votes

# Answer
As long as the client speaks HTTP, sure. If you have more of this kind of general question, SO might be a better place for them.
> 3 votes

# Answer
We used Google App Engine as a back-end for some mobile game projects. I strongly recommend it.

It's simple and very awesome, and HTTP is simple to implement on most platforms as many include API's for it. You must design the systems with a RESTFUL approach.

I also wrote an internal stat tracking and debugging tool using Goole App Engine which we used internally to monitor our test builds for console games.
> 2 votes

# Answer
You shouldn't have any problems with using Google Apps as a server for your client via HTTP. I'd even recommend it, especially since it is a free service (with some limitations).
> 0 votes

---
Tags: networking, multiplayer, client-server, google-app-engine
---


# Question
Title: How can I put Google Ads in a flash game?
What I want to do is put Google Ads in my flash game.

The first question is how can I do that?

The second question is the best place to put it; while loading, after finishing the game?

# Answer
> 10 votes
Last I checked you cannot embed Google Adsense in a Flash game/app, because Adsense is HTML+JS, which cannot be put inside Flash.

You could hover it over your Flash game...but there are compatibility issues, doesn't work on all OS/Browsers, and may cause UI bugs with your Flash game.

You could try hacking the Adsense code so that it requests the ad data and loads it & displays it inside Flash...but this is against their terms of service.

Your only option with Adsense is to place them on the same page next to your flash game (which isn't an option if you need your game to take up the full page). I suggest looking at Mochi ads, they are specifically designed to be embedded in flash games.

---

Edit: A user posted a link to Google Adsense for Flash Games...unfortunately they have quite strict requirements, which most people wont meet.

Current Requirements:

1. Game plays: Minimum 500,000 per day
2. Game types: Web-based Flash only
3. Integration: Must be technically capable of SDK integration
4. Traffic source: Must be 80% US & UK Traffic
5. Content: Family safe and targeted at users age 13 and up
6. Distribution: Must be able to report embed destination and have control over where games are distributed

# Answer
> 7 votes
Your best bet is to put google ads on the page next to your game.

---
Tags: game-design, flash, facebook
---


# Question
Title: Is Google App Engine a good platform for an online MMO?
I'm looking at some ideas of creating a smale scale MMORPG game, based in Java, this is a side/hobby project to help my learning process

I've already had a play with GAE and have put up a simple web app, I'm thinking of using this as my platform for a game

Is this a good idea? Are there any games out there that use such a platform? I can't see any limitations so far, other than Google might be able to "own" it rather than myself

# Answer
Sort of, depends on how much latency/speed you need.

Every http request (to a dedicated server) takes anywhere between 300-600 ms. In the app engine that looks more like 600-900 ms or even more(if you have a lot of queries). At the same time a single connection to the GAE has to last less than 30 secs, so...

What all that means is that you will have to be doing slow polling, which might be good enough for some turn-based, not real time games.

If you want to do a real time game you need to leave HTTP and go to TCP or UDP(especially UDP).

Having said that, if a slow latency/non-real time connection is good enough for your game, GAE scales pretty cheaply, and solves a lot of problems (no limit on the size of the db, no spam problems with large amount of emails, etc)
> 3 votes

# Answer
It's not exactly an MMO, but here's one article I read recently on using App Engine as a game server back-end:

http://gamesfromwithin.com/google-app-engine-as-back-end-for-iphone-apps

I have used GAE as a back-end for a couple of my projects, none of which was an MMO, but I certainly appreciate it as a strong web development platform that is easy to work with in general, and decidedly cheap to experiment with and bootstrap from.

As @DFectuoso points out, for a real-time MMO you are going to have some issues using any web server, much less App Engine in particular. However, a turn-based and/or social MMO quite possibly could use App Engine as the sole back-end.

Ultimately it does depend on your game architecture. There are strategies for doing near real-time or faking real-time where the main server is a web server like App Engine:

* You could do real-time communications peer-to-peer, only updating the server at key moments.
* You could attempt some real-time communication with strategies such as long polling, which is also referred to lately as "comet requests", in which you make requests to the webserver and the server never "finishes" the response which results in very long requests/polling, but allows the webserver to continually push new data as it becomes available. (Deeper comet support is an upcoming feature in App Engine, according to the roadmap.)
* In App Engine's case, you can also use XMPP/Jabber (an open IM protocol) to communicate quickly (just about real-time) with your game server. It might not be a great place to build a full real-time game, but there are many interesting chat bots written with App Engine's XMPP support.
> 3 votes

---
Tags: platform, google-app-engine
---


# Question
Title: Are there any dedicated rules/scoring libraries/frameworks/engines?
Note that this is not about graphics/physics/2D/3D/etc.! Rather I'd like to know whether there are dedicated solutions available for implementing custom rules/scoring on top of an existing framework, ideally addressing most common concepts already, for example players, matches, rule variations, game selection, preferences, high scores and the like?

Or is this functionality usually included in all those graphics oriented libraries/frameworks/engines? If so, are there any that stand out in this regard and do allow reusing the rules/scoring components easily without using the graphics part of the engine for example?

Alternatively, would you consider this topic to be better addressed by a standard Business rules engine instead, as suggested in Java Rule Engine for Game AI?

# Answer
Depending on your language, I'd write my own. The typical game's rules are generally so straight-forward (make the number of people you've killed higher than the number of people they've killed, hold this item for longer than they hold it, etc) than the maintainance of a rules engine may outweigh just hardcoding the rules.
> 4 votes

# Answer
I think you will have to write your own engine.

Have you ever looked at Zillions of Games? It's a commercial application that runs abstract games written in a script language called ZRF.

You can get some inspiration by looking at ZRF language specification. The best documentation I've found is here. Of course, you can take a look at the implementation of other games here and here.
> 3 votes

# Answer
Networking solutions sometimes include sophisticated matchmaking rule systems. I can't think of anything else.

Games have a lot of common concepts, unfortunately not all of them can be supported very well using a plugin technology or middleware. Some game engines or game tools offer prefabricated systems for making menus and highscores, but there are no general purpose solutions to implement specific screens like Preferences, Level Selection and such. These are game-specific.

Even very well documented rule systems like AD&D do not have a standard implementation. There are just too many variations possible, and each game requires its own set of rules or needs to tweak them for gameplay purposes.
> 2 votes

# Answer
> I'd like to know whether there are dedicated solutions available for implementing custom rules

Yes, they're called programming languages. :)

Seriously though, to make truly custom logic, you typically need a system that allows arbitrary conditions and actions, which is pretty much what a programming language does. Or to look at it from the other direction, it would be hard to imagine a system that could encapsulate any large variety of game rules that didn't end up resembling a full programming language of some sort.

There isn't really any sort of standardisation in game rules or scoring mechanisms across games generally, so there's not much in the way of common functionality that you could meaningfully extract in this area.
> 2 votes

---
Tags: scoring
---


# Question
Title: How to find two perpendicular lines given a single plane
Hey guys, i was wondering how i would go about finding the perpendicular lines relative to a surface normal.

For instance say i have (0,0,1) the expected output would be (1,0,0) and (0,1,0). What would be the best way of achieving this?

I realize that i will be using the cross product, but that requires two vectors, how do i get my first perpendicular line?

Thanks!

# Answer
> 5 votes
Firstly, the vectors you find will not be unique. Any two perpendicular vectors in the plane can be rotated to find two more.

To find an arbitrary pair of perpendicular vectors, just find another vector that is not a scalar multiple of your normal. You can do this by adding a constant value to one of your components (check that the other two aren't zero -- if they are, then add the constant to one of the zero components). Now that you have this other vector compute the cross product of this vector with the normal to get a vector in the plane. Then compute the cross product between this vector and the normal to get a second vector in the plane - and you are done.

# Answer
> 3 votes
> how do i get my first perpendicular line?

1. Cross the normal with any arbitrary vector. We'll call this result1 and it is on the plane & perp to the normal.
2. Cross the normal & result1 and this result (result2) is perpendicular to both normal & result1.

If the normal & the arbitrary vectors are unit length, and you normalize result1, your results will be a basis for an orthonormal rotation matrix.

edit - for the arbitrary vector, make sure it's not parallel to the normal.

# Answer
> 0 votes
If any of your normals have 0 in them, then a perpendicular vector will have a non zero component in that direction. IE (0,1,1) will be perpendicular to (x,0,0) for all x!=0. Other than that you can try (y,-x,z) for a perpendicular vector.

Also, lines are not vectors, so you are really finding perpendicular vectors.

# Answer
> 0 votes
One common application of this is to create a 'look-at' matrix for a camera

In this case you can start with your camera direction vector, and the world up vector as your second vector, and do something along the lines of:

```
vForward = normalize( vAt - vFrom )
vRight   = normalize( cross( vForward, vWorldUp ) )
vUp      = cross( vRight,   vForward )

```

And those vectors become the 3 rows of a 3x3 rotation matrix.

Beware of the case where vForward == vWorldUp!

---
Tags: 3d, software-engineering, mathematics, normals
---


# Question
Title: Which network engine/library/system to use in a .NET turn-based game?
I'm developing an abstract strategy turn-based game in C#.

Being so, high network load is not expected. The players don't even have to be connected all the time. The host could wait for the current player to connect and make his move. I know I could make a web site to run that, but I want anyone to be able to host their own games.

I need something reliable and that enables me to have good productivity.

I'm already underway with WCF. Was that a good choice? Which other network framework should I consider?

# Answer
I've been using WCF for my own turn-based strategy game, and it's worked out very well. The durable sessions area great, and duplex channels with client callbacks are ideal for pushing messages to the client at will from the server. WCF also supports multiple endpoint bindings, so you can have the local player connect through a named pipe binding while remote players connect through TCP bindings.

I recommend TCP bindings with binary formatting if you're sending lots of data on each turn.
> 2 votes

# Answer
If you feel comfortable and productive in WCF there may not be a strong reason to use anything else. I certainly think that WCF is a good place to start because if you follow its contract pattern it is an easy pattern to convert to work with other systems, should that need arise.

For one of my own projects, I started with a WCF prototype. When I started into "the last mile" I found that more often than not I was fighting WCF to get things done. I was particularly having issues with game matchmaking in WCF's peer-to-peer stack, which didn't quite give me the tools that I needed. In that project I ended up switching to XNA's network library, which gave me the Xbox-like matchmaking (and GamerTags and whatnot) that I was looking for and (badly) attempting to emulate in WCF. (Of course, XNA's networking library assumes you are working in an XNA game, and unfortunately still doesn't support publishing the game on Windows without a GfW Live contract.)

I didn't touch that much of my networking code in the switch from WCF to XNA Net, because the contracts themselves (the interface classes) didn't change all that much (other than dropping the WCF attributes). Writing Reader/Writer classes that implemented or consumed my contracts was fairly straightforward. I probably could have kept support for both with a little bit of `#if WINDOWS` mangling, but I had decided to just drop WCF support at that time, because it simplified things on that project. Perhaps interesting, in starting other projects directly with XNA Networking, I've still been using something of WCF's interface/proxy-driven "contract" pattern. I've been meaning to write a blog post on that subject, actually, because I think it is a good pattern to follow.
> 3 votes

# Answer
If you are simply passing "turn" changes back and forth then you are on the best path. WCF will allow you the greatest flexibility without adding very much to your development efforts, especially if you already know .NET.

Since it seems that latency is not an issue in your game, WCF is a great choice, because it will abstract away all of the message encoding from you, and since you don't need to eek out every last bit of performance, this abstraction should be more benificial to you than harmful.
> 1 votes

# Answer
Consider Neutron: http://www.exitgames.com/Neutron

It natively supports turn-based games, as well as account management and all the other things:

However, it costs at least $100 per month.
> 1 votes

---
Tags: c#, networking, turn-based
---


title: Methods for generating a map

text:
# Question
Title: Methods for generating a map
I'm looking to create a simple, "randomly" generated map for a small game.

The game consists of a top-down view of a world, with land-mass and ocean areas. Think of a simple outline map of the world for example.

The closest thing I can think of that I've seen before was the level-generator for the old *SimCity* games, or the *Civ* series, where you can set a preference for single continent versus many islands, etc.

What sort of algorithm would be suitable? The map will need to be moderately zoomable, so I can have a "whole world" view, and also a more zoomed-in local view, but I think I'll sort that out later.

Initially I don't need any concept of heights, just two areas - land and sea, although I might extend it later.

# Answer
The "famous" Amit (with the giant page of various game programming topics) has a game programming blog, and he just completed a 3-part tutorial of an interesting method of map generation. I really enjoyed the reads, and there's a working demo in the bottom of the third article which is pretty stellar.

**"Polygon map generation" part 1, part 2, part 3.**

This may be a technique that you want to adapt to your needs! At the very least, he mentions the algorithms he uses at each step of the process: he starts by generation Voronoi polygons, relaxes them to a more even distribution using Lloyd relaxation, uses "a simple function to divide the world into land and water", and then flood fills to determine oceans and lakes. It sounds like you can stop there, or read on for mountains and valleys and turning it into 3D and so on.
> 21 votes

---
Tags: algorithm
---


# Question
Title: Accelerometer or on screen controls for mobile UI in 3D games?
I can think of several 2D games which use the Accelerometer successfully, but in my experience as a player, character control in a 3D environment tends to be frustrating. Mostly because a 3D environment often involves a wider, continuous field of view which prevents me from sitting comfortably while playing.

Is this an unfair generalisation? Are there examples of the Accelerometer working well for 3D games on mobile devices? There is the obvious tradeoff here, screen real estate unobscured by thumbs, but is it worth it?

# Answer
> 3 votes
This is more of a question of, does the use of the accelerometer improves/or integrates well with the controls of your game or does it makes it worse. Having good controls contribute to the overall design of a game, so ask yourself whether you want to design a good game or a bad one, then implement the best controls (whether it be a touch interface, onscreen pad or accelerometer) for having the best experience for your game.

# Answer
> 3 votes
When you tilted too much, you will hardly see the screen (eyes must move), which is bad for intense action games.

I'm a joypad and keyboard gamer, so I'm used to key controls, and key or mouse controls give you an accurate directional feedback. So you know if you are driving straight.

In the X-Plane app, I found it's missing the HUD that shows your yoke position, which FlightGear has.

DO NOT use the accelerometer to look around, it's very difficult.

About Tilt to Live, it requires practice to steer properly.

That's my list of example cases.

# Answer
> 1 votes
Give the user the chance to choose between both things.

---
Tags: 3d, control, mobile
---


title: Mastermind type versus system

text:
# Question
Title: Mastermind type versus system
I'm thinking of incorporating a versus/competitive system into my webgame ( ninjawars.net ), based off of the old "mastermind" game.

Let's call choosing the color dots in mastermind the "defensive" role, and determining what color dots were placed the "offense" role.

Mastermind is already competitive, but when creating the "color dots" there's a limited amount of added difficulty that you can create (e.g. all random color nodes using a random number generator is probably the most difficult you could get \[I think that's true, random is the hardest case to crack, all one color is obviously the easiest\]) but what I would like to do is be able to allow players to increase the difficulty from their defensive role by adding to the number of color dots that the defender can use. For example, instead of 4 dots, the defender could have, I don't know, 20 dots, much harder. Or only get to place 1 dot, so they have a much simpler defense.

So the question is, how do I determine good amounts of more dots to allow the defender? Some measure of the simplicity of determining 1 dot, all the way up to the difficulty of X (quite a few) of dots? I'd really like to be able to mathematically determine number of possible combinations, but I... ...guess I was asleep during that part of school...

# Answer
> 2 votes
What you seem to be looking for is a refresher in Probability and Statistics.

For instance, if a player can choose between 4 colors/symbols for 6 spots there are `4*4*4*4*4*4` or `4^6=4096` possible combinations. 4 colors/symbols for 20 spots is `4^20=1,099,511,627,776`. With over a trillion possible combinations, that means the probability of a player guessing the 20 spot on the first try is worse than winning most lotteries.

In a game like Mastermind, each try eliminates possibilities (in Prob & Stats terms, tries are not "independent", unlike a game like "guess the coin flip"), improving the probabilities as the game continues. The more a player knows about the code from feedback (symbols locking, symbol match counts, and other feedback), the fewer combinations the player has remaining to check and the better the probability on the next check.

Hopefully that should be a good start to help you find some of the difficulty information you are looking for.

# Answer
> 3 votes
A good deal of research has been done for you, actually. The enjoyable problem is trying to see how few moves can be done to solve the problem. If you look up Mastermind\_(board\_game) in Wikipedia, you'll see that for a six-color four-slot game, there's a Six Guess algorithm, that Donald Knuth busted with a Five Guess algorithm, and later two more smart guys got it down to a little more than 4 guesses per game on average.

Letting the user know a little bit about the problem space can help make it a little easier: e.g., do you use a color more than once, is there a pattern, etc. Increasing the number of colors, or the number of slots, adds more complexity.

I'd also point out that the game goes by the name of "Bulls and Cows", "Codebreaker", and "Jotto" -- you may be able to find independent research papers under these names that are useful.

# Answer
> 0 votes
Playtesting. Make a bunch of variations (you could also vary difficulty by changing the number of available colors) and bug everyone you know to try them. Look at the win/loss ratios of the various versions and go from there.

# Answer
> 0 votes
Games are about balance IMHO, the problem I have about this question is your giving an already strong position more advantages without considering strengthening the weaker position.

The more options you give the defender naturally the harder it becomes to crack (because of permutation). But what about the attacker, competition in favor of a position is never good as it undermines the basic principle of fair play (equal opportunity).

---
Tags: competition
---


title: Scene Graph in Separate Thread

text:
# Question
Title: Scene Graph in Separate Thread
I develop my own game engine for fun (but not profit). I have rendering in one thread and my scene graph updates (velocity, etc.) in another. When it's time to render, the render thread adds the visible nodes to a new linear buffer and traverses them.

In more detail, my scene graph is triple-buffered. Each node in my scene graph has three copies of its relative and absolute transformation matrices (4x4). At any given time, one copy is written to by the scene graph thread, one copy is read by the renderer, and a third exists so that the reader or writer can move on to the next without waiting on the other. This prevents writing to something while it's being rendered and from rendering a half-updated scene graph. Somehow I've also got a fourth copy of each matrix for the user to work with so as to not conflict with the update thread. This seems to perform well by avoiding having to synchronize all the time.

However, this is a mess.

These are my ultimate goals for the system:

* Rendering and scene graph updating stay in separate threads.
* Minimize how much these threads have to wait on one another.
* Don't render a scene that's been halfway updated by the update thread. This is particularly noticeable if the camera is moving fast and sometimes it's rendered before or after an update.
* Reduced memory usage. I have way too many matrices per Node. I'm also considering moving to vectors for position/rotation/scale due to increased floating point drift with matrices.
* Ability to handle tens of thousands of Nodes. The current system does this reasonably well.

I also hope to incorporate Bullet (the physics engine) and networking in the future, neither of which I've given much thought.

What are some approaches for accomplishing a better scene graph?

# Answer
Have you read Johannes Spohr's thesis on "Pace" and its renderer? It describes a so-called "submission engine"\* parallel renderer, and may give you some ideas.

Here is the summary page (in German), and here is a direct link to the PDF which is in English.

*(\*: this link also goes to the article where I originally heard about the thesis.)*

EDIT: I'd only skimmed this previously, and I just looked at it again... and realized it really glosses over scene graph details. I guess I didn't realize how orthogonal his design was. Sorry if it's not particularly helpful.
> 4 votes

---
Tags: multithreading, scene-graph
---


# Question
Title: Good ways to edit arbitrary collision shapes for 2D physics engine?
Assume you have several 1024x1024 textures which contain an arbitrarily shaped and relatively complex cave system whose walls need to have collision polygons defined. The polygons need to be convex to work with the physics engine.

What kind of process and tools can you think of that would make editing the vertices of these walls as efficient and painless as possible? Especially considering that the polygons need to be convex, and the designer needs to see when that is not the case.

# Answer
Why not let the Artist/Level-Designer draw the rough outline of the cave, then use an algorithm like the ear-clip algorithm to create convex polygons from that outline?

You could even use a tool like potrace or autotrace to create vector outline from you images. Then use these directly or provide them to your Artist/Level-Designer as a starting-point.
> 3 votes

# Answer
You could run your textures through an algorithm to generate polygons based on images, and store the polygon data for use separately.

Several open source physics engines, such as FarseerPhysics, already incorporate a similar feature that you could inspect.

Alternatively, write a simple tool to load the image and allow you to manually 'draw' collision polygons. Depending on how detailed you need your polygons to be, and how many you'd need to create, this may actually be an easier option.
> 1 votes

---
Tags: tools, physics
---


# Question
Title: How to create simple physics for a group of balloons colliding in the screen (2D)
The game is 2D, how can I make simple physics for a group of balloons colliding in the screen.

What I need is the balloons not to overlap and to bounce when they reach the limits of the screen or other balloons.

Should I use something like box2d or is there a simple algorithm to do something like this?

# Answer
> 2 votes
There are simple algorithms to do this, but they are probably better implemented in Box2D than you could yourself. In particular:

* Box2D will let you have differently-sized and differently-dense (and so differently-massed) balloons, as well as different surface friction, and simulate them correctly.
* Box2D will give you realistic behavior if you want to simulate e.g. an object heavier than air falling onto the balloons.
* Box2D uses spatial subdivision, reducing the number of checks you need to do.
* Box2D will correctly simulate a balloon "pushing up" between two others, which is going to be tricky to get good and stable if you hack up your own penetration-and-correction test.

# Answer
> 2 votes
It sounds like this might be best approximated by circle-circle collision.

Store the balloons in terms of a center point and a radius (of a circle which closely matches the balloon art). Given this, collision checking is simple! Remember your pythagorean theorem. If one balloon is at (x1,y1) with radius r1 and the other is at (x2, y2) with radius r2, then:

```
if((x2-x1)^2 + (y2-y1)^2 < (r1+r2)^2) {
    // collision
}

```

So basically, the distance between them is `sqrt((x2-x1)^2 + (y2-y1)^2)` and the collision distance is `r1+r2`. Since `sqrt` is an expensive operation, square both of those to get rid of the square root, and you're left with the code I wrote above.

---
Tags: physics, box2d
---


title: How to handle a Sprite Class?

text:
# Question
Title: How to handle a Sprite Class?
Currently I am learning XNA and while playing around with some tutorials knowing what I am aiming for a game it made me think that the Sprite Class will be something very important and re-used a lot of times, not sure if I am mistaken or not with this thinking.

Bellow you can see the Sprite code I am using at the momment and I was wondering:

* How a Sprite Class should be or what functions in general it should have or am I mistaken that the Sprite Class will not be used by every sprite in my game ?

For example, in my sprite I could hold all property of the sprite even if one property is not being used, let's say an object that does not move around so it would have no speed which I could simple have a property saying that speed is disabled.

So i guess my real question is:

* **How should I structure my Sprite Class to have the best usage out of it ?**

If you have a sample code to show I would appreciate aswell not really necessary, just for reference (also it doesnt need to be in c#).

**Hope my question is not too confusing.**

```
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace MyGameTest
{
    class Sprite
    {
        public string AssetName;

        public Rectangle Size;

        private float mScale = 1.0f;

        public Vector2 Position = new Vector2(0, 0);

        public Vector2 Speed = new Vector2(0, 0);

        private Texture2D mSpriteTexture;

        public float Scale
        {
            get { return mScale; }
            set
            {
                mScale = value;
                Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale));
            }
        }

        public void LoadContent(ContentManager theContentManager, string theAssetName)
        {
            mSpriteTexture = theContentManager.Load<Texture2D>(theAssetName);
            AssetName = theAssetName;
            Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale));
        }

        public void Draw(SpriteBatch theSpriteBatch)
        {
            theSpriteBatch.Draw(mSpriteTexture, Position,
                                new Rectangle(0, 0, mSpriteTexture.Width, mSpriteTexture.Height),
                                Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0);
        }
    }
}

```

# Answer
I have found the concepts and examples in Johnathan Harbor's book VB Game Programming with Direct X to be **very** useful when writing XNA and older MDX code. The book is OLD, and its in Visual Basic 6, but his examples do use encapsulation (since vb6 didn't support inheritance) but they best illustrate the concept of building a basic 'system' through classes - I'd recommend browsing through it in the bookstore or library just to get some of the ideas: http://search.barnesandnoble.com/Visual-Basic-Game-Programming-with-DIRECTX/Jonathan-S-Harbour/e/9781931841252 -- Thats not to say there are not any of these concepts well demonstrated on line or by other authors, but I know and can vouche for the ones in this book.

(This started as a comment but became too long pretty quickly)
> 1 votes

# Answer
**You're thinking ahead of yourself**, trying to implement everything before you actually use it. **You don't even know what your Sprite class needs to do!** Why are you writing it then? Classes are meant to serve a purpose. You don't write them ahead of time; you write them as you need them.

Start by actually starting on your game. You'll reach a point where you need to use a Sprite class. So then make it (or use it as it currently is). When you run into something which needs to be in the Sprite class, add it. But stop what you're doing, don't try and write a do-everything Sprite class because you'll just end up with a bunch of unused features that waste your time and probably aren't **tested** or implemented right.

For example, right now. That entire class is unimplemented. There's no point to it until there is something using it, and once you start using it, it will be clear exactly what you need and don't need.
> 11 votes

# Answer
Well, a sprite is just a texture with a scale and coordinate in space, there'll be hundreds or thousands of them if you're going to use animated sprites. You'll need something to handle sprite flipping ie another class that groups sprites for animation purposes and can flip between them accordingly?

Here is some basics from FlatRedBall and its wiki (source is closed though); consider having a base class that is positioned, ie that has x, y (possibly z), rotation, scale, velocity, acceleration and whatever positioned objects will need. Have the sprite class and other relevant classes inherit this. Then have another class for actual game characters (entities) that are also positioned, but can either contain or some way be grouped (IAttachable) with sprites. Game characters generally need state as well as a lot of other things like collision bounds.
> 3 votes

# Answer
Speaking as somebody who has actually had a need to implement a sprite class for XNA, here's how I did it: First I took a look at SpriteBatch's draw function (the one with all argument specified):

```
public void Draw(Texture2D texture, Vector2 position,
     Rectangle? sourceRectangle, Color color, float rotation,
     Vector2 origin, Vector2 scale, SpriteEffects effects,
     float layerDepth);

```

And then I made my sprite class have these members:

```
class Sprite
{
     Texture2D texture;
     Vector2 position;
     Rectangle? sourceRectangle;
     Color color;
     float rotation;
     Vector2 origin;
     Vector2 scale;
     SpriteEffects effects;
}

```

Notice the similarity? ;)

**However** I have a rather unusual reason for needing such a class. You probably **don't** really want one!

What you are doing in your code is storing information about the image you are drawing as *data* inside an object. But what would be far better is to express as much information as possible **directly in the code**. In other words, say you have a bouncing ball with a position and a velocity. Here's what your class might look like:

```
class Ball
{
     Vector2 position, velocity;

     // Texture is a special case because the data cannot be expressed as code
     Texture2D texture;

     public void LoadContent(ContentManager cm)
     {
          // But the name of the texture can be!
          texture = cm.Load<Texture2D>("ballTexture");
     }

     public void Draw(SpriteBatch sb)
     {
         sb.Draw(texture, position, null, Color.Red, 0,
                 new Vector2(texture.Width/2f, texture.Height/2f),
                 Vector2.One, SpriteEffects.None, 0f);
     }
}

```

Note how as much information as possible about drawing the object is simply "hard coded". You should always have a preference for doing this, and make it data-driven only when absolutely necessary.
> 1 votes

---
Tags: xna, c#, sprites
---


# Question
Title: How to make the player slide smoothly against terrain
I'm making an isometric game. When the player tries to walk diagonally into a wall I want them to slide smoothly across it, so whatever portion of the movement would be legal is used, and anything in the direction of the normal is thrown away. Walls can be any angle, not just vertical or horizontal, and the player has 360 motion.

I feel like I'm almost there but I can't put the last piece into place.

Update: great news everyone! I have it working. But... I'm a bit confused what I should be normalising and what not. The normal just needs to be a unit vector, right? but then I'm mixing that with my input so I'm normalising that - am I wrong?

By the way, I have also found that I need to push the player 1 pixel in the direction of the normal, so that they don't get stuck on things - works well.

# Answer
> 13 votes
Just project your vector of motion onto the plane normal and then subtract the result from your vector of motion.

```
Vector undesiredMotion = normal * (dotProduct(input, normal));
Vector desiredMotion = input - undesiredMotion;

```

Something like that anyway. Although in your lovely diagram the input seems to be away from the wall so I'm slightly confused.

# Answer
> 1 votes
While it's straight forward to just remove the component of the motion that is in the direction of the normal, it may suit your gameplay to rotate the motion vector instead. For instance, in a 3rd-person action game, it may be easy to get slightly hung up on walls and other boundaries, so you can make some guesses at what the player intends.

```
// assume that 'normal' is unit length
Vector GetDesired(Vector input, Vector normal) {
   // tune this to get where you stop when you're running into the wall,
   // vs. bouncing off of it
   static float k_runningIntoWallThreshold = cos(DEG2RAD(45));

   // tune this to "fudge" the "push away" from the wall
   static float k_bounceFudge = 1.1f;

   // normalize input, but keep track of original size
   float inputLength = input.GetLength();
   input.Scale(1.0f / inputLength);

   float dot = DotProduct(input, normal);

   if (dot < 0)
   {
      // we're not running into the wall
      return input;
   }
   else if (dot < k_runningIntoWallThreshold)
   {
      Vector intoWall = normal.Scale(dot);
      intoWall.Scale(k_bounceFudge);

      Vector alongWall = (input - intoWall).Normalize();
      alongWall.Scale(inputLength);

      return alongWall;
   }
   else
   {
      // we ran "straight into the wall"
      return Vector(0, 0, 0);
   }
}

```

---
Tags: mathematics
---


# Question
Title: How do you add a scripting language to a game?
Let's say I have a game written in C++. But I want to add some modding or scripting functionality to it. How would one go about adding a scripting functionality to your game?

# Answer
> 28 votes
First of all, you should decide what part of your game is scripted. One option is to have a fully scripted game in the sense that while the time-critical backend operations are coded in C++, all the game logic is in the scripting language. Designers use the backend as a an API called from the high level scripting language. On the other extreme, you can have few specific places where scripts are used, such as the user interface or scripted sequences, with the majority of the game code is still in C++. There are advantages to each approach (speed, flexibility, compilation time, scope of game, etc.), but you need to decide that beforehand.

Once you know how you want to use scripting, you now need to decide if you're going to use an existing scripting language or your own domain-specific language. Today there are many scripting languages to choose from with different design goals and target audiences, so I'm not sure if it's worth creating your own anymore. If you decide to implement your own, here are some resources:

Lua is a popular lightweight and easy to embed scripting language. It uses a stack for communication between the host and embedded language and it was successfully used in many professional games. Sol2 simplifies the process of binding Lua and C++. If you're not fond of Lua's syntax, Moonscript is a language that compiles to Lua and adds a nice set of features.

Other options include AngelCode, which allows you to call C and C++ functions directly. Python and Ruby are a bit more complex to embed, but are very pleasant to program in. If you want to embed Python then take a look at Boost.Python. Another idea is embedding JavaScript to take advantage of the fast scripting engines developed for browsers (see V8 and SpiderMonkey).

# Answer
> 2 votes
I wrote a post about embedding GameMonkey script to a game using DragonFire SDK here.

Basically the idea is to expose your C\C++ functions to your chosen scripting language and use them from your script. In my tutorial, I exposed 2 functions from DragonFire SDK. At game start, I call onStart function from script and on update, I call onTimer function from script.

Hope that helps!

---
Tags: c++, scripting, modding
---


# Question
Title: How to include compiled GameMonkey script in final game release instead of script source?
I use GameMonkey to script the game play and use the script from my C\C++ host game. I've got it working the script with my engine. But I have a question. In these engines like Torque, Unreal, Unity, etc. when you finally build the game, all the scripts are also compiled and you don't need to ship all the script source.

How do I do that? Right now my engine needs GameMonkey source script to process the game logic.

Thanks

# Answer
> 1 votes
From the GameMonkey forum

> You want to gmMachine::CompileStringToLib() and later ExecuteLib(). You will want to do that with SetDebugMode() disabled otherwise your source code will be included in the compiled library.

http://www.somedude.net/gamemonkey/forum/viewtopic.php?f=5&t=555&hilit=compile

---
Tags: scripting, release
---


title: Component-Based System online resources

text:
# Question
Title: Component-Based System online resources
I've been considering moving to a more component-based approach in my games. Does anyone else have any decent reference material or sample implementations that would help make this transition a little easier?

# Answer
Please check out the links that I put in the bottom of this answer. A good number of them thoroughly answer this question, and I'd rather not duplicate the information here.

In particular, there is a question, "Component based game engine design" which I think directly answers your question.
> 9 votes

# Answer
Game objects as sets of components:

http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
http://gameprogrammingpatterns.com/component.html

Game engine as a set of components independently working with shared Data Storage:

http://www.acims.arizona.edu/PUBLICATIONS/PDF/JeffPlummerMSthesis\_wo\_Appendix.pdf
> 8 votes

---
Tags: architecture, entity-system, component-based
---


title: What are the free 3d OOP game engines?

text:
# Question
Title: What are the free 3d OOP game engines?
Could you please list a few free 3d OOP game engines, along with the pros and cons? Embeddable in VB.net would be great.

# Answer
> 3 votes
Existing questions which should answer you:

Also see the 3D Game and Graphics Engines Database.

# Answer
> 2 votes
OGRE3D, IrrLicht, Horde3d, Panda3d.

# Answer
> 1 votes
It depends on the language that you want to use. I have always liked the format of Java so I used the jMonkeyEngine to do this

---
Tags: vb.net
---


# Question
Title: Does using an licensed game engine prevent you from open sourcing a defunct work?
I'm curious as my previous company is asking us (people who developed the game) on what to do to the game since it's no longer financially viable.

My suggestion was to open source it so people can still enjoy the game at the same time it could at least be improved.

But we did use a licensed Torque engine which was mostly recoded/reworked. Not sure if their license allows for the move though.

(Also not sure if this is an appropriate question to ask here)

# Answer
> 10 votes
Most likely not - I doubt Torque would want their engine to be open-sourced.

For a real answer, read the license you signed when you bought the engine.

For an even better answer, read the license, then hire a lawyer to read the license.

What you may be able to do is distribute the Torque modifications as a patch. Anyone who has the engine source will be able to apply the patch and release a build. But, again, *consult a lawyer* before doing this.

# Answer
> 4 votes
I would say that the answer lies in your Torque license, which your company's legal department should read and base their decision on that.

You could also just email the Torque folk (they're *quite* friendly!), explain what you want to do, and ask if they see any problems or can suggest a path that gets you what you want.

This advice works in the abstract, too, and can be the answer for any question of the form "does my XYZ license allow me to do FOO?"

# Answer
> 1 votes
Your license with the engine owner prevents you from open sourcing it, not the fact that you used or modified it. Reading said license will confirm this.

Another option would be to give it to Instant Action (the company that owns what was once known as Garage Games, who created Torque) and let them distribute it as a sample, or otherwise integrate your changes into their work.

Console manufacturers explicitly disallow releasing code that uses their APIs to the public or to any non-licensed third parties, too, and I wouldn't be entirely surprised if Torque's license also forbade doing this with any of the code that you wrote.

# Answer
> 0 votes
Maybe you can make your TorqueScript gameplay code open source rather than the actual engine source.

---
Tags: legal, licensing, open-source
---


# Question
Title: XNA or SlimDX (DirectX 10) for multitouch rhythm game simulator
I'm looking to develop a multitouch rhythm game in C#. It is aimed to be a simulator for an existing arcade game, similar to this: http://www.youtube.com/watch?v=TAiNNpA3wwg So far, I've decided on several requirements for the game that should be present:

1) Unicode text display, without the characters being known beforehand (i.e. the displayed strings are not known at compile time, but entered in by the user).
2) Support for display of all the common image formats (PNG, JPG, BMP, and GIF) and playback of various audio (MP3, WAV, OGG, FLAC) and video formats.
3) Full multitouch support (I'd like to support as many simultaneous inputs as the user's hardware allows). **VERY IMPORTANT, MUCH MORE SO THAN THE OTHER TWO.**

I had been fiddling with XNA, but I've found drawing arbitrary Unicode text with SpriteFonts difficult (it hates it when you try and load the entire CJK Unified set). In addition, I haven't found an easy way to load certain formats like Ogg Vorbis audio in XNA.

So, with this in mind, I've started looking into using DirectX 10 via SlimDX. However, I'm very lost, and am unsure of how to start with it and if the features I need are even present in it. To top it off, SlimDX documentation seems to be very lacking, especially with me being new to game development. Which one of the two frameworks would be best for my goals?

P.S.: Any references to starting game development with SlimDX (June 2010) would be very helpful as well, especially in relation to Direct2D, which what I'll most likely be using.

# Answer
All of these are pretty high level requirements you have. You may be answering your own questions in that SlimDX is intentionally very low-level, whereas XNA tries its best to answer these high-level requirements, even if the XNA answer isn't necessarily the answer that you particularly seem to be looking for. I haven't worked with SlimDX, so I can only provide some of the perspective of an XNA developer, but hopefully some of it will be useful.

The better questions for XNA versus SlimDX more revolve around things like: which platforms are expecting to support? How much of DirectX do you know? How much of DirectX internals do you *care* to know?

1) This is a large problem in program design, regardless of platform. There is a reason that text layout libraries are large monstrous beasts. If full, true Unicode support is that important to you, you are ultimately going to need to use non-game-oriented frameworks like WPF, Pango, etc. WPF and/or Silverlight may in fact be a better choice for your game than XNA or SlimDX. (SlimDX does appear to give low level access to the Windows Font API, but using it is rarely as straightforward as you might think and at the end of the day WPF is still Windows' best repository of handling code for dealing with complicated Unicode issues.)

The XNA answer is that you need to find ways to cut down the amount of character graphics you load at once. Worst case that means that you write your own replacement for SpriteFont. (Writing a better SpriteFont isn't terribly hard, and to my knowledge you would need to do something like that in SlimDX anyway.) Most likely you find ways to partition and dynamically load SpriteFonts (that are each individually much smaller than, say, CJK Unified) as necessary at runtime. Certainly XNA doesn't have any direct samples to that effect, but you may find something in the community to help.

The most common answer is really just to constrain your input set. Supporting all of Unicode is hard, but it is easy enough to find common subsets that should make most of your users happy. I'd suggest taking a look at the input methods in various games. You'll notice, for instance, that even in CJK modes something like the Xbox built-in keyboard is going to use just a fraction of CJK Unified... A game isn't a word processor and gamer probably isn't going to expect full unicode support at runtime.

2) There are many .NET libraries that you can find to support various formats. Most of the image formats have good support in the standard library. Music and video formats can be trickier depending on how much you really need them (and which platforms you are looking to support). Again, taking good limits here can drastically simplify what it is that you are trying to accomplish.

For instance, one strong available library in XNA is the MediaPlayer interface:

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.media.mediaplayer.aspx

This API particularly allows you to interact with people's music libraries on the Xbox and Windows Phone 7 (and Zune). If you want people to provide their own music libraries, on those platforms, that is the API that you must use (there are no other options), and you are going to have to accept its limitations in format support. (Which most people will already be used to and have knowledge of if they are storing portions of the music libraries on those devices.)

On Windows there are certainly many more options for libraries that you can make use of for format support. Finding these libraries are probably going to be the same research regardless of XNA or SlimDX.

3) Multitouch is equally complicated in both XNA and SlimDX. XNA provides a useful multitouch API for Windows Phone 7 (and Zune HD):

http://msdn.microsoft.com/en-us/library/ff434208.aspx

Unfortunately the XNA multitouch API doesn't currently support Windows. On Windows with both XNA and SlimDX you will probably be using the same Windows multitouch API, which to my knowledge doesn't have a good, strong managed (C#) wrapper at all:

http://msdn.microsoft.com/en-us/library/dd371406(VS.85).aspx

There may be third party libraries that you can find, but again, that research will probably be the same regardless of what your framework game is built in.
> 6 votes

---
Tags: xna, c#, directx, directx10, slimdx
---


# Question
Title: Difference between Vorbis OGG and M4A/MP4/AAC?
From what i know m4a and aac are the same thing with mp4 allowing video while the former only allows audio.

Whats the difference between vorbis ogg and m4a? I looked it up and it seems that m4a/aac are patent free. What are reasons i may want to choose one from the other?

Assume source will always be lossless (wav/aiff/flac) and i am choosing the encoding to distribute with my game/demo

# Answer
Ogg Vorbis is soup-to-nuts Open Source. Every bit of the Ogg Vorbis specification is available and there are no known patents that apply to Ogg Vorbis. It is often free and easy to work with. (That is, if your platform/framework of choice supports working with it. For instance, XNA/XACT don't support Vorbis, but if you are using XACT you will be giving it your lossless files anyway and using its built-in compression.)

AAC is the product of a working group of corporations with several commercial goals in mind. M4A/AAC is not patent-free, it is patent encumbered:

http://en.wikipedia.org/wiki/Advanced\_Audio\_Coding#Licensing\_and\_patents

You don't need to pay patent royalties to use AAC files as a consumer, but if you were to deploy an AAC codec, for instance as a library dependency in a game, you may need to get a patent license and pay for it. (I am not a lawyer. You should talk to a lawyer.) That said, many platforms that you might be working on may already have an existing codec in place. XNA supports AAC in many places, and so does many Apple libraries, as two examples. Developing a cross-platform game with AAC is a bit more difficult (and you may want a lawyer involved).

In terms of "quality", just about every music codec out there is sufficient at a high enough bit-rate. In my experience the "good" bit-rates for normal music listening for Ogg Vorbis and AAC are reasonably similar. I think Ogg Vorbis is a good format and certainly a useful one when you need something open source and free as in beer and speech. (I have a good chunk of my personal music library in Ogg Vorbis, in fact. I like supporting strong open source efforts when I can.)
> 11 votes

---
Tags: audio, ogg-vorbis
---


# Question
Title: Any free 2D C\C++ framework that supports iPhone?
I'm looking for a C\C++ game dev framework that supports iPhone. It should have least Objective-C requirement to use it.

The closest one I could find is Kanji engine. But that's not free.

Other frameworks like cocos2d need to be code in obj-c.

So do you know any C\C++ game dev framework for iPhone?

Thanks

# Answer
Airplay SDK works well.

http://www.airplaysdk.com/

I've used it with the express edition of Visual Studio. It comes with a decent emulator for windows too, and supports more than just iPhone platform:

* iPhone OS
* Android
* Samsung Bada
* Symbian
* Windows Mobile
* BREW
* Palm/HP webOS
* Maemo

.. it also has pretty generous Indie licensing terms. The iphone/ipod/ipad license is free. Other platforms are available for $99 per seat/year if you earn \< $100k per year.

http://www.airplaysdk.com/licensing\_details
> 2 votes

# Answer
Allegro is a C/C++ 2D cross-platform programming library. They don't mention iPhone as a supported platform on the website, but it appears there in the recent changelog, so probably you can grab the development version and find something useful there.
> 4 votes

# Answer
I've used cocos2D on a project. It's pretty neat and easy to understand.
> 3 votes

# Answer
This might be of interest: http://code.google.com/p/oolongengine/
> 1 votes

# Answer
## Angel Engine

I don't know that the stable version supports iPhone yet, but it does support Mac OSX. There is a development branch thats specifically to enable iPhone support.
> 1 votes

# Answer
Ogre3d (www.ogre3d.org) supports pretty much everything, and includes an SDK for iPhone development as well (OGRESDK/SDK/iPhone directory). It is free so no worries about any fees for using it. It is primarily a 3d rendering engine, although plenty of people have used it for 2D work, so if that is a problem you might want to look at some of the 2D options listed above.
> 1 votes

---
Tags: c++, iphone, c
---


title: What C++ GUI library can you suggest?

text:
# Question
Title: What C++ GUI library can you suggest?
I'm building my own game engine in C++ and I'm currently deciding on what user interface I should use.

Should I use a library? Should I make my own?

# Answer
In fact, Qt widgets can be integrated with OpenGL and OpenGL can be easily integrated with Qt (QGLWidget). Of course, the platform native looking widgets might not be exactly what you are looking for, but do not worry, there are ways to customize them, create your own or use something else which would better suit your needs, such as Qt Quick (which you should be able to integrate as well).

If you are interested, do not miss these links: Widgets enter the third dimension: WolfenQt and Accelerate your widgets with OpenGL
> 11 votes

# Answer
I don't think you should write your own, the task of creating a game engine is so huge by itself, if you around there are many many libraries with good licenses that you could use, and modify to your liking.

For a game engine I would go for an Immediate mode GUI. More informations here: http://www.mollyrocket.com/forums/viewtopic.php?t=134

The key idea is to draw the component and control the interaction at the same time:

```
if (button(id, position, size))
{
    button_was_pressed();
}

```

For one, Unity uses a similar concept.

You can find an implementation by NVIDIA, used in their demos: http://code.google.com/p/nvidia-widgets/
> 9 votes

# Answer
Personally, I would recommend CEGUI. It's open source and pretty good. However, what you have to keep in mind is that it can be very, very verbose if you write out everything by hand.

But, on the plus side, it has renderers for both OpenGL and DirectX. I managed to put it on top of the template I normally use, which writes to a texture directly using a VBO (it's kind of hacky).

The game in question was for a networking assignment. The assignment was to have a networked game, with a lobby. I knew the lobby was going to be a pain in the neck to make, so I picked a library that did most of it for me.
> 8 votes

# Answer
The problem with most GUI libraries (Qt is probably the most popular C++ one that isn't Windows-only) is that most won't integrate well into an engine. Traditionally in a GUI app, the GUI library controls the main loop and you just hook up callbacks to events. In a game engine you generally want to control the loop, so it can be tricky at best. Maybe you are looking for something that will just handle drawing controls and dialogs and such into an 3D context you pass it? Those can be a lot harder to find :-/
> 5 votes

# Answer
I strongly believe in write your own but then again I'm very oldskool. Fighting with yet another GUI lib to do just that one thing that you want tends to drive me nuts, added to the fact that most game GUIs are quite trivial so you don't have to go all-out on MDI and super OO design where buttons can have scrollviews that highlight when you happen to hover over a taskbar on the side of a checkbox with draggable thumbs - or something like that. Different strokes for different folks I guess.
> 4 votes

# Answer
One option that might be worth investigating is using WebKit to render your user interfaces and doing all your UI with CSS/HTML/Javascript.

Here's an open source implementation (Berkelium), and here's a closed source, commercial implemtation (Awesomium)
> 3 votes

# Answer
I would suggest IUP - Portable User Interface: http://www.tecgraf.puc-rio.br/iup/

I've only used it with the Lua programming language but it was very easy to use. It only comes in C, LED and Lua flavors but you can easily make a wrapper for it.
> 3 votes

# Answer
I am personally using CEGUI in my game project, and it is a pretty robust solution. Problem is, sometimes it almost feels like to make one tiny change your altering tons of files.

I have not used it, but libRocket just went completely free, removing all license fees and what not. The cool part about this lib is that you write it in html/css syntax. http://librocket.com
> 3 votes

# Answer
Just raising an interesting suggestion, if developing the game for Windows, use the Win32 API. Just use the normal windows controls (I would recommend using the ATL/WTL libraries) but make them owner drawn.

I saw this technique being used in the first Unreal Tournament game, while looking through the publically released headers (for mod makers).

One of the key benefits to doing this is having the whole Windows UI infrastructure at your disposal, as well as maintaining the user's preferences for keyboard repeat rate, mouse sensitivity, double click speed, and other things. Also if you obey the rules the interface will be fast and flicker free.

The drawbacks are that you'll still have to write some code to subclass the windows controls to make them owner draw so that you can apply your own graphics and effects to them.

Just throwing this out as an idea.
> 2 votes

---
Tags: c++, gui
---


# Question
Title: Most Efficient way to read a Settings Configuration File
I have been working on a game for quite a while, and I am using Ogre3D for the rendering engine. It is getting to the point I need to move adjustable settings to a configuration file such as video settings/options, player keybindings, etc.

I am using RapidXML for parsing and loading my scenes, but I am not sure this is the best way to go about doing configurations. As a long time fan of Valve games, I know there's are just a long list of settings, basically no grouping, just a list. Where as UT games do something like

\[VideoOptions\] ... ...

\[GameSettings\] ... ...

Anyways, I am just wondering what the best way to go about this is.

# Answer
> 5 votes
This probably isn't the optimal solution, but I'm currently using Ogre's ConfigFile class (here is the API ref for it) for simple gfx/control/whatever config settings. Not a terribly robust solution, but it's worked fine for simple stuff.

Its format is similar to the UT example you gave, for instance:

```
[GraphicsSettings]
Resolution=1024 x 768
Antialiasing=2

[ControlSettings]
InvertLook=No
Sensitivity=2.0
...

```

# Answer
> 4 votes
You may also be interested in Boost.PropertyTree. It let's you access properties in a hierarchical manner, e.g. `settings.get<int>("Graphics.Resolution.Width")`. The are parsers/loaders available for XML, JSON, and more.

# Answer
> 1 votes
Another option is to embed a simple language like Lua and expose the configuration values you want to Lua. Then your configuration file becomes a series of assignments, and can be as complex or as simple as you like. I probably wouldn't do this just for loading configuration files, but scripting languages do come in very handy for many aspects of game development so it's worth considering.

---
Tags: game-design, c++
---


# Question
Title: How to represent a game character in code?
In a previous game I wrote I had a game character class. This class tracked the location, velocity, and a set of states. Except the states were tied very close to the animation. Each state would have a list of buttons that can transition it other states, and an animation that would go with that state (you could also do per-frame animation state changes, if you wanted to do something like have a very specifically timed punch or something). All of the collision data for the character was done on a per animation-frame basis. This was done for a fighting game, so it seemed necessary at the time to have the animation and collision tied so closely to the character state.

But the programmer in me feels like this is mixing responsibilities. And now I'm making a game engine that I want to be a little bit more generic than that. How do you typically organize the structures relating to the characters, how they're drawn, how they interact with each other and the world, etc?

I realize this is sort of a vague question that depends on the type of game I want to make, but I think seeing how other people handle this would be useful.

(and if it matters, this is all for a 2D game.)

# Answer
> 8 votes
If the game behavior and the animation are closely related - as they are in fighting games - this is not necessarily mixing responsibilities.

As munificent said in Why are MVC & TDD not employed more in game architecture?, *In a game, \[model and view\] are much closer to each other. The game world (model) is typically a set of entities positioned in some virtual space. The game view is also a set of entities positioned in some virtual space... The end result is that the line between model and view in a game would be arbitrary and not helpful: you'd end up duplicating a lot of state between them.*

In other words, if a purported abstraction isn't helping parcel responsibility and improve maintainability, it's not abstraction, it's just a division.

As to how I'd make a game engine that supported any model I needed - whether it's a closely tying animation and physics bits, or a total separation of object interaction and renderer, or both for different things in the same game - I'll give the standard answer. Evolve your hierarchy with component-based entities.

---
Tags: software-engineering, fsm
---


# Question
Title: Best way to store a word list in Java/Android
I'm building a game where I form words (think Scrabble) and I need to have them validated in real-time, meaning that I need to have some sort of word list loaded where I can check if the word made exists or not.

I was wondering what would be the best way to store that list, should I just create an Array or use some sort of database (sqlite3 in this case).

Thanks

# Answer
One of the most space-efficient ways to store dictionary words for quick lookup is a trie.
> 3 votes

---
Tags: java, android
---


# Question
Title: How can I design an effective game object interaction scheme with a component-based architecture?
This is a design question... I'm sure this could be generalized more, but I'm having a hard time with it. I am wondering about design for game object interactions - here is my example (2D puzzle-platformer).

Say the player is trying to progress through a level. There are many lights that can be pointed in different directions. Here is an example of how these light objects might interact...

* One light projects a platform that allows the player to cross a gap
* One light decreases the friction coefficients of anything it touches, another increases it
* One light nulls the effects of all lights, which would make the platform disappear while that light is on and null the friction modifiers
* Etc...

What is the best way to approach this problem when using a component architecture? Components for each major object seem obvious, as well as a clean way to define their effects on the environment. A class to "resolve" interaction (seems like that could become a mess quickly)? Some usage of the decorator pattern to create combined objects for those that are interacting at a given time? A data structure that lends itself to this?

Also, connecting audio to these interactions? It seems like connecting audio to the system would be just like connecting any other property, like visibility or player movement/collision.

Obviously as more components are added it would be nice if there was a robust system that could handle new ones with little modification, but I am not familiar with how to go about designing this.

Other Information: The engine I am using is an XNA engine called IceCream.

# Answer
> 5 votes
In an object oriented system, the only real answer to the question of *what's the best way to do X* is that you should just do it the most straight forward way you can think of to get something up and running, and then change it when an easier expression becomes apparent. Concerning yourself with choosing the right pattern before you've written any code is a good way to saddle yourself with the wrong answer from the get go; let all thoughts of patterns and components melt away and just follow these steps, starting from where you are today (assuming you have implemented a light component):

1. Add code to the light component to project platforms. (Get this working.)
2. Copy that component into a new component, remove the platform stuff and add code to decrease friction of appropriate objects. (Get this working, verify that #1 still works.)
3. Copy that component into a new component, removing the "new" code and add stuff to disable the other components' effects. (Get this working, then verify that #1 and #2 still work.)

At this point, you will (probably) have a ton of duplicated code. Extract common code into functions or another class (maybe a base class) or whatever seems appropriate. Just because you started with a "light component" though doesn't mean that LightComponent is an appropriate base; it could be that whatever code made up the light component isn't really a "component" per se and maybe that will be best represented by a set of functions or even a separate class that is aggregated into your new components (as a member variable).

# Answer
> 2 votes
In general terms, when an object of type A interacts with an object of type B, you want to have some effect C. This is called "double dispatch" and is very hard to do elegantly in C-like languages.

The effective but hard-to-maintain way is just a bunch of switch and if statements, depending on the types of your objects. You'll feel dirty writing it but it will get the job done.

The Visitor pattern is a more robust solution that hides the nasty type switching, but can be clumbersome to set up.

Normally any kind of type-switch in your code is a smell, but here you're trying to generalise polymorphism, which normally switches functions based on a single type, to switch functions based on two types. Polymorphism is a foundation of OOP so it's not a smell.

# Answer
> 2 votes
Let me see. This is just something I cooked up in my head while I was writing, so sorry if I'm missing something.

Get all light nodes in a reasonable distance around your dude.

For each light you render a polygon representing it's area of effect to a framebuffer object. So a cone of light would create a cone of one type of pixels in your FBO. Render each node type in passes in appropriate priority. You could encode information into each pixel like green channel could be fricition, red be gravity, blue and alpha be something else.

Clever color blending techniques could then create interesting effects. Each level could have it's own blending rules.You can also add fragment shading for psychedelic dynamic effects like pulsating gravity etc.

Lastly, just check which pixels your mandude is touching, and do recalculation of the bitmap whenever you are nearing the edges of the precalculated area.

Rough scetch made in 2 minutes kind of illustrating my idea:

Edit: In practice this means the only thing you need is one light component emitting a certain color. The rules connected to what color does what can be somewhere else entirely. You can encode a lot of data into the 32 bits you have pr pixel. Alternatively you can have multiple FBO's containing different attributes that don't affect each other. You could have one gravity/friction FBO and one 1bit collision FBO. If you choose this, you would of course have to flag which FBO your light should render into.

# Answer
> 0 votes
Observer pattern is one of the best solution. Message will be sent only to those objects (components) that are really interested in it. So reciever must subscribe on this message/event type.

There are many signal/slot implementations. For example, in C++ there is a sigslot library

For more information read about Qt signals and slots.

---
Tags: game-design, architecture, xna, c#, component-based
---


title: What's in a name?

text:
# Question
Title: What's in a name?
How does the name of a game relate to how popular it becomes? Have there been studies around this subject? Are people influenced by the name of a game?

# Answer
> 27 votes
A great name can help a **solid** game gain press and get gamers talking about it. Here's our checklist for naming our titles:

* **A name should be visually interesting**. For example, people remember Terry Cavanaugh's "VVVVVV" in part because of the shape of the name.
* **It should be descriptive**. When Cliffski named his latest title "Gratuitous Space Battles," people knew *exactly* what it was about. It doesn't have to be quite that blatant, but grounding the reader can help him/her figure out what the heck you're trying to give them.
* **It should polarize people**. It's okay if some people absolutely hate it.
* **And it should be remarkable**. That is to say that it should make people talk about it. People chuckle about "I MAED A GAM3 W1TH Z0MB1ES!!!1" and tell their friends.

**Strong note: Your mileage may vary!** What works for us might not be right for you -- everyone's goals are different. But naming our BASE jumping simulator "**AaaaaAAaaaAAAaaAAAAaAAAAA!!! -- A Reckless Disregard for Gravity**" fit all these criteria and helped us get the word out. Journalists remembered the title; gamers argued over whether they loved the name, or if we were horrible people; it pretty much describes the game; and it got people talking.

# Answer
> 12 votes
Name is very important: A guy has named a game with the most searched keywords on appstore.

Free Zombie Hero Angry War Ninja

# Answer
> 7 votes
As I research more about this subject. I realise that you should treat the game as a brand. Here is a very good article-- Game Matters - Name matters, by Scott Miller.

# Answer
> 5 votes
Well there are certainly copyright trolls around this topic.

If you ever try to use the word "Edge" in your game title, prepare to be sued by Tim Langdell

Bytes: Tim Langdell & the IGDA

# Answer
> 4 votes
This one is obvious but wasn't mentioned before, so here it goes:

Name should be really unique! Unfortunately I can't think of any examples right now, but there were cases when I heard a name of a game which seemed interesting and was unable to find it because it was too generic!

So first step should be to go to try out potential names on Google. Nobody wants to go through 15 unrelated pages of search in order to find website discussing the game.

# Answer
> 3 votes
Personally when I am thinking for a name of a game, there are some common words I would avoid.

Cliché Words:

* Shadow
* Night
* Legend
* Chronicles
* Dragon
* Power
* Ninja
* Super
* Etc.

Also when naming a game, make sure this is something not too abstract that has nothing to do with the game or storyline. Perhaps you can create a simple catchy title that is named after the main city in your game that the story revolves around. But ultimately, game design is supposed to be fun so choose a name you like and don't worry about it. Most likely, when someone proposed the title "World of Warcraft" many people thought it was terribly cliché. But with that games popularity, you begin to think of the game and its users rather then about the title.

# Answer
> 2 votes
A friend and former colleague of mine has a pretty strict stance about naming games. Before setting off to come up with a game's name, we consult his Unword-List. It contains all the cliché words that should never be used in one of our games. Here's a sample as far as I remember it:

* the
* of
* god
* war
* battle
* spell
* force
* forge
* and (includes &)
* top
* command(er)
* conquer(or)
* by
* undead
* zombie
* king
* demon
* slayer
* beyond
* good
* evil
* light
* dark
* world
* fantasy
* hero
* avatar
* space
* vs
* ...

And so on. The list is intentionally restrictive on the use of binding words like of, and, the, and so on. My point being: it's much easier to settle with things you DON'T want in your game's name up front, and forces you to be really creative. Or, if you're not, you can always enter all the no-go words into a textfile and let a random name generator have at it.

Out comes: "Evil Hero Commander of the Fantasy Space World by God" or similar. :)

# Answer
> 2 votes
I spent some time searching for an article that came out several years ago on the psychology of naming your product, but it's been a while and I'm not sure where it was. Probably somewhere on Gamasutra. Some of the points above were mentioned as well as this:

Don't use a name that involves colons or a subtitle.

For example:

Ninja Apocalypse = good. (structurally. The title itself is cliche)

Ninja Apocalypse: Battle for the Five Stars = bad.

You can get away with it if it's a sequel and the main title is a draw, but in a premiere game you want the main title to be descriptive in a straightforward manner. Short and punchy. People's eyes glaze over on long titles and if the cover art doesn't make the save, you've potentially lost a sale.

# Answer
> 1 votes
"The Secret of Monkey Island".

What? A secret? - buyer asks. - I love secrets! What? A *Monkey* Island? Really? Where?

...This is an example of a popular title that provokes many questions and funny associations. I think this is an example of a good title.

---
Tags: motivation, business, commercial
---


# Question
Title: How viable ogre3d is for a commercial project?
Well, I don't really what else to add to the question, since I don't really know what competitors have that OGRE doesn't.

Of course I'm talking game rendering quality here, I don't really think there are very complicated programming stuff left, maybe AI...

Since torchlight is the best game done with OGRE (I think), is it still a good solution for future games, whatever the 3D graphics technologies will be ?

What prevents OGRE3D from not being the best engine ? (consoles excluded, since they used some specific graphic library, except the xbox360 maybe...)

# Answer
> 13 votes
Whether Ogre3d is the best or viable depends entirely on the type of game. In the industry, what often happens is you use something like Ogre3d (or IdTech, or Source, or Unreal) as a starting point and build on it from there depending on your needs and requirements.

For instance, compare a game like GTA IV to Modern Warfare 2. The rendering requirements are completely different.

GTA IV has a day-night cycle, a weather system, fast moving vehicles, tons of light sources from cars to street lamps, a lot of animated actors on the screen, and it's an huge open world. GTA IV runs around 30hz and the gameplay is such that some input lag is tolerable.

MW2 is an fps with few vehicles, lots of explosions and screen effects, relatively few actors on screen, textures that your camera can go right up against, and a mostly predictable path through a pretty small world. MW2 runs at 60hz and input lag severely impacts gameplay.

It's impossible to make a rendering engine that's optimal for both kinds of games.

Ogre3d could be a good starting point for what you're trying to do, but as Ranieri said, don't be afraid to get your hands dirty.

# Answer
> 4 votes
You need to define what you mean by best engine. Ogre3D is strictly a Rendering Engine. That point alone scares off a lot of would be game developers.

Ogre3D does not have integrated collision, physics, networking, sound, scripting, etc. Ogre3d is only the graphics part of a game engine.

Ogre allows for easy integration with things like Nvidia Physx or Havok, etc but it is still up the developers to integrate the products.

Another disadvantage to using Ogre is when you look at fully integrated game engines, Unity, Unreal, etc. They have very nice in world editors designed for map makers, scripters, etc.

It's a lot more upfront work to design something like that on top of everything else you will need to integrate to have a usable game engine to create something from.

Ogre works well when the developer wants to be able to fully customize how they want their game engine. What components they will have, which libraries they will use, etc. This was the main idea behind why Ogre is and will always be a Rendering Engine.

# Answer
> 0 votes
As has been mentioned, OGRE is a rendering engine only. However, there are systems such as Python-OGRE which include other libraries and wrappers that are needed for a real game engine, of course using OGRE as a rendering engine.

---
Tags: ogre, commercial
---