Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

10. July 2017


Unity have announced that as of Unity 2017.3 Unity Editor and Player will no longer support the Direct X 9 renderer.  Why you may ask?  Unity have posted a blog explaining this:

Due to diminishing hardware numbers and the loss of platform support from Microsoft, we have come to the conclusion that continued support of the DirectX 9 API is no longer feasible and is working against us when it comes to developing new features in Unity. It has become increasingly difficult to support and maintain feature parity across several DirectX API versions (9, 11, and 12).

With the rise of new graphics APIs, we feel that Unity continues to have excellent coverage of the hardware and API choices available now and in the future.


What does this mean in practical terms?  Once Unity 2017.3 is released, that version and future version will no longer be able to target Window XP machines.  This is becoming increasingly less of an issue, but there are still a number of users working on Window XP.  Here are the current OS breakdown for Windows users according to the most recent Steam Device survey.

image


At this point we are talking > 1% of the PC market.  All told, a fairly reasonable cut-off in my opinion.  Even with Direct X 9 support going away, Windows XP machines can still be supported via the OpenGL renderer.

GameDev News

5. July 2017


There are a wealth of great add-ons for the Godot game engine, such as Add_Primitives, which adds several geometric primitives to the Godot editor, such as capsules, spheres and more.  This quick tutorial (including a video) goes step by step through the process of enabling an add-on in your Godot project.


First, you need to download the add-on you wish to enable, that or git clone it.  In this tutorial we are going to simply download it.  This link will download the add_primitives add-on zip.


Next, create a project.  Add-on’s are now located at the project level, not in the %APPDATA% folder.  In the project directory, create a folder called Addons.  In that folder, extract the zip file you downloaded earlier.  Next be sure to rename it from add_primitives-master to add_primitives, so the folder name matches the add-on name.  If you cloned using git, you wont have to perform this step.


Now load Godot.  Select the Scene Menu->Project Settings.

image


Switch to the Plugins tab

image


Next change Status to Active.

image


And done!  If you are using the Add_Primitives add-on from this example, you should now see an additional icon in the 3D view:

image


The Add-on will also be shown in your project view:

image


You can watch the above process in video form below.

Programming , ,

5. July 2017


Blend4Web is a technology that enables you to create games or applications entirely in Blender but publish them to the web, powered by WebGL.  The 17.06 release brings several new features including support for most Blender constraints, experimental AR support, a new camera logic node as well as new lighting and reflection features.


Details of the release from the release notes:B4W

New Features
  • Support for essential Blender constraints.

    Copy Location, Copy Rotation, Copy Transforms and Track To are available to use now. Also the following API methods have been added: append_copy_loc, append_copy_rot and append_copy_trans.

  • Experimental Augmented Reality support.

    Check out the AR application to get the look of the feature we’re going to improve much in our next releases. The application can be found in the apps_dev/AR folder and is also available in Project Manager.

  • New logic node Set Camera Limits.

    This node allows changing limits of the camera. Each limit can be set separately. Only limits available for current move style of the camera are applied after node execution.

  • Improved AA rendering.

    Scheme of rendering post-processing effects has been changed. It increases performance and quality of the anti-aliasing.

  • New experimental environment lighting algorithm for scenes with Cycles materials.

    Materials with Glossy BSDF and Diffuse BSDF nodes automatically enable environment lighting, which takes into account roughness of the glossy component.

    New algorithm requires WebGL 2.0 or WebGL 1.0 with available extension EXT_shader_texture_lod for correct work.

  • Optimized rendering of reflections.

    Cube reflections for scenes with no reflexible objects has been optimized. Now in such scenes the sky is used for reflections directly without redrawing for each individual reflective object.

  • Support for camera loading.

    From now on it’s possible to load additional cameras to the scene using dynamic loading feature.

  • Physics API improvements.

    Added set_angular_velocity. It allows to set object’s angular velocity.

