{"id":250,"date":"2026-10-18T20:50:30","date_gmt":"2026-10-18T20:50:30","guid":{"rendered":"https:\/\/robinclapworthy.com\/?p=250"},"modified":"2026-10-18T20:50:31","modified_gmt":"2026-10-18T20:50:31","slug":"galactic-gladiators-one-small-game-one-giant-headache","status":"publish","type":"post","link":"https:\/\/robinclapworthy.com\/?p=250","title":{"rendered":"Galactic Gladiators: One Small Game, One Giant Headache"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>The continuing adventures of building an arcade game in Visual FoxPro 9.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s been a little while since my last Galactic Gladiators update, but that doesn&#8217;t mean things have been quiet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Quite the opposite.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The game has continued to grow, with more features, more polish and, inevitably, more opportunities for things to go spectacularly wrong.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The ultimate test: another computer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s a rather important difference between a game working perfectly on your development machine and working on a completely different computer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To find out how close Galactic Gladiators was to being ready for other people to play, I set up a clean Windows 11 virtual machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The idea was simple: copy over the compiled EXE and see what happened.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Naturally, it wasn&#8217;t quite that simple.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first surprise was discovering that although certain graphics had been included in the compiled executable, the game&#8217;s GDI+ renderer still expected to find the original PNG files on disk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Without them, the spaceship refused to appear.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Apparently, even intergalactic spacecraft require the correct paperwork.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The mysterious disappearing screen space<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Then there was the display.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The game was running, but the layout wasn&#8217;t quite right. Parts of the interface were disappearing, and the mothership wasn&#8217;t fitting as intended.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After investigating the rendering and window layout, the culprit turned out to be something remarkably mundane: the Visual FoxPro system menu.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Adding one line:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SET SYSMENU OFF<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">removed an unwanted strip of screen space and restored the layout.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes the biggest problems have the smallest solutions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A game within a game<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One of the newer additions is BARF&#8217;s Tactical Deflection Simulator.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Essentially, it&#8217;s a futuristic version of Pong, complete with increasingly challenging gameplay, controller support and BARF&#8217;s customary attitude.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s even a combat skill to unlock if you can beat him.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It worked beautifully in development.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the compiled EXE, however, things became rather more entertaining.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Initially, the simulator couldn&#8217;t be found because its launch code was looking for a PRG file at a fixed location on my development machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once that was corrected, Pong launched \u2014 only for the main menu to appear over the top of it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The simulator was still running underneath. I could actually see it close when I closed the title screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After rather more investigation than a game of Pong should reasonably require, the solution came down to Visual FoxPro&#8217;s window handling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Changing the simulator&#8217;s <code>ShowWindow<\/code> property from <code>2<\/code> to <code>1<\/code>, while retaining its modal behaviour, finally resolved the problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pong was back.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I suspect the aliens were laughing at me.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">BARF gets comfortable<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Meanwhile, BARF has acquired a chair.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">He&#8217;s now sitting in it in both the Combat Simulator and the pause menu.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While the player is dodging asteroids, fighting alien spacecraft and generally trying to save the galaxy, BARF appears to have secured himself a comfortable supervisory position.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Management material, clearly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The next challenge: everything inside the EXE<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that the game is running on a clean Windows 11 installation, attention is turning towards distribution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At present, some graphics and sounds still need to be supplied as separate files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;d much prefer to package as much as possible inside the executable itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Visual FoxPro can store files within a compiled application, but getting external graphics and audio libraries to use those embedded resources directly is another matter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next experiment will be to load a PNG from the executable straight into memory, without relying on a physical image file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If that works, it could be the beginning of a much cleaner way to distribute the game.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And possibly another opportunity to discover something obscure about Windows programming.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting closer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The encouraging thing is that Galactic Gladiators is no longer just something that runs on my development PC.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s becoming something I can genuinely imagine handing to somebody else and saying:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;Here you go. Have a play.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s still testing to do, assets to package and undoubtedly a few more surprises waiting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But we&#8217;re getting there.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And if all else fails, BARF can always blame the pilot.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The continuing adventures of building an arcade game in Visual FoxPro 9. It&#8217;s been a little while since my last Galactic Gladiators update, but that doesn&#8217;t mean things have been quiet. Quite the opposite. The game has continued to grow, with more features, more polish and, inevitably, more opportunities for things to go spectacularly wrong. &#8230; <a title=\"Galactic Gladiators: One Small Game, One Giant Headache\" class=\"read-more\" href=\"https:\/\/robinclapworthy.com\/?p=250\" aria-label=\"Read more about Galactic Gladiators: One Small Game, One Giant Headache\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-250","post","type-post","status-publish","format-standard","hentry","category-galactic-gladiators"],"_links":{"self":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=250"}],"version-history":[{"count":1,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":251,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=\/wp\/v2\/posts\/250\/revisions\/251"}],"wp:attachment":[{"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robinclapworthy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}