Tuesday, December 12, 2006

A friend just sent me a link to this Channel 9 video and I watched the first couple of minutes.

http://channel9.msdn.com/Showpost.aspx?postid=261254

For those of you who don't have 40 minutes to watch this, its a video interview with Frank Savage @ MSFT, who heads of the XNA development team.  Frank worked on Wing Commander III and has a ton of street cred in the gaming industry.  MSFT wisely continues their trend of hiring the smartest people with the most cred and vision that they can find.

Anyway, allow me a moment of self reflection.  When I was 11 I made a spaceship game on BASIC for our 8086 PC.  It had colors and a cool spaceship I drew using arcs and lines, and the spaceship shot out this cool lightning bolt when you hit the space bar.  I got it to draw terrain (fixed skyscape that repeated over and over again) and was working on enemy spaceships.  At the time, I didn't understand that game developers give the illusion of many things happening at once by giving every object in the game world a chance to update itself every "tic" and that redrawing as often as possible was responsible for seeing various things moving on the screen at once.  I was trying to see if there was a way to get threads to work on BASIC, the old BASIC with 10 PRINT "HELLO", 20 GOSUB 2000 so I could have one thread per enemy spaceship and bullet.  Hey, it made sense at the time!   This caused me to wonder, where the hell did I go wrong?  I could have been one of those guys you read about, certainly no John Carmack in level of skill or innovation, but if I'd stuck with game programming maybe MSFT would be hiring me and people would say "Yeah, wow, you're that guy who worked on CornBlaster II" or something like that.  Oh well, I suppose I'm still young, if I only I could get off my ass and stop playing FFXII long enough to get back into game programming after an 18 year hiatus.

Tuesday, December 12, 2006 3:23:42 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback

I often remark about the Good Ole Days™ where I was a C++ developer doing app server code on Solaris with a Sparc on my desk and the Windows NT machine that was just for email and Word documents.  I have even written a little C in my .Net career: building a DLL to make some very specific P/Invoke action easier.  I haven't written anything significant (read: more than one function) since 1998. 

When one is working on the compact framework, shrink-wrap desktop software, or isntallers for desktop software, often something comes up that is not easy to do in .Net, cannot be done in .NET, or someone on your team balks at requiring the .NET framework in order to install the program.  I have always managed to steer around this issue by building a bootstrap installer (that runs a silent Dotnetfx.exe before the main MSI) or in some other way being convincing that the feature was not needed, .NET is needed, .NET is ubiquitous enough to assume, etc.  This recenty came up again when I built an installer for a non-.NET product we have here and various custom actions were required and written in .NET.  The department for whom I wrote the installer balked, as one of their machiens did not have .NET 1.1 despite claims of being up to date with windows update, etc.  I could have pushed the issue again but this comes up often enough that I really decided I should get back into C++ and be ready for future opportunities to innovate. 

It took me an embarassing amount of time to get the program working, here is a snippet.  I notice DasBlog does NOT have a C++ option under the insert code, harumpf!

using namespace std;