Changes
  • The “pivot” setting in the “params” parameter for the target_setup method has been made optional.
  • The Material API was improved to provide more clear messages in the browser console in case of errors. Also two methods have been added: is_node_material and is_water_material.
  • Sequential video fallback for video textures isn’t applied anymore in MS Edge due to the native support for HTMLVideoElement.
Fixes
  • Fixed incorrect rendering of materials with normal mapping.
  • Fixed VR code snipped.
  • Fixed keyboard events when the engine is working inside an iframe.
  • MSAA is disabled from now on for Adreno 4xx/5xx GPUs to prevent some rendering bugs.
  • Fixed translating/rotating of non-active cameras.
  • Fixed getting coordinates for mouse/touch events via the get_coords_x and get_coords_y methods.
  • Fixed bug with looped speakers that couldn’t be stopped in Firefox after calling the stop and the play methods sequentially.
  • Fixed sky redrawing after world node material parameters change.
  • Removed auto applying modifiers for objects with the Array modifier.
  • Fixed rendering artifacts for the transparent node materials in Firefox under Linux.
  • Fixed applying a node material animation after material inheritance.
  • Workers were disabled for physics simulation in IE11 and MS Edge to improve physics stability.

GameDev News

29. June 2017


In this section of our Bowling with Game Engines series, we will be implementing our bowling game in Unity. The idea is straight forward, implement the same simple 3D game across a number of game engines.  The Unity game engine is a logical place to start, as it is perhaps the most popular game engine in use today.  We will go step by step through the process of creating our game, both in text as well as a video version available here.   I am not a regular Unity user, so please do keep in mind, a lot of what I am about to show may not be best practice!  All of the assets used in this tutorial are available for Patreons as part of the bowling game kit, along with project files and this document in PDF form.  Don’t worry, these aren’t needed to follow along.

Let’s jump in.  Fire up Unity and create a new project.  In this example I am using Unity 5.6.1, however any recent version should work.


First, let’s start by dragging all of our required assets into Unity.  Simply select all of the game assets you will be using (FBX models, textures, audio files) and drag and drop them from Explorer or Finder into the assets folder.  If you are using the Patreon assets, simply copy the contents of Raw Assets in the Unity project folder.

clip_image002[4]


Unity does an extremely good job of importing assets and you should require no additional steps.  We now have all of the assets we are going to need to create our game, let’s get started.




Creating the Title Screen


First, we are going to start by creating a simple title screen with some awful looping background music.  We will be using our default scene for the splash screen and later we will create another scene for our actual gameplay.  We start off by saving our untitled scene.  Simply select File->Save Scene As…

clip_image004[4]

I saved it as TitleScreen. You should now have a new item in your assets list:

clip_image006[4]


We now have a few setup tasks to take.  We are going to be showing our title image and this requires us to alter the Main Camera entity. In Hierarchy panel select Main Camera, then in Inspector we change Clear Flags to Don’t Clear.

clip_image008[4]

This causes our camera to no longer have perspective ( things aren’t drawn smaller the farther away they get from the camera ).  Generally an Orthographic camera is what you use when working in 2D in a 3D world. Setting Clear Flags to don’t clear simply causes the default skybox to not be drawn, we could have optionally defined a background clear colour if we preferred. 


Now in Hierarchy panel, click the Create button, select UI->Canvas.  Next, with the newly created Canvas selected, click Create again and this time select UI->Panel.  At this point we should have this hierarchy.

clip_image010[4]


Next we have to make a slight modification to our imported Titlescreen image.  Select the Tilescreen.png image file in the assets view, then in Inspector change Texture Type to Sprite (2D and UI).  Then scroll down in the Inspector and click the Apply button.

clip_image012[4] 


Next select Panel in the Hierarchy view, and drag our newly created Sprite over to the Source Image section in the Image (Script) section.

clip_image014[4]


If you press Play now, you should see your Title screen in the viewport.

clip_image016[4]


Now let’s add a looping music file to our title screen.  In the Hierarchy view, select the Canvas entity.  Then in inspector scroll down and click Add Component, then Audio->Audio Source.

