LibSGD Announcement


Announcing LibSGD for Blitz3D!

OK, after a LONG period of indecision I have *finally* decided on my next project: 'LibSGD'.

LibSGD will be a simple game development library for use with multiple platforms and languages, and will be coming to a  platform and language near you soon - including Blitz3D!

LibSGD is written in C++, but the default public API will be pure 'C'. Using 'C' means it should be easily portable to various programming languages via something like SWIG, or even just by manual conversion (ie: I haven't even tried SWIGing yet).

I actually made a stab at something like LibSGD about a year ago after giving up on my game development 'career' (again!), only I made the slightly crazy decision at the time to use 'C++' for the public API - and it became pretty obvious pretty quickly that 'simple C++ game development library' is a bit of an oxymoron for anyone except C++ experts!

There are surprisingly few 'simple, scene based' 3d APIs around for non-web usage. The web has three.js and it's huge number of derivatives, and soon LibSGD! There are several behemoth C++ APIs such O3DE (nee Amazon's Lumberyard) and  OpenSceneGraph, probably the sanest of which would appear to be Irrlicht (still going!) but for non-C++ers there's very little I can find.

It's fairly early days yet, but in some ways, a lot of LibSGD is already written. The projects I have worked on over the last few years have effectively ended up forming the core of the LibSGD code base,  so I've got a pretty solid foundation to start with. Other chunks of 'yet to do' work (such as the animation and shadow casting code) remain in Monkey2/GLSL source form in the Monkey2 repository and await conversion to C++/WGSL.

Initial target plaforms

  • Windows, 64/32 bit
  • Linux, 64/32 bit
  • Emscripten

Initial target languages

  • C/C++
  • Python
  • Node.js (possibly weird, but one of my favourite dev envs these days)
  • BlitzMax
  • Blitz3D
  • MonkeyX (if there's demand?)

WTF, Blitz3D?!? Yep, we're bring the Blitz back baby! This is a bit of a publicity stunt in a way I guess, but I reckon a LibSGD based 'Blitz3D 2' would be a great way of advertising LibSGD in general. Just dropping yet another c/c++ gamedev lib on the world always felt like it was gonna be an uphill battle, dropping Blitz3D 2 less so.

Also, the Blitz3D community has proven itself to be incredibly creative and industrious when operating in constricted situations on WIP projects, so they will hopefully be able to come up with lots of juicy demos!

Also, it just feels like a fun, cool thing to do.

I've attached a tiny proof of concept demo with this post . it contains a 'runtime.dll' file that should be copied into your Blitz3D 'bin' dir - don't forget to backup the original! Once you've done that, you should be able to run the included sgd_test.bb demo. It doesn't do much, but it *works* and for a while I wasn't sure It'd be possible, or that runtime.dll would end up 100M or something!

Here's the attachment. It appears itch.io's 'attach file' feature doesn't actually, erm, attach files: https://murena.io/s/XaJ9XSRFbEMDrox

It's not at all spectacular - it's like this but the planet spins and you can mouselook around (but not move!)



The lighting is of course all wrong as there are no directional lights as yet.

The cool 'marble' material is from this great website: https://ambientcg.com/ - buy the man a coffee!

Any PBR materials from this site should load OK with LoadMaterial once they're unzipped. Of course, material loading will be made more flexible in future, but this seemed like a good place to start.

Note this will NOT be a rewrite of Blitz3D, only runtime.dll/command set is effectively changing, although now I have the Blitz3D source code cleaned up a bit and building with cmake it'd be nice to modernize things a little, we shall see.

Some more random details

  •  LibSGD will be open source.
  •  There will be a Paetron page. The plan is to basically *double* what I was making on Monkey2, which is a big ask because 25% of *that* was pretty much coming from one awesome user! But if I can achieve that I'll be able to work on this full time by my calculations. The page will probably go live soon, once I have a simple demo together that at least lets you load gltf2 models and move them around.
  •  LibSGD will NOT be backward compatible with Blitz3D, but it should be incredibly familiar to Blitz3D/MiniB3D users.
  •  LibSGD will use the 'Dawn' graphics engine/api. This is the open source engine written by google to power their implementation of 'webgpu'. Dawn has backends for d3d12, d3d11, vulkan, opengl, and opengles which means it can run on a wide range of hardware. I have been following the development of this closely (maintaining my own openxr compatible branch) and it rocks. It's kind of a beast in 'static library' form (170M for release build!) but once linked to an app/dll, it is much smaller. My first little b3d exe came in at 6M.
  • The 3D engine will use a simple entity system similar to Blitz3D and the same PBR material system used in Monkey2.
  • It will likely have a simple custom physics system to start with, similar to Blitz3D's but definitely with a functional ellipsoid this time for characters! I never quite got bullet working in Monkey2, so want a solid if simple system be default. I might return to bullet eventually but there are also more physics engines around these days to look at.

I have started a little 'Blitz World' forum at:

https://skirmish-dev.net/forum/

Feel free to post there (or here) with any questions/suggestions/comments you may have.

Bye!
Mark

Get Blitz3D

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

(+1)

Do your health a favour.Take your time.

(4 edits)

Hello!

Maybe save old Blitz3D name without 2?)

