C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

5
votes
2answers
743 views

XNA significant loss in fps by just adding a few hundred thousand more triangles?

I've got a minecraftish game that's running nice and smooth with a total of 9.3 million triangles, about 50-70fps average. Then if I try to render 9.9 million triangles I get hell and it drops to ...
1
vote
1answer
835 views

XNA game looks laggy below 100 fps?

My xna game is running at about 70-90fps and it looks laggy at this fps. I'm using fraps to record the fps and I have a 120hz monitor, over 120hz looks fine but I can't understand why it feels like ...
5
votes
1answer
327 views

Loading content (meshes, textures, sounds) in the background

In my game, I am aiming for a continuous world, that is, a world where you can go anywhere without breaking the immersion through load times and "virtual seams". My world is broken up into regions, ...
53
votes
7answers
5k views

What are the dangers of self-teaching game development? [closed]

I am about to embark upon a journey into game development. Following answers to my last question, I will be using C# and XNA. However, I don't personally know any other game developers and I don't ...
2
votes
1answer
1k views

Getting started using C# and Physics (Resources, Tutorials, Samples, etc.) [closed]

As an application developer, I plan on now getting started in game development so I have come along to this site. I am a proficient C# developer so I guess it makes sense to start game development in ...
0
votes
1answer
1k views

XNA Calling Variables from separate Classes

I'm having some issues in XNA. I have a Player class and I would like to call a foreach function from a list which has been declared in the Game1 main class, which is below: public class Game1 : ...
2
votes
1answer
566 views

Odd offset bug in Farseer/XNA/C#

So I'm using Farseer to create an immovable object: [...] private Body body; public Immovable(World world, ContentManager c, String s, int posx, int posy, int w, int h, String user_data) { ...
5
votes
2answers
911 views

Detect Mip mapping level in the shader?

Is there a way to do this in pixel shader 2.0/3.0? I've got on or off transparency so when the mipmapping level is different the transparency can take up too much of the texture and make it ...
5
votes
2answers
4k views

Keeping the camera from going through walls in a first person game in Unity?

I'm using a modified version of the standard Unity First Person Controller. At the moment when I stand near walls, the camera clips through and lets me see through the wall. I know about camera ...
0
votes
1answer
61 views

Primitives does not show on screen [closed]

