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

2
votes
1answer
270 views

Shader and Custom Vertex Format Errors

I am creating an editor of sorts that allow you to create 3D voxel models. I just got started and have ran into a few errors. Here is what it is producing: I think the problem has to do with the ...
12
votes
3answers
870 views

Biased, conservative random walk

I have a sprite which has Velocity and Position, either stored as Vector2. At each Update cycle, velocity is added to the position. I would like to give the sprite a third vector, Target. New targets ...
0
votes
1answer
1k views

3D Bone Animation API in C# [closed]

i have been looking for 3d Bone Animation for plain C# (to be used with Sharpdx or Slimdx) but i did not find anything !!! I just find some for XNA. Any Suggestions! Accept c++ suggestions also
1
vote
3answers
356 views

Help Reading this Data in XML as a List (ContentReader)

Edit: So i'm going to rephrase the question a bit, seeing as now i think know how i'm going to read this data. Looking at this example as my guide: ...
6
votes
1answer
155 views

How to put an invisible marker on a model and refer to it in the game?

I am using XNA/C# to load up 3ds Max models exported in FBX format. Is there some way to mark a specific point in the model like the pipe of a gun so I can just refer to it and place a bullet in there ...
4
votes
2answers
429 views

Trace with 2D terrain

I currently have some 2D terrain in my game defined by 2D coordinates with lines drawn in between them (linear interpolation too keep it simple). Now I want to cast a ray from anywhere above the ...
0
votes
3answers
2k views

Adapting DirectX samples to SlimDX

I'm trying to learn DirectX and SlimDX but I'm having a terrible time getting started. I'm taking the Triangle tutorial and trying to add color and transformations. Starting with controlling color, ...
5
votes
1answer
897 views

What are the drawbacks of this messaging system implementation?

So I've just been thinking about component and messaging systems recently for simple C# XNA games and came up with this. How extensible would this implementation be and what are the drawbacks? Example ...
3
votes
1answer
2k views

How do you split indices and vertices if their quantity goes over the limit?

I try to draw a flat surface of 500x500 squares which are built out of four vertices by two triangles. There are 1,000,000 vertices and 1,500,000 indices. The Reach profile of xna, limits primitives ...
1
vote
2answers
197 views

How (if possible) would I change the BasicEffect Matrix mid draw

Say, for example, I have a list of enemies. Each enemy is a textured quad which is the stored in a singular shared VertexBuffer and IndexBuffer with the buffer usage set to BufferUsage.WriteOnly ...
2
votes
3answers
2k views

How to convert screen space into 3D world space?

I am trying to make a 3D model to look at the mouse position. Currently I have this code: MouseState mouseState = Mouse.GetState(); Matrix world = Matrix.CreateTranslation(0, 0, 0); Vector3 source ...
1
vote
1answer
337 views

Avoiding lag when playing sound for first time using Cue.Play

In my code I'm using SoundBank.GetCue("cuename") and Cue.Play() to play my sounds. On the xbox whenever I first play a cue I get lag of about about one second. How can I avoid this? I'm thinking I ...
-4
votes
1answer
937 views

should i use java or c#? [closed]

i know a similar question has been asked before but, my question is somewhat different. I have been learning C# for a few years but nothing in game making, more like applications and web like ...
3
votes
1answer
423 views

Performace problems with Voxel Engine

well, I am creating a voxel engine in C# and XNA and many posts I have posted on this site have been due to performace issues, many people suggested using a profiler to help me out. I have, and ...
2
votes
2answers
2k views

Creating 2D billiard game with realistic movement

I'm new to XNA and game programming. I'm creating a 2D billiard game and I want to add balls with realistic movement (like 3D). Is it possible to achieve this without using 3D models? I only want to ...
7
votes
2answers
642 views

Is there a limit to Gametime.TotalMilliseconds?

Gametime should always be increasing, and totalmilliseconds is going to be the largest value. So if the game is hypothetically run for 1 day, this value should 86 400 000. This probably isn't a ...
9
votes
5answers
4k views

45° Slopes in a Tile based 2D platformer