It would good if LibSGD not to be a bare library, but to have an IDE editor from Blitz3D. It would also be nice if the editor had a “Start with C++” button, which would load a lightweight open-source C++ compiler and C++ code could be written directly in the Blitz3D editor (without syntax checking) And so that code written in C++ can be runned in the Blitz3D editor with the click of one button. So that not only BASIC is available)

(1 edit) (+3)

All I want is better Blitz3D, nothing more

(+2)

Wow fantastic news! Count me in on that one (also with Patreon)

Thanks, Xaron(?)

Ah yes Xaron aka Martin aka KrautApps. ;)

(+2)

Huge fan of Blitz3D, all the best with this venture - exciting stuff!

Believe it when i see it.

(+2)

:O I survived the pandemic to see this. Cool.

(+1)

From now on I will say this about anything new

(+1)

Fantastic news! Didn't expect you'd be back to public game tools ever again, and it was such a great loss. We need this way of working! Not really touched anything since Monkey2.

(+2)

Great to hear from you again! Giving it a C API is the right call, as it makes using it from "whatever" language possible. 

(+1)

This is cool. Will watch with great interest.

(+2)

Ive waited for this for years and this morning booted up Unreal for the first time ever..... I might not bother learning it now :P

(+1)

Great news!! Love the Blitz languages.

(+1)

Exciting news!

(+1)

Good luck Mark
I wish you all the best and success.

MikeHart

Thanks Mike!

(+2)

Great news :). I can’t wait to test it all. In C, there’s raylib for 2D/3D. Have you considered using sokol_gfx or bgfx for this graphics API abstraction instead of WebGPU ?

(+1)

Raylib has definitely helped inspire me to get back into things! But AFAIK it's pretty much 'direct mode' only and primarily 2D, whereas I wanted to go for a more 3d oriented scene graph approach.

I do dig raylib's 'DrawModel' command and briefly considered using a more direct approach like that, but it can't handle multiple passes for things like transparency so the user would end up having to write their own 'scene' system anyway. Besides, as you say, there's already Raylib! It runs on a ridiculous number of languages too, mainly thanks to 3rd party support, there're probably Fortran and COBOL versions out there somewhere!

I've never heard of sokol_gfx (will do) but I did take a look at bgfx and although it's very nicely done and apparently works very well, I was after something a bit more modern, and Webgpu is (apparently) modelled on the way modern gpu's work while offering a high-ish level interface so I went with that. Also, the fact it's a google thing means they're gonna make sure it works well on as wide a range of hardware as possible. I've been following development quite closely, and the people writing it go to a huge amount of effort to make sure the stuff they're adding really will work everywhere.

 I actually think the use of 'native webgpu' drivers like dawn and gfx-rs (the rust version in firefox) could take off in a big way, as they turn behemoths like d3d12 and vulkan into a much more usable API: https://webgpu.rocks/reference/interface/gpudevice/#idl-gpudevice

(3 edits)

For Raylib, you’re right, it lets you do simple things, but not as simple as Blitz3D. The author drew a lot of inspiration from libraries like XNA/Monogame.

Using Dawn or gfx-rs/wgpu is a good choice for the long term, but there are a few drawbacks (tedious build system, no stable target for mobiles at the moment, still experimental for Android, etc.) but this will improve over time.

sokol_gfx is therefore easier to integrate and use. :)

In any case I will follow your work with enthusiasm.

EDIT: There will soon be a 3rd challenger implementing WebGPU in Zig language (mach-sysgpu). They also include an C API.

(+1)

wonderful @blitz Research.

i'm such a fanboy of source and blitz. - william, rottbott, ckob.

i will be posting on the forums.

(+3)

Blitz3D 2? I'm in!

(+1)

Amazing Mark, look forward to what this turns into, and a Blitz3D 2 is a very smart move. Would love to see some modernisation of blitz3D too.

> Would love to see some modernisation of blitz3D too.

At the very least, I want a bigger toolbar and font, I'm not working in 1024x768 any more and my eyes are 20 years crappier!

Yea, option to work on the native display resolution would be a plus, with high dpi support so we don't have tiny icons! Look forward to what comes next for Blitz.