3. March 2015

 

With GDC on, after Unreal’s announcement I think this will come as a surprise to absolutely nobody…  Unity 5 is here and it now has a new, more indie-friendly license.

 

Here is the release from their blog:

 

Unity 5 is here. For everyone.

Today is the big day. We’re launching Unity 5 globally.  Today.  Yes, you can all download it now.

There are literally over a thousand improvements in Unity 5 that we’d love to talk about.  My quick blog today is not the place to do that.  This note is being posted just as I go on stage to officially launch Unity 5 at GDC in San Francisco.  We’re live streaming the launch and you will see Joachim, Ralph Hauwert, Todd Hooper, Will Goldstone go deeper on the technical upgrades in Unity 5.0.  You will also see David, of course!  And, there will be a few ‘guests’ from the industry on stage to talk about Unity 5 in their own words.  Visit our website at Unity3d.com for the latest details and explanations.  Also — Joachim will post some thoughts later this week once he gets through the craziness of the start of GDC.

Watch the launch event live right here:

 

 

While I can’t get into all the technical detail on Unity 5 in a short post, I do want to share with you the big ideas that we think define Unity 5.

  1. It is a graphics powerhouse capable of rendering beautiful, complex and detailed scenes.

  2. The highly extensible and feature rich editor is now 64-bit and is even more robust than ever with additions like our huge suite of integrated audio design tools*.  (* full multi-track audio mixer.  very cool.)

  3. Unity’s industry leading multiplatform support grow with WebGL and improves with better console platform support and the introduction of IL2CPP.  Unity now supports 21(!) platforms.

  4. With the launch of Unity 5, we are launching Unity Cloud Build which is providing an option to developers to boost their productivity and efficiency through the cloud. You can learn more about Unity 5 here.

The business model…. one of the big questions for everyone.  We’re evolving the best licensing model in the business into something even better. We’re adding value and power so that everyone has the creative freedom they need to succeed.  Before I describe our pricing model, I want to take a moment and describe the philosophy behind the new pricing. I know I am on tricky ground in describing pricing philosophically.  For many, I am sure you’d rather just see the numbers.  Here goes.  First, know that our pricing for Unity 5 is as much about Unity and our values at Unity as it is about anything else. This is entirely different than with any company I have worked with in my life.  We did not start with setting a profit goal and working backwards.  We started with two goals and worked forward to our developers.

Goal #1 — One of the founding principles of Unity is the idea that we work hard to solve very hard technical problems so our developers / users won’t have to.  For this to be at all relevant, our best tools need to be a great value.

Goal #2 — Deep in Unity’s culture is the principle of Democracy. The goal is to price in such a way as to reflect our principles.  Democracy is the principle we were founded on, and it means we do our best to put Unity in the hands of developers, Indies or Pros, that may not have the resources to pay for it.  Its about enabling most everyone to create with the best tools we can make.  I won’t get too soppy in this post — but is is an honor for me to work in a company so mission driven and principled.

So, on to the pricing model.  We have two.

Unity 5 Professional Edition

With Unity 5 Professional Edition, we’re adding incredible value for teams of all sizes.  Unity 5 Pro will have same starting price point as with Unity 4 Pro, at  $75/month subscription or $1500 perpetual. Pro customers get all the power of Unity 5 plus:

  • Team License

  • Unity Cloud Build Pro (12-month subscription)

  • Unity Analytics Pro (currently in beta)

  • Game Performance Reporting (currently in preview)

  • Asset Store Level 11 (a new collection of free assets available each month)

  • Access to previews and betas

  • No revenue limit, no revenue share

We think this is a huge value.  Unity 5 Pro provides a huge upgrade from Unity 4, and it comes with a bunch of extra services and a team license, all for the base pricing of Unity 4.  Inflation gone backwards… or, put another way, better value than ever before.

Unity 5 Personal Edition

Democracy is something we believe in. It’s in the DNA of those that work at Unity. It’s one of the things that drew me to the company. It’s also one of the things that is most important to the games industry. So with that in mind, we are launching Unity 5 Personal Edition. Unity 5 Personal Edition provides all the power of Unity 5 engine and editor. To clarify — this is important — it is the same Unity 5 engine and editor as in the Pro Edition.  It comes with all the features including  Profiler, Occlusion Culling, Render-to-Texture, and Post-Processing Special Effects as well as all the big Unity 5 features like Physically-based Shading, Enlighten, reflection probes and much more.

Unity 5 Personal Edition is free.  No royalty.  Free.

Unity 5 Personal Edition is for professional developers, Indies, hobbyists and studios with revenue under $100,000 and funding under $100,000.

