I'm always on the lookout for ways to make my games run in more places. So when BBC Basic for SDL 2.0 was added to itch.io, I decided to give it another look.
What makes this edition special to me is that it runs on Linux (where I develop) and Android (where I want to play more games). It's also a classic dialect with broad support, that's not going anywhere for a while. The package is reasonably sized by modern standards: 50 megs on the desktop, or 60 on Android. It comes with a ton of examples, and two IDEs to choose from, not counting the mobile UI. Which, by the way, is surprisingly usable, despite the bare-bones look. There's no monkey business involved: on the desktop, simply download a zip archive, unpack and run.
The package comes with dozens of examples, in several categories. Turns out the language has a ton of features, including a capable GUI library. Included games are actually playable, if flawed, and on mobile they scale nicely, so you don't need to worry about picking graphics modes. Simply looking through what's there can provide days of solid fun.
But ultimately I want to make stuff with it. Luckily BBC Basic comes with an excellent manual, personalized for each edition, and a handy index on the homepage. The language differs from other dialects, due to its age and origins, but it's nothing I can't handle. The IDE (written in BBC Basic!) helps as well, with features like auto-formatting and a tool to bundle your game for distribution, complete with assets, libraries, and a copy of the runtime. The latter is under a megabyte, by the way.
Where I stumbled was countless little quirks. It's the death of a thousand cuts.
To wit: for the past few days, I've been trying to port a little old game from another Basic, just to get a feel for the process. Migrating the code is surprisingly smooth; making it work, not so much. Here's a sample of the most annoying issues:
- There are separate commands for clearing the screen and setting colors for graphics and text, respectively.
- Virtual resolution is double the size of the window in most video modes. Wut.
- Graphics coordinates start in the lower left corner of the window (by default) and always go up. Not only that's backwards from text coordinates, it goes counter to every single modern API. Yes, yes, the Spectrum also used to work like that. There's a reason why everyone else switched things around since.
- The syntax for working with arrays of structs makes Perl seem readable.
else if construct is a lie. You still have to cap the chain with a cascade of
endif statements. And
case doesn't support arbitrary conditions.
Also, I said the manual is excellent, but it still needs feedback from someone who hasn't spent 35 years working on the language. Familiarity makes a lot of weird things seem obvious. A downloadable version would also be welcome.
Survival tip #1: have the IDE auto-number lines. The code doesn't need them, but error reporting is useless otherwise. Even so, error messages remain terse and unhelpful.
Survival tip #2: by default, programs are saved as binary files with the .bbc extension. On the desktop, you can also choose to save them as plain text .bas files, but those aren't supported in the Android version, or for that matter the application bundler. I soon learned to just go with the flow.
Luckily I'm bored enough to give BBC Basic another chance. Maybe things will go better with a text game. Wish me luck.