Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

31. March 2017
Today we have the final release of Unity 5.x before they move on to Unity 2017. This release comes with a ton of new features including Vulkan support, improved graphics performance, an improved light mapper and more.

Details from the release blog:

Massive lighting improvements
5.6 includes the Progressive Lightmapper preview, which provides immediate feedback when trying out different lighting scenarios, and much faster iteration, compared to the current Enlighten solution. 5.6 also offers Light Modes, which allow for various ways of mixing real time and baked lighting for static and dynamic objects.

Improved graphics performance
GPU Instancing which enables new kinds of effects where many similar objects are needed at a very low performance cost, has been improved with support for Procedural Instancing. And, with the addition of Compute Shaders for Metal, you can now add more details to your games by tapping into the raw power of the chipsets on Apple iOS and macOS.

Vulkan support
Vulkan support brings increased speed while reducing driver overhead and CPU workload; this leaves the CPU free to do additional computation or rendering and saves on battery life for mobile platforms.

Massive update to Particle System
5.6 greatly extends the range of particle effects to give more options and control to the user. This update also significantly improves Particle System performance.

New Video player
A new multi-platform video player enables playback of 4k video allowing you to build 360 degrees videos VR experiences.

Navigation system improvements
Improved AI and Pathfinding tools–also referred to as the NavMesh system–expand the possibilities to manipulate multiple nav meshes and agents. And, new tools for procedurally generated or dynamically loaded content enable a whole new set of use cases and gameplay options for character navigation.

New 2D tools and improvements
Unity 5.6 adds a whole set of 2D features that give you more control and make it easier to create complex 2D objects. New features for 2D physics enable new kinds of gameplay and effects, including fully featured particle effects interacting with 2D objects.

TextMesh Pro
One of the top performing tools on the Unity Asset Store is now available for free to users of 5.3+ and will be soon be natively integrated into Unity. TextMesh Pro features advanced text rendering with dynamic visual text styling, along with greatly improved control over text formatting and layout.

Performance Reporting and debugging improvements
In addition to exception reports, Performance Reporting now collects native crashes for iOS. Physics debug visualization and profiler improvements make it easier to find the source of performance issues in the game.

New platforms
Seamlessly publish to Facebook Gameroom, as well as Google Daydream and Cardboard for Android and iOS. Nintendo Switch support is also available now.

Unity Collaborate (Beta)
We added new options when publishing changes for finer control of your Collaborate projects.

Experimental support for WebAssembly
In 5.6 we bring experimental support for WebAssembly, a new cross-browser technology designed to help improve the Unity WebGL experience.



GameDev News

30. March 2017

 

Now that we have the basics of drawing graphics on the screen down in the ongoing Haxe and HaxeFlixel tutorial series now is a good time to move on to giving our player some control over the game.  Today we are going to look at how you handle keyboard input in a HaxeFlixel game.  It’s a fairly straight forward task, so this will be a fairly short tutorial consisting of a single code sample.  Without further ado, let’s jump right in with the code!

 

package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.input.keyboard.FlxKey;


class PlayState extends FlxState
{
   var sprite:FlxSprite;
   override public function create():Void
   {
      super.create();

      // Create a sprite and center it to the middle of the screen
      sprite = new FlxSprite(AssetPaths.enemy__png);
      sprite.x = FlxG.width/2 - sprite.width/2;
      sprite.y = FlxG.height/2 - sprite.height/2;
      add(sprite);
   }

   override public function update(elapsed:Float):Void
   {
      super.update(elapsed);

      if(FlxG.keys.enabled){
         if(FlxG.keys.pressed.LEFT)
            sprite.x--;
         if(FlxG.keys.pressed.RIGHT)
            sprite.x++;

         if(FlxG.keys.justReleased.UP)
            sprite.y--;
         if(FlxG.keys.justReleased.DOWN)
            sprite.y++;

         if(FlxG.keys.anyPressed([FlxKey.ESCAPE,FlxKey.SPACE])){
            sprite.x = FlxG.width/2 - sprite.width/2;
            sprite.y = FlxG.height/2 - sprite.height/2;
         }
      }
   }
}

This example draws a sprite centered to the screen and enables you to control it using the arrow keys.  The majority of logic happens in the update function, where we poll the status of various keys using the object FlxG.keys.  Notice that we start by checking if keys is enabled, this is because many platforms Haxe runs on may not have keyboard input at all.  Next we check the status of keys two different ways, using pressed() and justReleased().  There is a critical difference between these two approaches.  Pressed will have a list of all the keys that are currently being pressed, while released will only have a list of keys that were just released in this pass through the game loop.  The end result is, pressed will be true over and over as a key is held down, while justReleased will only be true once per individual key/press cycle.  This means to move up and down you have to keep hitting the UP/DOWN arrows over and over, while you will move left and right constantly as the LEFT/RIGHT arrows are held down.  Keep in mind the game loop takes only a few milliseconds to run, so even though it feels like a single key press, pressed will be true for several frames. 

 

