Tuesday 22 March 2016

Rise from your grave!

We're back!

After a lengthy absence from game coding (and blogging) I'm looking to start things up again.

This has been something that I've wanted to get back into for a while, but for various reasons haven't had the time or inclination to do so.

I've also had a bit of a love/hate relationship with BlitzMax **, and as good as it was it the development environment didn't play nicely on 64-bit Linux systems.  As that is what I use it was a bit of a problem.  Some long-standing bugs (such as looking in the wrong location for the joystick device) were never fixed and meant having to "hack" the language to get things working the way I needed.  Sound was also a bit problematic.

I've had a look at Monkey - which is the "next gen" version of BlitzMax, and it has some very nice features - such as generating HTML5 games, having a very familiar syntax and having a free version and an updated IDE (on Windows).

However the Linux IDE is more or less the same as the BlitzMax one, and it didn't take long to come across the first bugs, and on reporting it I was told that the free version "wasn't a priority".  A couple of months later the bug is still there, and although instructions have been given to changing the compiler to fix this manually, I really can't be pestered with that any more.

This has left me as a coder without a viable platform.

Being lazy I don't really want to go down the path of learning another language, so I'd like to stick with something (reasonably) familiar.

At work I use Visual Studio, and although Mono is tempting the development environments on Linux are a bit on the primitive side, at least when it comes to vb.mono, so I've put that one on the back-burner.

As I'd quite like to stay with a version of basic, and use something that I can at least generate Windows and Linux binaries with I've started looking through the open source alternatives.

FreeBasic is the first one that I've looked at, and it might be a winner!

Let's look at the list and see if it ticks the boxes:

* Is it cross platform? - Yes.  It compiles for DOS, Windows and Linux.  It doesn't support MacOS X as far as I'm aware, but then again I've not been in a position to compile for Macs for a while anyway.
* Does it have familiar syntax? - Yes.  It's a re-implementation of QBasic (which evolved into Visual Basic).
* Does it create stand-alone binaries? - Yes.  It compiles quickly and the speed of the binaries is (allegedly) close to that of C code compiled with GCC.
* Does it come with a modern IDE? - No.  It doesn't come with an IDE, however...





Geany (pictured above) is a rather nice IDE that supports FreeBasic.  It has code highlighting, autocompletion (if you download the FreeBasic tag file for it), allows you to compile and run the code directly from the IDE, in fact it does pretty much everything you could need.  It's also open source and available to install straight from the Ubuntu software repository.

Sound (using WAVs) is supported using external libraries.  There are some (primative) built in tone generator commands, but to do something beyond that requires a little work.

This is a little bit cumbersome at first, but there are plenty of examples out there of how it works, and I've already got sound samples working using the SDL libraries.

I may also look at using SDL for the graphics, depending on how good the inbuilt graphical functions are.

Once I've had a bit more of a play I'll create a follow up post, but so far it looks rather promising.


**As a footnote, BlitzMax is now available for free under an open license, if you are using Windows it is certainly well worth a go, just be prepared to have to work a bit to get it going properly on Linux.

No comments: