Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
23. November 2015

 

At the Android Developer Summit, Google just announced Android Studio 2.0 is available for download in preview form.  The two major new features will both be relevant for game developers, Instant Run which enables hot swapping of code on device and a GPU profiler, for profiling OpenGL ES code performance.

 

From the Android Developers blog:

Android Studio 2.0 Preview

Posted by, Jamal Eason, Product Manager, Android

One the most requested features we receive is to make app builds and deployment faster in Android Studio. Today at theAndroid Developer Summit, we’re announcing a preview of Android Studio 2.0 featuring Instant Run that will dramatically improve your development workflow. With Android Studio 2.0, we are also including a preview of a new GPU Profiler.

All these updates are available now in the canary release channel, so we can get your feedback. Since this initial release is a preview, you may want to download and run an additional copy of Android Studio in parallel with your current version.

New Features in Android Studio 2.0
Instant Run: Faster Build & Deploy

Android Studio’s instant run feature allows you to to quickly see your changes running on your device or emulator.

Getting started is easy. If you create a new project with Android Studio 2.0 then your projects are already setup. If you have a pre-existing app open Settings/Preferences, the go to Build, Execution, Deployment → Instant Run. Click on Enable Instant Run... This will ensure you have the correct gradle plugin for your project to work with Instant Run.

Enable Instant Run for Android Studio projects

Select Run as normal and Android Studio will perform normal compilation, packaging and install steps and run your app on your device or emulator. After you make edits to your source code or resources, pressing Run again will deploy your changes directly into the running app.

New Run & Stop Actions in Android Studio for Instant Run

For a more detailed guide setup and try Instant Run, click here.

GPU Profiler

Profiling your OpenGL ES Android code is now even easier with the GPU Profiler in Android Studio. The tool is in early preview, but is very powerful and not only shows details about the GL State and Commands, you can record entire sessions and walk through the GL Framebuffer and Textures as your app is running OpenGL ES Code.

Android Studio GPU Profiler

To get started, first download the GPU Debugging Tools package from the Android Studio SDK Manager. Click here for more details about the GPU Profiler tool and how to set up your Android app project for profiling.

Whats Next

This is just a taste of some of the bigger updates in this latest release of Android Studio. We'll be going through the full release in more detail at the Android Developer Summit (livestreamed on Monday and Tuesday). Over the next few weeks, we'll be showing how to take advantage of even more features in Android Studio 2.0, so be sure to check back in.

If you're interested in more Android deep technical content, we will be streaming over 16 hours of content from the inaugural Android Developer Summit over the next two days, and together with Codelabs, all of this content will be available online after the Summit concludes.

Android Studio 2.0 is available today on the Android Studio canary channel. Let us know what you think of these new features by connecting with the Android Studio development team on Google+.

 

I wonder how much of this functionality will be made available upstream to the IntelliJ IDE? 

GameDev News


18. November 2015

 

Microsoft is a different sort of company these days.  Starting back in 2014 they released the free community edition of Visual Studio.  Then in April of this year they launched the light weight and cross platform (and completely free) Visual Studio Code.  Today they announced the launch of Visual Studio Dev Essentials.

So what exactly does Dev Essentials include?

 

Tools

  • Visual Studio Community
  • Visual Studio Code
  • Visual Studio Express
  • Team Foundation Server Express

 

Of those products only Team Foundation Server is new I believe.  So mostly it’s a rebranding of the tools we’ve already got.  However it’s the add-ons that make the package.

 

Training

  • Pluralsight 6 month subscription
  • Xamarin University Mobile Training
  • WintellectNOW 3 month subscription
  • Microsoft Virtual Academy
  • HackHands Live Programming Help $25 Credit
  • Priority Forum Support

 

Cloud

  • Azure Credits ($25/month for 12 months)
  • Visual Studio Team Services account with 5 users
  • App Service Free Tier
  • PowerBI free tier
  • HackeyApp free tier
  • Application Insights free tier

 

For Mac Developers

  • Parallels Desktop Pro 3 months subscription
  • Parallels Acceess 3 months subscription
  • Windows Platform VM 60 days
  • Office Online Apps

 

Now many of these services are either limited time or coming soon, so not everything is available today and not everything is available for ever.  So if this program sounds interesting to you, head on over here for more information.

News GameDev News


15. November 2015

 

We already have motion controls, audio control and of course tactile control, what about controlling a game with your emotions?  It sounds far fetched but it really isn’t, in fact it’s here today.  Just about every single modern gaming device has a front facing camera available in some form or another.  Well, Microsoft Research lab Microsoft Project Oxford just announced the release of the emotion tool which enables you to detect emotions on a persons face.

 