The final portion of this example illustrates how you can query multiple key presses at a single time.  In this case we check if the ESC or SPACE BAR are pressed and reset our sprites position back to the center of the screen if they are. In addition to anyPressed() there are also methods to check just pressed, and just released.  There are also additional methods to check other values such as firstPressed(), firstJustReleased() and more.  You can also get an array of the currently pressed keys using getIsDown().  Ultimately FlxG.keys implements FlxKeyManager, so that is the class to check out to see the full scope of functionality available.

 

One interesting omission from HaxeFlixel is event driven (as opposed to polled) keyboard input.  The underlying OpenFL and Lime libraries do however support it.

 

The Video

Programming , , ,

28. March 2017

 

Construct is a 2D game engine that provides a visual programming interface and compiles down to HTML5.  Details of the upcoming release were announced back in February, today a beta is available to try.  With the move to Construct 3 it has moved entirely to be browser based, requiring the Chrome browser.

 

Details of the beta:

What the beta includes

Our aim is to get lots of testing done and receive general feedback. Construct 3 is also not on sale yet. So for the public beta we are making the Free Edition of Construct 3 available. This has limits and several features are unavailable. However we will be making the fully-licensed version available for one week during the Newgrounds Gamejam from May 15th-21st! We aim to have subscriptions on sale when that week ends, by which time we should have found and fixed any last issues relating to subscriber-only features.

How to use the beta

Construct 3 requires Chrome 57+. This recently became the lastest stable version. If your system hasn't updated yet, you can usually manually update by opening the Chrome menu and selecting Help → About Google Chrome. On mobile, check for updates in the Google Play Store. If you still can't update, try installing Chrome Beta.

You can log in to Construct 3 (and the construct.net website) with the same username and password you use here on Scirra.com.

We'd like to point out one especially useful feature of Chrome that makes it easier to use Construct 3: in the Chrome menu, try selecting More tools → Add to desktop (or Add to shelf on Chrome OS, or Add to homescreen on mobile). Be sure to tick Open as window if the option is there. This creates an icon for Construct 3 on your desktop or home screen that lets you use Construct 3 like any other app. It also removes the browser address bar and UI, which saves space on your screen for more of Construct 3! And don't forget Construct 3 works offline too, so the icon will continue to work wherever you go or whatever happens to your Internet connection.

Let me at it!

Ready to go? We're launching a whole new website over at Construct.net. It's still a work in progress, but we'll be updating it regularly throughout the beta. If you want to jump directly to Construct 3, just click the link below.

editor.construct.net

GameDev News

27. March 2017

 

Unity have released another patch, this one bringing the engine to version 5.4.5p1.  Composed of several fixes including:

Improvements
  • (815861) - UI: CanvasRenderer::OnTransformChanged will not be called when object is inactive.
