Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

26. February 2013

 

Just saw this pop up on Reddit and I thought I would share.  Yesterday a new engine was released, Loom.  (Nothing to do with the excellent game from LucasArts).image  Loom works on Mac and Windows and can target Mac, Windows, iOS and Android.

 

 

 

Loom is a new game engine 2D game engine, written in C++ and powered by their own custom scripting language, which is a mix between C# and ActionScript.  Looking at the code samples, this engine is obviously built over top of the Cocos2D game engine, which is one of those love it or hate it APIs.  Built around a command line interface, you can rapidly create and debug projects.  Additionally it includes a gameplay framework, UI library, Tweening library, Chipmunk physics, unit testing and more.

 

 

 

 

Licensees get the complete C++ source code and right now, licenses are free.  Eventually indie licenses will be 500$, and going up from there, so if you are interested, be sure to snatch up a license now.  You can read full details about the licensing here.

 

There are a good number of demos available with source code.  They also offer paid support, which is always handy.

 

You can learn more about the Loom engine at TheEngine.co.  Clever name that… Sign up for a free license here.

News

6. February 2013

As we reported back in december, Torque2D was going open source.  Well, the day has finally arrived, Torque2D's source code is up on Github now.

Torque2D Logo

 

 

So what is Torque2D?  It is a 2D cross platform game engine, previously under a commercial license.  I will let them describe their baby:

 

 

In simple terms, Torque 2D is an extremely powerful, flexible, and fast engine dedicated to 2D game development. The following is a breakdown of the core facts about the engine:

Currently supported platforms:
* Windows
* OS X
* iOS

Support for new platforms is surely on the way. In fact, YOU get to help us decide what we should work on, be it Linux, Android, editors, or just simple bug fixing. 

Languages:
* Core: C++
* Windows: C++ and Windows API
* OS X: C++, Objective-C, and Cocoa API
* iOS: C++, Objective-C, and Cocoa touch API

Main Features:
* Box2D physics
* Simple and flexible sprite system
* Composite system capable of rendering thousands of images and animations with little performance impact
* Integrated asset system that manages all your asset loading and unloading in an optimized manner
* Flexible module system that makes rapid prototyping a snap and code reusability a simple matter
* TexturePacker Support
* TAML serialization format (like XAML and XML)
* Batched rendering
* Multiple collision shapes
* Built-in unit testing framework, cross platform
* Solid behavior system for packaging reusable game logic that can be applied to multiple sprites in different projects

In addition to the core engine languages, you can script all your game play via TorqueScript. This is a C-like syntax language that is very simple to learn and utilize for your projects. Additionally, persistent files such as particles, levels, GUIs, and more are stored as "TAML" (Torque Application Markup Language). If you have ever edited XML or XAML in the past, you should feel more than comfortable with TAML.

Blazing Speed
Blazing fast performance on Windows, OS X, and iOS. On desktop platforms, you can have thousands of sprites, particles, and physics objects running at once without ever dipping below the 60 fps mark. While more limited, iOS hardware can run the engine at a solid 60 fps, even with hundreds of objects interacting on screen.

 

Very cool move open sourcing this GarageGames, I hope it works out for you.

 

You can read the complete announcement here.

,

30. January 2013

 

Don’t you just love it when you are thinking about doing something, then someone else comes along and does exactly that thing for you?  Well, exactly just that very thing just happened to me.  I had long considered doing a comparison post of some of the most popular HTML5 game engines, facing them all against each other implementing a common game and see which one came out on top.

 

Well, BuildNewGames.com just did exactly that.  In their words:

Today we are going to compare three popular JavaScript game engines: CraftyJS, ImpactJS and LimeJS. You really can’t go wrong with any of these great choices, but they do have their own strengths, weaknesses and style. Taking some time to get to know what’s out there is well worth it before embarking on a game

 

Most interestingly, he followed in the vein of popular TodoMVC example, of implementing a standard application to give you a quick glance at each framework in action.  The author has implemented a Breakout clone using each library.  Like so:

breakout screenshot

 

This is a very useful exercise, and I hope others pick up the baton and implement the same program in their framework of choice. 

 

In the end, ( spoiler alert ), the author comes to the follow conclusion:

So which engine is the real winner? I will leave that to you to decide. Since Lime and Crafty are free and open source, it’s easy to dive into them and give them a whirl. Impact is at a disadvantage here, as you need to pony up for the license before you can start playing with it. It’d be nice if Impact had some sort of trial period option.

 

If you are trying to select a JavaScript game engine, this is certainly a great read.

News, Programming ,

27. January 2013
Logo

 

LibGDX is a popular Java based open source cross platform game programming library that supports desktop, Android, HTML5 and now… iOS.

 

Other details about this release:

 

  • Minor changes to the Livewallpaper API. Note that the LWP support is still a little buggy. It’s a contribution, and while i did quite a bit of clean-up it’s still not entirely where it should be. I’d be super happy if someone took on that backend!
  • If you want to deploy to HTML5 you now need to use GWT 2.5!
  • We have rudimentary Maven support. Thanks a ton to Team Gemserk for libgdx mavenizer and all their help with this!.
  • Android Daydream support, a contribution by talklittle! This one is stable.
  • Gdx controllers extension, for Android/Ouya and desktop. HTML5 could be an option too! Volunteers? (looking at you Nex) Some notes on the current stub backend for HTML5
  • The gdx-net API is now part of core. Fetching things via HTTP should work on all backends. Here’s a little test. Big thanks to Noblemaster and Gemserk who led this effort!
  • Not exactly part of the release, but here’s a quick rundown on how to make your libgdx game work with Ouya!
  • Again, not exactly part of the release, but here’s an awesome guide by Swarm on how to integrate Swarm with your libgdx app! Note that you should probably interface the Swarm API so your desktop project continues to work.
  • First release of the iOS backend

 

 

The iOS release does have some caveats though.  You need a Mac, XCode and ( here’s the stickler ) a MonoTouch license, just like the PlayN project’s iOS port.  Unfortunately, MonoTouch costs 400$, so this is one of those things you should be aware of upfront.

 

That said, iOS is often the biggest market place, so being able to port your game could be easily worth the 400$ price tag. 

 

The following features are in the queue for the 0.9.9 release:

 

 

You can read the entire release notes here, and access the source code here.

 

Nice work LIBGDX team.

News , ,

25. January 2013

 

Rim have released Gameplay 1.6, a 3D cross platform library for writing games for Blackberry 10, Playbook, PC, Mac, Android and iOS devices using C++.  gameplayThis is a project we have been following here at GameFromScratch for quite a while, and given the complexity, its amazing just how fast you can get up to speed.

 

If C++ is your language of choice ( or LUA for that matter ), you really should check out Gameplay, it’s completely free and open source.

 

The following are the release notes of the 1.6 release:

  • Adds file Stream interface for reading/writing files instead of using fread/fwrite.
  • Adds Terrain class to support for heightmap based terrains featuring LOD, multiple surface layers, loading from PNG, RAW8/16, full transform, physics, patch culling and verticle skirt for cracks.
  • Adds object-space normal map generation to gameplay-encoder for terrain normal map generation.
  • Adds scene support for loading .terrain files in .scene files.
  • Adds scene support for inline cameras to .scene files.
  • Adds suppoft for defining .scene files without 'path' to gpb. New node can not be create in .scene file.
  • Adds static Scene::getScene(const char*) to query currently active scenes in a game, helpful for script access.
  • Adds support for multiple translate, rotate and scale commands in a single node entity within .scene files, processed in-order they are defined.
  • Adds scene support for material auto binding scene ambient color, light color and light direction.
  • Adds support for setting the depth compare function on materials.
  • Adds support for texture/sampler arrays being passed to materials.
  • Adds support for loading uncompressed DDS textures for the following formats: R8G8B8, A8R8G8B8, A8B8G8R8, X8R8G8B8, X8B8G8R8
  • Adds improvments to prefer higher quality mipmap generation.
  • Adds improved Gamepad API support for button enumeration, triggers and some mobile Gamepad support on BlackBerry.
  • Adds additional gameplay-tests for billboards, forms, gamepads and lights.
  • Adds support for launching the browser via launchURL(const char*).
  • Adds physics support for setLinearFactor and setAngularFactor on rigid bodies.
  • Adds methods to PhysicsCollisionObject to allow conversion to subclass types (i.e. PhysicsRigidBody, PhysicsCharacter, etc) from script.
  • Adds option for fullscreen without width/height config to use native desktop resolution.
  • Adds Linux support for OpenAL PulseAudio back-end.
  • Adds support for latest Bullet Physics 2.81 with NEON optimizations for mobile targets.
  • Adds support for preprocessor directive NO_LUA_BINDINGS in the gameplay project to omit inclusion of generated lua bindings in compilation for developer mode value.
  • Adds optimizations to Lua generator to only write generated files if they differ from existing files, reducing both build times and committing of unchanged script binding files.
  • Adds changes to Slider for setValueTextVisible, setValueTextAlignment, setValueTextPrecision and getters.
  • Adds Microsoft Windows 7 64-bit support.
  • Adds Apple iOS 6 support.
  • Fixes to external-deps to reduce the size of the libraries on Windows.
  • Fixes for Android to no longer need to copy files to the SD card before reading them. None of the Android samples require an SD card.
  • Fixes for animation of opacity on UI and fonts.
  • Fixes in UI for removing controls and also setVisible(bool).
  • Fixes for UI controls missing on MacOSX.
  • Fixes for setting UI alignment programmatically.
  • Fixes for lighting shaders.
  • Fixes to the texture minification mode from GL_LINEAR_MIPMAP_LINEAR to GL_NEAREST_MIPMAP_LINEAR for newly created textures with mipmaps.
  • Fixes minor memory leaks and possible access violations when calling Game::exit() from script.
  • Fixes physics debug drawing for large scenes causing the internal MeshBatch to grow to an enormous size.

 

