Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

2. August 2016

 

Allegro is a C/C++ game library with a found place in my memory.  It was one of the very first, freely available open source 2D C/C++ frameworks and it continues to be developed to this very day.  In fact, Allegro 5.2.1 was just released.

 

From the change logs.

Core:

  • Optimize bitmap holding a bit (Bruce Pascoe).

  • Add al_get/set_depth/samples (OpenGL only for now).

  • Optimize destruction performance when you have thousands of objects (e.g. sub-bitmaps).

  • Use low floating point precision for the OpenGL fragment shaders, which helps performance a lot on mobile platforms.

  • Don't stop and join the timer thread when stopping the last timer (prevents unnecessary delay in this situation on some platforms).

  • Add al_backup_dirty_bitmap and al_backup_dirty_bitmaps to more finely control when bitmap context backup is performed.

Android port:

  • Fix Android app issues when woken up during sleep.

  • Specify the Android toolchain file on the command line now. ANDROID_NDK_TOOLCHAIN_ROOT now has to be specified in an environment variable.

OSX port:

  • Improve joystick enumeration (Todd Cope).

  • Make al_set_new_window_title work correctly.

  • Don't send duplicate mouse move events.

  • Fix mouse warping behavior.

  • Exit fullscreen mode if ALLEGRO_FULLSCREEN_WINDOW is set when destroying a display (otherwise if you destroy and recreate display without terminating the program, a white window kicks around).

iOS port:

  • Make it compile again.

  • Don't backup textures as it is unnecessary.

  • Update minimum iOS to version to 6.1.

  • Disable the native png loader in favor of libpng, as it is broken on Apple's end.

  • Create library when creating the archive.

Windows port:

  • Fix the D3D target bitmap bug.

  • Clear display to black right away to avoid an ugly white flash.

Raspberry Pi port:

  • Fix system cursor support.

Linux port:

  • Make al_set_new_window_title work correctly.

Build system:

  • Use PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR instead of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This lets you use Allegro as a sub-project in your CMake project.

  • Fix GDIPlus finding in cmake-gui (Bruce Pascoe).

  • Add .gitignore and ignore build/ dir (Mark Oates).

  • Fix building examples with non-Allegro dependencies with the monolith build.

Documentation:

  • Various documentation updates (Daniel Johnson and others).

Other:

  • Add more #include statements in Allegro headers, so it's easier to use them in isolation (Jordan Woehr).

  • Allow marking tests as being hardware only.

  • Prefix some private Allegro macros and types to not pollute the namespace.

  • Make set_shader_uniform api const-correct (Bruce Pascoe).

Audio addon:

  • Adjust loop end position when calling al_set_sample_instance_length.

Acodec addon:

  • Allow file-backed audio streams to be restarted after they finish.

  • Add Opus codec support.

Image addon:

  • Fail gracefully if not built with PNG/JPG loaders.

Native dialog addon:

Font addon:

  • Make al_get_text_dimensions and al_get_glyph_dimensions return exact bounding boxes (koro).

  • Add ALLEGRO_GLYPH structure and al_get_glyph, allowing for some additional optimization when drawing fonts.

Examples:

  • Add more controls to ex_audio_props.

  • Add an example of using Enet with Allegro.

GameDev News

28. July 2016

 

The following is a recap of major events in the world of game development for the week ending July 28th, 2016.  I do a weekly video recapping the news available here with this week’s video embedded below.  This post is a collection of links mentioned in the recap.

 

The Video

GameDev News

28. July 2016

 

Unity 5.4 is finally here.  A major feature of this release is improved graphics with better multithreaded rendering, GPU instancing, texture arrays, computer shaders and more.  VR has been improved as well and one major usability issue is Retina is finally supported, but high DPI support on Windows is for a later date.  IL2CPP, their intermediate language to C++ compiler is now available on Android in this release.

UNT_news_2016_07_blog_B