Fixes
  • (837483) - Android: Acquire context on focus before notifying player.
  • (743739, 887242) - Android: Fixed a crash in WebStreamDecomp after a long sequence of reading asset bundles.
  • (870185) - Animation: Fixed root rotation when importing a humanoid animation that used the "Copy From Other Avatar" feature.
  • (879675) - Core: Fixed job system ending up with high CPU usage in certain circumstances eg. using UnityWebRequest.Send() in Editor after exiting Play mode.
  • (none) - Editor - Other: Editor internal resources can now be rebuilt in 5.4.
  • (728324) - Graphics: D3D9 - Make sure that internal resolves don't result in a drawn pixel – i.e single white pixel when using deferred mode.
  • (890915) - Graphics: Fixed a crash in GetBuildUsageTagFromAssets that was triggered by pro0ject that had ShaderVariants.
  • (864237) - Graphics: Fixed an issue with Assert "Texture aux property (unity_SpecCube0_HDR) should never be a built-in name!".
  • (863954) - Graphics: Fixed forward-only objects being rendered into Depth/DepthNormals textures multiple times when they had multiple submeshes and deferred shading was used.
  • (849424) - Graphics: On DirectX, avoid presenting a fresh-black frame whilst performing screen resizing.
  • (863625) - Graphics: Set the ambient probe for the deferred reflections pass to fix a difference between graphics jobs and non-graphics jobs rendering.
  • (870973) - IL2CPP: Fixed a race condition on iOS during method initialization.
  • (861046) - iOS: Added support in order to enable auto-rotation while broadcasting using ReplayKit.
  • (875180) - iOS: Removed extra notification sent on application launch.
  • (none) - Metal: Fixed an issue with setting DontCare load flag when running multithreaded.
  • (883312) - Physics: Fixed a crash caused by changing the value of the configuredInWorldSpace flag on a Joint attached to an inactive GameObject.
  • (888302) - Scripting: Fixed a coroutine crash in Coroutine::CompareCoroutineEnumerator.
  • (881103) - Shaders: Fixed an internal error on a GLSL shader compiling corner case.
  • (750307) - Shaders: Fixed advanced blend operations by requiring the shaders to be decorated with UNITY_REQUIRE_ADVANCED_BLEND(mode) declaration.
  • (863256) - Sprites: Fixed an issue where OverrideGeometry on instantiated sprites produced differing results in the Editor and Standalone.
  • (none) - Tizen: Resolved a crash that occurred when an app tried to exit.
  • (873678) - UI: Fixed an occasional masking issue when using deferred rendering path on Linux.
  • (856734) - UI: Fixed a curve preview crash not updating when points changed but bounds did not.
  • (856381) - UI: Fixed scrollrect performance being slow when it had a lot of content.
  • (880565) - UnityWebRequest: Fixed Editor freeze when exiting play mode with active UnityWebRequest with custom download handler script.
  • (876027) - UnityWebRequest: Fixed high CPU when WebRequest with custom download handler script was aborted.
  • (879749) - UnityWebRequest: Fixed redirect in editor when not in play mode.
  • (850239) - VCS: Fix for editor not checking out scene file before first write in freshly loaded project.
  • (886841) - VR: Fixed a subtle timing bug on Rift that could cause a minor view stuttering in certain situations.

 

As always, the patch is available for download here.

GameDev News

24. March 2017

 

The seminal role playing game engine, RPG Maker has just been released on Linux.  With the MV release, RPG Maker both runs on and can target the Linux platform.

 

From the announcement:

First, RPG Maker MV is now for Linux!

Screenshot from 2017-03-21 09-14-50

This means you can both use it on our Linux computer to make games, and deploy to Linux for other people to play from PC, Mac, or Linux editions of RPG Maker MV.

This update brings a bigger audience, both for RPG Maker MV, AND for its users. Your games can now be played by more people than ever.

 

Along with the Linux announcement, they also announced the release of RPG Maker MV Tools, add-ons available as DLC that extend the functionality of RPG Maker.  From the same announcement:

But we didn’t even stop there. We are also introducing RPG Maker MV Tools, DLC that adds new toolsets to the RPG Maker MV editor. We added the MV Tools menu into the latest update, and the first MV Tool, SAKAN -Tileset Builder-, is launching this week.

Untitled-1

SAKAN -Tileset Editor- is exactly what it says on the tin. This tool will let you quickly cut together tilesets using pieces of existing tilesets, a whole bunch of extra pieces added in SAKAN, or even possibly make your own.

While it won’t include all the power something like Photoshop does for making tiles, it will make organizing a tileset and making small edits faster than ever before, and right from RPG Maker MV itself, making your workflow simpler and easier.

 

RPG Maker MV is currently on sale on Steam.

GameDev News

Month List

Popular Comments

This is why I say C++ isn’t a beginner friendly language
Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


18. May 2012

 

 

You often hear people say things like “It’s memory management that makes C++ difficult”, this is patently false.  What makes C++ so incredibly difficult for new users ( and experienced ones! ) is the complexity.  Note, I didn’t say difficulty, I said complexity.

 

Today was one of those perfect examples, one of those experiences that I want to point at and say “THIS IS WHY YOU SHOULD LEARN WITH A DIFFERENT LANGUAGE!”.  Yes, that was shouting. 

 

 

Here’s the story.  Today I had a reader request guidance on how to make a release build of my C++ tutorial.  This was a really good request, so I put it together in tutorial form.  Something quickly dawned on me… I’ve never built this tutorial in release mode.  It was pretty obvious that I hadn’t because, well, it didn’t work!   Oops, my bad.

 

 

Let’s take a look at what happened, I want to see if you can guess what the problem is.  A gold star to whoever gets it before I reveal the answer at the end of this post.  That gold star offer applies to C++ veterans and new developers alike, this is a somewhat tricky one, especially considering the starting point!

 

 

