EzDevInfo.com

xna interview questions

Top xna frequently asked interview questions

Viability of C#/.NET as the new standard game dev platform?

For a long time now C++ has been the dominate game development language. Many AAA quality 3D engines are available to fit any budget.

My question is, with the rise of XNA, has C# and the .NET framework been positioned well enough to take over as the new standard game development platform? Obviously the inherent cross-platform nature of the XNA framework (Windows, Xbox, Zune) has its benefits, but are those benefits good enough to entice large game dev studios to switch gears?

Personally, i am torn between using C#/XNA for a new project, and using Java via jMonkeyEngine. I have a great desire to have my game be portable to multiple platforms, and the only languages i know well enough to accomplish this are C# and Java. i would love to see an implementation of the XNA codebase that is powered by OpenGL and would run on Mono, but i think that is merely wishful thinking at this point.

I am curious to hear what others have experienced while building 3D games in something other than C++.


Source: (StackOverflow)

Graphics Card and XNA 4.0

I create a new project in xna 4.0 for windows. I put it on both Reach and HiDef profile settings in properties. When debugging I get the following error:

No suitable graphics card found. Could not find a Direct3D device that supports the XNA Framework HiDef profile.

I made sure to select the 'Reach' profile, I still get this error.

  1. Graphics card is an intel GM45. It states support of DX10 on their website.
  2. Intel Core 2 Duo 2.2Ghz
  3. Windows 7 Professional
  4. Visual Studio 2010 Ultimate
  5. 3GB RAM

So whats wrong with what I'm doing? Thanks.

PS. If I cant run XNA 4.0 games, Can I create a 3.0 project with xna 4.0?


Source: (StackOverflow)

Advertisements

How to slow down or stop key presses in XNA

I've begun writing a game using XNA Framework and have hit some simple problem I do not know how to solve correctly.

I'm displaying a menu using Texture2D and using the keyboard (or gamepad) I change the menu item that is selected. My problem is that the current function used to toggle between menu items is way too fast. I might click the down button and it will go down 5 or 6 menu items (due to the fact that Update() is called many time thus updating the selected item).

ex.
(> indicate selected)
> MenuItem1
MenuItem2
MenuItem3
MenuItem4
MenuItem5

I press the down key for just a second), then I have this state:

MenuItem1
MenuItem2
MenuItem3
> MenuItem4
MenuItem5

What I want is (until I press the key again)
MenuItem1
> MenuItem2
MenuItem3
MenuItem4
MenuItem5

What I am looking for is a way to either have the player click the up/down key many time in order to go from one menu item to the other, or to have some sort of minimum wait time before going to the next menu item.


Source: (StackOverflow)

Draw Rectangle with XNA

I am working on game. I want to highlight a spot on the screen when something happens.

I created a class to do this for me, and found a bit of code to draw the rectangle:

static private Texture2D CreateRectangle(int width, int height, Color colori)
{
    Texture2D rectangleTexture = new Texture2D(game.GraphicsDevice, width, height, 1, TextureUsage.None,
    SurfaceFormat.Color);// create the rectangle texture, ,but it will have no color! lets fix that
    Color[] color = new Color[width * height];//set the color to the amount of pixels in the textures
    for (int i = 0; i < color.Length; i++)//loop through all the colors setting them to whatever values we want
    {
        color[i] = colori;
    }
    rectangleTexture.SetData(color);//set the color data on the texture
    return rectangleTexture;//return the texture
}

The problem is that the code above is called every update, (60 times a second), and it was not written with optimization in mind. It needs to be extremely fast (the code above freezes the game, which has only skeleton code right now).

Any suggestions?

Note: Any new code would be great (WireFrame/Fill are both fine). I would like to be able to specify color.


Source: (StackOverflow)

Worms style destructible terrain

I want to prototype an idea for a game I have. The idea for this game is that the player will dig through the ground, creating tunnels and finding treasure.

I'm looking to create 'worms style' terrain, with collision detection for the player wandering and jumping around the tunnels. Examples of this type of dynamic terrain can be seen in these pictures. Example 1 Example 2

My question is how is the best way to implement this type of destructible terrain? I am using XNA game studio.

Thanks, James.


Source: (StackOverflow)

C# game development after XNA [closed]

I am a game developer who made games in .Net languages with XNA for the past four versions of it. Unfortunately now there's this news: http://www.gamasutra.com/view/news/185894/Its_official_XNA_is_dead.php#.UQ3yiehQCh8

