Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon Join the GFS Discord Server!
15. November 2015


Just published a new quick tutorial to YouTube on retopology in Blender.  Besides being a word that spell checkers despise, retopology is the art of creating a low resolution mesh by drawing over top of a higher resolution version.  This quick video tutorial shows the process in Blender using model snapping and the shrinkwrap modifier.


The 1080p version is available here.


15. November 2015


We already have motion controls, audio control and of course tactile control, what about controlling a game with your emotions?  It sounds far fetched but it really isn’t, in fact it’s here today.  Just about every single modern gaming device has a front facing camera available in some form or another.  Well, Microsoft Research lab Microsoft Project Oxford just announced the release of the emotion tool which enables you to detect emotions on a persons face.


Basically you send it a picture and it returns the probability of various emotions.  For example, I sent it this image here and it returned the following results:



Basically you feed it an image in URL form and optionally a rectangle selecting the face, and it returns a JSON result with the probability of each emotion.  In this case Microsoft determine with 99.99% likelihood that this baby is sad, with a 0.001% chance that it’s angry instead.  I fed it a handful of pictures and it did a remarkably accurate job.


You can use it as a REST API now ( or just play with the playground ) right here.  Otherwise the SDK can be downloaded here.


So the tech is actually here already and works pretty well.  The question remains… would gamers embrace having a camera constantly scanning their emotions?  I actually can think of a few genres or tools where they might.  How many “you mad bro?” apps can we expect to flood the market now? If nothing else, it’s a fun tool to play around with on a Sunday afternoon!

Programming Totally Off Topic

14. November 2015


CastleDB is a light weight database written in Haxe with data composed of sheets.  It makes storing structured data extremely simple, much like working with an Excel spreadsheet and much simpler than a traditional database.  The resulting data is stored in JSON making it easily used in almost any game engine or programming language.   Most interestingly you can treat 2D game levels just like any other data using the newly built in level editor.


There is an HD video version of this guide available here.  It covers mostly the same details as this tutorial but goes into a bit more depth of using the level editor.


Let’s first take a look at the database side of things.  Even without the level editing abilities, games are often in need of simple database services.  Simply download and extract the archive for your appropriate platform:



Then run cdb.exe.  The interface looks like this:



Start by creating a new sheet by clicking Create a sheet.  This is comparable to creating a new table in a database.



Simply name your sheet and click Create.


Next we add some columns to our newly created sheet, same basic process.



Next pick the column type.



Optionally tick Required if the field cant be left empty.



You could select List and link to another database creating complex relationships.  Now we can populate a a database using the “New Line” command.  Select a type like Sprite (Image) and the appropriate dialog is displayed.



Now save the cdb file somewhere and you can access the data with code relatively easily.  First create a source file with the following contents, the black magic that links your cdb file to haxe code.

package com.gamefromscratch.castledemo.db;
private typedef Init = haxe.macro.MacroType < ["new.cdb")] > ;


And now you can consume it like:

package com.gamefromscratch.castledemo;

import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.Lib;
import haxe.Resource;

import com.gamefromscratch.castledemo.db.MyData;
class Main 
	static function main() 
		#if js


Pretty simple over all.  Now what was that about a level editor?


Well… remember back when you created the first sheet?  You may remember a little checkbox “Create Level”.



Well this creates a table just like any other with some prepopulated values:



Width and Height are the number of cells that compose your level, the rest will be populated shortly.  Notice the Edit button that appears now?  Click it.


TADA!  Level editor.

The level editor can work in tiles or objects, let’s start with a single object layer for our background image.  Click the New Layer button at the top right.


Name it then click create.  Now click the File… button and we will select our background tiles.



Your image will now appear ready for painting, like so:



In Tile mode, simply select the tile, or tiles you wish to paint with like so:



Now back on your layer make sure you are in Tiles mode:



And paint away:



You can also work in object mode, which allows you to place sets of tiles without being confined to the grid.  First, define a set of tiles as an object:



Now you can switch your level to object mode and draw using the created objects instead.


Now perhaps coolest of all, you can also instance data easily enough.  For example, we could add and place NPCs on our map, first we extend the map sheet to have an addition field, a List called npc, like so:


The List contains a reference to our monster table for example, x,y coordinates and an id.  Now if you head back to your map, you will see you’ve got an additional layer created:



Which you can now use to place NPCs or other data in your world.  You could do the same thing for collision data, whatever you wish.

This is only scratching the surface of what the level editor can do, there is even auto-tiling support built in.  Be sure to watch the video version for a more in-depth idea of the level editors capabilities.  Then when you are all done, it’s ultimately just data that you’ve been working with.


Now the downside is, there is no level loader when you are done.  So whatever engine or game you are importing the result into, it’s still just data.  It’s going to be your responsibility to display it all on screen.


The Video


11. November 2015


Unreal Engine 4.10 was just released today.

Welcome to Unreal Engine 4.10! This release is packed with a number of great new features, but our main focus has been to increase engine stability and fix outstanding issues. Hundreds of reported bugs have been bashed, many new quality of life improvements were added, and virtually every supported platform has received updates. Unreal Engine is designed for incredible VR experiences, and every release it gets better. Epic's "Bullet Train" VR demo is powered by new features in this version, with new rendering optimizations designed specifically for head mounted displays. Mobile gets a nice upgrade in this release too, with new scalability features and support for refraction. Last but not least, great news for programmers: You can now use Visual Studio 2015 for development on Windows. And on Mac, we've revamped our Xcode projects to allow you to work more efficiently. We've also refreshed our target platforms with support for latest SDKs.

New Major Features Include:

  • Refraction Effects for Mobile
  • Optimized VR Rendering
  • Visual Studio 2015 Support
  • Mobile Material Quality Settings
  • UE4 Platform Updates (many)
  • Landscape Mirror Tool
  • Low Latency VR Motion Controllers
  • Automatic Blueprint Node Arrangement
  • Web Browser UI on Android
  • Gamepad support on Android
  • Amazon Fire Game Controller and Fire TV Remote Support
  • NVidia Shield Controller and Portable Support
  • Samsung Gamepad Support
  • XCode Project Overhaul
  • Mobile Provisioning Selector
  • Misc bug fixes


Click here for full details of this release or fire up the Epic Launcher to update.

GameDev News

11. November 2015


Urho3d, an open source 3D engine we took a closer look at last year, just released version 1.5. 

link to



