Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon Join the GFS Discord Server!
7. July 2020


A common question I receive is, can I use C++ with the Godot game engine.  If you are looking to do live game scripting like in Unreal Engine, the short answer is no, you cannot do that with Godot.  You can however develop in Godot using C++ in three different ways.


Native Development

The first option is extremely straight forward.  Godot is an open source project, with the vast majority of source code written using C++ (11).  You can of course extend or change every aspect of the Godot game engine in this manner, you simply need a C++ compiler, Python and SCONS.  You can learn more about the process here or in the Godot documentation available here.

An important detail to note is, even though Godot is open source, it is released under the MIT license, which is very liberal in what it allows you to do.  Unlike licenses such as GPL or LGPL, there is no requirement to make your code changes public.


GDNative

The next and newest option is GDNative.  You can think of GDNative as a plugin interface for Godot enabling you to write C or C++ code and is an ideal way to create shared add-ons or extensions.  The ideal advantage to GDNative over modules is they are not tightly coupled into the engine itself, so a minor change doesn’t require a complete rebuild.

There are C and C++ templates available here that give you a good idea how to create your own GDNative extension.  One major example of a GDNative extension is Godot’s OpenVR implementation.  GDNative extensions are the most decoupled from the underlying engine of the 3 methods.


Modules

Somewhere between modifying Godot and extending it with GDNative is the use of modules.  If you take a look at the Godot Engine source code, you will notice that a large chunk of the engine is implemented as modules.  This includes everything for assimp and bullet physics, to GDScript, Mono and even GDNative itself are implemented using modules.  Modules are an integral part of the game engine and can integrate tightly, but give you a … more modular, way to extend Godot.

Details on creating your own modules following this tutorial or the official documentation here.


You can learn more about all three options in the video below.

GameDev News Programming


15. June 2020


Very similar in scope and purpose to the recently covered Gravity language, today we are looking at wren.  wren is a class based programming language that aims to bring Smalltalk like programming to a Lua sized footprint, with the intention of being embedded in application code.  Highlights of wren include:

  • Wren is small. The VM implementation is under 4,000 semicolons. You can skim the whole thing in an afternoon. It's small, but not dense. It is readable and lovingly-commented.

  • Wren is fast. A fast single-pass compiler to tight bytecode, and a compact object representation help Wren compete with other dynamic languages.

  • Wren is class-based. There are lots of scripting languages out there, but many have unusual or non-existent object models. Wren places classes front and center.

  • Wren is concurrent. Lightweight fibers are core to the execution model and let you organize your program into an army of communicating coroutines.

  • Wren is a scripting language. Wren is intended for embedding in applications. It has no dependencies, a small standard library, and an easy-to-use C API. It compiles cleanly as C99, C++98 or anything later.

Wren is open source under the MIT license with the source available on GitHub.  You can also try out the wren language in your browser using this handy site.  You can learn more about wren in the video below.

GameDev News Programming


11. June 2020


DragonRuby is a game development framework powered by the Ruby programming language.  It is lightweight and crossplatform with an easy to learn API.  It is regularly $47USD, however it is currently included in the Bundle For Racial Justice currently running on Itch.io, along with hundreds of games for just $5.

Key features of DragonRuby include:

  • Dirt simple apis capable of creating complex 2D games.
  • Fast as hell. Powered by highly optimized C code written by Ryan C. Gordon, the creator of SDL (a library that powers every commercial game engine in the world).
  • Battle tested by Amir Rajan, a critically acclaimed indie game dev.
  • Tiny. Like really tiny. The entire engine is a few megabytes.
  • Hot loaded, realtime coding, optimized to provide constant feedback to the dev. Productive and an absolute joy to use.
  • Turn key builds for Windows, MacOS, and Linux with seamless publishing to Itch.io.
  • Cross platform: PC, Mac, Linux, iOS, Android, Nintendo Switch, XBOX One, and PS4 (mobile and console compilation requires a business entity, NDA verification, and a Professional GTK License, contact us).

You can learn more about DragonRuby in the video below.

GameDev News Programming


9. June 2020


Currently trending on Hacker News, Gravity is an open source programming language that is designed to be embedded in iOS and Android applications.  Released under the MIT license, Gravity is entirely C99 code with the single dependency being the C Standard Library, making Gravity incredible portable.  It is also extremely light weight while still being feature rich, with a syntax inspired by the Swift programming language.

Details from the Gravity website:

Gravity is a powerful, dynamically typed, lightweight, embeddable programming language written in C without any external dependencies (except for stdlib). It is a class-based concurrent scripting language with a modern Swift like syntax.

Gravity supports procedural programming, object-oriented programming, functional programming and data-driven programming. Thanks to special built-in methods, it can also be used as a prototype-based programming language.

Gravity has been developed from scratch for the Creo project in order to offer an easy way to write portable code for the iOS and Android platforms. It is written in portable C code that can be compiled on any platform using a C99 compiler. The VM code is about 4K lines long, the multipass compiler code is about 7K lines and the shared code is about 3K lines long. The compiler and virtual machine combined, add less than 200KB to the executable on a 64 bit system.

The source code for Gravity is available here, with various editor syntax support available for download here.  Gravity was ultimately created to be the scripting language behind the Creo IDE for iOS and Mac development.  You can learn more about Gravity in the video below.

GameDev News Programming


1. June 2020


Plywood is a new C++ based cross platform C++ framework created by Jeff Preshing, who previously worked at Ubisoft Montreal.  Plywood is composed of 3 primary parts, a project build/management system, a C++ reflection and serialization system and a collection of modules to provide low level functionality needed by all games.  Plywood is open source on GitHub under the MIT license.

Details about getting started and building Plywood are available here.  If you need help or are interested in learning more, the Plywood Discord server is available here.  You can learn more about the Plywood framework in the video below.

Programming GameDev News


See More Tutorials on DevGa.me!

Month List