I am surveying the ecosystem of game engines, looking for something that supports coding in Visual Studio (I use F# heavily, believe it or not!) and I am having trouble finding something that is high quality, still alive, and high performance to replace XNA. Unity for example misses the mark because it only allows for scripting in MonoDevelop, while I want a more developer friendly experience.

So what is a good replacement for XNA?


Source: (StackOverflow)

Recommendations needed for good AI references [closed]

I've been asked to help out on an XNA project with the AI. I'm not totally new to the concepts (pathfinding, flocking, etc.) but this would be the first "real" code. I'd be very thankful for any resources (links or books); I want to make sure I do this right.


Source: (StackOverflow)

Resources for Windows Phone 7 development [closed]

Windows Phone 7 has been unveiled and MS have announced all details of the development chain at the Mix10 conference.

So this could be a good starting point/collection of online resources as they appear

EDIT: I've removed the speculation tag now that the covers are off


Source: (StackOverflow)

Is MonoGame reliable?

I'm looking for a cross-platform game development framework. MonoGame looks easy to learn and fast to develop, but I see most of the games featured at their page do not work, or have a lot of bugs.

Can anyone explain if MonoGame is reliable for ios/droid professional mobile game development?


Source: (StackOverflow)

What Should Be in a 2D Game Engine? [closed]

Ok, so I ended up writing my own game engine based on top of XNA, and I am just wondering what else I need to make a complete engine.

This is what's in the engine:

  • Physics (Farseer Physics)
  • Particle Engine (Mercury Project)
  • 2D Cameras
  • Input Handling
  • Screen Management (Menus, Pause Screen, etc.)
  • Sprite ( Animation, Sprite Sheets)
  • And XNA stuff like Sound.

Am I missing anything that might be crucial to a game engine?


Source: (StackOverflow)

Custom WP7 Silverlight control with dynamic 3D content

Ideally I need to implement a WP7 control that can be added to any XAML and which displays a dynamic, interactive 3D scene.

Currently I have this implemented via XNA in shared mode, and the UI is rendered on top of the scene using UIElementRenderer. However this solution is sub-optimal because

  1. The application must render the whole screen because in shared mode, Silverlight does not draw anything by itself.

  2. I couldn't find any way of detecting that a Silverlight control needs to change its presentation, be it due to user interaction or animation. Controls are rendered only when the 3D scene changes because of this, and so they lack the slick look and feel of the native WP7 applications.

So, is there a way of rendering a 3D scene inside one control, and letting Silverlight manage the rest of the UI?


Source: (StackOverflow)

UI library for XNA

I'm working on a small and simple XNA game and I'm noticing I'm spending way too much time implementing basic UI functionality like menus, (rich) text rendering including wrapping and basic UI lay-out such as alignment of elements.

This is a fairly common problem, and I was wondering whether anyone knows of a library to handle these things. I know there are some good skinnable options available to windows programmers (Crazy Eddie's GUI comes to mind), but as I'm targeting the Xbox 360 I would like to find a pure managed solution.


Source: (StackOverflow)

XNA 2D Camera Engine That Follows Sprite

What is the best way to create a parallax effect in an XNA game? I would like the camera to follow my sprite as it moves across the world, that way I can build in effects like zoom, panning, shake, and other effects. Anybody have a solid example of how this is done, preferably in a GameComponent?


Source: (StackOverflow)

How to install the XNA Game Studio 4.0 in Windows 8?

This question is related, but NOT a duplicate: How to install XNA game studio on Visual Studio 2012?

I read the above mentioned post, and have got xna projects opening, but I now have a problem.

Some of the references to the XNA framework aren't found:

Microsoft.Xna.Framework.Avatar
Microsoft.Xna.Framework.GamerServices
Microsoft.Xna.Framework.Net
Microsoft.Xna.Framework.Storage
Microsoft.Xna.Framework.Video

And all references to Microsoft.Xna.Framework.Content.Pipeline

Without these, I can't compile or run any games that I've made. I can't find the dll that contains these, or where I should put them.


Source: (StackOverflow)

Convert string to Color in C#

A am encountering a problem which is how do I convert input strings like "RED" to the actual Color type Color.Red in C#. Is there a good way to do this?

I could think of using a switch statement and cases statement for each color type but I don't think that is clever enough.


Source: (StackOverflow)