This release certainly makes Gameplay on the desktop seem much more viable.  Terrain support is certainly a nice new addition as well.

 

Good job Gameplay team.

News, Programming , , ,

Month List

Popular Comments

LINQ for C++ with cpplinq
Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


4. April 2014

 

When it comes to programming languages, I literally use dozens, but when it comes down to an all other things being equal decision my go to language of choice tends to be C#.  One of the big plus sides of C# is the wonderful LINQ ( Language Integrated Query ).  LINQ makes heavy use of lambda (closures) a feature lacking until recently in C++.  Now with lambda expressions part of the C++ language LINQ for C++ is now a possibility.  It exists as a single hpp file you add to your project.

 

If you aren’t already familiar with LINQ, here is a simple example in C#.  It’s a simple scoreboard that sorts the results by name, then by score, then totals and averages all of the scores.  As you can see, it’s a very compact and clean way to access data.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Entry
    {
        public Entry(string name, int score)
        {
            this.name = name; 
            this.score = score;
        }

        public string name { get; set; }
        public int score { get; set; }
    }

    class Program
    {
        static void Main(string[] args)
        {
            List<Entry> scoreEntries = new List<Entry>();
            scoreEntries.Add(new Entry("mike", 42));
            scoreEntries.Add(new Entry("bob", 99));
            scoreEntries.Add(new Entry("doug", 99));
            scoreEntries.Add(new Entry("steve", 12));

            var sortedByName = scoreEntries.OrderBy(item => item.name).ToList();
            Console.WriteLine("Sorted by score");
            sortedByName.ForEach(item => { Console.WriteLine(item.name + " " + item.score); });

            Console.WriteLine("\nSorted by name");
            var sortedByScore = scoreEntries.OrderBy(item => item.score).ToList();
            sortedByScore.ForEach(item => { Console.WriteLine(item.name + " " + item.score); });

            var totalOfScores = scoreEntries.Where(item => item.score > 0)
                .Sum(item => item.score);

            var averageScore = scoreEntries.Average(item => item.score);
            Console.WriteLine("\nTotal of scores == " + totalOfScores + " Average Score == " + averageScore);

            
        }
    }
}

 

Now let's take a look at the C++ version using cpplinq:

#include <string>
#include <list>
#include "cpplinq.hpp"
#include <iostream>


class Entry{
    public:
        Entry::Entry(std::string name, int score){
            this->name = name;
            this->score = score;
        }

        std::string name;
        int score;
};


int main(int argc, char **argv)
{
    std::list<Entry> scoreEntries;
    scoreEntries.push_back(Entry("mike", 42));
    scoreEntries.push_back(Entry("bob", 99));
    scoreEntries.push_back(Entry("doug", 99));
    scoreEntries.push_back(Entry("steve", 12));

    using namespace cpplinq;
    
    auto sortedByName = from(scoreEntries)
        >> orderby_ascending([](const Entry & entry){ return entry.name;  })
        >> to_vector();
        
    auto sortedByScore = from(scoreEntries)
        >> orderby_descending([](const Entry & entry){ return entry.score;  })
        >> to_vector();

    std::cout << "Sorted by name" << std::endl;
    from(sortedByName)
        >> for_each([](const Entry & entry){ std::cout << entry.name << " " << entry.score << std::endl; });

    std::cout << std::endl << "Sorted by score" << std::endl;
    from(sortedByScore)
        >> for_each([](const Entry & entry){ std::cout << entry.name << " " << entry.score << std::endl; });

    auto totalOfScores = from(scoreEntries)
        >> select([](const Entry & entry){ return entry.score; })
        >> sum();

    auto averageScore = from(scoreEntries)
        >> select([](const Entry & entry){ return entry.score; })
        >> avg();

    std::cout << std::endl << "Total of scores == " << totalOfScores << " average score == " << averageScore << std::endl;
    return 0;
}

 

A few obvious differences.  Cpplinq statements start with the from methods defining the type of data source to perform on.  In this case I used the default from() which takes a standard C++ STL type.  There are also from__array() and from_range() for working with arrays and iterators respectively.  Next the . (dot) operator has been replaced with the >> operator.  Of course the lambda syntax is different as well ( C++’s is much uglier ), otherwise at the end of the day, it is very similar to LINQ in both look and execution.

 

If you are new to C++ and are struggling to wrap your head around the uses for lambdas, give cpplinq a shot and you will quickly see their value!

Programming

blog comments powered by Disqus

Month List

Popular Comments