You can see a full comparison of the licenses here.

Download Unity 5, play with it, experiment with it, and create something beautiful and lasting.

Today is a big day.  I hope you are as excited about it as we are at Unity.

John Riccitiello

 

So what exactly does the new license mean? Well for small time developers it's absolutely awesome. Unity Personal edition is basically the exact same product as Pro now, except completely free.  What’s the catch?

 

Well, maximum revenue AND funding of $100,000.  Over that and you need to buy the Professional edition.  So essentially, if you are profitable or well funded, you need the pro version.  If not, it costs not a cent and you get the full version, free.  Not free plus royalties… free.  Up to 100K.

 

There are a couple catches though…  probably the biggest deal is you will have a Unity splash screen on startup.  You don’t have access to the team server, cloud builds and pro analytics tools, but for most people that should be a non-factor.

 

All told, it’s a pretty sweet day to be a game developer!

Programming

2. March 2015

 

Along with the Maya LT release Autodesk also teased a bit about their upcoming game engine Stingray.  You may recall sometime back that Autodesk acquired a company called Bitsquid that were working on a light weight, cross platform C++ game engine.  However since that announcement we have heard absolutely nothing.  Considering their importance to the content creation market place, you’d think Autodesk entering the game engine market ( well, other than Scaleform that is… ) would be a big deal.

 

Well now, after almost a year of silence, some details have emerged with more coming this week at GDC.  The Bitsquid engine is now Stingray.  Granted, details are still pretty sparse.  Here’s what we’ve got so far:

On Wednesday, March 4, from 3:30 - 4:30 p.m. in Moscone Convention Center, West Hall, Room 3003, Autodesk is hosting an exclusive tech preview of its Stingray Game Engine. Built using the core technology behind the Bitsquid engine acquired last summer, Stingray is currently in development and comprises intuitive, powerful tools that make it easier for professional and novice developers to bring graphically advanced games to market on a wide range of platforms. 

“Bitsquid has been a part of the Autodesk family since the acquisition last summer, and both teams have been hard at work to update, improve and add features to the engine,” said Martin Wahlund, CEO, Fatshark. “We are excited to announce that we are actually using the new Stingray engine to build our upcoming ‘Warhammer: End Times - Vermintide’ game.” 

The technical preview at GDC will highlight several core areas of focus that make it easier for game makers of every level create the next generation of blockbusters. Autodesk will give a live demonstration of several key advances it has made in Stingray such as: 

- Simultaneous Platform Deployment: A live link between Stingray and multiple target devices allows game designers to evaluate their games simultaneously on multiple platforms; 
- Integrated Workflow: A more efficient pipeline to export 3D content; 
- Modern Data-Driven Architecture and Powerful Rendering Capabilities: A data-driven core architecture makes it easier for a user to change the look of a game without having to rewrite and re-compile the engine.


As I said earlier, Autodesk entering the game engine market could certainly be a big deal.  Of course there are far too many unknowns  ( like for starters… pricing ) to get too excited yet.  There is a teaser video available, but it tells you absolutely nothing:

If you are interested in beta testing, you can sign up here.

News, Programming

27. February 2015

 

In this tutorial, we look at animating sprites using the Animation class.  We look at loading sprites two different ways.  First creates them by splitting up a Texture loaded into memory.  The second example uses a texture atlas.  As always the code is provide below.

 

You can watch the video in HD here.

 

 

The Source

 

Example 1:

package com.gamefromscratch;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class AnimationDemo extends ApplicationAdapter {
   SpriteBatch batch;
   Texture img;
   TextureRegion[] animationFrames;
   Animation animation;
   float elapsedTime;
   
   @Override
   public void create () {
      batch = new SpriteBatch();
      img = new Texture("walkcycle.png");

      TextureRegion[][] tmpFrames = TextureRegion.split(img,256,256);

      animationFrames = new TextureRegion[4];
      int index = 0;

      for (int i = 0; i < 2; i++){
         for(int j = 0; j < 2; j++) {
            animationFrames[index++] = tmpFrames[j][i];
         }
      }

      animation = new Animation(1f/4f,animationFrames);
   }

   @Override
   public void render () {
      elapsedTime += Gdx.graphics.getDeltaTime();
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
      batch.begin();
      batch.draw(animation.getKeyFrame(elapsedTime,true),0,0);
      batch.end();
   }
}

 

Example 2:

package com.gamefromscratch.com;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;

public class TextureAtlasAnimationDemo extends ApplicationAdapter {
   SpriteBatch batch;
   private TextureAtlas textureAtlas;
   private Animation animation;
   private float elapsedTime = 0f;
   
