Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

9. May 2017

 

YoyoGames have just released GameMaker Studio 2.06.  The update brings new functionality to the built in image editor ( trim, reverse frames and colour remove ).  New touch gestures have also been added, rotate and pinch.  This release also marks the first release with feature parity between the Windows and newly released Mac versions.  Additionally the Mac version now automatically installs and downloads Mono if it is not already installed.

 

Details from the press release:

The GameMaker Studio 2 update will increase developer productivity with new image editor tools and Visual Studio 2017 compatibility, while user-interface changes to the Resource Tree will imagedecrease some occurring issues from the launch version. 2.06 also includes some necessary bug fixes to ensure users receive the smoothest GameMaker Studio 2 experience possible. For more information about each fix and feature coming in the GameMaker Studio 2 2.06 update, please visit: https://www.yoyogames.com/gamemaker/releasenotes

GameMaker Studio 2 for Windows PC is available as a free trial download and can be purchased through YoYo Games’ website and Steam starting at $99.99. Users of GameMaker Studio can still upgrade to GameMaker Studio 2 at a 40 percent discount until May 31, 2017. Developers interested in providing feedback to the Mac IDE can send an email to helpdesk@yoyogames.com with the subject line “Mac IDE Closed Beta” and provide their full name, country and Mac specifications (including OS version) to be considered an invite.

GameDev News

8. May 2017

 

Ever needed to loop a background forever in your 2D game and wondered the best way to do it?  That’s exactly what we are going to look at today, with all the code samples done using HaxeFlixel, which I recently covered in this tutorial series if you wish to learn more.  One key aspect is to have a background that is seamless.  That is the ending edge and beginning edge need to blend seamlessly together.  For this example I am using this graphic (click for the full resolution version).

BloodRed

 

There are two approaches we are going to cover today.  The first one is the simplest, essentially we update our camera when we get within half a screens height of the edge and loop it to the bottom, like so:

CameraLoop0001-0060

 

Let’s take a look at the code.

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.FlxObject;

class PlayState extends FlxState
{
   var bg:FlxSprite;
   var camTarget:FlxObject;
   override public function create():Void
   {
      super.create();
      bg = new FlxSprite(0,0,AssetPaths.BloodRed__png);
   
      add(bg);

      camTarget = new FlxObject();
      camTarget.setPosition(FlxG.width/2, FlxG.height/2);
      FlxG.camera.target = camTarget;

      add(camTarget);
   }

   override public function update(elapsed:Float):Void
   {
      super.update(elapsed);
      camTarget.y+=25;

      // Move the camera to loop forever  
      if(camTarget.y >  bg.height - FlxG.height/2){
         camTarget.setPosition(FlxG.width/2, FlxG.height/2);
      }
   }
}

 

The downside to this approach is you also need to reset the Y coordinate of all the entities in your scene as your camera resets.

Another option is to use two instances of the background and as you approach the edge you raise the lower most version to the top and repeat forever.  Like so:

CameraLoop20001-0060

 

Here is the code for this approach.

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.FlxObject;

class PlayState extends FlxState
{
   var bg:FlxSprite;
   var bg2:FlxSprite;
   var camTarget:FlxObject;
   override public function create():Void
   {
      super.create();
      bg = new FlxSprite(0,0,AssetPaths.BloodRed__png);
      bg2 = new FlxSprite(0,bg.height,AssetPaths.BloodRed__png);
   
      add(bg);
      add(bg2);

      camTarget = new FlxObject();
      camTarget.setPosition(FlxG.width/2, FlxG.height/2);
      FlxG.camera.target = camTarget;

      add(camTarget);
   }

   override public function update(elapsed:Float):Void
   {
      super.update(elapsed);
      camTarget.y+=25;

      var greater,lesser;
      if(bg.y > bg2.y){
         greater = bg;
         lesser = bg2;
      }
      else{
         greater = bg2;
         lesser = bg;
      }
      if(camTarget.y > greater.y + bg.height - FlxG.height/2){
         trace("Flip");
         lesser.y = greater.y + bg.height;
      }

   }
}

 

This approach has the advantage of enabling you to keep coordinates consistent, but has the downside of requiring a second identical sprite.  Since the second sprite is simply an instance of the same texture though, the memory impact should be almost non-existent.

Programming , , ,

