Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
10. October 2016


Shiva is a Lua powered 2D/3D game engine with a full editing environment.  Shiva 2.0 has been in development for some time now and Beta 7 was just released.  There are several new features in this release, excerpted from the release notes:

New Plugin Support

ShiVa 2.0 now has a fully functioning plugin module that allows you to build multi platform libraries directly from inside the editor. Our script editor is now also capable of loading and editing native code files, such has .h and .cpp. In essence, you will never have to tab out of ShiVa for any of your coding needs starting with beta 7! The option for using an external IDE such as Visual Studio, Xcode or Android Studio still does exist of course, and we provide projects and solutions for all these IDEs as well as generic makefiles.

The plugin structure has also changed quite a bit. It is now much easier to include 3rd party libraries thanks to the new Framework system. If you want to learn more, please have a look at our plugin documentation. Another very cool feature of the new plugin system is initial HTML5 support for Windows and OSX. Yes, that is correct: You can now use native code inside your web applications! The feature is still WIP and has known rough edges, but we would very much like all of you to try it out and give us lots of feedback.


New Material Editor

This release also includes the first chunk of the material editor. Materials from ShiVa 1.9.2 can be loaded by the module, edited and assigned to objects, just like you used to in the old editor. The terminologies for certain features have changed a bit, but we are confident that you will feel right at home after a few minutes. Please understand that we are still working on making PBR materials as easy to edit as Standard materials, which means it does not ship in beta 7. However we will include it in one of the next betas.


Engine Updates

Beta 7 comes with updates and bugfixes for our engines to make them compatible with the latest versions of iOS, Xcode, Android Studio and Visual Studio. For instance, our WinRT port now builds in VS2015 update 2+ by default, which means the UWP project we were talking about in beta 6 is now finally available to everyone at a click of the export button - no special project modifications necessary. iOS 10 support and Android 6/7 have been added as well.


Shiva 2.0 beta is only available to existing Shiva 1.x licenses.

GameDev News

8. October 2016


Welcome to the next chapter in the on-going Closer Look At game engine series.  The Closer Look series is aimed at informing you quickly if a given game engine is a good fit for you or not.  It’s a combination of overview, review and getting started tutorial that should give you a quick idea of a game engines strengths and weaknesses.  Today we are looking at Clickteam Fusion, a codeless game engine that has been around in one form or another for over 20 years.  I have to admit up front, this guide isn’t as in-depth as previous entries as I am rushing a bit to get it out to you.  This is because as ofctf25 publish date (Oct 6/2016) Clickteam Fusion 2.5 is heavily discounted in the Humble Bundle.


As always, there is an HD video version of this guide available here.


About Quickteam Fusion


Quickteam Fusion is a 2D cross platform game engine that takes a codeless approach in a similar vein as Construct2 or Stencyl.  First released as Klik and Play in 1995, it was later rebranded The Games Factory, then Multimedia Fusion then finally Clickteam Fusion.  Clickteam tools run on Windows, and via various add-ons and modules is capable of targeting Windows, iOS, Android, Flash, HTML5 and Mac OS.  Note that several of these modules have an additional price tag from the base package.  In terms of pricing, here is the current ( 10/6/2016 ) from Steam.



Please note however that those prices are in Canadian dollars.  Also Clickteam is frequently discounted up to 75% or more, so do not ever pay the full price.  The free version is mostly full functioning minus extensibility and the ability to generate a game that runs outside of Clickteam itself, along with a few in game resource limitations.  The Developer Upgrade removes the requirement to display that the game was authored in Clickstream ( via Splash screen, credits, etc ) as well as adding some more controls inside the engine, most of which aren’t game related.


There are some fairly successful games that have been authored using Clickteam Fusion, the most famous of which is the Five Nights at Freddy’s series.  Other games include The Escapists, Freedom Planet and a few dozen more games available on Steam, Google Play or the iOS App Store.  So this is a production ready game engine, although only suited for 2D games.


Inside Clickstream Fusion


The strength of Clickteam is certainly the tooling it comes with.  All work in Clickstream Studio is done in the editor:



One of the biggest faults against Clickstream has got to be it’s aging UI.  While not particularly attractive, it is for the most part effective.  On the left hand side you’ve got the Workspace Toolbar, which can be thought of as your scene graph.  “Scenes” in Clickstream are somewhat confusingly referred to as Frames.  You game is made up on one or more frames, and when you select a frame you see the level editor shown on the right.  This is used for placing and interacting the various items that compose your scene frame.  On the bottom left you see the Properties panel, this changes based on what object is currently selected.  Also shown here is the editor for Active objects.  Actives are very important to CTF as we will see shortly.  There are also windows for controlling layers, for selecting built in assets, etc.  Windows can be undocked, pinned and move about the interface easily.




The primary editing service can be used to easily create levels or maps via simple drag and drop.



You can also insert new items into the frame:



Then choose from the dozens of built-in object types available:



Perhaps 90% of the time, what you are going to use is an Active object, which is essentially Clickteam’s version of Entity or Sprite.



Double click the newly created Active and you get the active editor:



This tool combines several different tools into one.  There is a full paint package in here with fairly advanced tooling.  There are tools for doing common tasks like setting the Active’s pivot point and direction of facing, and there are tools here for defining and previewing animations.


In addition to the built in objects, there are several other extensions that can be added using the Extensions manager:



Additionally Clickteam offer a store for additional extensions that are both freely available and for sale:



Confusingly there is no direct integration between the store and Clickteam.  Therefore you have to download and manually install extensions and assets purchased this way.  The Store’s contents are mostly free and also showcase games created using Clickteam, tutorials, game code and more.


“Coding” in Clickteam

At this point you should have a pretty good idea how you compose the assets of your game to create levels… how do you actually add some logic to it?  That is done using these four tools:


Left to right they are the Story Board editor, Frame Editor, Event Editor and Event List Editor.


Story Board Editor


This one is pretty simple.  It’s just a top level overview of the Frames that make up your game.  Remember your game is ultimately composed of multiple frames, like so:



Frame Editor


The Frame Editor is simple the level editor we’ve already taken a look at.


Event Editor



This is where the “coding” happens.  Essentially its a top down flow chart/graph of events that happen in your game and what those events happen to.  Here for example is the “code” to select a Flying Saucer Active in the game “Saucer Squad”:


On the left hand side are the events (38 and 39, 36 is a group heading and 37 is simply a comment).  That first event triggers when the user left clicks on the Saucer object.  The right handle side of the screen shows the action that occurs when that happens.



So for the event on Line 38, then the user clicks the left mouse button on Active type Saucer, it plays the sound sample Button_1, among other actions.  It’s essentially these events and actions you use to create your game.  Let’s create a very simple example… lets create an action that simple plays a sound effect when the frame (scene) is created.

First select Insert->Condition



This will bring up the conditions dialog:



In this case I clicked the Storyboard Controls (the chessboard/horse icon), then chose Start of Frame.  The creates a new action that will fire when the frame is started.  Now to the right hand side, select the space below the Speaker icon, like so:



Right click and all of the available options will be displayed:



Next the appropriate editor will be shown



Event List Editor

This editor performs the same functionality as the Event Editor, but instead of in a somewhat unwieldy grid view, it represents the events in a much more readable list form:



One last editor of note is the expression editor, for creating much more advanced logical conditions:



Individual entities within the frame can also have their own events, set in the properties panel of the selected item:


Clicking edit will bring you back to the exact same interface we just discussed.  Also in the properties panel you can define variables:



These values can then be interacted with in other event controllers.


Community and Documentation

Documentation in Clickteam is decent.  Built in there is an integrated CHM based help system, as well as 4 multipart tutorial games to get started.  There are also a wealth of tutorials available to download (mostly free) on the Clickteam store.  There are also a fair number of Clickteam tutorials on YouTube, although many of them are quite awful.  There is an active forum as well as a wiki.  All told, for every problem I faced, I found a solution quickly enough online.