Basically you send it a picture and it returns the probability of various emotions.  For example, I sent it this image here and it returned the following results:

image

 

Basically you feed it an image in URL form and optionally a rectangle selecting the face, and it returns a JSON result with the probability of each emotion.  In this case Microsoft determine with 99.99% likelihood that this baby is sad, with a 0.001% chance that it’s angry instead.  I fed it a handful of pictures and it did a remarkably accurate job.

 

You can use it as a REST API now ( or just play with the playground ) right here.  Otherwise the SDK can be downloaded here.

 

So the tech is actually here already and works pretty well.  The question remains… would gamers embrace having a camera constantly scanning their emotions?  I actually can think of a few genres or tools where they might.  How many “you mad bro?” apps can we expect to flood the market now? If nothing else, it’s a fun tool to play around with on a Sunday afternoon!

Programming Totally Off Topic


14. November 2015

 

CastleDB is a light weight database written in Haxe with data composed of sheets.  It makes storing structured data extremely simple, much like working with an Excel spreadsheet and much simpler than a traditional database.  The resulting data is stored in JSON making it easily used in almost any game engine or programming language.   Most interestingly you can treat 2D game levels just like any other data using the newly built in level editor.

 

There is an HD video version of this guide available here.  It covers mostly the same details as this tutorial but goes into a bit more depth of using the level editor.

 

Let’s first take a look at the database side of things.  Even without the level editing abilities, games are often in need of simple database services.  Simply download and extract the archive for your appropriate platform:

image

 

Then run cdb.exe.  The interface looks like this:

image

 

Start by creating a new sheet by clicking Create a sheet.  This is comparable to creating a new table in a database.

image

 

Simply name your sheet and click Create.

 

Next we add some columns to our newly created sheet, same basic process.

image

 

Next pick the column type.

image

 

Optionally tick Required if the field cant be left empty.

image

 

You could select List and link to another database creating complex relationships.  Now we can populate a a database using the “New Line” command.  Select a type like Sprite (Image) and the appropriate dialog is displayed.

image

 

Now save the cdb file somewhere and you can access the data with code relatively easily.  First create a source file with the following contents, the black magic that links your cdb file to haxe code.

package com.gamefromscratch.castledemo.db;
private typedef Init = haxe.macro.MacroType < [cdb.Module.build("new.cdb")] > ;

 

And now you can consume it like:

package com.gamefromscratch.castledemo;

import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.Lib;
import haxe.Resource;

import com.gamefromscratch.castledemo.db.MyData;
class Main 
{
	
	static function main() 
	{
		
		#if js
		MyData.load(null);
		#else
		MyData.load(haxe.Resource.getString("new.cdb"));
		#end
		trace(MyData.myDB.get(Lich).HitPoints);
	}
	
}

 

Pretty simple over all.  Now what was that about a level editor?

 

Well… remember back when you created the first sheet?  You may remember a little checkbox “Create Level”.

image

 

Well this creates a table just like any other with some prepopulated values:

image

 

Width and Height are the number of cells that compose your level, the rest will be populated shortly.  Notice the Edit button that appears now?  Click it.

image

TADA!  Level editor.

The level editor can work in tiles or objects, let’s start with a single object layer for our background image.  Click the New Layer button at the top right.

image

Name it then click create.  Now click the File… button and we will select our background tiles.

image

 

Your image will now appear ready for painting, like so:

image

 

In Tile mode, simply select the tile, or tiles you wish to paint with like so:

image

 

Now back on your layer make sure you are in Tiles mode:

image

 

And paint away:

GIF

 

You can also work in object mode, which allows you to place sets of tiles without being confined to the grid.  First, define a set of tiles as an object:

GIF2

 

Now you can switch your level to object mode and draw using the created objects instead.

 

Now perhaps coolest of all, you can also instance data easily enough.  For example, we could add and place NPCs on our map, first we extend the map sheet to have an addition field, a List called npc, like so:

image

The List contains a reference to our monster table for example, x,y coordinates and an id.  Now if you head back to your map, you will see you’ve got an additional layer created:

image

 

Which you can now use to place NPCs or other data in your world.  You could do the same thing for collision data, whatever you wish.

This is only scratching the surface of what the level editor can do, there is even auto-tiling support built in.  Be sure to watch the video version for a more in-depth idea of the level editors capabilities.  Then when you are all done, it’s ultimately just data that you’ve been working with.

 

Now the downside is, there is no level loader when you are done.  So whatever engine or game you are importing the result into, it’s still just data.  It’s going to be your responsibility to display it all on screen.

 