I want to have simple 45° slopes in my tile based platformer, however I just cant seem to get the algorithm down. Please take a look at the code and video, maybe I'm missing the obvious? ...
2
votes
2answers
885 views

How do I deal with abstracting collision handling code between entities with differing collision components?

I'm using a component based entity design with Components that hold the data and Systems that act on entities based on the components they have. Entities are registered to all systems as they are ...
1
vote
1answer
637 views

Can't seem to get predictive collision detection working correctly

I am trying to set up the collision detection on a basic 2d game, player clicks a button sprite moves one step int he corresponding direction. Currently all my sprites have the collision rectange ...
2
votes
0answers
1k views

Controlling 3D model with mouse XNA 4.0 C# [closed]

I am creating a 3D table tennis game and the racquet (created in Maya 2012) is controlled by the mouse. I have used picking method to control the racquet, however the cursor is not on the racquet. It ...
3
votes
1answer
1k views

XNA mouse position in windows forms

I am using this code in Update method in XNA RenderControl in Windows Forms: ... Mouse.WindowHandle = renderControl1.Handle; MouseState stat=Mouse.GetState(); ... Everything works fine but when I ...
3
votes
1answer
389 views

Confused about order of operation when using a Matrix in XNA, C#

Here are two different pieces of code This is what I started with Vector2 hold = Vector2.Transform(pos1, mat1); Matrix inv = Matrix.Invert(mat2); Vector2 pos2 = Vector2.Transform(hold, inv); And ...
1
vote
3answers
586 views

Loading and using GLEED2D levels into WP7 Game

I've been trying to use this modified version of GLEED2D that includes WP7 support, The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to ...
1
vote
1answer
254 views

Should i be worried about loading so much data?

So a week ago or so i asked this question: A few queries about my Map Data (& ideas of improvement, seconded opinion required) And the advice in the comment was to ask them as 3 separate ...
2
votes
1answer
975 views

How do I load Gleed 2D levels in WP7 XNA game?

I've been trying so long to use this modified version of GLEED2D that includes WP7 support, I'm stuck into loading the level into my game, now my Game1.cs class has the following: protected ...
1
vote
3answers
4k views

Making a level editor for my game

I am doing a 2D sprite based game in XNA for WP7, The game logic is simple, you start at some point, you want to avoid obstacles and reach a certain goal. obviously I need to make many levels for the ...
2
votes
1answer
1k views

How to get window size from within another class?

I have found this post explaining about how to get the size of the Window, but for whatever reason I'm having issues getting it to work inside of a Singleton class that I'm made to manage a set of ...
7
votes
3answers
3k views

Is there a simple way to group two or more sprites, so all of them will be dependent on each other?

I think that this question is very similar to this one, but I'm not sure if the answers are universal. So, my goal is: Place two sprites in fixed position, for example player and his eyes Make ...
1
vote
4answers
241 views

Designing a game that allows for selectable perks/customization

Call of Duty games all have the core functionality of any FPS (walking around, killing, dying and repeat). Layered on top are various stuff. Of interest to me is during pre-game when you pick your ...
2
votes
1answer
759 views

Create a car sound with frequencies

Im trying to create a car game in c sharp! Im now trying to figure out a way to get some sounds into the game! For example, the acceleration sound of the car. I recently tried to add a 5 second-sound ...
3
votes
0answers
173 views

Getting error messages from my server [closed]

I'm working on client-server-client game. Client is sending their status (position) 30 times a second. I'm using Lidgren.Network namespace for networking (server, client). I've got two questions: 1. ...
2
votes
2answers
304 views

Telling which side of a voxel was hit by an object

In XNA, I have an axis-aligned BoundingBox representing the object's hit box, and a Vector3 representing the object's velocity. I also have a stationary 1x1x1 axis-aligned BoundingBox representing a ...
4
votes
3answers
611 views

How to calculate origin and position of a weapon which should be “in hands”?

I'm currently stuck with my game, which is from the top perspective. I'm currently using these sprites for player: (using the second at the top): And here's what I use for my gun My problem is ...
3
votes
4answers
1k views

Why does using multithreading during my load screen increase my load times? [closed]

