Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
1. November 2016

 

The Godot Game Engine has seen a slew of recent updates and is heavily under development in anticipation of Godot 3.0.  In the recent 2.1 update the Asset Library functionality was added (click here for details of the Godot 2.1 release), which is the Godot equivalent of the Unity or Unreal Engine asset stores.  Yesterday they announced the beta release of the web front end for browsing assets in the asset library using your web browser.

image

 

The announcement also documents the process of submitting your own asset to the library.

 

Another recent announcement from the Godot team was an update on the renderer changes for Godot 3.0.  The process is split across 3 milestones, and milestone 1 has just been reached, including:

Done for Milestone #1 (October 2016):
  • Make Godot compile against GLES 3.
  • Refactor the Image class to include modern data types.
  • Refactor the texture API to include more modern texture compression formats.
  • Refactor the rendering API to make it easier to understand (and contribute to!).
  • Write a more flexible, GLES 3 GLSL compatible shader language.
  • Write a more efficient Mesh format, which allows faster loading/saving.
  • Optimize scene rendering to use less function calls.
  • Make rendering always happen in Linear colorspace.
  • Investigate Physically Based Rendering (PBR), using GGX and alternatives.
  • Investigate cubemap filtering.
  • Create a new FixedMaterial that reflects PBR capabilities.
  • Implement PBR.
  • Convert gizmos to use the new FixedMaterial.
  • Add Lighting using PBR.
  • Investigate a ShadowAtlas allocation strategy.

 

Already there are some pretty powerful features in there and there are two more milestones to go.  There is a full description of the other milestones in the blog post as well as complete descriptions (and justifications) for the tasks completed in milestone one.

 

I have to say, the Godot engine is improving at a shockingly awesome rate these days.  If you are new to Godot, do be sure to jump into the GameFromScratch tutorial series.

GameDev News


23. September 2016

 

Welcome back to our ongoing Godot tutorial series.  You may notice a pretty major change in the way Godot looks from previous tutorials.  This is because this tutorial jumps forward to Godot 2.1 which has an updated look and feel.  Don’t worry, the process is virtually identical regardless to which version of Godot you were running.  Today we are going to look at implementing 2D lights in your Godot game.  This will involve creating Godot light nodes, as well as occluders to prevent light.  We will also look at light masking, which is useful for implementing fog of war type effects. 

 

As always there is a video version of this tutorial available here.

 

First let’s set up a simple scene we can test our lighting on.  I simple create the following hierarchy using the default Godot icon sprite.

image

 

Then scale it up like so:

image

 

Now let’s add a Light2D as a Child to our Root node:

image

 

Notice the exclamation mark?

image

 

This is because we need to specify a texture to use as the light source.  I created the following image in Paint.net (process is shown in the video if you want to see how it was made):

LightMask

 

Notice that this image is a grayscale PNG file with an alpha channel.  Where there are no pixels at all, there will be no light shown.  Where it is whitest, the light will be most intense, while the darker it gets the less intense the light.  Save this image or create your own and add it to your project.  Now we set it as the texture source for our light.

image

 

Now if you move your Light2D node around the scene, you will see how it interacts with other objects in the scene:

GIF

 

There are a number of properties you can set for the light, such as the Energy (intensity) Color (tint) and Scale (size):

image

 

Notice also Mode.  We will come back to that in a minute.  Now sometimes you aren’t going to want all lights affecting all objects in the scene.  Thankfully there is a setting for that.  Notice in the range category there is a setting called Item Mask:

image

 

This controls what layer of items this light will interact with (there is also a setting for shadows as well).  Now if you switch over to your Sprite, under canvas item you will notice a Light Mask setting:

image

 

So long as the light and CanvasItem use the same masking channel, the light will apply to that node.  If they don’t use the same channel, the light will have no effect.  This can lower processing costs and enables you to exempt parts of your seen from being lit if so desired.

 

Now sometimes you want to have light actively blocked in your scene.  For example you might have a wall that should cast a shadow.  This is easy to implement in Godot using Occuluders.  This is simply a polygon area where the proverbial light don’t shine.  Let’s set one up around the nose of our Godot sprite.  Add a LightOccluder2D to your Sprite.

image

 

Your scene hierarchy should now look like:

image

 

With the LightOcculder2D node selected in the Scene the following icon should be available in the 2D view:

image

 

Click the pencil.  Now we want to draw our occlusion polygon, like so:

Gif2

 

Now notice the way the light interacts with the scene...

gif4

 

Now remember earlier on the Mode value of our Light2D node?

image

 

Now we are going to switch it over to “Mask” and show a powerful capability.  This can be used to create localized lights or to implement fog of war effects.  Just like before we need a texture to represent our light source, but this time we want the pixel values reversed, so I created the following image:

LightMask2

 

In this case the black area will receive no light, while the whitest area will contain the most light.  Here is the end result:

gif5

 

By scaling the light out to the full size of the screen, you can easily attach such a light to the character sprite to easily implement a fog of war type approach.

 

The Video

Programming


9. August 2016

 

After a few release candidates, Godot Engine just released version 2.1.  If you’ve never heard of the Godot Engine, it’s a popular MIT licensed open sourced 2D/3D game engine, we previously featured it in the Closer Look series in addition to a pretty massive tutorial series, should you wish to learn more.  Godot 2.1 focused heavily on usability issues, the kind of things that make a developers life smoother on a daily basis.Godot

 

 

Features of Godot Engine 2.1 include:

    • new asset sharing platform
    • new plugin api
    • dynamic font support
    • fully internationalized editor UI
    • editor visual customization
    • user customizable key bindings
    • live script reloading
    • profiler and frame profilers
    • remote scene inspector
    • HIDPI/Retina display support
    • drag and drop support
    • contextual menus
    • script editor improvements
    • improved asset pipeline
    • improved resource preview and thumbnails
    • new animated sprite features

You can read a great deal more about these new features in the release post.

 

This feature takes a hands-on look at the new functionality available in Godot 2.1:

GameDev News


7. August 2016

 

I’ve been a huge fan of the open source Godot Engine for a very long time, in fact I’ve done an in-depth tutorial series available here.  Godot has seen a number of improvements in the upcoming 2.1 release, but the recently added Visual Scripting interface is probably the biggest new addition.  In this post we are going to look at this new functionality.  A couple of warnings to start.  First, as of writing ( 8/7/2016 ), Visual Scripting is only available in the development branch.  So you will have to build Godot engine from scratch from the Github repository.  Second, this functionality is extremely early and not fully developed.  There is currently no debugger or profiler support and expect bugs.  Heck, I’m having trouble even running scripts at this point, but it’s probably user error on my end.  You have been warned!

 

I also did a video showing hands on with the new Godot Visual Scripting language.  It is available embedded below.

 

Creating a Visual Script

 

Creating a script is a simple process, basically identical to creating a GDScript.  Add a new script as usual.

image

 

Now in the Create Node Script, pull down language and select VisualScript.  VisualScript’s have a .vs extension in Godot.

image

 

Creating Visual Scripts

 

Visual Scripts are basically a flow chart of nodes, like so:

 

image

 

You start by implementing a function.  All of the usual GDScript functions are here:

image

 

This enables you to handle various events within your games lifecycle.  This will create a new node on the graph that acts as an entry point:

image

 

You notice in this example there is a parameter “event” here.  With it selected you can see it’s values in Inspector:

image

 

You will notice on the right side of the Function node there is an arrow and blue dot.  The arrow is for program flow, while the dot represents output.  Other nodes can have various inputs, which are also color coded.  We can now add other nodes to our graph, from the Available Nodes section.

image

There is basically a one to one ratio of nodes and functions available in GDScript.  Add a new Node from the InputEvent section for Is Pressed, simply drag and drop from the Available Nodes to the drawing surface.  Now we connect the two nodes together.

GIF

 

You will notice the newly created is_pressed test has another line out to continue the process as well as a bool output (notice the different color coding).  We could not continue our code by branching to a conditional like so:

image

 

Of course, this is VERY early, but it does give you an idea of how Visual Scripting will work in Godot.

 

The Video

Programming


12. July 2016

 

Earlier today I somewhat belatedly mentioned the Godot 2.0.4 release.  In that post I mentioned the upcoming 2.1 release... well I should have waited a few hours, as Beta 2.1Godot has just been released.  Keep in mind however, it is a Beta so buyer beware.  If you are working on a production project, you may be wise to wait for the full release.  The 2.1 release has been focused on improving usability.

 

The features of this release include:

  • New asset sharing platform: Godot has a new platform for sharing assets between users. It's still rough, but it will improve with time. As of now there is almost no content to test it with, but we will upload some plugins and the demos there in the coming days.
  • New plugin API: Downloaded assets can be used as plugins to extend the editor functionalities. Our first attempt at offering an API for this is still probably incomplete, so help us improve it with your feedback.
  • Support for dynamic fonts: Load TTF and OTF font files directly into your projects. This aids enormously with internationalization.
  • Fully internationalized editor UI: Godot can now be used in several languages and displays all unicode characters properly (including CJK). Right-to-left language support is still unimplemented though.
  • Editor visual customization: Change font sizes or set custom fonts, set custom themes, etc.
  • Customizable keybindings: Most keybindings can now be customized and there is a new binding editor in the editor settings.
  • Live script reloading: Saved scripts in the editor will be reloaded in the running game automatically, and tool scripts will also be automatically reloaded.
  • Profiler & frame profiler: Godot has a fully featured profiler (with graph plotting), which allows going back in time and see the performance numbers and most used functions frame by frame.
  • Remote scene inspector: Inspect the scene tree of the running game live, including nodes and resources.
  • HiDPI/Retina support: Godot detects high resolution monitors and offers the editor UI with native resolution. All Godot icons were redone in vector graphics for the occasion, thanks a lot to @drjmwho did almost all of them!
  • Drag & drop support: Godot now supports drag & drop editor-wide. Dragging assets from filesystem explorer to Godot will also open the relevant import dialogs.
  • Contextual menus: Godot now also supports contextual menus where relevant.
  • Script editor usability improvements: Incremental search, better highlighting, smart function matching in code-completion, etc.
  • Improved asset pipeline: Automatic re-import and reload of assets and scenes when changed.
  • Improved thumbnailer: Previews are updated in real-time, and thumbnails of resources will appear in the inspector.
  • New AnimatedSprite features: Labelled animations, and the ability to play animations without an AnimationPlayer.

You can download the release here, scroll down to locate the beta link.

GameDev News


GFS On YouTube

See More Tutorials on DevGa.me!

Month List