The seventh framework on my list is GLBasic.

08/07/2015 6:55 PM
Downloading & installing GLBasic.


08/07/2015 7:45 PM

I checked out nearly all of the examples including the source code. All built and ran with no issues. Some very nice games.

There is a built-in IDE. That is nice. The language itself reminds me of some of the specialized BASICs and other programming languages I used long ago on the Amiga and C64.

I think that is in part due to the simplicity of the structural requirements and in part due to the way the editor formats the keywords (capitalizing them).

Like Monkey X, I am using the free version of GLBasic.

The blurb lists the following benefits of the premium (as in the one you pay for) version:

  •  Lots of target platforms
  • 3D Version
  • Network commands
  • Inline C/C++ Code

Seeing “inline C/C++ code” is another thing that reminds me of programming languages I used many years ago. It is pretty cool to be able to do that.

When they say lots of target platforms I must say they really mean lots of target platforms! Truly they seem to support more than even Unity.

Unfortunately, the free version supports only: Create 2D and console programs Windows, Linux and Max OSX.

This means I won’t be able to post any of my work on this page for you to check out. Unless I bite the bullet and buy the pro version.

Tell you what… let me get started exploring it and if I think it has a decent amount of potential as a rapid 2D game development framework I will buy the Pro version.


08/08/2015 8:16 PM

Okay, I finally got a chance to get back to this. I spent some time in the editor coding some very simple programs just to get a feel for the language and IDE.

It definitely takes some getting used to. Monkey X and HaxeFlixel were very quick to pick up with almost no learning curve because the editors and languages are so close to C# and modern editors.

In contrast, GLBasic is a very custom approach. I am not saying it is bad. In fact, it seems quite well thought out and very comprehensive. It is truly a BASIC programming language with its own unique approach in how you write functions and so forth.

It some ways it seems a little clunky. It actually makes me think this is what modern programming would be like if the approach used in the 90s had persisted and continually expanded and improved iteratively over many years. Instead of being completely rebuilt from the ground up in the style of modern languages and editors.

There is a rich set of functionality built into the language actually supporting callbacks, function pointers (delegate methods) and so forth.

Anyway… I had a quick look around the forums and the Internet in general for a Tiled Map Loader for GLBasic. Although I saw a few references on the forums of people saying they had created one I never actually came across a module that was available for download.

So… this means I will need to write my own Tiled Map Loader for GLBasic. I don’t mind tackling this. It shouldn’t take more than a couple of hours I’d guess even though I’ll still be getting used to the language and environment.

If nothing else, it will at least be something to give to the GLBasic Community so that going forward they will have a Tiled Map Editor available to use and continually enhance (ideally!).

I will start on this project later tonight.


08/08/2015 10:01 PM

Alrighty then… I am back and I now have a Tiled Map Loader for GLBasic. To simplify this work I did not create an XML parser to handle the Tiled XML data format. That would have been complicating things more than needed. I am sure I could knock one out easy enough but it would just have added more time for no real reason.

I chose to work with the Tiled CSV text file format. It provides a simple file structure that is easy to parse. Still I spent about an hour and 45 minutes writing and testing this Tiled Map Loader.

This was an interesting little project. GLBasic is old “old school” BASIC programming. It has no classes at least not that I could find any hint of. This is BASIC procedural programming and I am fine with that providing working with GLBasic proves to be a rapid 2D game development environment. It is all about efficiency to me. Get more done in less time while having more control over everything.

What I did to encapsulate this work was create a new code file for the TiledMapLoader. Inside that file, I created 3 types (think of C/C++ structs):

// This wraps up all of the Global data contained in this module
// isolating it from the rest of the program.
TYPE TiledMapInternalDataType
    nDataLayerStartPositions%[]
    sAllData$
    sHeader$
ENDTYPE

// This contains the name of a Tiled Map Layer and the array of Tile IDs contained in this layer
// This is not directly used. It is embedded inside the TiledMapType
TYPE TileMapLayerType
    Name$
    nTileData%[][]
ENDTYPE
// This contains all of the TiledMap data including an array of Tiled Map Layers
TYPE TileMapType
    Width%
    Height%
    NumberOfMapLayers%
    oMapLayers[] AS TileMapLayerType
ENDTYPE
// This is the resulting single container the developer works with
oTileMap AS TileMapType

Originally I had my types named as TiledMapLayerType and TiledMapType. Then I realized at these points the representations of the data is applicable to all tilemaps regardless of the source. So that is why they are now simply named TileMapLayerType and TileMapType. Universal is a good thing.

I am happy with it. First, it actually works. Always an important thing. 😉

