{"id":37495,"date":"2017-03-21T06:00:18","date_gmt":"2017-03-21T11:00:18","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=37495"},"modified":"2017-03-21T10:24:21","modified_gmt":"2017-03-21T15:24:21","slug":"pseudoku-this-is-not-programming","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=37495","title":{"rendered":"Pseudoku: This is not Programming"},"content":{"rendered":"<p>The part of development that I love: Programming.<\/p>\n<p>The part I do not love: All the stupid crap that keeps me from programming.<\/p>\n<p>Unfortunately, when you&#8217;re an indie you gotta deal with some of that non-coding stuff.<\/p>\n<h3>Business<\/h3>\n<p>In order to get my game on Steam, I need to have a business checking account. Fine. I go to the bank and open one.<\/p>\n<p>Turns out that in order to open that checking account, I need an ID for my business. Which means I have to create one. Fine, go to the government site and begin asking them for permission to be a business. <\/p>\n<p>To form a business, you first must register your fictitious name. Example: &#8220;Foo Games&#8221;. <\/p>\n<p>Okay then. Let&#8217;s go to a different and even more obtuse site to figure THAT out. It turns out that registering a fictitious name is a complex process that varies from state to state, and what little documentation exists is contradictory when it isn&#8217;t missing or out of date. <\/p>\n<p>I am now mired in a stupid <a href=\"?p=27836\">side-side-side quest<\/a>. I should point out that I&#8217;m genetically predisposed to <a href=\"?p=646\">lose my shit over problems like this<\/a>.<\/p>\n<p><!--more-->Everyone says &#8220;hire a lawyer&#8221;, which is great if you know of a good one that works in this field and have the money to pay them.<\/p>\n<p>I hate this. All of this. Every step is expensive and a gigantic time sink. This bullshit can devour hours of productivity just to figure out which of these fifty forms I&#8217;m supposed to fill out and more hours of time to figure out how to fill them out. And the only way to avoid that headache is to make it even more expensive by hiring and meeting with a lawyer, which is <em>itself<\/em> a time-sink.<\/p>\n<p>HATE this.<\/p>\n<p>Hate. Hate. Hate.<\/p>\n<p>Okay. This is frustrating. I need to put this aside until I cool off. Let&#8217;s work on something else&#8230;<\/p>\n<h3>VM<\/h3>\n<p>My program is having crash problems. Last week I incorrectly said that Pseudoku fails to run on 5% of machines, but that tally included people who never even downloaded it. That poll was a measure of &#8220;Of the people responding to this poll, how many tried to run the game and couldn&#8217;t?&#8221; This means that &#8220;People who didn&#8217;t try the game and in fact care nothing about it&#8221; were being thought of as &#8220;able to run the game&#8221;. If you straighten out this misunderstanding, it looks like the failure rate is more like 10%.<\/p>\n<p>My problem is that the game works fine on my machine. I have all the libraries required. Other people don&#8217;t. In order to pinpoint the problem, I need to be able to replicate their results. Someone suggested using a virtual machine. This is a great idea, since I already have VirtualBox installed.<\/p>\n<div class=\"dmnotes\">I installed it to mess around with <a href=\"https:\/\/www.reactos.org\/\">ReactOS<\/a>. I meant to write about this at some point but never got around to it. <\/p>\n<p>ReactOS is an attempt to make a free, open operating system that&#8217;s compatible with Windows. This means interface, drivers, everything. It sounds impossible. But if it worked it would basically accomplish what Valve was trying to do with SteamOS, which is give the public a way to push back against Microsoft hegemony. Right now Microsoft can drop support for an old OS to force you to upgrade. And each new version can have more security holes, more privacy concerns, less user freedom, and more overbearing hand-holding. What are you going to do? Take your Steam library of hundreds of Windows-only games and storm off to Linux?<\/p>\n<p>I tried ReactOS. Even in a Virtual Machine it ran really snappy. It did basically everything I asked it to do&#8230; except play games.<\/p>\n<p>That&#8217;s a tough problem. The people working on WINE for Linux have been hammering away at this for ages and have made very little success in terms of games. I don&#8217;t know if it can be solved, but I&#8217;m very interested to see how far they get.<\/p><\/div>\n<p>I download a version of Win7 that Microsoft offers specifically for testing. It&#8217;s actually designed for testing stuff like &#8220;How does my site look using IE 6 on Win7&#8221; or some such. They offer a bunch of combinations of MS operating systems and IE browsers. I&#8217;m going for Win7 first because I really want Pseudoku to run on it. I consider it to be the best OS Microsoft ever made. Also, according to the <a href=\"http:\/\/store.steampowered.com\/hwsurvey\">Steam hardware survey<\/a> about one-third of all users are still on Win7, so missing out on Win7 means cutting myself off from a lot of potential customers.<\/p>\n<p>Besides, this is a bare-bones, dead-simple application. It <strong>ought<\/strong> to work on Windows XP, for crying out loud. <\/p>\n<p>If you&#8217;ve never used a virtual machine: It&#8217;s a program that emulates a computer. You can control the properties of this computer: How much memory, how much storage, how many hard drives, how large the monitor is, etc. The only limitation is that the emulated computer needs to fit inside the host. So it needs to have less memory, less storage, etc. There&#8217;s a pretty big overhead to running a virtual machine, which means the virtual computer (also called the &#8220;guest&#8221;) is going to be a lot slower than your actual PC.<\/p>\n<p>You can install an operating system on this guest PC, and (aside from being kind of slow) it should perform identically to a physical machine. There&#8217;s no way for the operating system to &#8220;know&#8221; that it&#8217;s inside a virtual machine. <\/p>\n<p>I install Windows 7. The game crashes. <\/p>\n<p>After some careful study of the log files (after I stop to add log files to the program) I&#8217;m able to see that the failure is when the program tries to call OpenGL.<\/p>\n<p>That really shouldn&#8217;t happen. OpenGL WORKS. I&#8217;ve never heard of a situation where it didn&#8217;t. Even a fresh install of an old OS with no updates should still be able to talk to OpenGL. This is a really strange problem and I don&#8217;t know what to make of it. <\/p>\n<p>Well, let&#8217;s try Win8. I download the OS, install it, and it won&#8217;t start up. Apparently running Win8 in a VM requires you to enable some sorcery in your BIOS. I don&#8217;t know enough about VM&#8217;s to understand this, but I reboot the machine and enable the required option.<\/p>\n<p>Windows won&#8217;t start.  <\/p>\n<p>To be clear, I mean the REAL Windows. Windows 10, that I&#8217;m running on my real computer here in the real world outside of The Matrix, won&#8217;t start. It blue screens. <\/p>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/pseudoku-fail1.jpg' width=100% alt='Shit just got real.' title='Shit just got real.'\/><\/div><div class='mouseover-alt'>Shit just got real.<\/div><\/p>\n<p>I am reminded of <a href=\"https:\/\/xkcd.com\/349\/\">the XKCD strip where attempting to solve easy problems led to more serious problems, until the entire endeavor ended in disaster<\/a>.<\/p>\n<p>No problem, I&#8217;ll just disable that setting. I reboot, disable the virtual whatsit, and the OS is still broken. <\/p>\n<p>I dig my Windows 10 disc out and do a repair. I re-enable the stupid mystery feature, and get back to work&#8230;<\/p>\n<p>I finally get Win8 running in the virtual machine, and then I discover it can&#8217;t run the game either.<\/p>\n<p>But this version of Win8 is made for testing internet explorer. Maybe Microsoft left out a bunch of stuff? Maybe this isn&#8217;t SUPPOSED to be able to do graphics? It&#8217;s a free OS they give away, and it would be just like them to cripple it.<\/p>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/pseudoku-fail2.jpg' width=100% alt='Shit just got virtual.' title='Shit just got virtual.'\/><\/div><div class='mouseover-alt'>Shit just got virtual.<\/div><\/p>\n<p>So let&#8217;s just create another virtual machine. This time I&#8217;ll use the Win7 disc I have leftover from my days of 32 bit computing. I used this same version of Windows a few years ago. It&#8217;s not some crippleware testbed. This is the real thing. It will certainly be able to handle OpenGL calls. Once that&#8217;s sorted out I can work out where OTHER people are crashing, because they sure as hell aren&#8217;t crashing on OpenGL calls.<\/p>\n<p>It takes a long time to get this installed. The VMs I downloaded from Microsoft were snapshots of a machine that was already set up, but this time I have to go through the real Win7 install process. That takes ages under ideal conditions, and much longer under a VM.<\/p>\n<p>Once that&#8217;s done, I try to run the game and <strong>of course<\/strong> it still crashes on OpenGL calls.<\/p>\n<p>Well, I guess I should update this version of Windows, since it is a fresh-off-the-disc install.<\/p>\n<p>(Three hours later&#8230;)<\/p>\n<p>Okay, we&#8217;re up to date. And&#8230; it still crashes.<\/p>\n<p>Now, I KNOW this doesn&#8217;t make sense. I have never seen or heard of a situation where OpenGL would fail like this. <\/p>\n<p>For the record: I&#8217;m using Virtual Box. Yes I installed the virtual drivers and yes I enabled hardware acceleration. I also tried it without HW acceleration enabled, and with many different settings in many configurations. This was a pain in the ass, since every time I wanted to make a change I had to reboot the virtual computer, and every time I do that Windows 7 remembers it STILL has EVEN MORE updates to apply. Even on reboot #7, it&#8217;s STILL applying more updates. <\/p>\n<p>I try dependency walker. It&#8217;s <a href=\"http:\/\/stackoverflow.com\/questions\/17023419\/win-7-64-bit-dll-problems\">useless<\/a>. I install the appropriate VC redistributables onto the target. It doesn&#8217;t help. I try many different ways of compiling the project, linking various things statically, including every possible DLL the program uses in the program directory<span class='snote' title='1'>Fun fact: Do you know some savage jackass in Redmond decided that from now on, 64 bit DLLs go into \/system32? I didn&#8217;t know that until now.<\/span>.<\/p>\n<p>Finally I just start groping around, trying random things. I discover that some OpenGL calls crash and some don&#8217;t. The ones that don&#8217;t are the &#8220;core&#8221;. The ones that do are the &#8220;extensions&#8221;. <\/p>\n<p>See, OpenGL stuff dates WAY back to 1992. <a href=\"?p=26269\">Since then, it has undergone a strange evolution<\/a>. As we entered the age of graphics cards and shaders it needed to grow, so new stuff was bolted onto the original system. It was messy and ugly and probably more convoluted than it needed to be. I&#8217;m using the <a href=\"http:\/\/glew.sourceforge.net\/\">OpenGL Extension Wrangler<\/a> to gain access to these &#8220;new&#8221; (as in less than fifteen years old) features. That&#8217;s fine. People will tell you, &#8220;all computers have that stuff now&#8221;. However, that is evidently not the case for virtual machines. Virtual Box has a system to pass graphics calls to the host machine, but evidently it doesn&#8217;t have access to the extended stuff in OpenGL.<\/p>\n<p>This explains why my game doesn&#8217;t run on a virtual machine, but it has nothing to do with why my game doesn&#8217;t run for random people out there. I just wasted two days in complete frustration only to realize that none of this matters and I&#8217;m no closer to solving the problem. <\/p>\n<p>Head. Hit. Keyboard.<\/p>\n<h3>Coming Along<\/h3>\n<p>After writing the above: <\/p>\n<p>We got the business stuff mostly worked out. (I hope.) We saved a lot of time and stupidity by skipping the fictitious name thing and just naming the company after me. It&#8217;s boring, but it&#8217;s done.  Creating a fictitious name in this state is stupidly expensive<span class='snote' title='2'>It takes several weeks and costs just short of $300. Most of that time and money is to pay to have the name &#8220;published&#8221; in &#8220;trade journals&#8221;, which I suspect only exist so that people can pay them money to publish the name of their company. The law states that for your name to be recognized it has to be &#8220;published&#8221;, and so this idiotic do-nothing service is the result. What a dumb waste.<\/span>. Whenever I used to see a business called &#8220;Thompson&#8217;s Bakery&#8221; I always assumed the owner lacked imagination. Now I realize they probably just had a low tolerance for bullshit.<\/p>\n<p>I know I can probably reach out and find a volunteer to test my Pseudoku builds, but I was really hoping to come up with my own test machine. I&#8217;m not sure what I&#8217;m going to do next. My ideal test machine would be a virgin install of 32 bit Windows 7<span class='snote' title='3'>By &#8220;virgin&#8221; I mean all the relevant updates are installed, but no games or Steam.<\/span>. If I can get it running there, then I can be confident it will run just about anywhere.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The part of development that I love: Programming. The part I do not love: All the stupid crap that keeps me from programming. Unfortunately, when you&#8217;re an indie you gotta deal with some of that non-coding stuff. Business In order to get my game on Steam, I need to have a business checking account. Fine. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"class_list":["post-37495","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/37495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=37495"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/37495\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=37495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=37495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=37495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}