Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
14. May 2018


Synfig Studio 1.3.7 was just released.  Synfig Studio is a free and open source 2D animation package available for Windows, Mac and Linux.    It is used to create 2D animations using both Vector and Bitmap graphics and removes a great deal of the tedium and labour involved in frame by frame animation.  This release is primarily a bug fix release, fixing the following issues:

  • Fixed bug causing FilterGroup layer not save Origin parameter (issue #505).
  • Fixed error preventing user to move keyframe at certain circumstances (issue #503).
  • Fixed crash on Windows when closed file is re-loaded (issue #521).
  • Fixed crash when you press Esc key during the rotation of the object (issue #470).
  • Fixed issue #485: Spline Tool tangent menu crashes Synfig.
  • Fixed issue #502: Attempt to run plugin cause to Synfig crushes.
  • Fixed bug which was causing Synfig fail to start on systems with Gtk prior to version 3.20. This error is caused by incorrect CSS errors handling (style parameter ‘min-height’ was introduced in Gtk 3.20, for earlier version need to use ‘child-min-height’).
  • Added static analyzers CLion and cppcheck (just Synfig Studio for now). Using them would be possible to fix some rare bugs and memory leaks. To run static analysis use analyze_cppcheck.sh or analyze_clion.sh inside synfig-studio folder.
  • Fixed some errors found by analyzers (planned iterated fixing of this sort of bugs).
  • Fixed compilation error on OSX with old GCC.


You can read a more complete change log of commits right here, while Synfig can be downloaded here, you will be prompted for how much you wish to pay as well as for an email address, but you have the option of entering $0.  The source code for Synfig is hosted on Github and is available here.


To learn more about Synfig, check out the following hands-on video:

GameDev News Art


14. May 2018

Details


orx-project.org

ZLib License

View On YouTube

  

Orx is a cross platform open sourced 2D game framework written in C and available on Github under the permissive ZLib source license.  What makes Orx somewhat unique among it’s peers is the data driven approach that Orx takes.  Instead of storing game data using a collection of objects in code, it is instead split out into data files.  This enables you to quickly change the content of your game without having to do a recompilation.   So for example you make have an entry like the following for defining the camera in your scene:


[Viewport]
Camera            = Camera
BackgroundColor   = (255, 180, 0)

[Camera]
FrustumWidth  = 1024
FrustumHeight = 768
FrustumFar    = 1.0
FrustumNear   = 0.0
Position      = (0.0, 0.0, -1.0)
;Zoom          = 3.0

By editing this config file you can make major alterations to the camera without having to recompile your code.  Chance the FrustrumWidth in the ini file, and the next time you run your game’s window will be smaller.  Now let’s look at the code required to consume the Viewport/Camera data in your C/C++ application:

orxViewport_CreateFromConfig("Viewport");

Yep, that’s it.  This will create the viewport, notice the camera property and create one of them as well, entirely driven by data. 


This approach has a couple of advantages.  First it creates a clean separation of code and data which should in theory make for easier to maintain code.  It also takes these values out of the compilation process, meaning changes do not require you to recompile your code.  Additionally, this data driven approach makes creating tools for you game a cinch, as you are simply writing out simple easily understood text files. 


There are of course disadvantages too.  Since you moved the code out from the compiler, you lose features such as intellisense as well as compile time error checking.  Moving more details off into data files can make hunting down bugs even more difficult.


Let’s take a quick look at one of the samples from the Orx tutorials, with the comments stripped down for brevity.

#include "orx.h"
orxOBJECT *pstSoldier;

orxSTATUS orxFASTCALL EventHandler(const orxEVENT *_pstEvent)
{
  orxANIM_EVENT_PAYLOAD *pstPayload;

  /* Gets event payload */
  pstPayload = (orxANIM_EVENT_PAYLOAD *)_pstEvent->pstPayload;

  /* Depending on event type */
  switch(_pstEvent->eID)
  {
    case orxANIM_EVENT_START:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has started!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_STOP:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has stopped!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_CUT:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has been cut!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_LOOP:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has looped!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_CUSTOM_EVENT:
    {
       /* Logs info */
       orxLOG("Animation <%s>@<%s> has sent the event [%s]!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)), pstPayload->stCustom.zName);

      break;
    }
  }

  /* Done! */
  return orxSTATUS_SUCCESS;
}

/** Update callback
 */
void orxFASTCALL Update(const orxCLOCK_INFO *_pstClockInfo, void *_pstContext)
{
  orxVECTOR vScale;

  /* Is walk right active? */
  if(orxInput_IsActive("GoRight"))
  {
    /* Sets walk right as target anim */
    orxObject_SetTargetAnim(pstSoldier, "WalkRight");
  }
  /* Is walk left active? */
  else if(orxInput_IsActive("GoLeft"))
  {
    /* Sets walk left as target anim */
    orxObject_SetTargetAnim(pstSoldier, "WalkLeft");
  }
  /* No walk active */
  else
  {
    /* Removes target anim */
    orxObject_SetTargetAnim(pstSoldier, orxNULL);
  }

  /* Is scale up active ? */
  if(orxInput_IsActive("ScaleUp"))
  {
    /* Scales up the soldier */
    orxObject_SetScale(pstSoldier, orxVector_Mulf(&vScale, orxObject_GetScale(pstSoldier, &vScale), orx2F(1.02f)));
  }
  /* Is scale down active? */
  if(orxInput_IsActive("ScaleDown"))
  {
    /* Scales down the soldier */
    orxObject_SetScale(pstSoldier, orxVector_Mulf(&vScale, orxObject_GetScale(pstSoldier, &vScale), orx2F(0.98f)));
  }
}


/** Inits the tutorial
 */
orxSTATUS orxFASTCALL Init()
{
  orxCLOCK       *pstClock;
  orxINPUT_TYPE   eType;
  orxENUM         eID;
  orxINPUT_MODE   eMode;
  const orxSTRING zInputWalkLeft;
  const orxSTRING zInputWalkRight;
  const orxSTRING zInputScaleUp;
  const orxSTRING zInputScaleDown;

  /* Gets input binding names */
  orxInput_GetBinding("GoLeft", 0, &eType, &eID, &eMode);
  zInputWalkLeft  = orxInput_GetBindingName(eType, eID, eMode);

  orxInput_GetBinding("GoRight", 0, &eType, &eID, &eMode);
  zInputWalkRight = orxInput_GetBindingName(eType, eID, eMode);

  orxInput_GetBinding("ScaleUp", 0, &eType, &eID, &eMode);
  zInputScaleUp   = orxInput_GetBindingName(eType, eID, eMode);

  orxInput_GetBinding("ScaleDown", 0, &eType, &eID, &eMode);
  zInputScaleDown = orxInput_GetBindingName(eType, eID, eMode);

  /* Displays a small hint in console */
  orxLOG("\n- '%s' & '%s' will change the soldier's animations\n- '%s' & '%s' will scale the soldier", zInputWalkLeft, zInputWalkRight, zInputScaleUp, zInputScaleDown);

  /* Registers event handler */
  orxEvent_AddHandler(orxEVENT_TYPE_ANIM, EventHandler);

  /* Creates viewport */
  orxViewport_CreateFromConfig("Viewport");

  /* Creates soldier */
  pstSoldier = orxObject_CreateFromConfig("Soldier");

  /* Gets main clock */
  pstClock = orxClock_FindFirst(orx2F(-1.0f), orxCLOCK_TYPE_CORE);

  /* Registers our update callback */
  orxClock_Register(pstClock, Update, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);

  /* Done! */
  return orxSTATUS_SUCCESS;
}

/** Run function
 */
orxSTATUS orxFASTCALL Run()
{
  orxSTATUS eResult = orxSTATUS_SUCCESS;

  /* Should quit? */
  if(orxInput_IsActive("Quit"))
  {
    /* Updates result */
    eResult = orxSTATUS_FAILURE;
  }

  /* Done! */
  return eResult;
}

/** Exit function
 */
void orxFASTCALL Exit()
{
  /* We're a bit lazy here so we let orx clean all our mess! :) */
}

/** Main function
 */
int main(int argc, char **argv)
{
  /* Executes a new instance of tutorial */
  orx_Execute(argc, argv, Init, Run, Exit);

  return EXIT_SUCCESS;
}


#ifdef __orxMSVC__

// Here's an example for a console-less program under windows with visual studio
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
  // Inits and executes orx
  orx_WinExecute(Init, Run, Exit);

  // Done!
  return EXIT_SUCCESS;
}

#endif // __orxMSVC__

This example illustrates a simple animation.  The game loop itself consists of implementing 3 simple functions, Init(), Run() and Exit() for handling various stages of the lifecycle.  The actual game loop itself is the Update callback function which is called continuously as your game is run.  Speaking of which, here is the code running.  The left and right arrow keys toggle between the animations, while up and down scale accordingly.

GIF


Now the “guts” of this example is actually in the ini file containing the data.  Let’s take a look:

[Display]
; In this example, we use the same size for the screen display than our camera's frustum so as to obtain a 1:1 ratio
ScreenWidth   = @Camera.FrustumWidth
ScreenHeight  = @Camera.FrustumHeight
Title         = Anim Tutorial
Smoothing     = false
[Resource]
Texture = ../data/object 

[Input]
SetList = MainInput

[MainInput]
KEY_ESCAPE = Quit

KEY_LEFT   = GoLeft
KEY_RIGHT  = GoRight
KEY_UP     = ScaleUp
KEY_DOWN   = ScaleDown

[Viewport]
Camera = Camera

[Camera]
FrustumWidth  = 640
FrustumHeight = 480
FrustumFar    = 1.0
FrustumNear   = 0.0
Position      = (0.0, 0.0, -1.0)

[Pivot]
Pivot = (15.0, 31.0, 0.0)

[[email protected]]
Texture = soldier.png

[Soldier]
Graphic             = Graphic
AnimationSet        = AnimSet
Scale               = 4.0

[AnimSet]
Direction   = right # down
StartAnim   = IdleRight
KeyDuration = 0.1
Digits      = 1
FrameSize   = (32, 32, 0)

Texture     = soldier_full.png
Pivot       = @Pivot

IdleRight   = 1 ; <= We only want one frame
IdleLeft    = 1
WalkRight   = -1 ; <= We want as many frame that can fit in the texture defined by WalkRight
WalkLeft    = -1

IdleRight-> = IdleRight 
IdleLeft->  = IdleLeft 
WalkRight-> = WalkRight 
WalkLeft->  = WalkLeft 

[IdleLeft]
Flip        = x

[WalkLeft]
Flip        = x

[IdleRight]
Direction   = left

[IdleLeft]
Direction   = left # up

[WalkRight1]
KeyEvent    = !!Left!!

[WalkRight4]
KeyEvent    = !!Right!!

[WalkLeft1]
KeyEvent    = !!Right!!

[WalkLeft4]
KeyEvent    = !!Left!!

As you can see, just about every aspect of the game is data driven here, from the animation names, the source graphic files, to the camera, viewport and even keys pressed and the corresponding binding to call for each key.


This post only scratched the service of how Orx works, but should give you an idea of the data driven approach they have taken.  It certainly wont be for everyone, but it could be a great fit for many people.  If you are interested in giving Orx a shot, be sure to check out our video, which is also embedded below, to walk through the installation process and get you up and running.  Then it’s time to jump into the extremely thorough getting started guide and tutorials available on the Orx website.

Programming


12. May 2018


SFML have just release SFML 2.5.0.  SFML, or Simple & Fast Multimedia Library, is a cross platform C++ powered 2D game framework providing low level game related functionality such as 2D graphics, audio, networking and window creation code.  If you are interested in learning to use SFML be sure to check out our SFML tutorial series available here.  The 2.5.0 release includes a new cursor API, new clipboard API, a new VertexBuffer class, loop point support in the Music class.  Of course there were a ton more minor changes and fixes in this release.

Complete details from the release notes:

General
  • Replaced FindSFML.cmake with SFMLConfig.cmake (#1335)
  • Markdown'd and updated readme, changelog, contributing and license files (#1196, #1368, #1317)
  • Improve packaging support (#1173)
  • Added Tagfile generation and search (#1327)
  • Added CMake variables to select the modules to be built (#798, #800)
  • Do not install extlibs if SFML_USE_SYSTEM_DEPS is true (#1236, #1237)
  • Fixed various type conversion/comparison warnings (#1325)
  • [Android] Increased minimum API version to 14 (#1362)
  • [Android] Removed custom toolchain and added support for the newest NDK version and Gradle (#1350, #1393)
  • [iOS] Updated the binary libs from exlibs/libs-ios (#1207, #1209)
  • [iOS] Use a CMake toolchain file for iOS build (#1268, #1269)
  • [iOS] Install extlibs if needed (#1348)
  • [iOS] Drop 32 bit support (#1374)
  • [iOS] Force correct iOS architecture for cmake (#1373, #1377)
  • [iOS] Added iOS example (#1378)
  • [macOS] Fixed launch of cocoa examples (#1334)
  • [macOS] Improved application signing process (#1020, #1036, #1194)
  • [macOS] Improved CMake script (#1215, #1371)
  • [macOS] Use -stdlib=libc++ (#1361)
  • [OpenBSD] Added support for OpenBSD (#1330)
System
Bugfixes
  • Added protected destructor to sf::NonCopyable to prevent possible resource leaks (#1125, #1161)
  • Fixed crash when sf::Clock is constructed in a global scope (#1258)
Window
Features
  • Implemented Cursor API (#269, #784, #827)
  • Implemented Clipboard API (#715, #1204, #1221)
  • Renamed a few key codes (#1395)
  • Added joystick example (#1363)
  • [Windows] Added support for interfacing with joysticks via DirectInput when it is available (#1251, #1326)
  • [Windows] Fix discrete GPU preference symbols being exported from the wrong place (#1192, #1406)
Bugfixes
  • [Android] Return correct key code for delete/backspace (#1309, #1362)
  • [iOS] Don't need to find vorbisfile or vorbisenc (#1347)
  • [Linux] Fixed sf::Window::getPosition() returning incorrect position because of differences in window managers (#1228, #1266)
  • [Linux] Fix X11 key repeat handling not filtering out events from other windows (#1223, #1230, #1291)
  • [Linux] Restore fullscreen of a non-visible window (#1339)
  • [macOS] Fixed window menu not working (#1091, #1180, #1193)
  • [macOS] Fixed crash with application messing hardware detection e.g. TeamViewer (#1323)
  • [macOS] Added support for (some) Hat/POV axis (#1248)
  • [Windows] Prevent uninitialized read by zeroing memory (#1264)
  • [Windows] Fixed modifier keys handling (#1357)
Graphics
Features
  • Implemented additional line spacing and letter spacing in sf::Text (#928, #1366)
  • Added sf::VertexBuffer class (#1308)
  • Added GPU local texture copying support, allowing performance optimizations and texture swapping (#1119, #1319, #1320)
  • Optimize performance by skipping glTexCoordPointer() call if not needed (#1015)
  • Generate shape outline vertices only if necessary (#925, #1356)
  • Removed dependency to libjpeg, stb_image_write now supports writing JPEG files (#1278, #1279)
  • Enable comparing sf::Transform and optimize resetting OpenGL back to the identity matrix (#1298)
  • Added missing setActive() virtual method to sf::RenderTarget (#1157)
  • Updated stb_image to v2.16 and stb_image_write to v1.07 (#1270)
  • Added sf::RenderTexture stencil and multisampling support (#1274, #1285)
  • Added example demonstrating sf::VertexBuffer, sf::Shader and sf::Thread usage (#1352)
  • Optimized sf::RenderTexture performance (#1379)
Bugfixes
  • Properly free memory in sf::Font::cleanup() (#1119)
  • Fixed memory leak in sf::Font (#1216)
  • Fix OpenGL texture coordinate pointer not being updated correctly under certain conditions (#1297)
  • Fix for broken text when the font is reloaded (#1345)
  • Fix memory leak in sf::Text (#1233, #1360)
  • Fixed strict aliasing punning warning when generating the key of a glyph in Font.cpp (#1187, #1396)
  • Fixed OpenGL version string being parsed incorrectly on some platforms (#1249, #1390)
  • [macOS] Worked around render target bug (#1132, #1342)
  • [Windows] Replaced time-based joystick poll with a hardware event handler (#1179, #1195, #1198, #1199, #1421)
Audio
Features
  • Added loop point support to sf::Music (#177, #629)
  • Added support for the extensible PCM wave file format (#1296)
  • [iOS] Enable audio module (#1338)
Bugfixes
  • Fixed inconsistent seek behavior in sf::SoundStream (#1118)
  • Fixed stack overflow in sf::SoundStream::fillAndPushBuffer() (#1154)
  • Fixed seeking quirks in the FLAC reader (#966, #1162)
  • Allow polymorphism with sf::SoundSource (#1185)
  • Fixed WAV file writer writing wrong header values (#1280, #1281)
  • Small bugfix to argument of alcCaptureOpenDevice() (#1304, #1305)
  • [iOS] Find OpenAL correctly (#1263, #1376)
  • [Windows] Updated OpenAL Soft to 1.18.1 fixing crashes (#1247, #1260)
Network
Features
  • Add append/overwrite parameter to Ftp::upload (#1072, #1399)
Bugfixes
  • Fixed wrong condition for building network support (#1253)
  • Changed TCP listen backlog from 0 to SOMAXCONN (#1369, #1407)
  • Fixed socket reuse not conforming to documentation (#1346, #1408)

GameDev News


12. May 2018


Amazon have just released version 1.14 of their Lumberyard game engine.  Lumberyard is derived from the CryEngine game engine, you can learn more about Lumberyard in our revised hands-on video available here.  While Lumberyard 1.14 is not a gigantic release, it does contain some huge new features including:

  • Support for Visual Studio 2017 in addition to Visual Studio 2015
  • New variable system for the Script Canvas visual programming language
  • New bookmark system for Script Canvas
  • New virtual gamepad gem for touch screen on screen controller support
  • New EMotion FX morph target animation system
  • New component entities:
    • Wind Volume
    • Sky Cloud
    • Force Volume
  • New particle emitter component

There are several other smaller improvements and fixes that are all detailed in the release notes available here.  You can download the Lumberyard installer here.

Do be aware, in addition to the pre-requisites defined in the Project Configurator, you also need to have MFC support installed in Visual Studio, which is not included by default.  The following video goes hands-on with the new release and also shows how to add MFC to Visual Studio 2017.  Be sure you have done this before creating a new project, or it will fail.

GameDev News


9. May 2018


Phaser 3.7.1 continues it’s rapid release schedule, the most recently released version being 3.7.1.  Phaser is a HTML5 2D game framework, with 3.x being the most recent branch.  If you are interested in learning more about Phaser, be sure to check out our Getting Started with Phaser 3 video, also embedded below.  This release focused heavily on API refinement, loading performance gains and improvements to the documentation.  This change also fixes Googles recent web audio idiocy in Chrome 66.

Details from the release blog:


New in this version is support for Loader Pack Files. These were a popular feature in Phaser 2 and allowed you define a list of resources in a JSON file that the Loader would consume and then load for you. They're back in Phaser 3 now and refined to be more powerful than before. Packs can even load other packs, and you can selectively run just a part of a pack if you wish.

Also improved is the ability to use Phaser outside of Webpack. I have removed the requirement for the Webpack raw-loader plugin entirely, and swapped the defines to use typeof checks, which means you should now be able to require Phaser into your package, no matter what bundler you're using, and without any special configuration needed. If you are using Webpack you can still benefit by using our config, but those outside of Webpack, or in environments like Electron are no longer penalized.

The Change Log for this release is massive and contains a few important updates. I would urge you to please read through it as there are some API breaking changes inside in certain areas. This release also fixes the issue Chrome v66 has bought into the mainstream with regard to unlocking Web Audio on desktop and their insane new Media Engagement Index.


You can read the complete change as well as download here.

GameDev News


GFS On YouTube

See More Tutorials on DevGa.me!

Month List