From the release notes:

  • Database subsystem with either SQLite or ODBC support.
  • Localization subsystem.
  • Improved the navigation / crowd navigation API and examples.
  • SSE and animation performance optimizations.
  • Enable BT_USE_SSE on Linux and MinGW platforms, enable BT_USE_NEON on Android and Raspberry-Pi platforms.
  • Urho3D macros such as OBJECT, EVENT, HANDLER renamed to have URHO3D_ prefix to prevent ambiguity with other libraries.
  • Double support to Variant, Deserializer, Serializer & JSONValue. Store Lua object attributes accurately as doubles.
  • Support for moving nodes & components between scenes, or creating components “sceneless” and moving into a scene later.
  • Cubemap loading from DDS files.
  • Refactored the object class registration mechanism to store the object’s base class for “Is this class derived from this” queries.
  • Optional “raw” Lua file loading through direct filesystem access for easier debugging.
  • Configurable blend mode in renderpath quad commands.
  • UV coordinates added to raycast results.
  • Allow submitting bare function names instead of full signature to Execute() & DelayedExecute() in AngelScript, similar to specifying event handler functions.
  • Allow negative scale for nodes.
  • Culling camera optimization for viewports, to allow rendering multiple viewports with the same culling data set.
  • Refactor Urho2D animation playback. Add optional Spine support (user must supply Spine runtime.)
  • Refactor Urho2D sprite atlas handling.
  • CollisionShape acquires model resource from StaticModel in same node automatically if collision model undefined.
  • Request the high-power GPU on AMD multi-GPU setups.
  • API for programmatic animation track & keyframe creation.
  • Added AnimationController IsAtEnd() function.
  • Added “remove on completion” mechanism to AnimationController.
  • Added function to remove all components of type to Node.
  • Added GetParentComponent() function to Node.
  • Added resource memory usage stats to DebugHud.
  • Support for ScanDir() on Android.
  • Improve Variant / VariantMap bindings on Lua.
  • Improve internal mechanisms for Lua bindings, e.g. store Urho3D context inside Lua state global table.
  • Improve API for kNet connection stats.
  • Improve AngelScript GetChildrenWithClassName() to return also derived classes.
  • Improve UI tab behavior
  • Improved navigation debug geometry
  • Improve ConvexCast by taking into account CollisionShape’s offset position & rotation.
  • Spline class cleanup & improvements, including linear interpolation mode, and looping Catmull-Rom mode.
  • Refactored JSONValue class to be more JSON-like.
  • Material render order support within a pass.
  • MM_FREE mouse mode, which disassociates cursor visibility from being confined inside the window.
  • Allow doubleclick event in UI over emptiness
  • Make Octree::Raycast() threadsafe.
  • GetGLContext() added to GraphicsImpl on OpenGL to allow the application to perform manual context switching.
  • Fixes for vertex texture fetch on D3D11.
  • Allow optional forced creation of CPU-only vertex & index buffers also in non-headless operation.
  • Unified texture upload behavior: half-float formats need to be provided as such on both D3D & OpenGL. Added float/half-float conversion functions.
  • Automatic generation of intermediate directories in FileSystem::CreateDir().
  • Warn if attempting infinite distance physics raycast. Remove erroneous infinity default value from AngelScript physics raycast bindings.
  • Allow non-strict numeric type to be returned from Variant, e.g. GetFloat() succeeds for an int.
  • Allow to disable PhysicsWorld or PhysicsWorld2D automatic simulation stepping during scene update. When disabled, the physics world can still be stepped manually.
  • Support for manual advancing of value animations.
  • globalVars VariantMap for AngelScript to allow easy cross-ScriptFile parameter passing.
  • Improve ConvexCast() to return distance using the hit fraction.
  • Ensure normalized vertex weights in AssetImporter, and clamp to 4 weights maximum instead of error, by dropping the smallest weights.
  • Configurable layer count in DynamicNavigationMesh to control memory usage.
  • Emscripten ETC1 & PVRTC extension support detection.
  • Emscripten hardware instancing support.
  • emscripten_get_now() for better timer precision and less CPU use.
  • Disable frame limiter Sleep() on Emscripten.
  • Disable audio output in C++ samples where it isn’t necessary.
  • Remove redundant glEnable() / glDisable() calls related to OpenGL texture types.
  • Removed defined_ member variable from BoundingBox, Sphere & Rect in favor of determining the definedness from the bounds being valid.
  • Invalid order checking for Lua binding overloads.
  • Dangerous math class constructors marked explicit.
  • Properly enabled multithreading in GCC/Clang builds.
  • Emscripten toolchain & build related fixes and improvements.
  • Clang tools support in the build.
  • Annotator & script binding extractor skeleton tools in preparation for generated script bindings.
  • Build improvements for CLion IDE.
  • Support Android NDK r10e.
  • Support non-PCH build.
  • Support spaces in path for build.
  • Install d3dcompiler DLL to bin directory for Windows / D3D builds.
  • Improved Urho3D DLL installation logic.
  • More user-friendly operation for missing HTML help compiler or dot.
  • Symlink assets to the build binary directory.
  • Allow installed sample executables to run out-of-the-box on Windows.
  • Reformatting of source code to get rid of indents on empty lines.
  • Script subdirectory in the engine source renamed to AngelScript.
  • Option to build Urho3D without threading (URHO3D_THREADING). Normally disabled on Emscripten but can be enabled for experimental development on browsers with included support.
  • Improved documentation on contributing and 3rd party library policy.
  • Update AngelScript to 2.30.2.
  • Update Assimp to September 2015 revision.
  • Update Bullet to 2.83.6.
  • Editor: setting for new node position preference.
  • Editor: particle editor improvements.
  • Editor: function to assign child nodes into a spline path.
  • Editor: center camera on object with HOME key.
  • Editor: selectable MMB functionality.
  • Editor: language selector and localizations.
  • Editor: Blender hotkeys mode.
  • Editor: HSV color wheel.
  • Editor: event handling refactoring.
  • Editor: 3D debug icons.
  • Editor: make showing IDs optional.
  • Editor: cubemap generation support.
  • Editor: export scene to .obj.
  • Editor: accelerator keys for reset pos/rot/scale.
  • Editor: quickmenu select topmost option with Enter key.
  • Editor: local offset added to spawn editor.
  • Fix missing bindings in navigation / crowd navigation script API.
  • Fix missing Lua bindings for Component class.
  • Fix SplinePath AngelScript bindings.
  • Fix failure to add / remove obstacles due to DetourTileCache queue being full.
  • Fix UI element debug draw.
  • Fix quantized AABB bug with large collision meshes.
  • Fix incorrect viewport size when rendering to both backbuffer & textures.
  • Fix flashing of 2D sprite animations due to misreported animation length.
  • Fix AssetImporter single keyframe animations.
  • Fix GetData() from rendertarget textures on D3D9.
  • Fix handling of lightmap textures in AssetImporter.
  • Fix debug geometry rendering if backbuffer resolve was used.
  • Fix blend mode of Urho2D material getting overwritten.
  • Fix terrain shader quality on mobile devices.
  • Fix partial rendertarget clear on D3D11.
  • Fix URHO3D_PACKAGING build option on Windows shared lib build.
  • Fix PackageFile::GetEntryNames() to return filenames with original case.
  • Fix FXAA3 shader on OpenGL.
  • Fix Depth shader on D3D11.
  • Fix Blur shader.
  • Fix shader code which attempts to use 3D textures on GLES.
  • Fix objects getting removed from physics simulation due to zero Node scale on some axis.
  • Fix line height of included SDF fonts. Fix corrupt rendering if Text3D changes font from SDF to non-SDF or vice versa.
  • Fix inaccurate terrain occlusion.
  • Fix ValueAnimation resource not loading properly.
  • Fix RigidBody2D body type enum.
  • Fix RigidBody2D & CollisionShape2D to be resilient of the add order.
  • Fix Drawable2D’s not using viewmask in rendering & raycast.
  • Fix Quaternion::FromLookRotation() zero cross product case.
  • Fix RigidBody2D custom mass handling.
  • Fix multiple value children created into XMLElement.
  • Fix TmxFile2D loading according to the updated Tiled spec.
  • Fix integer overflow in Random() functions.
  • Fix potentially unreleased Lua function references.
  • Fix UIElement functions that may crash at UI deletion time.
  • Fix mistaken commenting out of GLSL source code.
  • Fix animation “freezing” due to model being invisible while the animation finishes.
  • Fix Graphics::ResolveToTexture() on D3D11, especially for less-than-fullscreen viewports.
  • Fix potential crash or error during animation event processing, if animations are added/removed.
  • Fix potential null pointer access at navmesh destruction time.
  • Fix not allowing collision geometry from multiple CustomGeometries in the same node.
  • Fix space glyph not getting loaded in some fonts.
  • Fix missing resource dependencies tracking when resource autoloading is switched on during runtime.
  • Fix crash on MinGW build with SSE optimizations.
  • Fix windowed / fullscreen switching on Emscripten.
  • Fix missing URHO3D_API specifiers from some classes / structs.
  • Fix improper rounding during TrueType loading, which would displace some glyphs.
  • Fix incorrect bounding box of StaticSprite2D.
  • Fix lost font texture (OpenGL only) not being handled for Text3D.
  • Fix crash with CollisionChain2D with not enough vertices. Allow to create CollisionChain2D in the editor.
  • Fix crash caused by querying HashMap or HashSet while it’s being cleared.
  • Fix erroneous hardware keyboard input on Android.
  • Fix Android MIPS build.
  • Fix UI element layouting changing the user-defined minimum size.
  • Fix crash in 64bit build when opening the console window.
  • Fix potential edge artifacts in dynamically created spritesheets.
  • Fix Spine animation playback thread safety.
  • Fix mouse button release while cursor hidden not releasing drag elements.
  • Fix too heavy-handed skybox shader Z adjustment on GLES, which caused objects to be obscured by the skybox.
  • Fix protected AngelScript class variables showing up as serializable/editable.
  • Fix ResourceRefList serialization bug caused by String::Split() not returning empty strings.

GameDev News

See More Tutorials on!

Month List