How a small rendering bug made a surprisingly big difference to Galactic Gladiators.
Sometimes the biggest improvements to a game don’t come from adding new features. They come from fixing something that’s been broken for ages.
For quite some time, the subtitles in Galactic Gladiators have been behaving rather strangely.
They’d appear for a split second and then vanish.
I’d assumed there was something wrong with the timing. Perhaps the subtitle counter was being reset, or another routine was hiding the text prematurely.
But during a recent debugging session, something interesting happened.
I put a breakpoint in the routine responsible for hiding subtitles. The text appeared, promptly disappeared, and then… nothing.
The debugger didn’t stop until about seven seconds later.
Which was exactly when the subtitle was supposed to disappear.
The timer wasn’t broken at all.
The subtitle was still there. Visual FoxPro thought it was visible. Its caption was correct. Its countdown was working perfectly.
It just wasn’t being drawn on the screen.
The Culprit
Galactic Gladiators uses a custom graphics engine written in Visual FoxPro 9, with GDI+ and buffered rendering.
Rather than drawing everything directly to the screen, the game builds each frame in memory before displaying the completed image.
This makes the animation considerably smoother.
Unfortunately, the final battle’s renderer was also painting straight over my perfectly innocent Visual FoxPro subtitle label.
The subtitle hadn’t disappeared. It had been buried beneath the graphics.
The Fix
Initially, I tried bringing the label to the front and refreshing it.
No luck.
The eventual solution was surprisingly straightforward: draw the subtitles directly into the same graphics buffer as the rest of the game.
Now the subtitles are part of the completed frame, rather than separate controls fighting for screen space.
And suddenly, dialogue that had been practically invisible for months started appearing properly.
An Unexpected Improvement
Here’s the interesting part.
I’d spent a lot of time giving BARF, the game’s resident alien, things to say.
Little observations, warnings, jokes and reactions to what’s happening around him.
But because the subtitles were disappearing, much of that personality simply wasn’t reaching the player.
Now it is.
And the difference is remarkable.
The game immediately feels more alive. There’s more humour, more context and more character.
All without writing a single new joke.
What’s Next?
I’m now extending the subtitle system so different characters can have their own identities.
BARF will have his usual excitable personality, while the ship’s computer will be considerably calmer, more precise and rather dry.
The two aren’t necessarily going to get along.
At least, not initially.
Eventually, they’ll have their own voices too.
But that’s another story.
For now, I’ve learned something rather useful:
Sometimes the feature you’ve been looking for is already there. You just can’t see it.
Galactic Gladiators — built in Visual FoxPro 9, because apparently nobody told me I couldn’t.