OK, I added a loading screen to my game, and in order for the game able to update and show a loading screen and load stuff in the background I came to the concludsion that I needed to host the loading ...
3
votes
3answers
826 views

How to parse & “pack” network commands?

I'm currently creating a game which should be multiplayer (client-server-client), but I'm stuck. I have been doing crazy things like building a text chain like string networkMessage = userHash+" ...
27
votes
4answers
2k views

Why does my object move faster at 45 degrees than at 90 degrees?

I have objects in my game that move faster at 45 degrees then at 90 degrees. Each object has Point (x,y) position Vector2D (x,y) direction Int speed And what I do during a update is that new ...
4
votes
3answers
663 views

IndexOutOfRangeException on World.Step after enabling/disabling a Farseer physics body?

Earlier, I posted a question asking how to swap fixtures on the fly in a 2D side-scroller using Farseer Physics Engine. The ultimate goal being that the player's physical body changes when the player ...
5
votes
3answers
961 views

Can I swap out Farseer physics fixtures at runtime?

I am working on a 2D side-scroller using Farseer Physics Engine v3.3.1. In order to create a realistic physical skeleton for the player, I am using a method similar to the one explained here (See ...
3
votes
2answers
1k views

How can I map thumbsticks to cardinal directions?

I've got a tile based game that has notions of moving up, down, left, right and the diagonals (by alternating horizontal/vertical movement). I've found that if I use the default ...
3
votes
1answer
1k views

Create a rectangle struct to be rotated and have a .Intersects() function

In my XNA program, I am trying to swing a sword. The sword starts at an angle of 180 degrees, then rotates (clockwise) to an angle of 90 degrees. The Rectangle struct that XNA provides, Rectangle ...
3
votes
1answer
245 views

Does ContentManager.Load<T>() re-read an asset if I have loaded it before?

Or is it smart enough to know I have asked for it before and return an in memory copy created from the first call? For example if I have a projectile's texture: Texture2D projectile; If then I ...
2
votes
3answers
2k views

How do I check collision when firing bullet?

I'm currently creating 2D game from top perspective. I'm having problems with bullets. Yes, I currently simulate their movement so user can see them (about 2x ). Moving them with // this is static ...
4
votes
2answers
1k views

Rendering a lot of Models at once with XNA

In an hexgrid based game, I render all terrain tiles as a separate model, reusing the same texture objects on all similar tiles. The tiles is a pretty simple model. When the terrain is set to be at ...
1
vote
1answer
329 views

Input in OpenTK

How to use Input in OpenTK 1.0? There is not much info around, some classes are unfinished. What I want to achieve, is to be able to use input not only in OnUpdate function, but also in other classes ...
8
votes
6answers
818 views

How can I store all my level data in a single file instead of spread out over many files?

I am currently generating my level data, and saving to disk to ensure that any modifications done to the level are saved. I am storing "chunks" of 2048x2048 pixels into a file. Whenever the player ...
0
votes
1answer
214 views

Creating a vertexbuffer to define vertices arranged in a grid with the view for easy editing later

I'm using the marching square algorithm (2D version of marching cubes) to generate vertices. I end up with vertices arranged in a grid. I want to enable destructible terrain, and the way i was ...
-6
votes
2answers
1k views

How can I convert the 3D Object designed in MAYA or 3D Max to OpenGL Object?

I'm try to convert the 3D Objects created in the Maya or 3D Max to Simple OpenGl object anyone please guide me how can I do so???
0
votes
2answers
335 views

Can I create mods for a D3D game made in C#?

There is a game currently in development in C# (using Direct3D for graphics) that I want to make mods for. Ideally, I would like to make the mods in C#, but after that I am lost. How would I (or ...
0
votes
1answer
892 views

Open source component-based game engines? [duplicate]

Possible Duplicate: Are there existing FOSS component-based frameworks? What open source game engines with component-based design of game objects do you know? And which best of them? I mean ...
5
votes
1answer
1k views

Things to do to port game made for iOS in Unity to Android?

I have just made my first game for iOS and submitted it to app store. I was thinking of porting my game to Android also. I would like to know things one need to do/remember to port game made for iOS ...