   @Override
   public void create () {
      batch = new SpriteBatch();
      textureAtlas = new TextureAtlas(Gdx.files.internal("spritesheets/myspritesheet.atlas"));
      animation = new Animation(1f/15f, textureAtlas.getRegions());
   }

   @Override
   public void dispose() {
      batch.dispose();
      textureAtlas.dispose();
   }

   @Override
   public void render () {
      elapsedTime += Gdx.graphics.getDeltaTime();
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
      batch.begin();
      batch.draw(animation.getKeyFrame(elapsedTime,true),0,0);
      batch.end();
   }
}

Programming , , ,

23. February 2015

 

Until this point in the series we have only created single scene games.  In any non trivial application you are often going to want to have several scenes make up your game.  For example you might have a scene for your title screen/intro, then a main menu, then a game playing then finally a game over scene.  Today we are going to look at how to do exactly this.  We are also going to look at sharing information between those scenes.

 

This scene is available as an HD video here.

 

Creating Multiple Scenes

 

First and foremost, you always need to have at least one scene to start up.  Let’s go ahead and create one, the Title screen seems logical enough.  Create a scene that draws a simple graphic, called it “title_scene.scn” and set it as your startup scene.  If you are unfamiliar with this step, please see prior tutorial parts.  Once complete it should look something like this:

image

 

Next we want to create a scene to transition to.  I called mine game.scn.  It may not be completely obvious, but you actually close your scene to create the new scene.  Select Scene->New Scene:

 

Then say yes to the scary dialog that pops up ( of course, we assume you’ve saved your scene and set it as the startup scene already! ):

image

 

Now in the second scene, I just created a simple Panel, with a pair of label controls, like so:

image

 

It doesn’t really matter what you do.  The labels are just to show that information can be shared between Scenes.  Our game isn’t actually going to do anything.

 

 

Ok… so now we have our two scenes… how are we going to wire them all together?  Well that requires a script.  Re-open the title_scene.scn scene.  There is a handy Open Prev Scene menu option, or you can use open Scene…

image

 

Adding a Script to control scene switching

 

Now that we have our original scene selected, we need to add a script to it.  To do this, switch to the Resources tab and select the New Resource icon:

image

 

For type select GDScript:

image

 

I named mine ‘global.gd’.

 

Now we write out our script.  We are going to be auto loading this as a node into our game when our application starts, so we need to inherit from Node or a Node derived class.  In my case I used node.  You can inherit a class using the extends keyword.

 

Here is the code for our simple Node script.  We create a function so scenes can switch between scenes, and demonstrate getting a session variable, as well as setting a global variable.

extends Node

#The currently active scene
var currentScene = null

#just some data for our game.  It could be HPs, Alignment, Direction, etc...
var PlayerName = "Mike"


func _ready():
   #On load set the current scene to the last scene available
   currentScene = get_tree().get_root().get_child(get_tree().get_root().get_child_count() -1)
   #Demonstrate setting a global variable.
   Globals.set("MAX_POWER_LEVEL",9000)
   
# create a function to switch between scenes 
func setScene(scene):
   #clean up the current scene
   currentScene.queue_free()
   #load the file passed in as the param "scene"
   var s = ResourceLoader.load(scene)
   #create an instance of our scene
   currentScene = s.instance()
   # add scene to root
   get_tree().get_root().add_child(currentScene)
   
   
#simple accessor function to retrieve playerName   
func getPlayerName():
   return PlayerName

 

Autoload script on startup

 

Be sure to save your newly created script.  Now we want to set it so that this screen runs automatically when our game is started.

To do this, go to Scene->Project Settings.

In the resulting dialog, you want to select the AutoLoad tab.  Now you specify the script you want to autoload, and the name you want the node to be known as.  This is case sensitive by the way.

In path, select your newly created global.gd.  In Node Name call it globals then click Add:

image

 

Now this script will be run automatically when your game or application starts up!

 

Now that we can switch scenes, let’s make us of this ability.  In your title_scene.scn project, attach a script to the image you used.  Personally I used a TextureFrame to hold my title screen.    We are simply going to check for the user pressing the left mouse button, and if they do, we are going to switch scenes.

extends TextureFrame


func _ready():
   set_process(true)
   
func _process(delta):
   if(Input.is_mouse_button_pressed(BUTTON_LEFT)):
      get_node("/root/globals").setScene("res://game.scn")

 

As you can see you can access the script by getting it as a node using the name you provided in the AutoLoad dialog.  Once again this value is case sensitive and you have to include the /root/ part. 

 