int _tmain(int argc, LPTSTR argv[])
{
        _cputs("COPYING PLUGIN\r\n");        
        HKEY resultKey = NULL;    
        
        LONG result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
            _T("SOFTWARE\\ej-technologies\\install4j\\installations"),
            0,
            KEY_READ | KEY_QUERY_VALUE,
            &resultKey);
        if(ERROR_SUCCESS == result)
        {
            _cputs("Searching for registry value\r\n");
            ///////////////////////////////////////////////////
            //Figure out how many values there are in the key
            ///////////////////////////////////////////////////
            DWORD maxSubKeyLen, numVals, maxValNameLen, maxValLen, numSubKeys;
            DWORD valueNameLen, valueLen, valueType;
            LPTSTR subKeyname, valueName;
            LPBYTE value;
            FILETIME lastWriteTime;

            RegQueryInfoKey(resultKey,
                NULL,
                NULL,
                NULL,
                &numSubKeys,
                &maxSubKeyLen,
                NULL,
                &numVals,
                &maxValNameLen,
                &maxValLen,
                NULL,
                &lastWriteTime);

            valueName = (LPTSTR)malloc (maxValNameLen + 1);
            value = (LPBYTE)malloc (maxValLen);

            ///////////////////////////////////////////////////
            // Enumerate each value to see if it is the one we want
            ///////////////////////////////////////////////////
            for(int i = 0; i < numVals; i++){
                valueNameLen = maxValNameLen + 1;
                valueLen = maxValLen +1;

                RegEnumValue(resultKey,
                    i,
                    valueName,
                    &valueNameLen,
                    NULL,
                    &valueType,
                    value,
                    &valueLen);
                _tprintf(_T("\nValue: %s="), valueName);
                _tprintf(_T("%s\r\n"), (LPTSTR)value);
                LPTSTR compVal = LPTSTR(valueName);
                LPTSTR instdir = _T("instdir");
                
                _tprintf(_T("%s??%s\r\n"), compVal, instdir);
                int compare = _tcsncmp(compVal, instdir , 7);
                if(0 == compare){
                    //now we know "value" is our install dir
                    LPTSTR valueString = (LPTSTR)value;
                    LPTSTR pluginStr = _T("\\plugins\\carspot.jar");
                    
                
                    LPTSTR srcPath = _tfullpath(NULL, _T("./carspot.jar"), _MAX_PATH);
                    _tprintf(_T("srcPath=%s\r\n"), srcPath);

                    LPTSTR destPath = (LPTSTR)malloc(_MAX_PATH);

                    _tcscpy(destPath, valueString);
                    _tprintf(_T("SPARK install dir is %s\r\n"), value);
                    _tcsncat(destPath, pluginStr, _tcslen(pluginStr));
                    _tprintf(_T("Plugin dir is %s\r\n"), destPath);


                    _tprintf(_T("copying..."));
                    if(!CopyFile( srcPath, destPath, FALSE)) {
                        DWORD error = GetLastError();
                        _tprintf(_T("Last error was %i", error));
                    }

Since my C career was on Solaris I was unfamiliar with ALL of the conventions I was confronted with.  Not even main() is the same, where is good ole int main(int argc, char ** argv) ?   What the hell is an LPTSTR or a DWORD?  On Solaris pretty much everyone used the RougeWave String package.  I eventually figured out (using some books Chad Albrecht recommended) that LPTSTR is typedef'd based on whether or not UNICIODE is a #define-d, found the template versions of all the string manipulation libraries (best not to use the ole vanille strcmp etc), realized no one uses "delete" on Win32, and that most predefined types do not use "*" (LPTSTR is defined as TCHAR *) and generally got myself back into C-thinking.  My final head-scratcher was when my program worked fine on my PC but not on any machine I copied it to.  I'm not sure if this is just how my project was set up or not, but it seems the linker functions far differently in debug builds?  Changing to a Release build finally got it working.  Some of my attempts to free() memory crash at runtime so I've obviously got some more reading to do before I can call myself "back in action".

C++
Tuesday, December 12, 2006 2:41:37 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, December 11, 2006

The Wii and the PS3 are impossible to get right now.  Rewind a year, so was the XBox 360, rewind further and so was the PS2 and the Xbox before that.

What is the point of launching to HUGE customer demand with an infinitesimal numbers of units, then spending marketing dollars on top of that, as if you needed to stir up demand?   What is the point of making the launch for the holidays when all you have to offer is a small quantity of units that you would have sold out of anyway?

I'm chewing on the idea that its done on purpose.  Think about it: you have a new console, possibly a new online service, they are almost certainly going to have some bugs at first despite all your testing efforts.  Why not produce only a limited # of consoles so that any errors are caught and fixed in 200,000 consoles instead of 2,000,000 consoles.  The first people to buy are essentially un-paid beta testers. By releasing in such limited quantities, you are also being assured that only the people who want your product very, very badly are going to get it.  No one is going to casually walk in off the street and buy your new console on a whim and be upset.  The guy who camped out in front of best buy to get his new console isn't going to say "screw it" and take it back if it overheats or has some quirks.

Thoughts?

Monday, December 11, 2006 10:37:42 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [5]  |  Trackback
 Tuesday, December 05, 2006

Why, oh why, is it that I cannot get a version of dotnetfx.exe that does not include the ASP.Net runtime and such?  It would be nice for my end users if such a thing existed.

.NET | Rant
Tuesday, December 05, 2006 3:57:45 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, November 21, 2006
Tuesday, November 21, 2006 12:08:27 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Monday, November 20, 2006

http://feeds.cinematical.com/~r/weblogsinc/cinematical/~3/51505052/

Whiskey Tango Foxtrot?  Hollywood continues to suck.  Hollywood is a great example of a bunch of old idiots who are living in a meticulously constructed fantasy world of their own, then blaming movie downloads on their malaise, rather than the fact that they they make terrible decisions over and over again.

 

Monday, November 20, 2006 10:17:18 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, November 15, 2006

I am a Lord of the Rings nerd, and I don't mind saying so.  Hell, I'm even an armchair Tolkein Scholar, if that gives you any idea how much of a nerd I am.  I don't speak any made up languages but I really enjoy the depth of the mythology.  The LOTR movies directed by Peter Jackson are among the best films to come out of Hollywood in recent memory.

Reading here
http://feeds.cinematical.com/~r/weblogsinc/cinematical/~3/49649575/

You can see that The Hobbit is indeed on track to become a movie, though it may be a few years before production begins.

Glas tulo na min oh hé siniath!

Wednesday, November 15, 2006 11:25:12 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback

I spent a bit of time yesterday hacking Codus to work on .NET 2.0 and generate generic classes and collections for data access.  Talking to Sean from Adapdev a bit it looks like I'm going to try to clean this up and contribute the changes so they're available in future Codus and Adapdev.Net releases.  So, if you have been looking for .Net 2 support in these excellent tools, it seems its on the way.

Wednesday, November 15, 2006 11:11:13 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Monday, November 13, 2006
PS3

Despite being a Microsoft FanBoy, I have long enjoyed the Playstation franchise.  While I don't have the time to procure one by camping out the video of Final Fantasy XIII has convinced me that the PS3 is going to ultimately be the dominant platform yet again.  There aren't any launch games I'm interested in but if I saw one sitting on the shelf at Target I'd probably pick it up just for a BluRay player.

Note to Sony and MSFT: you suck when it comes to releasing your consoles.  Sony expects to sell 7,000,000 units as quickly as they can make them and I see no reason to doubt it.  Why, then, launch with only 400,000 units in the US?  That's 8,000 per state if distributed evenly, and how many BestBuy, KMart, Target, Walmart, EBGames, Toys 'R Us are they then split between?  What's the point of advertising and such when not even half of the "very hard core gamers" will be able to get one. 

Monday, November 13, 2006 1:23:31 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, November 09, 2006

Note the strange silence after yesterday's elections.

Where are the broken voting machines and screams of foul play?
Where are the people turned away from the voting booth by scary people?
Where are the misleading ballots that trick you into voting for the wrong candidate?
The hanging chads?
The hacked-into diebold machines?
I guess those only happen when the republicans win the day.  How did we get through yesterday with only a single recount?  I guess those things only happen when the republicans win the day.  A republican victory, we should believe, is a sham, a proof of foul play, an abomination impossible to conceive.  A democratic victory is an affirmation, a proof of the righteous mandate of the people.

Oh well, back to writing code.

Thursday, November 09, 2006 11:43:32 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback