Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
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


12. July 2016

 

Godot is a popular open source 2D/3D game engine.  If you are interested in learning more I did a closer look review as well as a complete tutorial series.  They just released Godot 2.0.4 in advance of the soon to be released 2.1.

 

From the 2.0.4 release notes:

Enhancements:

  • Many new classes documented! Thanks to all those that got involved after our call for contributors! Feel free to join us as there's still a lot to do, but the progress is heart-warming!
  • Updated libraries: GLEW 1.13.0, libogg 1.3.2, libvorbis 1.3.5, libtheora 1.1.1, libpng 1.5.27
  • Ability to rotate controls using tool
  • Added classes' short descriptions as tooltips in the create dialog
  • Added 'fat' option for bits param on scons for osx, produces a binary containing both 32 bits and 64 bits binaries
  • Added InputMap.get_actions()
  • Change low processor usage mode to cap to 60 FPS rather than 40 FPS
  • Change the default comment color to #676767
  • Debugger: show error message if description is not available
  • Dynamic property list for control margins allowing floating point properties to be used with ratio anchors
  • iOS: added "arch" parameter, made iphone use it to build isim
  • OSX: Key modifiers (Ctrl, Alt, Meta and Shift) may be used as Input keys now
  • OSX export: Default to fat format, make it an enum
  • Prettier str() for arrays
  • Rename CanvasItem.edit_get() to edit_get_state()
  • The create dialog starts collapsed now. The original behavior can be reactivated in the editor settings
  • Various enhancements to the script editor, such as member variables highlighting, breakpoint markers, caret blinking, etc.

Bug fixes:

  • Avoid crash if setting modifiers fails
  • Avoid mirroring to go negative to fix crash
  • Change invalid characters when get user data dir on Windows & Unix
  • Correctly parse utf8 from zip_io open, also fixes issues when exporting or opening android apk files
  • Editor: Fix base dir when going back to project manager
  • Fix a inherited transform bug with Camera2D preview drawing
  • Fix bug in String==StrRange comparison
  • Fix CanvasItem.get_global_transform() andCanvasItem.get_local_transform()
  • Fix crashes in code completion and SamplePlayer
  • Fix error storing path for children of instanced nodes in .tscn
  • Fix errors while exporting to Android
  • Fix File.get_as_text() to return the whole file
  • Fix OpenSSL connections on 64-bit Windows
  • Fix own world option of Viewport
  • Fix parsing of floats in scientific notation
  • Fix several bugs related to node duplication and signals
  • Fix Theora video playback without a Vorbis stream
  • Fix unsaved modifications in scripts being overwritten on filesystem changes
  • Fix visual server error when minimizing the window
  • Fixed ancient bug that prevented proper theme editing
  • Fixed bug using DirAccess in Android Marshmallow due to data dir being a symlink
  • Fixed various bugs with inner classes
  • LineEdit: Fix and improve selection behaviour
  • Make Input Actions config not affect the editor
  • Properly deliver localized coordinates when passing gui events through parents
  • Resolve numerical error when comparing instancing an inheritance to avoid wrongly saving unchanged properties
  • Windows: prevent freeze while moving or resizing the game window.
  • And many other nice changes that we can't possibly list here without boring you to the end of times!

Godot is available for download here.  Stay tuned for the 2.1 release which should arrive any day now.

GameDev News


13. May 2016

 

Version 2.0.3 of Godot Engine was just released.  Godot is an open source 2D/3D cross platform game engine I have extensively covered in tutorials available here.  Two of the biggest new features are from the way Godot is built.  Starting with this release OSX 64bit binaries are available.  Meanwhile on Windows, Visual Studio is now being used to compile Godot, replacing MingW, would should result in a pretty solid increase in performance.  If you run into incompatibilities, please be sure to let the team know.  In addition to these changes, OpenSSL was re-enabled in this release, after some prior security concerns.  There are of course several bug fixes and enhancements in this release.

 

The following features and changes were added in this release:

Enhancements:

  • Many new classes documented! Thanks to all those that got involved after our call for contributors! Feel free to join us as there's still a lot to do, but the progress is heart-warming!
  • Ability to shrink all images x2 on load
  • Add preview of the Camera2D's screen boundaries
  • Allow dragging on only one (global) axis when holding down shift
  • More precise InputMap Axis descriptions in project settings
  • Move export GUI debug toggle to export settings window
  • New Dictionary.has_all(Array)
  • Script editor usability improvements:
    • Autocomplete no longer shows duplicates
    • Fixed code completion after opening bracket
    • Options to change the caret color and toggle blinking
    • Option to trim trailing white space on save
  • Subclasses can extend from other subclasses via relative paths
  • Update to Godot's regex library
  • Update OpenSSL to version 1.0.2h

Bug fixes:

  • AnimationPlayer: Prevent resetting timeline when pinned
  • Fix behavior of OS.set_window_resizable
  • Fix Camera2D ignoring zoom when checking limits
  • Fix checking unsaved changes only in current scene
  • Fix launching from .app on OSX
  • Fix 'Quit to Project Manager' not stopping the running application
  • Fix shader editor syntax coloring
  • Fix to avoid video texture scaling
  • GridMap: Fix backwards rotate hotkeys
  • Keep editable instances data when replacing tree root node
  • Made trackpad behaviour optional in 3D mode
  • Reimplement key input events in Emscripten export
  • Rotation APIs: Better exposure for degrees methods
  • Tabs: various usability fixes

You can read the full release notes in the change log here.

GameDev News


23. February 2016

 

We mentioned a few weeks back that Godot 2.0 Beta was released.  Today we can remove the beta moniker from the release, the full blown release of Godot 2 is now here.  Major new features from the release include:

NEW CORE FEATURES

While for 2.0 core changes were not a priority, there are some nice improvements on this release!

Improved scene instancing

Instancing is one of Godot's best features. For this version it has been further improved. Previously, only the root node of a scene was editable. Changes to sub-nodes would result in data loss.

It is now possible to edit any children node of the instanced scene and have the changes persist. Even sub-instances of instances can be edited with persistent modifications.

Scene inheritance

Begining Godot 2.0 scenes can not only be instanced but also inherited. This allows many interesting use cases such as:

  • Having a base scene (ie, enemy, collectable, obstacle, etc.) with a node hierarchy common to all (like explosions, shines, indicators, etc), and then extend it for each class.
  • Making non-destructive changes to a scene that was imported (ie a 3D scene, etc.)
  • Making non-destructive changes to a scene created by another team member.

New text-based scene format

Godot supports the XML format for saving scenes and resources, but we had problems with it:

  • Scenes are saved packed in xml, so the content is uncomprehensible.
  • The format is not efficient to parse.
  • It is not friendly to VCS (Git, SVN).
  • XML is not easy to write manually, and it's easy to make mistakes.

Having this in consideration, Godot 2.0 adds a new text file format inspired by TOML. This new format is descriptive (human friendly) when saving scenes, and Git/SVN friendly:

For 3.0, this format will be the only text based format supported, and XML will be deprecated.

onready & singletons

Initializing class member variables can be quite of a hassle, code such as this is common in GDScript:

The 'onready' keyword allows initialization of class member variables at the same time when _ready is called, saving some code:

But doing this for autoloaded scenes can still be a hassle, as it has to be done every time a script is created. To ease on this, it's possible to make an autoloaded scene or script a singleton variable (accessible at global scope) in the project settings:

All this, of course, working together perfectly with code completion.

Other new core features

Smaller new core features were also added:

  • Support for ZIP packs on export instead of PCK
  • Support for OPUS Audio Format
  • Changed to a more compatible JPG decoder.
  • Very improved gamepad support

NEW EDITOR FEATURES

The Editor part of Godot 2.0 is where most of the work was focused. The priority was to improve tools and make the workflow more efficient.

NEW LAYOUT AND THEME

Godot 2.0 sports a new theme courtesy of Andreas Esau. It looks more professional and less confusing than the previous one. Many unneccesary icons, margins, arrows, etc. were removed to further clean up the visuals.

As a plus, dock panels (which were previously fixed on the right) can now be moved and rearranged.

New file dialog

One of the common hurdles with Godot was the overly simple file dialog:

For 2.0 we have created a new one, which supports:

  • Navigation History
  • Favorites
  • Recent Folders
  • Thumbnail Previews (and list view compatibility mode)

New filesystem dock

Godot used to have a primitive tree dock panel view with all the project resources. This was replaced by a more modern filesystem dock:

This new panel can show resources in both thumbnail and icon view (similar to File Dialog), but it also includes several tools.

By popular request, Godot's new filesystem dock has tools to allow the user to:

  • Rename and move files and fix all resource/scene dependencies automatically.
  • Warn when files being deleted are referenced by other resources.
  • Use a heuristic to search for broken dependencies within the project.
  • Visually explore and reassign dependencies for a given resource.
  • Explore the owners for a given file.
  • Explore which resources might be orphan, for easier clean up.
Multiple scene editing

Godot's divide and conquer approach to making games relies on subdividing scenes in several sub-scenes, each with an identity or function.