I'm trying to render terrain, everything compiles fine, but I can't see anything on screen. ( I'm moving camera around in case it was on the other side) Can't figure out whats wrong. public class ...
1
vote
3answers
4k views

MonoGame Mac installation instructions [closed]

Does anyone know how to install MonoGame on Mac. I have been looking around for a while and I can't find any guides. I have Mono and MonoDevelop up and running fine, but I cannot figure out how to ...
1
vote
2answers
5k views

Check collision between instantiated objects?

I am using a script to instantiate multiple objects having rigidbody with different velocities at different positions. I want to destroy two or more objects when they collide, but I'm not getting ...
5
votes
1answer
852 views

Infinite 2D Terrain

I was wondering how to create infinite 2D platform terrain. I've read about perlin noise and I have an idea I'd like to illustrate below. However, I have no idea how to achieve this. Are there any ...
1
vote
1answer
343 views

3D/perspective Top down shooter bullet issues

I'm developing a top-down shooter with multiple levels (ground for ground units, middle level for buildings, top level for air unity). The problem is the collision. Though I can make the collider ...
2
votes
3answers
3k views

C# 2D Game Library?

I'm looking for a C# 2D game library based on something like OpenTK which wraps OpenGL for C# Basically something like Slick2D (2D game library for Java) which is based on LWJGL which is an OpenGL ...
1
vote
1answer
602 views

3D Collision help

I'm having difficulties with my project. I'm quite new in XNA. Anyway, I'm trying to make 3D game and I'm already stuck on one basic thing. I have terrain made from a heightmap, and an avatar model. I ...
1
vote
1answer
147 views

XNA: weird collision behaviour

I'm reading the book "Learining XNA 4.0", and I'm in the object oriented disgn part. I'm having a weird problem with the collision of 2 rectangles. I have a list of automateSprite and a Player class ...
1
vote
1answer
509 views

Mouse click rectangle doesn't update to actual mouse position

I'm making a menu in XNA; and to solve clunky input via arrow keys, I thought I would use mouse input. I got everything to work perfectly, then I tried to click on something specific and nothing ...
3
votes
2answers
393 views

Tessellating/Subdividing a quad

I am creating a quad that starts as a single quad, then divides itself multiple times (from 1 -> 4 -> 16 -> 64 -> 256 etc) but I have encounted an issue. When I get to 64 sub divisions only 16 quads ...
2
votes
1answer
300 views

Scripting: Loading all scripts at runtime vs loading scripts when needed

I'm using Boo as a scripting language in my C#/.NET game via the in memory compiler with it and I really love it, however I'm having trouble deciding when I should load my scripts. This is my first ...
1
vote
3answers
696 views

Pathfinding for units of variable size

I'm using a grid map for a top-down RTS, and using a* for pathfinding. Specifically, I've found one implementation which is heavily optimised, and I've been using it for a while, but now I've realised ...
1
vote
1answer
2k views

Inventory Management concepts in XNA game

I am trying to code the inventory system in my first real game so I have very little experience in both c# and game engine development. Basically, I need some general guidance and tips with how to ...
1
vote
2answers
738 views

DirectX Flicker

I'm using DirectX 9 via SlimDX (C#). My screen flickers a lot during rendering. I dug a little deeper and see that the surface is being cleared early. Here's an example: ...
1
vote
2answers
522 views

Best practices, extending classes

I'm developing a game in XNA(C#) and I wonder what are the best practices for having different types of pads. For example I have 2 types of pads: Pad that just moves left (decreasing X coordinate) ...
4
votes
3answers
683 views

Pathfinding for a lot of units, mostly random movement

I'm using a uniform cost eight-directional grid as a map, with buildings that represent unpassable terrain - the map tries to simulate a top-down flat city. I'm trying to fill the city with randomly ...
6
votes
2answers
5k views

How do I create selectable menu options in C#/XNA?

Ok, I have my game's menu system set up. There are 3 screens (Controller Detect Screen, Title Screen, and GamePlay Screen). I wish to improve on this by having the ability for the player to select ...
2
votes
1answer
222 views

How do I stop my game from Skipping Screens?

I used the code from this - http://www.xnadevelopment.com/tutorials/thestateofthings/thestateofthings.shtml (The second method using enumerations) I modified it to add a 3rd screen for gameplay and ...
6
votes
2answers
17k views

Resolution problems when porting a Unity game to Android

So, I'm porting a game to the Android for the first time in Unity3D. And I've run in to a few problems along the way. My current problem is the resolution doesn't seem to be right, it cuts off the ...
0
votes
4answers
911 views

XNA transparent objects?

I've working on a voxel like game like Minecraft, but I'm not sure how I should handle alpha. I've got the world split into chunks and I render each chunk, I have things like leaves which have alpha ...
-2
votes
2answers
1k views

how to create a new game like pacman, snake, airplane fight game in C# with xna [closed]

I have a school project to create a game develop in c#.. I know all Basic of OOP and c#. I don't know where to start?.. Suggestion will appreciated Thank you
2
votes
3answers
840 views

How to I create a resource manager?

Currently I'm using XNA's ContentManager to load my content. For the unfamiliar the ContentManager deserializes classes from disk and keeps a reference for future requests. I'm currently facing a ...
0
votes
3answers
121 views

initialising units' properties & upgrades

I'm making a RTS in which units can get several cyber-upgrades (individual, not as a global tech-tree upgrade like in most RTS games) before they're created. Now, I'm trying to decide how to do this, ...
1
vote
1answer
422 views

Public Static vs. Instanced Classes [closed]

I've seen a lot of rhetoric over the year about not using a Public Static class to store global variables or methods that are used across an application. I understand the philosophy about code ...
0
votes
2answers
2k views

How to Translate and Position at the same time?

Hi I'm having problem Translating and Positioning at the same time e.g take example of retro spacecraft shooting games in which your spaceship moved in x-axis automatically and you just needed to ...
0
votes
1answer
2k views

How to make a top down shooter? [closed]

I want to know is with XNA 4.0 (and C#) How do I exactly make a top down shooter? I have been looking for ages, but have been unable to find out how. If someone could tell me how to get started with ...
7
votes
2answers
1k views

Calculating a quaternion so a bone points in a specified direction

In an attempt to solve this question, I decided to figure out the absolute (world space) directions of each joint in the source pose (as normalized unit vectors), and then rotate the joints of the ...
2
votes
2answers
943 views

How to calculate the direction a ball must bounce

I have a tile engine I have made. I can detect collision between the ball(the player) and the tiles. When a collision is detected all the colliding tiles are stored inside a list. My question now is, ...
5
votes
1answer
746 views

How would I create Dynamic LOD with Quad Trees

I would like to be able to create something like the following http://www.youtube.com/watch?v=LxZhWrSmrOY&feature=player_embedded how would I create something like it? I understand I will have to ...
0
votes
3answers
2k views

Designing an entity system for a tile-based puzzle game

I'm developing a tile-based game creation library in C# and along with it I'm creating a game to test all of its functions. This is a screenshot of the game: You've probably never heard of the ...
6
votes
2answers
520 views

XNA ContentManager.Load causes string allocation

I was running the Visual Studio memory profiler on a project and noticed that an enormous amount of strings were being instantiated. It turns out that ContentManager.Load appears to create a new ...
7
votes
1answer
4k views

Elapsed game time differs from total game time in XNA

I was trying three different ways of using ElapsedGameTime and TotalGameTime, because I want an exact match, so everything is updated/drawn accordingly. As I was experimenting, I learned that the ...
5
votes
3answers
565 views

Random monsters move in-sync instead of individually

I am making a game in which monsters spawn randomly and begin to move around randomly. I am fairly new at programming but not at game development. Through using a few tutorials I was able to make 1 ...
1
vote
1answer
1k views

Creating thrusters on a ship in Unity3D

So, I'm using the legacy particle "small flames". Basically what I want it to do is always emit below the ship, so when the ship turns and such it still looks like the thrusters are firing. I know ...
1
vote
1answer
661 views

C# OpenTK - Getting world coordinates of points that are altered by matrices

I have written a skeletal animation system for a game i am working on. To draw lines that represent a skeleton, i use the GL matrix, and multiply it by each bone a long the body. For example before ...
3
votes
1answer
559 views

Controlling the snake in a snake game with the mouse

I am trying to implement a snake game in C# using the WPF forms. Well I know to implement the snake game, where the snake is controlled by the keyboard. But how would I do it, if I wanted to control ...
1
vote
2answers
984 views

How do you make game objects (enemies, NPCs) move in interesting, non-linear ways? (e.g. shoot 'em up enemies)

I'm using a series of easing equations to make menus and transitions a little more interesting in my first game. That got me thinking about how game objects (enemies, NPCs, spaceships, whatever) are ...
2
votes
2answers
855 views

Getting one rigidbody to follow another, but still react to stuff Unity3D/C#

Basically what I'm doing is having a ball you can pick up and drop on a ramp. When you pick up the first ball, the second ball follows close behind, and when you drop the first ball on to the ramp the ...
1
vote
2answers
946 views

How would I achieve diablo like 2D isometric projection?

I am in the process of coming up with an idea for a game, and I would like it to be isometric like Diablo. The problem is I have no idea how it achieves the effect of height like in the following ...
0
votes
1answer
117 views

Creating a 2D Line Branch (Part 2)

Yesterday i asked this question on how to create a 2D line branch; Creating a 2D Line Branch And thanks to the answered provided, i now have this nice looking main branch; *coloured to show the ...
2
votes
2answers
2k views

Dealing with 2D pixel shaders and SpriteBatches in XNA 4.0 component-object game engine?

I've got a bit of experience with shaders in general, having implemented a couple, very simple, 3D fragment and vertex shaders in OpenGL/WebGL in the past. Currently, I'm working on a 2D game engine ...