A summary of new features in 5.4 are:

  • Graphics & rendering performance improvements:
    • Better multithreaded rendering
    • Fewer draw calls with GPU Instancing – available on Windows, OSX, Linux, PlayStation 4, and Xbox One
    • Improved low level graphics features: texture arrays, compute shaders, and more
  • For Artists:
    • Thanks to sizing controls, a new trigger module, and better lighting with Light Probe Proxy Volumes (LPPV) particles are now more customizable.
    • In-engine support for motion vector rendering
  • VR Improvements: more built-in multiplatform VR support and better performance
  • IL2CPP for Android is now an officially supported platform (previously it was labeled ‘experimental’)
  • The editor now supports Mac Retina displays (Windows HiDPI support is in the pipeline) and we’ve added a zoom-able game view function (OSX & Windows)
  • Cloud Build setup is now available from the within the editor.  
  • Performance Reporting is now fully integrated in the editor, 1-click activation without plugins or code
  • A major Analytics feature update with raw data export, Heatmaps, Live Stream, and Ads data in the dashboard
  • In-App Purchasing now supports the Amazon Appstore
  • Web Player and PS3 Build target options have been removed along with iOS 6 support (we now support iOS 7.x and above)

 

There are a ton more details of the release available here.

GameDev News

27. July 2016

 

Marmalade is a cross platform C++ based game engine that just release version 8.5.  The biggest feature of this new release has got to be heavily updated 2D editor, Marmalade 2D kit.  Other features of this release include support for OpenAL and Windows Live Tiles.

 

From the release announcement:

All-new 2D Kit editor experience

Since the first release of Marmalade 2D Kit we have been working hard to improve the editor's appearance, user experience and functionality, based on feedback from users.

In this release the look and feel of the 2D Kit editor has been completely overhauled, including new style objects, intuitive icons and adjustable colors using a preference panel.

The core user experience has also been dramatically improved with changes such as:

  • Dockable panels
  • Custom editor layout preferences
  • Layout guide helpers
  • Context menu for node creation
  • Clearer animation timeline
  • Multi-key selection
  • Relative animation key frames by default
  • Intuitive zoom control
  • Clearer messaging
  • Easier 9-slice texture setup
  • Improved asset thumbnails
  • Improved animation panel 
  • Improved player interface
  • Improved resource panel
  • Improved object inspector
  • Improved anchoring support for stretching nodes

Rounding out the changes we have added some other useful functionality such as a command line interface for exporting scenes and optional automated upgrade of existing projects.

All of this is accompanied by significantly improved documentation, such as the user manual and tutorials, and a raft of general bug fixes.

New OpenAL support

OpenAL is very popular in the game dev community, allowing you to create immersive sound fields with built-in support for positional audio.

We have now added official OpenAL support, based on OpenAL Soft, to the Marmalade Platform as a cross-platform middleware module.

This new middleware module builds on top of s3eSound and is therefore available to all supported platforms, from iOS and Android to Windows and OS X. 

Whether you're starting a new project or porting an existing one to Marmalade, providing a more engaging audio experience just got much easier.

For an overview of OpenAL support in the Marmalade Platform, see here.

New Windows live tile support

One way to make your Windows apps more engaging is through the use of a live tile for your app.

With this release we are introducing a new s3eWindowsLiveTile extension to make this as easy as possible.

Interested? Find out more in the overview for S3E Windows Live Tile support.

Improved C++11 support

The previous Marmalade Platform release saw the addition of C++11 support to the main release, with the initial focus on Windows/Mac OS X Desktop and Simulator.

In this release, we've made some minor improvements in C++11 support, primarily to provide better support for the latest version of Visual Studio 2015: Update 3.

We have also significantly reduced the size of the C++11 add-on packages so you can now get started with C++11 support even quicker.

Beyond this release, the next major update to C++11 support will focus on iOS and Android so keep an eye out for it!

Improved EDK documentation

