Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Dave Hunt

Member Since 30 Dec 2002
Offline Last Active Yesterday, 08:20 PM

#5223963 XNA Ghost Attack Behaviour

Posted by Dave Hunt on 17 April 2015 - 07:57 AM


Also, you shouldn't use floating point variables for storing time values, since most of the system functions return time values as an unsigned integer. If you convert the system's time values to float, aside from that extra conversion, you're also just throwing away bits of precision, and forcing floating point operations where integer operations would be sufficient (and faster).

XNA's GameTime class uses TimeSpan structures, which return seconds as doubles.

 


And if that's not it, then it's most definitely because your "float time" variable is not static or global, so it gets set to 0 every frame (or every time you call the Attack() function), and then to the elapsed frame time, instead of accumulating the time since the collision was detected.

This.




#5215732 What IDEs are recommended for Lua and/or Python?

Posted by Dave Hunt on 10 March 2015 - 05:59 PM

I use PyCharm Community Edition for python.




#5214262 Directx11 Sprite class

Posted by Dave Hunt on 03 March 2015 - 12:24 PM

Unless you're set on implementing your own sprite API, I would recommend the SpriteBatch class in the DirectX Tool Kit.




#5211086 What are the recommended places to store save data?

Posted by Dave Hunt on 16 February 2015 - 06:24 PM


Personally I would consider saving within the application's directory to be incorrect on Windows.

In fact, with a "proper" Windows installation, your application's directory will be read-only.




#5211084 WM_INPUT Keys Not Registering

Posted by Dave Hunt on 16 February 2015 - 06:21 PM

See Keyboards are Evil.

 

Basically, it's a hardware problem.




#5210547 Making an XNA game that can adapt between HiDef and Reach profiles

Posted by Dave Hunt on 13 February 2015 - 02:42 PM

Read the comments from Shawn Hargreaves at the end of this article. He answers this question there. Basically, you would isolate the Reach vs HiDef content into separate library projects, so they can be pipelined with the appropriate profile. Your startup code would check for which profile was supported and set the GraphicsDevice accordingly. You would also (obviously) need separate code paths for any features not supported in both profiles.

 

Also, the belief that Reach is for Windows Phone and HiDef is for PCs is a common misconception. Shawn has pointed out many times (see this article and associated comments) that it's not about Phone VS Other, it's about commonly available device capabilities, regardless of platform. Reach happens to fit Windows Phone quite nicely, but it is also appropriate for many of the older generation video cards. This is because, even though many of those cards supported higher-end features, they all did that in a non-standard way that didn't always produce consistent results across cards. The two-profile mechanism provided a way to guarantee consistent functionality.




#5173964 C# While Statement

Posted by Dave Hunt on 15 August 2014 - 01:17 PM


or will it run the random selection again?

Why would it? randomChoice won't change unless you have code inside the while loop that changes it.

 

But, the best way to determine that for yourself would be for you to actually try the code and see.




#5169821 problem gamemaneger

Posted by Dave Hunt on 28 July 2014 - 11:43 AM

The type "PlayerIndex" doesn't exist in SharpDX. You need to get rid of all references to it in the code.

 

The Viewport property of GraphicsDevice returns a SharpDX.ViewportF, not a SharpDX.Viewport.




#5165872 optymizations by self modifying code

Posted by Dave Hunt on 09 July 2014 - 12:33 PM

There was a series of articles in Dr. Dobbs Journal detailing the optimization of Pixomatic for x86 processors. The first in the series is here - http://www.drdobbs.com/architecture-and-design/optimizing-pixomatic-for-x86-processors/184405765

 

There's a brief discussion of the self-modifying pipeline in that first article. I didn't spend any time trying to locate the subsequent articles in the series.




#5165604 some assembly unknowns

Posted by Dave Hunt on 08 July 2014 - 12:10 PM

Is there an actual question in there or is this just YAFR (Yet Another Fir Ramble)?




#5165559 DLL Import Failure

Posted by Dave Hunt on 08 July 2014 - 09:32 AM

If it's a true .NET DLL, then you shouldn't need to do any DllImport at all. Just add a reference to the DLL (right-click References in Solution explorer and click Add Reference...). When the project builds, it will automatically copy the DLL to the correct output directory.

 

If it's not a true .NET DLL, then you will need the DllImport and you need to manually place the DLL in the same directory as your app's .exe directory. That directory will be under either the Debug or Release directory under your project, depending on whether you're doing a Debug or Release build.

 

If the DLL depends on other DLLs that aren't in your environment path, then you'll need to either add references to them (for .NET DLLs) or copy them to your .exe directory as well.




#5161312 Code::Blocks: Process terminated with status -1073741819

Posted by Dave Hunt on 18 June 2014 - 08:09 AM

Take a very close look at the first parameter of your load_map function...




#5160413 SDL Documentation

Posted by Dave Hunt on 13 June 2014 - 08:39 PM

For the SDL.net API doxygen docs, look here: http://cs-sdl.sourceforge.net/apidocs/html/index.html




#5150936 Drawing Text with Dx11

Posted by Dave Hunt on 02 May 2014 - 09:50 AM

Have you considered using the DirectX Toolkit?




#5147521 how to set a texture?

Posted by Dave Hunt on 16 April 2014 - 08:32 PM

You might want to set the texture on the device before you draw the primitive. :-)

 

Also, you need to use an FVF (if you insist on avoiding shaders) that matches your vertex buffer (e.g. it needs to include D3DFVF_TEX1).






PARTNERS