So what ultimately do I think of Clickteam Fusion?  For the most part it is what it’s advertised to be, a code free 2D game creation kit able to target multiple platform.  There is of course a learning curve, but it’s a relatively short one.  As a code focused programmer, I don’t find the coding process extremely productive, but I can see how it would be so for a more visual oriented person and especially for a non-coder.  Clickteam tools are certainly getting a bit long in the tooth, a lot of the legacy cruft is showing it’s age and the UI could certainly use an update.  My biggest hesitation is wondering how well this development system would scale with system complexity.  If you’re game isn’t easily broken into scenes or is sprawling in complexity, I can see Clickteam becoming incredibly cumbersome.  That said, I think this is a successful all in one development tool that can take you a very far way in a very short period of time even with minimal to no development skill.


The Video

Programming Design

6. October 2016


Unity just released a new patch, 5.4.1p4.  Composed of the usual slate of fixes and improvements, here they are from the release notes:


  • Asset Database: Added a new API for getting asset information without loading asset into memory.
  • Graphics: Updated tooltip test for "Box Projection", "Box Offset" & "Box Size".
  • Lighting: Renamed popup menu item from "Default scene parameter" to "Scene Default Parameters".
  • Substance: Improved substance assets processing when switching platforms, upgrading a project and building.
  • tvOS: Added "Require Extended Game Controller" option to player settings.
  • (819905) - Animation: The Animation preview will correctly display a preview animation when a model is dragged to the preview area.
  • (832271) - Audio: Fixed memory leak when quickly loading and unloading lots of audio assets.
  • (834100, 833996) - Canvas: Fixed a regression introduced in 5.4.0p4 where non-native fullscreen player appeared darker when Canvas was present, in Linear color space.
  • (814282) - Graphics: Fixed the issue of projectors rendering twice if transparent objects are in the scene.
  • (827364) - Graphics: Fixed a rare deadlock that can happen when graphics jobs are enabled.
  • (815783) - IL2CPP: Allow now Monitor.TryEnter to correctly obtain a previously taken lock that has been released, which did not work in some cases.
  • (826624) - IL2CPP: Correct the stack state handling during code conversion for some box opcodes.
  • (834376) - IL2CPP: Removed an unnecessary assert when GC.Collect(1) is called. The call will still have no impact though.
  • (none) - IOS: Fixed an iOS 10 warning for improper use of runloop.
  • (830528) - IOS: Fixed the Remote notification detection code.
  • (830273) - Metal: Fixed grab pass combined with image effects appears darker.
  • (818563) - Metal: Fixed an issue whereby view was not scaling properly when using Screen.SetResolution in fullscreen mode.
  • (822217) - Substance: Fixed an asset import crash.
  • (820301) - Substance: Fixed a crash when switching build platform.
  • (820162) - UAP: Fixed an incorrect language being returned when system language was Spanish(Argentina).
  • (832104) - UAP: Fixed the issue of incorrect resolution being reported when the composition scale changed and the game window was minimized.
  • (818294) - UI: Fixed the Canvas related crash when some elements are being deleted.


As always the patch can be downloaded here.

GameDev News

5. October 2016


Back in May Google announced VR support was going to be built into future versions of Android.  It was only a matter of time until Google launched a compatible device, and today that device is here.  The DayDream View is a new VR headset very similar to Samsung’s Galaxy GearVR headset. 


The new headset has some interesting features.  Perhaps the most shocking aspect of the DayDream View is that it is made from fabric, causing it to be the lightest of the available headsets.  It’s also shipping with a touchpad motion controller with two buttons.  The headset is compatible with Google’s newly released Pixel phones as well as future VR enabled Android devices.  Perhaps most impressively, the headset and controller are shipping for $79 and will be shipping in November.


Below is Google’s DayDream View launch video:

GameDev News

3. October 2016


Welcome to the next part in our ongoing Defold Game Engine tutorial series.  In this tutorial we are looking at working with the integrated Box2D physics engine built into the Defold engine.


As always there is an HD video version of this tutorial available here or embedded below.


The Defold engine makes it extremely easy to work with physics but is rather minimal in it’s implementation.  Let’s jump right in.


Creating a Collision Object


The heard of implementing physics in Defold is the Collision component.  This is composed of two part, the Collision Component that describes the physical attributes of a game object, and the Physics shape, which defines it’s dimensions.  I start off by creating this simple Gameobject, the image used in the sprite is 128x128 pixels:



Now we simple add a new physics component to the game object.  Right click the Game Object in the Outline, select Add Component, then select Collision Object:



Here are the default properties of a Collision Object:



Type is important and we will cover that shortly.  Mass is the weight of the object relative to dimensions, friction is how one surface reacts to another ( think traction ), restitution is the “bouncy-ness” of an object, linear damping and angular damping determine how motion of the object degrades over time, locked rotation determines if the physics simulation will rotate the attached game object or not.  Group and Mask are used to determine which collision objects interact with other collision objects.  Objects in the same group will collide, while objects not in the same group, or if that particular group isn’t added to the Group value ( comma separated ) will not interact.  So think of Group as the physics identity or type(s) this object belongs to, while Mask is the groups that object will interact with.


Next we need to define the shape of our physics object.  Simply right click the Collision Object and select Add Shape:


Next pick Box:



In the properties, set the Width and Height to match the size of our source image.  Depth is the value along the z-axis and can be left at the default value in most cases.



Now that we have our Collision object define, simply create a couple instances of our game object in the scene and the results are immediately demonstrated.



You probably didn’t want the boxes just dropping out of the world now do you?  So we need to create a physics body for the “floor”.  We can easily do this by creating a new Game Object in main and adding a physics body to it.  Like so:




The problem here is, our newly created floor will be effected by gravity, just like every other object in the scene!  This is where the Type of the Collision Object becomes important:



So far we have only used the default, Dynamic.  A dynamic object is a fully simulated physics object.  It will take part in the simulation, will be part of the simulation and will be affected by the simulation.  Static is what we want in this situation.  A static object will be part of the simulation, but will not be effected by it.  This is your proverbial unmovable force!  So other objects in the simulation will be able to hit the collision object and they will be affected by the collision, but the static object will not be changed in any way.  Kinematic objects are special objects that are generally moved directly by the character or code but also take part in the physics simulation and will be affected by it ( think that players sprite for example ).  Triggers on the other hand are simply shapes in the world that can detect a collision and can be hit, but wont have any affect on anything in the world.  They are often used to detect movement, for example the goal area in an air hockey game.


Now with our floor object set to static, our updated results!



So, how exactly do we control global physics properties, such as gravity?  These settings are available in the .project file:



Physics and Code

Now that we know how to set up a physics simulation, let’s look at how to deal with it in code.  For we are going to look at how you respond to a collision in code.  As you might be able to guess, messages are used.  Let’s look at a simple program that responds when a collision occurs.  Attach a script to your box object and add the following code:


function on_message(self, message_id, message, sender)
    if message_id == hash("contact_point_response") then"@render:","draw_line", { 
    		start_point = vmath.vector3(message.position.x -40, message.position.y - 
    		40, 0),
    		end_point = vmath.vector3(message.position.x +40, message.position.y + 40, 
    		color = vmath.vector4(1,0,0,1) })"@render:","draw_line", { 
    		start_point = vmath.vector3(message.position.x -40, message.position.y + 
    		40, 0),
    		end_point = vmath.vector3(message.position.x +40, message.position.y - 40, 
    		color = vmath.vector4(1,0,0,1) })	

This code simply listens for the contact_point_response message which is sent when a collision occurs with the attached game object.  When such a collision occurs, this code draws an X centered about the collision point by sending the draw_line message to the render subsystem.

There is a great deal of information about the collision passed along in the message parameter:


As you can see, information on what object was collided with, how fast, groups, velocity, mass etc are all available in the contact_point_response message.


On final topic to cover is occasionally you are going to want to be able to apply force directly to a physics object using code.  This is also easily accomplished using the following code:"#collisionobject", "apply_force", { 
    		force = vmath.vector3(0,5000,0),
    		position = go.get_world_position()})

Again using Defold’s messaging system, we send the apply_force message to our Collision Object component.  This applies 5000 newton of force along the Y axis.  Added inside our collision handler, it makes for some interesting results!



The Video


AppGameKit Studio

See More Tutorials on!

Month List