The EDK can be one the trickier areas of the Marmalade Platform to master so we've improved our EDK documentation in a couple of key areas to help make the learning curve a little less steep.

Please take a look at the updated getting started guide and a new section on debugging extensions.

Download now!

We think there's something for everyone in this release so head over to the Developer area to download now or check out the release notes for full details.

GameDev News

27. July 2016

 

Immediately following the release of Unity 5.3.6, we begin the patch cycle all over again with the release of Patch 5.3.6P1.  One again this patch is primarily a bug fix release, it also saw the Oculus Rift SDK updated to version 1.6.

 

From the release notes:

Improvements
  • VR: Updated to Oculus version 1.6 .
Fixes
  • (811596) - Asset Management: Assets added using AssetDatabase.AddObjectToAsset will no longer change their name when the project is saved.
  • (803481, 807275) - AssetBundles: Fixed an issue where calling Resources.UnloadUnusedAssets while loading an AssetBundle with AssetBundleRequest.LoadAssetAsync caused an error & stopped the asset from being loaded properly
  • (812396) - Audio: Fixed a crash when/after building for standalone with empty project with several audio clips.
  • (807653) - IL2CPP: Fixed IPEndPoint on IPv6 network.
  • (791844) - iOS: Fixed an issue where InputField.onEndEdit was called from an active InputField.
  • (815735) - iOS: Names for new iOS devices when selecting Unity Remote device.
  • (759719, 759191, 733920) - Mono: Corrected a number of possible hangs with SSL sockets when the Unity Editor entered and exited the play mode. These hangs often showed up in the AuthenticateAsClient method.
  • (810551, 810692) - Networking: ReliableFragmented channel stops working after client has disconnected, then reconnects.
  • (764330) - OS X: Fixed Screen.currentResolution.refreshRate being always 0.
  • (813872) - Particles: Fixed an issue where playing the scene with more than 270 particle prefabs caused a crash.
  • (none) - Windows Store: Fixed a potential crash on Xbox One when retrieving advertising id.
  • (none) - Windows Store: Fixed a rare deadlock when recursively calling InvokeOnAppThread and InvokeOnUIThread many times
  • (none) - Windows Store: Fixed an assert that happened on startup on Xbox One in debug builds.
  • (808700) - Windows Store: Fixed touch screen keyboard input not working on UWP.

GameDev News

Month List

Popular Comments

No bones about it. Bones in LibGDX and Blender
Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


14. February 2014

This is one of those things I’ve been fighting with for the past few days so I thought I would share a bit.

 

First a bit of a primer for those of you that aren’t all that familiar with bones yet.  Bones are a common way of animating 3D geometry.  Essentially you add an armature (skeleton) to your scene and bind it to the geometry of your mesh.  Moving the bones the compose your armature will then update the bound geometry.

 

Let’s take a look at an example in Blender.  Here is the anatomy of skeletal animation in Blender:

Blender

 

Each bone in turn has a “weight”.  This is the amount of influence the bone’s movements have on the geometry.  First you need to parent the mesh to the armature.  Simply select the mesh, then shift select the bones and press Ctrl+P.

 

Each bone then has a certain weight attached to it.  The colour determines how much influence a bone has over the geometry.  Consider the following, it’s the weight mapping for the top most bone in that example:

Blender2

 

So now, if in pose mode, I rotate that bone, we see:

Blender3

As you can see, moving the bone changes the surrounding geometry based on the bones influence area.  In a nutshell, that is how bone animation works in Blender.  I cover more of the “how to” in the Blender to LibGDX tutorial if you want details.

 

 

So that’s bones in Blender, lets take a look at the LibGDX side of the equation.  Here is how the skeleton is represented in a g3dj file:

{"id": "Armature", 

"rotation": [-0.707107,  0.000000,  0.000000,  0.707107], 

"scale": [ 1.000000,  1.000000,  1.000000], 

"translation": [ 0.012381, -0.935900, -0.017023], 

"children": [

  {"id": "Bone", 

  "rotation": [ 0.500000, -0.500000,  0.500000,  0.500000], 

  "scale": [ 1.000000,  1.000000,  1.000000], 

  "children": [

    {"id": "Bone_001", 

    "rotation": [ 0.000000,  0.009739, -0.000000,  0.999953], 

    "scale": [ 1.000000,  1.000000,  1.000000], 

    "translation": [ 1.000000,  0.000000,  0.000000], 

    "children": [

      {"id": "Bone_002", 

      "rotation": [-0.000000, -0.013871,  0.000000,  0.999904], 

      "scale": [ 1.000000,  1.000000,  1.000000], 

      "translation": [ 1.575528,  0.000000,  0.000000]}

      ]}

    ]}

  ]}

]

 

You can also see the bones as part of the geometry node as well, like so:

{"id": "Cube",
   "translation": [-0.012381, -0.017023, 0.935900],
   "parts": [
   {"meshpartid": "shape1_part1",
   "materialid": "Material",
   "bones": [
      {"node": "Bone",
      "translation": [ 0.012381, 0.017023, -0.935900, 0.000000],
      "rotation": [ 0.500000, -0.500000, 0.500000, 0.500000],
      "scale": [ 1.000000, 1.000000, 1.000000, 0.000000]},

      {"node": "Bone_002",
      "translation": [ 0.012381, 0.047709, 1.639329, 0.000000],
      "rotation": [ 0.502062, -0.502062, 0.497930, 0.497930],
      "scale": [ 1.000000, 1.000000, 1.000000, 0.000000]},

      {"node": "Bone_001",
      "translation": [ 0.012381, 0.017023, 0.064100, 0.000000],
      "rotation": [ 0.495107, -0.495107, 0.504846, 0.504846],
      "scale": [ 1.000000, 1.000000, 1.000000, 0.000000]}
   ],
   "uvMapping": [[]]}
]},

 

The later are the bones that are contained in the mesh “Cube”.  This will be relevant in a minute.  Instead lets look at the Armature composition.

 

Each bone within the hierarchy is basically just a series of transforms relative to its parent.  The armature itself has a rotation, scale and translation, as do each child.  In your ModelInstance, the Armature is a hierarchy of Nodes, like so:

GDX1

 

Animations then are simply a series of transforms applied to bones over a period of time, like so:

GDX2

 

These values correspond with the keyframe values you set in Blender.

 

Now there are a couple gotchas to be aware of!

First off, in LibGDX a bone is probably more accurately called a joint.  Remember what a bone looked like in Blender:

GDX3

Only the “bone head” is used.  The tail effectively doesn’t exist.

 

So, positioning relative to a bone will bring you to the base, not the tail.  Therefore, if you want to say… use bones for positioning other limbs, you need to create an extra one, and this lead to a problem.

Say I want to create a bone then that I can search for in code to mount a weapon upon.  I would then have to do something like this:

Blender5

 

This allows me to locate the very tip of my geometry.  But there is a catch.  If I export it, I can see the new bone Bone_003 is part of my armature:

Gdx6

 

That said, remember the entry for “Cube” showed the bones it contains… yeah well, that’s a problem.

Gdx7

See… the new bone isn’t actually contained within the geometry.

As a direct result, when working with it in code in LIbGDX, it just doesn’t work.  It never returns the proper position, or at least the position I would expect.  I’ve also had some weird behaviour where an exported model with only a single bone can’t be programmatically updated as well.  I need to investigate this further.

 

As a result, I’ve decided that bones simply aren’t the way to go about it.  Instead what i’ve started doing is putting a null objet in where I want weapon mounts to appear.  It doesn’t seem to have the gotchas that bones have so far.

 

Sorry for the slow rate of updates, I am sick as a dog right now.  So if that post seemed a little incoherent, that’s why! :)

 

Programming , ,

blog comments powered by Disqus

Month List

Popular Comments