Thursday, May 6, 2010

Fun with alphas!

I'm having great fun with my alphas versions! I mean in trying to fix compatibility bugs...
It's not as bad as it sounds. Its part of the job fixing silly stuff. That's why game companies have beta testers and a bunch of different machines to test on. Coding problems I can test most of them by myself but hardware I can't. So I can only rely on brave volunteers feedback.
Some stuff I learned: 

Deploying .NET 32 bits to 64 bits
Bug: You compile and run on 32 bits machine but it crashes on 64 bits.
Solution: In VS use the the Configuration Manager and compile for "x86" platform, not "any cpu".
To enable the Configuration Manager you must enable advanced options.

Distribution with ClickOnce
Thats what "publish" in VS does. It will download the right dlls for the user.
The bad thing is that it hides the application in a silly cache directory and only adds a mysterious im-not-quite-your-usual-link to the executable and nothing else.
Since I want some files to be available to the user (game manual and post mortem files) I'll have to find a way to copy these files somewhere else. Most likely the desktop or some C:\folder. But then ClickOnce uninstall won't clear those files and I'll have to mess with something. Bah.
I hate applications that leave crap after uninstall so I'll have to do it cleanly. I hope I won't have to write a ClickOnce deployement class or something. Talk about making it simple.

Creating DirectX textures
Bug: crash when creating a new texture on some gfx cards.
I was impressed by how Managed DirectX is easy to use. In my memories DirectX was something awfully verbose and convoluted with lots of LPDDIRECTSOMETHING crap and tons of lines of code just to fucking init a device. That was from DX6 or DX7 days in C/C++. Its so much simpler now, even more in .NET.
Good. But I was bit a naive in thinking I shouldn't have to check gfx cards capabilities and limitations when creating textures. So if I pass a parameter value that offends the gfx card, DX throws an error at you with little explanation. You have to guess what parameter is the culprit. So you have to annoy the people who tried your game and crashed with request about trying each one of your code fix. Thankfully they seem cooperative and glad I'm trying to fix the game.
Solution? : In Texture ctor the culprit is either numLevels and/or  texture size not a power of 2.
Wth? I thought texture sizes ^2 was a thing of the past.
I hope there is set of texture constructor parameters that fits for all gfx cards but I'm not too sure now...

End of rant.

No comments:

Post a Comment