Answer Questions
uzs1 .xnb file size
Hi all, I assume I am doing something wrong with the importing of content, but I can't seem to figure this out. I have 3 .bmp images that are each around 30kb. I am importing them as Textures and using the Sprite processor. The resultant .xnb files are 250-300 kb =/ I am fairly sure the .xnb file doesn't have mipmap data in it. Any idea why these images are becoming so large Thanks The Sprite texture processor uses the SurfaceFormat.Color format for textures, which is a 32bit uncompressed format (the .xnb will be roughly 4 * width * height bytes). Since .bmp files can be indexed and use a form of compression it is possible that the .bmp file can be smaller than that. Cheers, Leaf. Leaf. ...Show All
N_John Learning to draw in 2D (tutorial)
We just finished a new tutorial that should help teach the basics of using sprites including rotation and scaling. http://www.xnaspot.com/Tutorial_Learn2D.aspx Please let us know what you think. Submit@XNASpot.com Also we really want to post what people have been working on so if you have any code samples or even just a screen shot of a game you are working on send it in. gr8! thnx You can use a large sprite, but there are also other ways. You can also write a tile engine, or render a 3d-background using primitives. I just finished a -simple- pong game using 2D Textures and simple movemen ...Show All
Jordan111 Scaling a mesh with its animation
Hi, I have some models exported from max using the Panda DirectX exporter. When working with large models, then trying to scale them down (including the bones) the animation matrices kept coming out with the original translations (which of course messed the animation up). When attempting to work with a small model to begin with, there were other problems (mainly the viewport camera not letting me zoom in on the model, and that the bones themselves could not be created in sizes matching the skin). I mention all this so maybe someone can shed some light, but what I really want to know is this: Since the above did not work for me I simply attempted to scale the model down from with the content processor. I tried several variation, all of whic ...Show All
el_Fede 2D Code slow on 360 but fine on Pc
Hey I'm fairly new to programming and have created a basic 2D vertical shooter for a university project. Now the code is very dirty and needs alot of optimizing but I am new to all this so not entirely sure how to do it properely. As it stands everything is done in the game1.cs code file. I know this is not how its suppose to be done. The problem is its slow and jerky on my 360 and not on my pc. Just wondered if there was a quick way to speed up to code, or as the way I've writte the code its just going to be slow on the 360. If I post my source up somewhere, could some of you guys take alook at it and give me some advice Whats the best place to host a file Regards David I threw "C# arrays" in ...Show All
Shawn Carroll Xbox live vision libraries
i was reading on the gesturetek website that they are releasing the libraries for the xbox live vision camera to registered xdk developers. will they release it to members of the xna creators club too, or is it just for the big shot developers i would be really interested in making a game using the camera. XNA doesn't currently include any camera APIs. Please file a suggestion over on the connect site if this is something you'd like to see in future versions. thanks. do you know if there will be support for it in a future build perhaps would anyone know of any other APIs for windows that i might be able to use to make a game totemball, using the xbox live vision camera, or any oth ...Show All
Shailesh Chaudhary multi-threading for ai/ expensive processing
I've been writing a game for about 1/2 a year or so now, using c# and MDX, and I'm getting to the point where I'm starting to work on implementing some very basic "fuzzy logic" ai. Up until now, all of the ai and non-graphics related work has been done in the "update" part of the render loop. It occurs to me that much of the ai code only needs to run every once in a while and therefore is really out of place in an update method that is called every frame. Should I have another thread to handle these processes I have a couple game programming books (Tom's DX9 books), but they've never gotten this indepth. thanks Gary is right, you can have use some kind of incremental update, like this: /* Gam ...Show All
Rajesh batchu can be used PixelShader for post-processing in XNA 2D SpriteBatch?
I am new programming pixel to shader in HLSL U__U and have looked for information on using these with spritebatch for the post-processing of the 2D XNA sprites. somebody knows if it can or since I can do it some example:) THK My Shader (Embossed) uniform extern texture UserTexture; sampler textureSampler = sampler_state { Texture = <UserTexture>; mipfilter = LINEAR; }; float4 MyShader( float2 Tex : TEXCOORD0 ) : COLOR0 { float4 Color; Color.a = 1.0f; Color.rgb = 0.5f; Color -= tex2D( textureSampler, Tex.xy-0.001)*2.0f; Color += tex2D( textureSampler, Tex.xy+0.001)*2.0f; Color.rgb = (Color.r+Color.g+Color.b)/3.0f; return Color; } technique PostProcess { pass p1 { VertexShader = null; Pixe ...Show All
mattdawg A few XNA questions.
Now with XNA will you be making the game right in XNA, or do you like make it with another program using different code and then just use XNA to make it playable on the 360 Thanks! You would be using XNA Game Studio Express to develop your game. XNA is a framework, not a development environment. You might want to check out the FAQ Correct. You use XNA GSE to code (on your PC) and debug (remotely on your 360 or on your PC for a Windows version) your game. The assumption, I believe, is that you have a network in your house that both your 360 and PC are hooked up to. Hello, Your game must be written using C#(At least for our first release) and using the XNA Framework to run your game on the X ...Show All
Prince of Dhump Managed DirectX vs Native DirectX performance
Greetings, I'm sure many people asked this before but no one has ever been able to answer this for me :( I've searched high and low (on this forum too) but theres no answer to this question: Whats the performance difference between MDX and DX I'm currently writing a little 2D engine in MDX, and its quite fun to do! But it doesn't perform that well, I've managed to get a few performance gains due to me revising my own code, but it just doesn't quite cut it. Also when is this MDX 2.0 gonna be released Or is that XNA And what are the main differences between MDX1 and XNA Thanks in advance. Thank you for this answer. I have no doubt that my coding is at fault of the slow performance. I however have already set it up s ...Show All
SPWilkinson Using standard gamepad on PC ?
Still havent got my hands on an XBox - but what to buy a gamepad i can use for testing on my PC. Can i use a standard gamepad for XNA development on PC or do i need to buy the specialized controller for windows The GamePad class in XNA only recognizes the 360 controller AFAIK (haven't tried it with other pads). You could use DirectInput on the PC only (not available on the 360 using XNA) for other gamepads (and peripherals) however. Thanks alot - ill get the "standard" one (being the cheapes for some reason) If that's the case then there's no difference. A 360 controller is a 360 controller as far as XNA is concerned at least as far as the c ...Show All
John123 HOWTO: Get ContentManager from within a GameComponent?
Happy new year to all! I have a (silly) question here: I constantly finding myself passing ContentManager reference to a GameComponent while I initialize it. Is there a way not to pass this reference and retrieve ContentManager reference from other means (e.g. through game services, etc.) Or do I just create a new ContentManager for each GameComponents that I have Won't that occupies more memories (and also slower) Thanks, Ben. You could create a static class which contains your ContentManager and any other objects you need in other classes (SpriteBatch is one you might need all over the place) and then get it from there when needed. Something like this: public static class SharedObjects { public static Co ...Show All
Le Saint Resonable Expectations for XNA Game Studio Express?
Based on my understanding of what I have read so far I have the following assumptions (please correct me where I am wrong) and questions: With the XNA Game Studio Express I will be able to develop PC games and with a developer membership I will be able to compile a version that I can transmit localy to my XBox 360. In the first incarnation that will be released there will be no support for networking (ie. Live) online multiplayer. Is there a legal method to distribute content created from XNA Game Studio Express to specificaly targeting the XBox 360 envirionment (ie. Can you legally provide compiled or uncompiled games with the intent for other developers to download and run your creations ) Will there be any means available for XNA Game ...Show All
Basiclife my first game problems
Hi everyone :) I have been having some weird issues with this tutorials code. It is mainly in this area here: myTexture = Texture2D .FromFile(graphics.GraphicsDevice, "mytexture.bmp" ); Which is located in here: void LoadResources() { myTexture = Texture2D .FromFile(graphics.GraphicsDevice, "mytexture.bmp" ); spriteBatch = new SpriteBatch (graphics.GraphicsDevice); } Everytime i run the game it gives me this weird error: An unknown error has occured. The result code was -2005529767. Any ideas what it might be Thanks for any replies. Thank you, I think that will help. yea i called it exactly the same so that there wouldn't be any confusions but in the end ...Show All
kastanienreis DepthBufferEnable backwards?
Am I doing something wrong (not unlikely, I'm fairly new to C#, DX, and of course XNA) or is DepthBufferEnable working backwards Here's an example: graphics.GraphicsDevice.RenderState.DepthBufferEnable = true; graphics.GraphicsDevice.RenderState.DepthBufferEnable = false; It looks like the depth artifacts appear on the metaball when depth testing is supposed to be enabled. What gives If you're seeing "saw teeth" artifacts, it's probably a result of depth precision. Try setting the near distance to as high as you are comfortable with (i.e. before the near plane starts to clip items). You're probably accidentally rendering things in the right order, by looking at the metaballs from the ...Show All
ajpharrington "Your first game" graphics device errors
I'm working on trying to get the "Your first game" code given in the Help documentation to work. I had an exception when accessing the graphics device which I solved by turning the multisampling option to "off". Now I have another exception which occurs when I attempt to load a sprite texture into the graphics device. This texture has been added to the project and so it's where it should be. I'm thinking maybe it's just my GeForce4 graphics card is not supported by XNA. Any thoughts on this Here is the code where the exception occurs: <code> void LoadResources() { myTexture = Texture2D .FromFile(graphics.GraphicsDevice, "ptah1.gif" ); <<<<<< Exception thrown ...Show All