Second, it provides a reasonably encapsulated view of the data considering what I had to work with.

Third, I am now much more familiar with the idiosyncracies of GLBasic and have a better idea of how to approach development in it.

Now, my next project will be to move forward and start knocking out the same sequence of demos as I did for Monkey X and HaxeFlixel.


08/09/2015 8:59 PM

Okay, back again. I spent about an hour building my tile map rendering system and then doing the coding needed to duplicate the parallax scrolling display.

I gotta say this GLBasic is actually starting to impress me. Truthfully, when I first checked it out it seemed kind of archaic to the degree that even an “old school” programmer like myself had my doubts about its viability in 2015.

However, the more time I spend working with the language the more things I discover about it. For instance, tonight I discovered it actually offers a greater degree of encapsulation than I had realized. The Types are not limited to simply defining fields. Interestingly, you can also place functions inside these Types. Any experienced developer will know what this means… these are objects! So, in this way GLBasic is actually an OO language.

Also, the speed of the language is very good. Both for compilation and execution. For example, my parallax scrolling demo compiles in 2.6 seconds. And how about the actual execution speed? Well, keep in mind I can only build for Windows at this point (free version) and I am able to draw the entire tile mapped screen 2.5 times per millisecond. Yes, that means I can redraw the entire screen 2,500 times per second.

Now, keep in mind I do have a powerhouse of a laptop. 16 GB RAM, 2.5 GHz quad core i7 CPU and 3 GB GTX-970M GPU. So yeah it is a powerful laptop. I am going to put the exe on a flash drive and try it out on my 8 year old laptop and see how it performs. But… keep in mind hardware only continues to improve. Heck cell phones these days seem to have about as much power as the top PCs from a decade ago.

Update at 9:28 PM

Hmm… well this is a fine example of why I hate the trend with Microsoft’s operating systems. My 8 year old laptop is running Windows Vista 64-bit and my new laptop is running Windows 8.1 64-bit. I have often said each new OS just bogs down the hardware that much more.

So… what results did I get on my “old” machine? GLBasic can draw the entire tiled mapped screen 4.1 times per millisecond. Yep, able to redraw the entire screen 4,100 times per second.

Well… I guess that definitely helps me to decide about updating to Windows 10. I was pretty much decided to not do it but still was on the fence just a little bit. But this shows just how ridiculous these Windows OS “upgrades” really are. I mean seriously?! My 8 year old laptop has 4 GB RAM, 2.5 GHz duo core CPU and a GPU of the same level. Yet it outperforms my new laptop that has far superior hardware.

Anyway enough rambling about that. Yeah… GLBasic actually looks like a solid game development framework. I wish I could build a web demo of what I have done so far.


08/10/2015 5:58  PM

From talking with some users on the forums last night and today I learned that you can build for HTML5 and HTML5-WebGL even in the free version of GLBasic. Unfortunately, the support for web is not very good. I downloaded and installed the Java Development Kit (required for HTML5 builds in GLBasic) and sure enough I was able to build for HTML without any errors.

However, the builds did not actually work in any browser I tested on. 🙁


08/10/2015 6:09  PM

In my time spent with GLBasic I developed a solid appreciation of the language. Ultimately, the lack of support for development of web games has brought my journey into GLBasic development to an end. It is a real shame too because I found the language refreshing in its “back to basics” simplicity. I will likely check back again from time to time in the hope that true HTML support comes to GLBasic.

I would like to point out that if you simply want to develop games for desktop and / or mobile you may want to check out GLBasic. I can verify that Windows desktop development is solid and several people on the forum mentioned the support for mobile development is very strong. Indeed, from checking out various works by those users I can see that many are creating and releasing mobile games on Android and iPhone.

 

License for use of this code: You agree to use this code at your own risk. I will not be held responsible for anything that happens as a result of you choosing to use this code.  This code is released as purely open source and can be used free of charge for educational purposes and this code can be used in your game projects (free or commercial).  This is just my way of giving back to the GLBasic community and game developers in general.

If you accept the terms above…
you can download my Tiled Map Loader & Tile Map Renderer code here.

That is a zip file (4,128 bytes) containing two GLBasic files:
TiledMapLoader.gbas
TileMapRenderer.gbas

Just remember, this was my first work in GLBasic while learning the language. It is solid and works fine. It can be cleaned up and improved.

Please keep in mind the Tiled Map Loader only loads in the tile data from the layers.  I only tested it with 3 layers and it worked fine. It should be able to handle as many different map layers as are contained in the Tiled map file. I just never tested with more than 3 layers.

This does not support loading of objects or any other data from the map file. You can certainly update the map parser easily enough to handle such things.

I hope it helps you.