So, once we click our title image, it should load our other scene.  Let’s add a bit of logic to it.  Load the game.scn ( yes, I wish their was a project mode that prevented this switching between scenes stuff… ), attach a script and add the following code:

extends Panel


func _ready():
   var name = get_node("/root/globals").getPlayerName()
   get_node("Label").set_text(str(name, " is the greatest player ever!"))

   var powerLevel = Globals.get("MAX_POWER_LEVEL")
   get_node("Label2").set_text(str("Maximum power level is ", powerLevel))

 

This code illustrates too simple concepts... calling a global instance ( Singleton in Godot parlance btw ), such as setScene() or getPlayerName() or calling a global variable. Both methods make it very easy to share data between various scenes, escentially forming the backbone of your application.

 

The Video

 

Programming , ,

20. February 2015

 

This tutorial is available as an HD video here.

 

In this tutorial we are going to look at the UI aspects of the Godot game engine.  If you have prior experience with other game engines, you will probably be shocked by the number of UI widgets and containers that ship with Godot.  While many of these controls would never be used in a game, they are absolutely invaluable for creating tools.  Of course they are also great for making games, making implementing your UI a breeze.

 

Using Controls in Godot is just like using any other Node, although the relationship between them is where things vary the most.  Let’s take a quick look at what’s included:

image

 

All controls inherit from Control, which in turn inherits from CanvasItem, which allows it to be drawn on screen.  At the end of the day there are three categories of Controls: UI Wdigets, Containers and Popup Windows.  The containers are controls that contain other controls.  Quite often they will automatically arrange their contents for you.  Popup Windows are exactly that, dialog boxes you can display for things like messages, file selection, etc.  Then there is everything else…  these are the various widgets you can use in your application, things like Buttons, Labels and even video players.

 

Your First GUI Application

 

Let’s jump right in, show how controls work and the relationship between containers and controls.  We are going to create a simple menu where our controls are automatically laid out vertically.

 

Start out by creating a VBoxContainer, which is a box of controls that automatically arranges it’s children vertically.

Create a VBoxContainer Node:

image

 

Size it somewhat centered on your screen, like so:

image

 

Now in the Scene tab, make sure VBoxController is selected and create a new node:

image

 

Select MenuButton:

image

 

Repeat a couple times so you have multiple buttons.  Your scene hierarchy should look like this:

image

 

Next select MenuButton and in the Inspector set the Text:

image

 

You can set a number of properties that control the button’s appearance.  Keep in mind, like all other nodes in Godot, the Control inherits positional information from it’s parent container.

 

As you add text to your controls, you can see that the container automatically aligns them vertically within:

image

 

Now, what if you want to expand the labels to use the entire space available within the parent control?  That can easily be accomplished too.  For each button, go into the Inspector and drop down the Vertical setting and make sure Expand is selected:

image

Now you should see the menu laid out like this:

image

 

You may find the Font to be laughably small… so lets quickly create a new font.  We covered this in the past but a quick recap.  Select Import->Font:

image

 

Select a ttf file and save it as a fnt file, like so:

image

 

Now you can the font of each menu item using the Load option of Custom Font in the Inspector with a Button selected, like so:

image

 

After setting the font, sizes should change automatically, like so:

image

 

You need to perform this task for each Button… or…

 

Using a Theme

 

Godot has limited theming support, but in reality that mostly just means you can set a common font.  Select the VBoxContainer, locate Theme and create a new one:

image

 

Now drop it down again and select Edit:

image

This will now bring you to the theme editor window, which contains a preview of how your theme looks with various controls:

image

 

In the Inspector, select Theme->Default Font and load our font:

image

 

When happy with your theme, select Save Resource button:

image

 

Save it as a .thm file:

image

 

Now all of the controls in your container should be updated ( You may have to load the theme again using Theme->Load ):

image

 

Connecting Code to your Control

 

Now that we have our controls wired up, lets go ahead and wire them up to do something. 

 

First lets attach a script to our container.  In the Scene tab, select the VBoxController and click the new script button:

image

 

Create it using whatever settings you wish, like so:

image

 

Now select your first MenuButton and click the Connections button:

image

 

Select Pressed, then press the Connect button:

image

 

Make sure the container is selected, then press Connect:

image

 

This will create a method named _on_MenuButton_pressed in the VBoxContainer script.

 

Now edit your code like so:

image

 

Now run your game and you should see:

image

 

And if you click the first button you should see:

image

 

There are several more controls available, but the basic process of using them is nearly identical so I wont go into it.  For more details on laying out controls or more examples ( such as using pop-ups and Bitmap buttons ), be sure to watch the video tutorial as well!

 

The Video Version

 

Programming ,

Month List

DisqusCommentsSummary