Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
17. March 2014

 

A pretty common journalistic practice is the news embargo.  Basically a number of journalists are given advance access to information and a date which is the earliest time they can reveal that information.  Everyone once in a while someone jumps the gun and breaks the embargo; often by mistake, sometimes on purpose.  Often when you see a new story pop up, followed a little while later with a 404 error this is what happened.  They released early and got a take down notice.

 

Right now, with the GDC going on, it’s a common time for game dev related news releases, so this one makes sense.  Polygon seems to have done just that, although the link is now dead, this reddit post caught the news and posted this cached link.  As they say, the cat is now out of the bag.  Why people say that and why they are stuffing cats in bags in the first place I’m not exactly sure.  Anyways, here is the text of what was announced:

 

Unity 5 — billed as "a massive update" to the multiplatform game engine and toolkit — was unveiled today at Game Developers Conference 2014.

Unity Technologies, makers of the suite, said Unity 5 will overhaul the game's audio toolset and deliver upgraded lighting and and a physically based shader system. It now is a 64-bit engine with this release, Unity Technologies added.

Of note, Unity 5 will also include the launch of a cross-promotion neetwork for mobile games called Unity Cloud, "enabling mobile game developers to run full-screen interstitial ads in their mobile games, as well as exchange ad units with other Unity developers."

The last full version, Unity 4 launched two years ago. Unity supports development on all mobile OSes, plus Windows, MacOS and Linux, the PS3, PS Vita, Xbox 360 and Wii U. Games developed with Unity range from acclaimed indie titles like Gone Home, to mobile hits like Temple Run, to the upcoming Wasteland 2 on PC.

 

Of course it is all pure speculation at this point, so except more details to emerge.  Or of course this could all turn out to be completely bunk.  In some ways I am kinda hoping it’s bunk as that’s a pretty underwhelming list for a major release.  A .5 release I could see, but not a full revision.  Improved audio tooling is nice and I am certain 64bit support will appeal to some but… it’s just so blah.


15. March 2014

 

MakeHuman started life in 1999 as a Blender plugin named MakeHead, a plugin for procedurally creating head meshes.  In 2000 the first version of MakeHuman was released.  In 2005 it was turned into a stand alone application. Today we seem a major milestone release of MakeHuman 1.0.0!

 

So what exactly is MakeHuman?  It’s an application for generating human models.  Most impressively it generates very clean, fully rigged, quad only, Mudbox/zBrush ready models using 1170 controllable morph targets.  If you’ve ever played a video game that allowed you to fully customize your character, you have an idea what MakeHuman provides.  The major difference is MakeHuman generates a model ready for use in major 3D applications.  In many ways it is very similar to the application Poser.

 

image

 

Oh yeah, did I also mention it was completely free and open source?

 

Now for a couple key links. 

You can download MakeHuman here.

The source code is available here.

You can access the current buglist here.

The 1.0.0 press release is available here (and repeated below).

 

So why should you as a game developer care?

Well first of all, it is about one of the easiest ways to create game ready human assets.  Speaking of game ready, you also have the ability to create game appropriate rigs:

image

 

Perhaps most importantly, the resulting mesh is both clean and relatively low polygon ( unless of course you choose the smooth option ).  Here is an exported mesh opened in Blender:

image

All told its about 24K quads as currently configured.  The mesh is and ampature are both logically laid out (with clothing all as separate meshes) and ready for use:

image

 

If you need a human model for your game, you really have nothing to lose checking out MakeHuman.

 

Press release:

Art News


11. March 2014

 

We are going to look at networking for your LibGDX application.  Networking in LibGDX is relatively primitive, supporting only socket communications.  In many cases though, that’s more than enough.  We are going to implement a very simple socket based chat application.  The code is heavily commented, so the discussion will actually be pretty sparse.  If I missed something please leave a comment and I will do my best to address it.

 

Alright, let’s jump right in with the code:

package com.gamefromscratch;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Net.Protocol;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.net.ServerSocket;
import com.badlogic.gdx.net.ServerSocketHints;
import com.badlogic.gdx.net.Socket;
import com.badlogic.gdx.net.SocketHints;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.TextArea;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;