The Video

Programming


28. October 2015

 

So I find myself needing to create a new website and this created a world of complications with one very easy solution, which I’m assuming you can guess from the title above…

 

I started GameFromScratch.com some 5ish years ago and the state of the web has changed a great deal since then.  I had a dedicated server from other projects, so the sky was the limit when it came to choosing a server technology.  I had little idea what GFS would evolve into or how much control I would require over my CMS, so as a programmer I went with the language/technology I was most comfortable with at the time, C#/Asp.net.  Instead of doing everything myself I built the site around BlogEngine.  It’s served me well enough, but in this age of mobile, SEO and responsive design, it’s a needlessly complicated mess.

 

I did a recent redesign of the site, but in the end I want to do a clean break.  Problem is, you can’t.  I have years of Google search engine juice, thousands of in-bound links and many other things that would break if I ported to a new site.  Beyond that, ugly or not, creaky or not, GameFromScratch is still my baby and I couldn’t just put her out to pasture.

 

After some thought on the subject I figured out how to go forward.  GameFromScratch is going to continue exactly as it is.  I will continue hosting 100% of my content here, I will add new blog posts and tutorial series here just like normal.  However, “finished” tutorial series will also be available on another home.  With the exception of perhaps pissing Google off due to duplicate content, I think it’s the best of both worlds.  People can continue to enjoy GameFromScratch.com as it is today, while people using it for straight reference material can enjoy a much cleaner and hopefully faster site.  Also it gives me the opportunity to introduce a slightly shorter and more accurate URL.  Win/win for everyone I hope.

 

This however lead me to the same challenge I had years ago… choosing a technology.  Now though I have come to realize less is more.  I have no desire to use a gigantic bloated CMS like Wordpress or Drupal.  More to the point I have absolutely no desire to install another server or database technology (and potential security loophole) on my servers.  I also had, have and always will continue to have a gigantic aversion to PHP, which winnows down the field a heck of a lot.  On the other hand, I also have little desire to manually craft a site from scratch.

 

Enter Jeykll.

jekyll-logo-light-solid

Jeykll is what you could call a “Static Site Generator”.  Basically its the framework to create a site within, couple with some tools that generate the site for you.  No database, no server technology, nothing.  The end result is simply a folder full of clean, modern HTML that can be deployed however you want.  This means no added security risks, no performance overhead and extremely simple backups.  It does however provide a framework of local tools that make your development process a heck of a lot faster than just writing HTML.

 

I am still very new to Jekyll, but so far it ticks all of the boxes I need.  The only real complication in the scenario is Ruby, the language it depends on.  As a language/ecosystem, Ruby seems horrifically fragile and it’s 10x worse on Windows where it is a bit of a red headed step child.  Point blank, getting and keeping your Ruby stack running is going to be by far the most challenging part of the process.

 

Anyways, if you find yourself needing to create a website, consider checking out Jekyll, I’ve created a small video about it available here or embedded below.

 

I looked at a few other options that you might wish to be aware of and why I personally didn’t go with them.

 

  • Adobe Muse
    • It was a nice editor and with it’s themes provided a great deal of what I needed.  The resulting code though wasn’t extremely clean, it has a rather hefty pricetag, and worse of all, once you commit to Muse you have to stick to Muse to generate new versions of your website.
  • Siteleaf
    • Siteleaf is very similar in basic process to Jekyll.  With a few major differences.  First, it includes web hosting options as well as an in cloud content editor.  Second, it’s got a price tag attached.  Third, it simply didn’t work on Windows… bit of a deal breaker there.  It’s not really Siteleaf’s fault, it’s Ruby, but still a rather large deal breaker for me.
  • Dozens of other static site generators
    • You certainly aren’t starved for choice in this category.  That said, if in doubt, go with the one with the biggest community.  That’s Jekyll.  I was tempted to find one that was built on top of Node instead of Ruby for a better Windows experience, but with Jekyll releasing version 3 with less dependencies and a smoother Windows experience, this became unimportant.
  • Wordpress/BlogEngine/Drupal et al
    • What can I say, they are still an option.  Jekyll certainly isnt for everyone.  Each of these CMSs is absolutely huge, some are downright dinosaurs at this point.  On the other hand… there is no scaffolding, no hosting requirements, a huge community of people you can contract work out to, etc.  If you are not moderately tech savvy, these are still most likely your best best.  Just be aware, you pay for that convenience when something goes wrong… it goes REALLY wrong.  Then again, you can also hire someone to fix it.

Totally Off Topic


GFS On YouTube

See More Tutorials on DevGa.me!

Month List