3. May 2017

 

Ever find yourself wanting to render a 360 degree view of your model?  If you’ve ever used Blender for game sprite creation I bet you have.  What is the best way to go about doing this?  One way is to keyframe the object rotating over time, although this may not result in the lighting you want.  A better way is to orbit the render target using the camera.  The question is, how do you do this?  Well you can manually keyframe the camera’s position and rotation but this process is a gigantic pain in the butt.  An easier solution is to have the camera follow a spline path.  That’s what we are going to look at today, it’s thankfully quite easy, but perhaps not entirely intuitive.

 

First thing you need to do is create the path for your camera to follow.  In my case I’m using a simple circle, with the center of the circle around my target, like so:

image

 

Next, select your camera, then shift select the curve.  Then hit CTRL + P and select follow path.

image

 

And voila!

BlenderCamPath

 

That said, how exactly do you control how fast the animation moves?  Don’t worry, it’s quite easy.  With the curve selected, go to the Data panel and locate the Path Animation section.  The number of frames can be configured here.

image

 

Easy 360 degree (or in this case, 180 degree) rendering!

RotateGif

 

You can watch this in process in the video below.

Art ,

3. May 2017

 

Microsoft recently purchased the company behind Simplygon, a tool for creating quality lower resolution versions of high polygon meshes.  One of the nice things about Microsoft acquiring a company is, if they don’t kill it off outright, they often make it available for free.  That is exactly what has happened with Simplygon Connect.  Here are the details on the two versions available.

image

 

Head over to the developer portal, sign in (I used my existing Live account) and the following downloads are available.

image

 

In addition to the above downloads, Simplygon is already supported inside Unreal Engine.

Details on the limitations between the Connect version and the offline version are scarce, and the site seems to completely lack an FAQ or additional information.  The obvious difference is 1 node vs 10 on the commercial version, however I have no idea what a node actually is.  The other obvious differences is the commercial version supports Windows 8 as well as 10, has the ability to supress automatic updates and email support is available.  The free version is limited to Windows 10.  I am currently downloading the SDK to see if additional information is available, however their servers seem to be absolutely crawling at the moment.

GameDev News

3. May 2017

 

Hot on the heals of the 4.16 preview release, Epic have released a hotfix for the 4.15 branch.  The major purpose behind this fix is to work toward resolving D3D Hung crashes while enabling additional NVidia GPU diagnostics.  To support these new diagnostic features however, you need to update to a newer NVidia driver.  More details on the GPU Hang bug are available here.  This hotfix also addresses the following issues:

Fixed! UE-35606 Crash when Importing .OBJ using the File > Import into Level Option
Fixed! UE-42207 SVN SASL binaries may be causing crashes for some users
Fixed! UE-42911 Reflection capture crash in FindOrAllocateCubemapIndex
Fixed! UE-42165 [CrashReport] UE4Editor_Renderer!FReflectionEnvironmentSceneData::ResizeCubemapArrayGPU() [reflectionenvironment.cpp:215]
Fixed! UE-43279 Crash launching QAGame onto Windows
Fixed! UE-42920 Regression in Gaussian and Circle DOF
Fixed! UE-43443 GC Clustering broken for USoundWave assets (crash)
Fixed! UE-43028 UnrealVS is not working in Visual Studio 2017
Fixed! UE-43888 GitHub 3475 : Added a gitignore exception for automation files.
Fixed! UE-43608 EDL in 4.15 may not be fully safe and should be disabled by default
Fixed! UE-43346 Crash in Packaged Game When Using Gameplay Tags
Fixed! UE-42547 Removing a key from a Enum Map variable causes duplicate keys to remain
Fixed! UE-43928 FBlackboardKeySelector filters cause invalid argument assert
Fixed! UE-42759 Vulkan is crashing on S7 Mali
Fixed! UE-42184 IAP failed to read purchase
Fixed! UE-41313 Failed to compile C++ Code project, for iOS/tvOS in Development, in Xcode 8.3 beta 1
Fixed! UE-44029 FRepChangelistState leaks memory
Fixed! UE-44470 Compile failure packaging code project for tvOS from Mac
Fixed! UE-43454 Add Aftermath support to UE4Editor

 

As always, the fix is available for download using the Epic Game Launcher.

GameDev News

Month List

Popular Comments