Answer Questions
jackrudolf C# Performance
i mean are there differences between C++ and C# in performance C# is 100% slower because it is not directly using CPU. But from what I have heard, the performance is really close. MS official said they aimed to have performance with-in 7% slower compare to C++. Asides from the exact performance, C# lets you to make cleaner code, safer code, easier code. This gives you more time to focus on optimization on higher level instead of stuck at lower level. Also most games are GPU intensive, not so much CPU intensive. You should worry about your DX engine more than C#. Everytime this issue comes up I go back to what the Garage Game guys said when they ported Marble Blast Ultra over to C# and XNA - ...Show All
JohnnyP34 Text Renderer and Font Generator
Check out my font rendering system. I think its the easiest one to use that's out right now that can handle any character set :) There is full source to the font generator as well as the font renderer. Here is a tutorial on how to use the font renderer as well as the downloads to the generator and a sample that uses it. http://www.ziggyware.com/readarticle.php article_id=44 All of the samples on my site that render text use this system. http://www.ziggyware.com/articles.php cat_id=6 Sure. There's been some posts on how to do this. In the program.cs file that's generated when you create a Windows XNA game, change the Main to show whatever form you want instead of an instance of the Game class. Just create and ...Show All
Adam Walters Draw() called before Update()
I noticed Game.Draw() is being called before Game.Update(), which doesn't (seem to) make sense. Is there any suggested way of dealing with this If Update() is supposed to, umm, update the state of the application to a certain local time, before the first Draw() there is no state ready to be painted to speak of. Just to make things awkward, I will completely disagree. I would argue that your objects should all be initialised to a valid (i.e. drawable) state in their constructors. Therefore an initial update should not be necessary. Moreover, artificially updating the scene after construction in fact causes the game to skip the "first" frame. Considering the above statements, it wo ...Show All
Andreas Maurer Grouping units like in a RTS game
hello all.. is it possible to group units (drawing a rectancle) while holding down the mouse button with XNA i am planning to do a 2D game where i would need this.. if yes, please give me a hint how to do it... thanks in advance greg Shouldn't be a problem, it's just a question of implementation. XNA can certainly handle cursor location, mouse clicks and dragging. It's up to you to draw the box and figure out what objects are within in. Then its just a matter of assigning orders to those units. (I assume this is for a RTS game ) Here is an idea for you. Since I haven't actually done it yet, I'm not sure if this is the best way to go about this. ...Show All
BMcDowell PlayerIndex?
I need some help and explaining of PlayerIndex and how to use it. this is an example of what I want to do: "for (int i = 0; i < Players.Length; i++) { if (XInputHelper.GamePads[i\].APressed) { GamePad.SetVibration(i, 1.0f, 1.0f); } }" Players is an Array of all the player objects. I want to cycle all my players and start to rumble that specific controller, but I don't know how to easily transform the int i = 0 too PlayerIndex.One (i\ should be only i in brackets but this forum displays a light bulb if i write that) Cheers Alfons Yeah, what Joel said.... Thanks alot! I used " PlayerIndex)0; //should give you PlayerIndex.One" and it works like a charm. Andy ...Show All
Hedgeh0g Tool for auto HLSL Generation?
Are there any tools out there to enable the graphical building of a shader network, such as in Autodesk Maya's Hypershade tool or Softimage XSI's RenderTree tool, which can enable you to use a GUI to set up an object's basic material properties and then automatically generate the appropriate HLSL shader fragments needed to reproduce the material effect in your game without having to manually write HLSL files Certainly, if you want to create complex shader effects, you would need to be able to edit the HLSL or manually create new custom HLSL files, but for creating HLSL files to render basic, standard material properties, there really should be a graphical tool to take some of the work and difficulty out of it. Such a tool should allo ...Show All
msikes 3D Particles?
I want to create particles in 3D, where shall I start Should I create quads for each particle or is it too performance demanding I heard of something called point sprites, sounds nifty and somewhat limited, but how do I create a point sprite And please don't point me to the Mercury project, I know they exist. Cheers Off the cuff, for point sprites, would it be better to do particles using a shader, so the GPU does the work I've seen a tutorial on using shaders for particle systems, but I was also thinking of creating a thread to do particles with to help speed things up. Thanks. Particle Systems are one of the funner, not-so-hard to create components in a lot of games ...Show All
John.Doe SpaceWar Memory Usage
Hi all, I compiled the SpaceWar demo without any problem, and was able to get the keyboard to respond. My concern is on memory usage. When running the game from the Release folder (and even closed Visual C# editor), SpaceWar uses about 165Mb of memory. Now, what is it with the .Net Framework that always eats up so much memory It is just on my computer, or do others out there use that much memory that seems a bit extreme. any here have base memory requirements for a XNA peice of code with say just a single 3D object with one plane spinning As I mentioned in another thread SpaceWar was done to a time and to deliver a demo for gamefest, we didn't actually tune for per ...Show All
Ramanujam Sampath Lockable texture issues
Is there a way to create a texture that is both lockable and a rendertarget If not, is there a way to update just a portion of the texture without deleting the rest of the contents A texture in the default pool (necessary for render target usage) could not be locked. You can try the following instead - Create a surface in the system memory pool. - Make your changes there - Transfer the changes with UpdateSurface ...Show All
Mario N Model texturing
Does anyone know of any sites where I can find out how to texture a model and then export that texture to be used in XNA I am new to modeling and any help would be awesome. Thanks in advance. So would I just use the UV Map modifier to set UV coordinates for one model And how would I do that For starters...yes, you should definitely be using a poly mesh. I don't know of any game engines that are capable of rendering anything that is not a poly mesh. You can construct a model as nurbs, or subsurfaces, or patches, or whatever. But if you ever want to get a model into a game, you ALWAYS have to convert it into basic triangle polygons. So yes, you want to be using poly ...Show All
George Rezk Blender .X files and XNA compatibility
Are the .X files blender exports compatible with Xna GSE. At the moment I get 2 errors one shows: Error 1 Could not read the X file. The file is corrupt or invalid. Error code: E_FAIL. whenever i have subdivisions on my model. The other states: Error 1 Could not read the X file. The file is corrupt or invalid. Error code: D3DXFERR_PARSEERROR if I have any other shape in my scene other than the standard cube which automatically starts in blender. I am running blender 2.42a Thats the same version I have, 2.42a. I edited my previous post to include a link to download both exporters. The direct x exporter works great thanks for your help. Well, if you already have that one, you should be f ...Show All
Ryn slow, jerky execution
Hi all, I've ported the first series of my MDX tuts at www.riemers.net to XNA. Before I put them online, however, there is a bug a need to fix first. 50% of the times I run my project (in Game Studio or the .exe), the program runs very slowly. Even for a rotating triangle, I get 5 frames/second. This problem is not only for my projects, but also for others I dload from the internet. It's only sometimes, half of the times it starts with high framerates. After a few moments of framerate 5, chances are the program starts running normally. I only found vague indications of other people having this problem. I stripped the program to the bone, and don't think the error is in the code. When I check the amount of time that has elapsed ...Show All
Marcus J A potential bug in the XNA Framework ?
On two separate occasions my XNA application has crashed because of an AccessViolationException thrown from Microsoft.Xna.Framework.dll!Microsoft.Xna.Framework.Graphics.Texture2D.GetSurfaceLeve(int level = 0). The exception is being thrown when I try to change the render target. Both times the error has been thrown it was after about 5 minutes of running the application without any problems (and on the same line). The second time I kept moving the mouse around and was using the computer to make sure it wasn't an issue being caused by my screen saver. I am not making any native calls into anything except QueryPerformanceTimer() and QueryPerformanceFrequency() which are being imported in a separate class using PInvoke. Render Targets: m_posi ...Show All
HowardRichards 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. I checked his site and it's somewhat up to date as far as what's going on in the industry so he's still doing something. There's no n ...Show All
creaturita Detecting device capabilities
Hi. Now i'm trying to get the hardware capabilities, because one of my friend was trying to run an example that i give to him and the sample didn't work because his graphics device don't support: ' SupportsHardwareTransformAndLight' //(i saw that using MDX 1.1) So i want to modify the device creation to make it with 'GraphicsDevice.SoftwareVertexProcessing = true' but at this time i don't know how ask about the default device capabilities before the device was created. How can i do that thanks. Unfortunately, a very long call, but here it is: graphics.GraphicsDevice.CreationParameters.Adapter.GetCapabilities( DeviceType .Hardware).DeviceCapabilities.SupportsHardwareTransformAndLight thanks for your answer.. ...Show All
