The continuing adventures of building an arcade game in Visual FoxPro 9.
It’s been a little while since my last Galactic Gladiators update, but that doesn’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.
The ultimate test: another computer
There’s a rather important difference between a game working perfectly on your development machine and working on a completely different computer.
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.
The idea was simple: copy over the compiled EXE and see what happened.
Naturally, it wasn’t quite that simple.
The first surprise was discovering that although certain graphics had been included in the compiled executable, the game’s GDI+ renderer still expected to find the original PNG files on disk.
Without them, the spaceship refused to appear.
Apparently, even intergalactic spacecraft require the correct paperwork.
The mysterious disappearing screen space
Then there was the display.
The game was running, but the layout wasn’t quite right. Parts of the interface were disappearing, and the mothership wasn’t fitting as intended.
After investigating the rendering and window layout, the culprit turned out to be something remarkably mundane: the Visual FoxPro system menu.
Adding one line:
SET SYSMENU OFF
removed an unwanted strip of screen space and restored the layout.
Sometimes the biggest problems have the smallest solutions.
A game within a game
One of the newer additions is BARF’s Tactical Deflection Simulator.
Essentially, it’s a futuristic version of Pong, complete with increasingly challenging gameplay, controller support and BARF’s customary attitude.
There’s even a combat skill to unlock if you can beat him.
It worked beautifully in development.
In the compiled EXE, however, things became rather more entertaining.
Initially, the simulator couldn’t be found because its launch code was looking for a PRG file at a fixed location on my development machine.
Once that was corrected, Pong launched — only for the main menu to appear over the top of it.
The simulator was still running underneath. I could actually see it close when I closed the title screen.
After rather more investigation than a game of Pong should reasonably require, the solution came down to Visual FoxPro’s window handling.
Changing the simulator’s ShowWindow property from 2 to 1, while retaining its modal behaviour, finally resolved the problem.
Pong was back.
I suspect the aliens were laughing at me.
BARF gets comfortable
Meanwhile, BARF has acquired a chair.
He’s now sitting in it in both the Combat Simulator and the pause menu.
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.
Management material, clearly.
The next challenge: everything inside the EXE
Now that the game is running on a clean Windows 11 installation, attention is turning towards distribution.
At present, some graphics and sounds still need to be supplied as separate files.
I’d much prefer to package as much as possible inside the executable itself.
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.
The next experiment will be to load a PNG from the executable straight into memory, without relying on a physical image file.
If that works, it could be the beginning of a much cleaner way to distribute the game.
And possibly another opportunity to discover something obscure about Windows programming.
Getting closer
The encouraging thing is that Galactic Gladiators is no longer just something that runs on my development PC.
It’s becoming something I can genuinely imagine handing to somebody else and saying:
“Here you go. Have a play.”
There’s still testing to do, assets to package and undoubtedly a few more surprises waiting.
But we’re getting there.
And if all else fails, BARF can always blame the pilot.