Screenshots
Videos
Comments
Veedub,
Coincidentally, I also just posted a Bezerk clone. I'll download yours and have a look.
I get a DirectoryNotFoundException:
Could not find a part of the path 'C:\Documents and Settings\VanWagner\My Documents\Visual Studio 2005\Projects\Berzerker\Berzerker\Images\NewZerkie.png'
You may just want to make it so that file goes through the content pipeline like all the others.
I got it to work by changing some code in Game1.Intialize() to remove the hard coded paths:
m_mgrSprites = new XSpriteManager();
m_mgrSprites.AddTexture("Zerkie", "./Images/NewZerkie.png", 260, 500, Color.White);
m_mgrSprites.AddTexture("RobotAnimation", "./Images/RobotAnimation.png", 700, 700, Color.White);
m_mgrSprites.AddTexture("gun", "./Images/gun.png", 40, 40, Color.White);
m_mgrSprites.AddTexture("CyborgAnimation", "./Images/CyborgAnimation.png", 200, 400, Color.White);
Note to self:
Hard coded directories = bad.
Should be fixed. I will re-zip.
Even if I make the changes you suggested the problem is still exists depending on how the program is run. As veedub says, hard coded directories are the culprit. Your best bet is to have some code that finds the necessary directory(ies) at program startup. Then, you can prepend this found directory to all your file names before loading them. You can see how I do such a thing by looking at the DIrectoryNamePathResolver in my "XNA Utilities" project (you can find it on my profile/projects page). It looks for the named directory in a variety of known locations. It's specific to how I work but you could alter it for your needs.
I also fixed the hard coded directories. But then I get:
"InvalidOperationException was unhandled.
The size of the data passed in is too large or too small for this resource."
This happens on the tex.GetData statement:
// get the image data
Int32[] texbits = new Int32[m_pxWidth * m_pxHeight];
tex.GetData(texbits);
strTexName is Zerkie at the point it fails.
Not sure what to do to fix that...
m_pxwidth and m_pxheight are 260 and 500, while the size of the png is slightly different. Dunno if that's the problem...
Thanks for being my QA team hehe.
I have uploaded a new zip. I've never seen that sonyice. Do you get that before the game starts up? Can you get the new file and try again?
veedub-
Yes I don't actually see anything start even when running this newer exe. I get the "Please tell Microsoft about this Problem" error window. (I'm sure they'd do their darnest to help, but nevertheless I simply press "Don't Send"). I think my system is just starting to show its age. I had a similar issue with something else not running because textures were not in powers of two that other people didn't seem to have. However, although my ATI 9600XT is not exactly a cutting edge video card anymore, it's still not completely over-the-hill either.
I might look into this later, but I have to take off for a while.
I'm having the same problem as sonyice. I'm also running an ATI graphics card (Radeon x1400). The problem is definitely due to the fact that the m_pxwidth and m_pxheight values being reported by TexturePool are different than the actual Texture size from GetData (line 186 of XSpriteManager).
Ok I think it is probably due to the fact that the texture was an odd size. At some point the size was being rounded up which resulted in a mismatch. I have resized the image so that it matches.
Strange that only some graphics cards are complaining. This is definately good to know. A good rule of thumb would be to keep image sizes rounded off to the nearest 10th pixel.
I uploaded a new zip with v1.1. Let me know if this fixes the issue. Thanks!
I tried v1.1, but the problem was still happening.
It would appear that my card (and maybe all ATI cards?) only allow textures to be in dimensions of powers of two, and this error occurred slightly differently with the Snake project as well.
If I look at the Width and Height properties of the tex variable in your code (which is a Texture2D) at run time, those values are always powers of two for me. So the zerkie texture is 512 X 512. Apparently for you, it matches the size of the png?
So, if this code:
//get the image data
Int32[] texbits = new Int32[m_pxWidth * m_pxHeight];
is changed to:
//get the image data
Int32[] texbits = new Int32[tex.Width * tex.Height];
your game runs for me, and appears to work fine including the collision detection which I believe is what this code above is ultimately used for.
So, you could try that quick change, and verify that it works for your system as well.
I like this version of Berzerker. It's easier to kill the robots! Plus it's easy to get them to walk into the walls. I also like the extra gun feature to change from single bullets to multiple.
Oddly, it's more entertaining to code/debug stuff lately than to actually play games. Well, with the exception of FlatOut2 maybe. Can't seem to stop playing that on the 65" screen. Too fun.
Thanks sonyice! I have made the fix and it works fine for me. Also, the issue is in the XNAExtras code for anyone out there using XNAExtras.
v1.2 uploaded.
I'm watching Crank right now. Pretty insane movie...in one scene there was a bad guy playing this game on a monitor in the back seat of a car.
Sweet. I'm gonna rent that now.
Lower your expectations and you will enjoy it.
Please
log in to leave a comment