Godot 2.0 improves upon this with multiple scene editing support, allowing several scenes to be open at the same time. Switching between them is painless and Godot also automatically reloads scenes when a dependency (instance or inheritance) has changed.

New tool layout

In Godot, tools appear contextually when a given node or resource is selected. This makes the UI flow fast and removes large part of the need to maually organize panel layouts.

This aspect of Godot was also improved in 2.0 with the introduction of a new bottom panel. On it, contextual editors can make a tidy appareance. Some of the editors are also always shown with persistent buttons:

  • Output console
  • Debugger
  • Animation editor

New code editor

Godot has the code editor integrated to the rest of the editors. Until Godot 1.1, scripts were opened contextually to the scene being edited but, as multiple scenes can now be edited, this is no longer possible.

To compensate, the new code editor now works more similar to an IDE, where scripts are just opened all the time. Switching to a scene will also automatically switch to it's dominant script (script in the root node, where it's most commonly placed), making the programming experience smoother.

The code editor also has many new features:

  • List of opened scripts, as using tabs would mean running out of space quickly.
  • Temperature indicator for each script, with most commonly used scripts being shown closer to red.
  • Script history: It is now possible to go back and forward in history of edited scripts easily.
  • Documentation pages show as documents. This allows having multiple pages open together with scripts.
  • Quick access to tutorials, class list and help search.
  • Improved code completion

Improved debugger

The debugger has seen many improvements too. A new addition is the reporting of run-time errors with proper notifications.

Godot is designed from the ground to attempt handling common crash situations by recovering and reporting an error. This is helpful in production games, as unexpected bugs that might commonly cause a crash will not make it fail. These errors, however, were silently being reported to stdout, so it was not easy to spot them. Added to that, given the debugger does not stop for them, having some context to understand their origin was difficult.

A new section "Errors" was now added which turns red when run time errors occur. Selecting or hovering the error will display a backtrace of script files that led to this situation.

Video memory debugger

Another new, useful feature is a new Video Memory debugger. This allows to see how much video memory is in use, as well as to discern which resources take up the most amount of video RAM.

Debug on hardware devices

It is also now now possible to debug a game running on an actual devices. Make sure to enable "Deploy Remote Debug" option in the remote options menu. If you have a device with Android 5.0+, Godot can take advantage and debug over the USB cable directly.

Collision and navigation debugging

We added support for debugging collision shapes and navigation polygons, both in 2D and 3D, in run-time. Just select the "Visible Collision Shapes" and/or "Visible Navigation" options in the above menu to enable this.

Live scene editing

In the vein of larger game engines, Godot has now live editing support. The way it implements this feature is different though. Godot uses IPC to synchronize the editor state with the running game. This means that any change made to the scene being edited is reflected automatically on the running game.

While this approach to live editing does not allow easy inspecting into the game from different editor cameras (something it might be implemented eventually anyway), it has the huge advantage of allowing the possibility of editing a level while it's being played (and avoid the edited state from being lost when the game stops). Just add enemies, move them around, change their properties, add colliders, platforms, tiles, etc. and everything is reflected instantly on the running game.

To enable live editing, just toggle it at any time from the remote options menu.

Video of live editing in action:

It is also possible to do live editing on an actual device! Just select "Deploy Remote Debug" together with "Live Editing" in the remote options menu:

New color picker

There is a new color picker courtesy of Mariano Suligoy, supporting visual HSV, raw mode, screen picking, favorite colors, and more!

Smaller new additions

Godot 2.0 brings several smaller new additions to aid in usability:

  • Visible history for property editor
  • Selection for overlapping objects in 2D and 3D
  • Categorized project and editor settings
  • Inline documentation as property tooltips
  • Array / Dictionary property editing
  • Multiple node editing
  • New Animation Editor Layout
  • Improved anchoring tool
  • SpinBoxes (both controls and in property list) can be dragged to change value.
  • Many more small additions.

FUTURE

We know the weakest part of Godot is still the 3D engine and we plan to fully work on modernizing it. However, we feel there are several more urgent issues that need to be improved usability wise. Godot 2.1 will continue in the same vein as 2.0 and keep adding usability improvements. (Feel free to check the Roadmap ).

The full text of the release notes are available here.  There is an even more complete change log available here.  The Godot team have also launched a Stack Overflow style question and answer site available here.  Of course, if you are interested in learning Godot Engine we have a comprehensive tutorial series available here on GameFromScratch.

GameDev News


GFS On YouTube

See More Tutorials on DevGa.me!

Month List