So, I was building Pang 9 ( my Pong tutorial ) in release mode.  I downloaded the project files from here if you want to follow along at home.  I simply extracted the project, then I downloaded the full SFML 1.6 SDK, imported the Visual Studio 2008 project into Visual Studio 2010 and compiled the DLLs for multithreaded release mode, and copied those DLLs into my release directory.  Code compiles just fine under release, so then I run it ( within Visual Studio ) and:

 

 

image 

 

Uhoh… this can’t be good!  The offending line of code is right here:

 

sf::Music* SoundFileCache::GetSong(std::string soundName) const { std::map<std::string,sf::Music *>::iterator itr = _music.find(soundName); if(itr == _music.end()) { sf::Music * song = new sf::Music(); if(!song->OpenFromFile(soundName)) <----- EXCEPTION IS HERE { delete song; throw SoundNotFoundExeception( soundName + " was not found in call to SoundFileCache::GetSong"); } ..... SNIP ......

Well, there is a big bad pointer right above the line, that seems an obvious candidate doesn’t it?   Well don’t waste your time on that train of thought, the pointer isn’t the issue.  The .find call seems a likely candidate too, it isn’t though.

 

Hmm, lets start looking there, ill set a breakpoint and trace into the _music.find() call.  Oh yeah, this a release mode only bug, so our hands our tied on the debugging side of things… great.  Alright, lets take a closer look.

 

image

 

 

<Bad Ptr>.  Oooh, that’s not good.  Obviously I’ve done a bad allocation here somewhere, but that just doesn’t make sense, not with the way this data type works.  In fact, the only place these pointers are even allocated is in this actual method, and we haven’t even got to that code yet!

 

For some reason, our empty map ( it hasn’t been used yet, this is the first call ), is returning a Bad Ptr instead of working as expected.  This can’t be right?  But wait… that’s a red herring anyways, isn’t it, after all our exception has nothing to do with the Bad Ptr or the std::map at all, this is just the IDE sending us on a wild goose chase. We can literally boil it down to exactly two lines of code:

 

sf::Music * song = new sf::Music(); if(!song->OpenFromFile(soundName))

 

Now we are getting somewhere, we have isolated our reproduce case down to exactly a two line program!  Hmmm, both are just standard SFML calls.  Short of being out of memory, nothing here should be able to fail.  So then, what the hell is causing this problem???

 

 

// ANSWER TIME, got your guess yet?  Did you get it right and I owe you a gold star?  Let’s find out!

 

 

Well, long story short, it’s our SFML dlls built for Visual Studio 2010.  See, this is our first method call into any SFML DLL and it’s causing an explosion… but, why the heck is that???

 

 

Well, lets take a trip over to the SFML 1.6 project and check out how I built them.  All I did was download the SFML 1.6 project for Visual Studio 2008, delete all the examples and set my build mode to Release DLL and compiled everything.  Hidden between the various warnings was one very very very important but cryptic message:

 

image

 

A bunch of warnings as a side effect of the import process, and one extremely important warning… the ahah moment if you will:

 

Warning    8    warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\temp\t\SFML-1.6\build\vc2008\LINK    sfml-graphics

 

Say what?

 

 

Now here is the thing, with C++ libraries need to be IDENTICAL.  You link debug to debug, multithread to multithread, etc…  At the same time, you have to link Visual Studio 2010 binaries to Visual Studio 2010 binaries ( although not all versions are binary incompatible, VS 2005 and 2008 could share libraries I believe ), and this here is the source of all the trouble!

 

The sfml-graphics graphics library statically links to a lib called freetype, and this library isn’t compatible with Visual Studio 2010.  Download the newest version, extract it into the extlibs folder, recompile and PRESTO, problem solved.

 

 

 

So there you go, an unhandled exception in a call to open an audio file ended up actually being caused by a statically linked font library in a 3rd party graphics dll!

 

 

Still think it’s memory management that makes C++ tricky for beginners?  The biggest problem is, new developers run into this stuff almost immediately.  You need to conquer so much to get up and running with C++, the linker being one of the earliest and most daunting obstacles.  I honestly don’t expect anyone with a few months of programming experience to have been able to puzzle this one out.  It’s exactly these kinds of things that make people throw up their hands saying “Oh screw it, programming is too hard!”.  I don’t like a quitter, but frankly in this case… they are right!

 

 

Of course, this is by no means limited to C++.  I have had very similar experiences with Java where some XML file feeding another XML file feeding a code generator called by Maven puked out a message code like “Error, unknown problem”.  Thing is, with no other programming languages do you encounter this kind of problem until you are ready to deal with the complexity.  In C++, you start dealing with this crap on day 1.

 

So this, is one such reason why I say C++ isn’t a beginner friendly language!

General ,

blog comments powered by Disqus

Month List

Popular Comments