clip_image018[4]


In the newly created Audio Source in Inspector, drag our imported audio file over to the audio clip section.  Down below, make sure Play on Awake is set and then tick the box next to Loop.

clip_image020[4]


Ok, we now have a title screen and a sound track playing!  Good work so far… now let’s add a simple script that changes scenes on click. Let’s create our script.  Right click in the Assets area, select Create-> C# Script.

clip_image022[4]


Name it PanelScript.cs.

clip_image024[4]


Double click the newly created script file and it will open in your editor of choice.  Now enter the following code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class PanelScript : MonoBehaviour {

   // Use this for initialization
   void Start () {
      
   }
   
   // Update is called once per frame
   void Update () {
        if (Input.GetMouseButtonUp(0))
            SceneManager.LoadScene("GameScene");
    }
}


Here we are simply checking every single pass through the game loop if the Left (0th) mouse button (or touch) is clicked, and if it is, we load the scene named “GameScene”.


Hmm… guess we should make a scene called GameScene now shouldn’t we?  Once again right click the Assets panel, then select Create->Scene.

clip_image026[4]


Rename the newly created Scene to GameScene.

clip_image028[4]


We are now done with our title screen scene.  Make sure you save.  Before we open our newly created GameScene, we have one last step to perform.  In the File menu, select Build Settings…, then select Add Open Scenes.

clip_image030[4]


Now double click our newly created GameScene to open it up.  If prompted to save, do so.  Now it’s time to create our game!


Click here to continue to part two!

Programming , , ,

29. June 2017

Click here for Part One

Creating the Game Scene


Now it’s time to get to work on creating the game itself.  Start off by dragging BowlingLane into the scene.

clip_image002


Now move the lane so it’s at position (0,0,0) in the Inspector under the Transform component.

clip_image004


One thing I noticed is the Normal map is way too strong.  Select the Bowling Lane material (either in the Materials panel, or drill down to it).  Dial back the Normal Map strength from 1.0 to 0.2.

clip_image006


We are almost done with our bowling lane.  The final thing we need to do is add a Collision Shape to it, so the rest of the stuff in our game world will interact with it properly.  With the BowlingLane selected, click Add Component->Physics->Box Collider

clip_image008


The nice thing with Unity is, it will automatically shrink wrap the collider geometry to match your mesh, so you should have to do no additional work!

clip_image010


So, that’s it for the lane, now time to create the Bowling pins.  Simply drag the Bowling Pin into the scene:

clip_image012


Hmmmm… pretty dark. What’s going on here?  Well, right now we are getting our lighting from the Directional Light in our scene.

clip_image014


We don’t want to mess around with advanced lighting, so instead right click and get rid of it. Now lets set up Ambient lighting instead.  Select Window->Lighting->Settings

clip_image016


Change Environment Lighting->Light Source to Color, then select the Ambient Color as white:

clip_image018


Now our scene will have universal consistent lighting:

clip_image020


Now it’s time to add some physics to our pin.  Once again we have to make a collision object component, but we also need to create a RigidBody component.  Add a Box collider just like before.  Then add another Component and select Physics->Rigidbody

clip_image022

The default settings are about right, so there is nothing else we need to do here.


The final thing we need to do with our pin is apply a tag to it so we can locate it using code later. With the Pin selected, in the Inspector at the top drop down the Tag drop down and select Add Tag…

clip_image024


Click the + Icon, then in the resulting text box enter “Pin” then Save.

clip_image026


Now select the Pin again, and in the Tags list, select Pin which should now be an option.

clip_image028


Now we simply need to create 4 ( or 9… depending your bowling preferences ) clones of our pin. Select the BowlingPin in the scene graph, right click and select Duplicate.  This will create a copy with all of the settings and components defined. 

clip_image030


After duplicating, position the pin and repeat the process until you have enough pins.

clip_image032


Click here to continue to part three.

Programming , , ,

Month List

Popular Comments