public class Networking implements ApplicationListener {
    private OrthographicCamera camera;
    private SpriteBatch batch;
    private Skin skin;
    private Stage stage;
    private Label labelDetails;
    private Label labelMessage;
    private TextButton button;
    private TextArea textIPAddress;
    private TextArea textMessage;
    
    // Pick a resolution that is 16:9 but not unreadibly small
    public final static float VIRTUAL_SCREEN_HEIGHT = 960;
    public final static float VIRTUAL_SCREEN_WIDTH = 540;
    
    
    @Override
    public void create() {        
        camera = new OrthographicCamera(Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
        batch = new SpriteBatch();
        
        // Load our UI skin from file.  Once again, I used the files included in the tests.
        // Make sure default.fnt, default.png, uiskin.[atlas/json/png] are all added to your assets
        skin = new Skin(Gdx.files.internal("data/uiskin.json"));
        stage = new Stage();
        // Wire the stage to receive input, as we are using Scene2d in this example
        Gdx.input.setInputProcessor(stage);

        
        // The following code loops through the available network interfaces
        // Keep in mind, there can be multiple interfaces per device, for example
        // one per NIC, one per active wireless and the loopback
        // In this case we only care about IPv4 address ( x.x.x.x format )
        List<String> addresses = new ArrayList<String>();
        try {
            Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
            for(NetworkInterface ni : Collections.list(interfaces)){
                for(InetAddress address : Collections.list(ni.getInetAddresses()))
                {
                    if(address instanceof Inet4Address){
                        addresses.add(address.getHostAddress());
                    }
                }
            }
        } catch (SocketException e) {
            e.printStackTrace();
        }
        
        // Print the contents of our array to a string.  Yeah, should have used StringBuilder
        String ipAddress = new String("");
        for(String str:addresses)
        {
            ipAddress = ipAddress + str + "\n";
        }
        
        // Now setupt our scene UI
        
        // Vertical group groups contents vertically.  I suppose that was probably pretty obvious
        VerticalGroup vg = new VerticalGroup().space(3).pad(5).fill();//.space(2).pad(5).fill();//.space(3).reverse().fill();
        // Set the bounds of the group to the entire virtual display
        vg.setBounds(0, 0, VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT);
        
        // Create our controls
        labelDetails = new Label(ipAddress,skin);
        labelMessage = new Label("Hello world",skin);
        button = new TextButton("Send message",skin);
        textIPAddress = new TextArea("",skin);
        textMessage = new TextArea("",skin);

        // Add them to scene
        vg.addActor(labelDetails);
        vg.addActor(labelMessage);
        vg.addActor(textIPAddress);
        vg.addActor(textMessage);
        vg.addActor(button);
        
        // Add scene to stage
        stage.addActor(vg);
        
        // Setup a viewport to map screen to a 480x640 virtual resolution
        // As otherwise this is way too tiny on my 1080p android phone.
        stage.setViewport(VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT,false);
        stage.getCamera().position.set(VIRTUAL_SCREEN_WIDTH/2,VIRTUAL_SCREEN_HEIGHT/2,0);
        
        // Now we create a thread that will listen for incoming socket connections
        new Thread(new Runnable(){

            @Override
            public void run() {
                ServerSocketHints serverSocketHint = new ServerSocketHints();
                // 0 means no timeout.  Probably not the greatest idea in production!
                serverSocketHint.acceptTimeout = 0;
                
                // Create the socket server using TCP protocol and listening on 9021
                // Only one app can listen to a port at a time, keep in mind many ports are reserved
                // especially in the lower numbers ( like 21, 80, etc )
                ServerSocket serverSocket = Gdx.net.newServerSocket(Protocol.TCP, 9021, serverSocketHint);
                
                // Loop forever
                while(true){
                    // Create a socket
                    Socket socket = serverSocket.accept(null);
                    
                    // Read data from the socket into a BufferedReader
                    BufferedReader buffer = new BufferedReader(new InputStreamReader(socket.getInputStream())); 
                    
                    try {
                        // Read to the next newline (\n) and display that text on labelMessage
                        labelMessage.setText(buffer.readLine());    
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }).start(); // And, start the thread running
        
        // Wire up a click listener to our button
        button.addListener(new ClickListener(){
            @Override 
            public void clicked(InputEvent event, float x, float y){
                
                // When the button is clicked, get the message text or create a default string value
                String textToSend = new String();
                if(textMessage.getText().length() == 0)
                    textToSend = "Doesn't say much but likes clicking buttons\n";
                else
                    textToSend = textMessage.getText() + ("\n"); // Brute for a newline so readline gets a line
                
                SocketHints socketHints = new SocketHints();
                // Socket will time our in 4 seconds
                socketHints.connectTimeout = 4000;
                //create the socket and connect to the server entered in the text box ( x.x.x.x format ) on port 9021
                Socket socket = Gdx.net.newClientSocket(Protocol.TCP, textIPAddress.getText(), 9021, socketHints);
                try {
                    // write our entered message to the stream
                    socket.getOutputStream().write(textToSend.getBytes());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        });
    }

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

    @Override
    public void render() {        
        Gdx.gl.glClearColor(0.5f, 0.5f, 0.5f, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        batch.setProjectionMatrix(camera.combined);
        batch.begin();
        stage.draw();
        batch.end();
    }

    @Override
    public void resize(int width, int height) {
    }

    @Override
    public void pause() {
    }

    @Override
    public void resume() {
    }
}

 

And when you run the code you should see:

image

 

The top two values are the IP v4 addresses of the machine you are running on.  You need to enter these in the other copy of the application you want to chat with.  This address uniquely identifies your machine on the internet, while we specified the port (9021) using code.  Think of a port like a mailbox at an apartment building.  The street address of the building is comparable to the IP address, while PORT is akin to the apartment number.  Port values go from 1 to 65,536, although several are reserved.  Most of the reserved ports are > 100, so when picking a port for your application look up to see if that address is a dedicated port ( such as 80 for HTTP communication, or 21 for FTP ), or simply pick a random high value.  Your machine can have multiple addresses, one per network adapter and possibly more, especially if you run virtualization software like VMWare.  Then there is the value 127.0.0.1, this is a special address known as a loop back adapter, and address that points back at itself.

 

Where it currently says “Hello World”, this is where any incoming messages will be displayed.

 

In the first textbox, you enter the IP address of machine you want to send a message to.  In this example, you can actually send a message to yourself, simply enter your own IP address.  Finally the second textbox is the text of the message to send.  Of course you send the message by pressing the Send Message button.

 

One thing you may notice from the above example is I set it to run in the oddball resolution of 540x960.  Why did I do this?  For a couple reasons.  First, the native resolution of the phone I tested on ( HTC One ) is 1920x1080 and the default Scene2D Skin/Font are wayyyyyyyy too small at that resolution.  Of course I could have created a a new skin that was more appropriate but, well, I'm lazy.  The second reason is that resolution is a decent size and is the same aspect ratio as 1080p ( 16:9 ), so it scales well, both up and down, when displayed on a 16:9 screen.  On an iPad it’s going to look like absolute garbage.  Perhaps in the future I will do a post specifically about handling multiple device resolutions.

 

There is one more thing to be aware of, this example currently will not work on iOS.  The Scene2D TextField widget currently doesn’t bring up the iOS on screen controller.  There is a fix on the LibGDX contributions forum.  It’s an iOS specific hack/workaround, so I wouldn’t expect it to be merged into the main trunk.  Finally, LibGDX built in networking is fairly simple, limited to just socket programming.  For more robust networking support check out kryonet, it supported in LibGDX and is reported to work across all LibGDX platforms except HTML5.  Which isn’t really surprising, as the author Nathan Sweet is also a LibGDX contributor.

Programming


11. March 2014

 

From this post on reddit I have learned of the open sourcing of Sony’s game tool creation kit Authoring Tools Framework (ATF).  The ATF is a comprehensive .NET/C# based framework for creating game tools.  It has been used to create all kinds of tools for several shipped games including the level editor for Naughty Dog’s epic Last of Us.

 

In Sony’s own words:

Authoring Tools Framework (ATF) is a set of C#/.NET components for making tools on Windows. ATF has been used by most Sony first party game studios to make many custom tools such as Naughty Dog’s level editor and shader editor for The Last of Us, Guerrilla Games’ sequence editor for Killzone games (including theKillzone: Shadow Fall PS4 launch title), an animation blending tool at Santa Monica Studios, a level editor at Bend Studio, a visual state machine editor for Quantic Dream, sound editing tools, and many others. ATF has been in continuous development in Sony's Worldwide Studios central tools group since early 2006.

 

The license is Apache Version 2, which is a very liberal license with no GNU style conditions.

 

Sample Level Editor created using ATF

 

When I said comprehensive earlier, I meant it.  This is an incredibly well documented project.  There is a 75 page PDF DOM programming guide, a 30 page Getting Started PDF as well as a comprehensive online Wiki, including the ATF Programmer’s Guide.

 

The framework itself contains a number of classes.  It is provided as a Visual Studio 2010 project.  As you can see, ATF provides GUI components, Collada and Perforce support and more.  The core however is um… in Atf.Core, which provides the backbone of the framework itself.

 

image

 

From my quick scan, ATF appears to provide a game orriented MFC style document model.  It’s complex, it will take some time digging before I can fully appreciate what this framework provides.  However, to assist in that, there are a number of included samples:

image

 

Unfortunately, a few of them are missing, including probably the one you would be most interested in, LevelEditor.  Hopefully these get released in short order.

 

It is getting increasingly common to create games using C# and this toolkit should make the job a heck of a lot easier!  Very cool release Sony!

News


10. March 2014

 

Ever heard of FMOD?  As far as game libraries go, FMOD is perhaps one of the most ubiquitous libraries in existence.  It is a low level audio library and the question isn’t really who uses it, but who doesn’t.  FMOD is integrated into just about every game engine you can think of including CryEngine, Unity, Unreal, Trinigy and Source.  It has literally been used to create hundreds of games.  FMOD has always been available for free on free projects, but had a price tag for commercial releases.  Earlier today @FmodStudio made the following Tweets:

 

image

 

The link in question leads to this article on Gamasutra ( although oddly not their own site ).  The press release reads as follows:

Melbourne - 10th March, 2014 - Firelight Technologies announced today that its next generation audio tool suite, FMOD Studio, is now free for indie developers.  FMOD Studio has always been free for non-commercial projects, and from today it will also be free for commercial indie projects.

"We started out as an indie company so we've always felt an affinity with the indie community." said Firelight Technologies CEO Brett Paterson. "They're risk takers, innovators and explorers. We wanted to give back to that community and we can’t wait to see what they do with FMOD Studio."

Firelight Technologies recently released FMOD Studio 1.3 with new features specifically for indie developers:

·         Unity integration plug-in

·         Plugin SDK for creating sound generators and effects with examples on GitHub

These additions come on top of an industry-leading feature set that includes an intuitive and familiar UI, an all-in-one multi-track editor for interactive music and sound effects, and a full-featured mixing desk with dynamic mixer snapshots and control surface support, as well as supporting cross-platform authoring on both PC and Mac.

Since its release last year, FMOD Studio has already been used in a number of AAA titles, including Forza Motorsport 5, which recently won an IGN award for best audio on Xbox One. FMOD Studio is also proving to be popular with iOS and Android developers, with several unannounced titles due in the coming months.

 

So basically if you make less than 100,000K  ( at least I assume that is the case, budgets under 100K strikes me as odd wording ) you can use FMOD for free.  If you make over 100K, you should be able to afford it. Smile 

 

I'm loving how much more accessible game development tools are becoming!

News


GFS On YouTube

See More Tutorials on DevGa.me!

Month List