Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
27. May 2013

 

In this day and age almost all graphics engines are behind the curtain based on 3D.  It's just the way graphics hardware works, so we now deal with textures instead of pixels  SpriteProjectand sprites.  At the end of the day, almost every single 3D game engine get a 2D sprite engine created on top off it, and now jMonkeyEngine is no exception with the release of The Sprite Project.

 

In case you have never heard of it, jMonkeyEngine is a complete Java based 3D engine, that is quite mature ( version 3+, over a decade old! ) and completely open source.  The Sprite Project is a 2D sprite engine built over top of it.  Here is a sample application taken from the documentation(pdf link).

 

package mygame;

import com.jme3.app.SimpleApplication;


public class Main extends SimpleApplication {

static Main app;

public static void main(String[] args) {
  app = new Main();
  app.start();
}

static SpriteEngine engine = new SpriteEngine();

@Override
public void simpleInitApp() {
  Sprite sprite = new Sprite(“Textures / Sprite.png”, “Sprite 1”, assetManager,
    true, true, 9, 1, 0.15f, “Loop”, “Start”);
  SpriteLibrary.l_guiNode = guiNode;
  SpriteLibrary library = new SpriteLibrary(“Library 1”, false);
  library.addSprite(sprite);
  engine.addLibrary(library);
}

@Override
public void simpleUpdate(float tpf) {
  engine.update(tpf);
  }
}

Pretty simple looking eh?

So if you are looking for a 2D sprite library built on top of a great Java 3D engine, you need look no further.


25. April 2013

 

As you may know from previous posts I am rather a big fan of Lua based game engines.  When I learned about a new one completely off my radar, I just had to check it out.  The game engine in question is Dreemchest.

image

 

As I mentioned earlier, Dreemchest is scripted using Lua.  Underneath Dreemchest is powered by a C++ core.  In terms of other Lua game engines, Dreemchest is probably most similar to Corona in scope.  It comes with a WYSIWYG editor and somewhat uniquely, enables you to use Flash to create your user interface.  Unlike Corona, you don’t need to authorize against and build on their servers, everything is done locally, I know some people really hate that about Corona and Gideros ( and more recently Loom ). Oh yeah, it’s also free(for now?).  Let’s jump in and take a look at Dreemchest.

 

First things first, you need to download Dreemchest, which you can do right here.  It is available for Windows and MacOS, although I have to admit, the MacOS version seems to be a lot less stable right now, so if you have a choice I would consider choosing the Windows version.  There is no installer, simply download the archive, extract it then run composer.  Dreemchest seems to be a Qt app, so I’m a bit shocked a Linux build isn’t available.  Then again, Linux is a fairly small sub-set of the population, so maybe that’s a down the road feature.

 

Meet Dreemchest Composer.

 

Dreemchest Composer in action

image

This is the WYSIWIG environment in action with the Animation sample loaded.  Currently there are over 20 samples available showing you how to perform various actions in Dreemchest.  As you can see from the Window above, it’s a pretty sparse environment, but most of the information you need is available.  Across the top is the toolbar you would use to configure and run your application.  Below the is the WYSIWYG editing area and below that is the output panel.  On your right hand side is the Property window, which is populated dynamically by your script objects, allowing you to view and configure values visually instead of in code.  Below that are your assets, that you can import, create then drag and drop into your scene.

 

The UI itself is incredibly customizable, every dialog can be detached, moved or closed, leaving you law things out exactly as you want.

image

 

Coding and documentation

 

So, where exactly do you do the coding?  If you have the Animation sample open, take a look at the assets panel and you will see a pair of script objects, App and Hero.

image

 

Double click one of these script files and it will open in the integrated text editor.

image

It’s a fairly barebones editor, but it does what you need including syntax highlighting, auto-completion and automatic indention.  It’s nice not having to switch apps to edit code.

 

The programming language itself is standard Lua 5.1, with an class inheritance system.  If you know Lua you will be immediately comfortable with Dreemchest.  If you press play or F5 to run your application, it runs directly inside Dreemchest:

image

As of right now, debugging options are quite light.  You can alter position, from portrait to landscape, simulate home button press and not much else.  Oddly enough, once the application is running, you see the options traditional debugging options, such as step in, step out and continue.  That said, I cant figure out how to add an actual breakpoint.  My guess is, this is a feature under active development.  I look forward to it too, as for now you would be limited with printing to the output window while debugging.  Build and load times are virtually non-existent, which is nice.

 

From a coding perspective, there is a pretty good amount of documentation, especially for such a young project.  As mentioned earlier, there are currently 20+ samples included with the download.  There are a series of tutorials available here as well as an API reference available here.  The API is quite straight forward, somewhat minimal, but still under developed.  Pretty much everything you need to create a 2D game is currently there, including graphics, tweening, audio and physics.  For physics, there is also an integrated shape editor which is rather convenient.  Still under development, new functionality is being added with each release.  This is critical though, as you don’t get source code, so you need all functionality needs to be in box.

 

Flashing

 

Perhaps the most innovative feature of Dreemchest is the ability to embed and communicate with Flash objects for creating your UI layer.  You can included an SWF file just like you do any other graphic file.  The swf file can contain ActionScript2 code, and the two languages can communicate back and forth.  Here is a simple example from the SDK on working with a Flash animation, showing how you can load and communicate between the languages.  uiButtons is the swf file that has been added to the scene.

class "Main"( StageObjectContainer )

function Main:main()
    -- Register necessary functions for Flash UI
    UIManager.registerFunction( 'nativeSetPitch', function( value ) trace( 'Pitch set to: '..value ) end )
        
    -- Attach to events dispatched from Flash UI
    UIManager.attachListener( 'uiStop', self )
    UIManager.attachListener( 'uiToggleMusic', self, 'onMusicToggle' )
    
    local ui = uiButtons.new()
    self:attach( ui )
        
    -- Notify Flash UI by dispatching an event
    UIManager.dispatchEvent( 'onRefresh', { version = 104, message = 'hi there!' } )
end
    
function Main:uiStop( e )
    trace( 'Stop the music' )
end
    
function Main:onMusicToggle( e )
    if e.pause then
        trace( 'Pause music' )
    else
        trace( 'Continue music playback' )
    end
end

This allows you to use the rich UI functionality of Flash/ActionScript for your UI layer, while performing game logic and rendering in Lua.

 

Building your application

 

When it comes to creating and deploying your application, that’s a pretty simple process.  Simply select the File->Export menu and select the platform.  You need to have a Mac to build iOS or OSX target.  You need to install the Android or iOS SDK and point Dreemchest at the proper directory before you can export to either platform.  The results of the build (an apk in the case of Android) are in the output subdirectory although I had to do a bit of searching to figure this out.

 

image

 

Conclusion

 

Dreemchest is certainly a young engine, but it has a great deal of potential.  I did experience crashes and a few UI glitches, although the newest release seems a great deal more stable.  I’m actually quite surprised by just how much it did improve in just a couple weeks, this bodes well for the future. This is certainly an engine worth keeping an eye on, especially if you like Lua and are targeting iOS or Android.  It may not be for everyone, if you need source code for example, Moai is a better fit.  But if you are looking for an all in one accessible toolkit, Dreemchest is a good pick.  Of course, it’s free too, so you’ve got nothing to lose by checking it out.

Programming


12. April 2013
During GDC Havok announced Project Anarchy a collection of their gaming technologies including Physics, Animation and the Vision engine for mobile. Today a few more details where announced and its all great news!

What’s included?

We have a powerful toolset made up of Havok’s Vision Engine, Physics, AI and Animation Studio; components of which have been used to build games like Modern Combat 4, Halo 4, Skyrim, Orcs Must Die and Guild Wars 2 to name a few. Project Anarchy bundles these technologies together, allowing users to download a complete toolkit with exporters for max and maya and a full WYSIWYG editor.

The Havok Vision Engine is built on top of an extensible C++ plugin framework and Project Anarchy will include the source for the plugins we use to connect our other products to the Vision engine. This source will also be maintained online and will provide insight for users on how to extend functionality with their own offerings; mail [email protected] if you’d like to know more.

How free is “free?”

You can download and develop your game on the PC for free. Releasing that game for iOS or Android is completely free. We’ve tried to keep it simple. No crippleware, no restriction on how big you are, no hidden royalty payments on the back end. You can opt to purchase direct support from our engineers or additional source code.

What about other platforms?

Additional platforms are not free. If you want to expand and generate revenue from other platforms you can license those directly from us. Given the ability with Project Anarchy to quickly move to new platforms, the risk/reward here will be easily understood based on the game’s initial success. We’re hoping that with these options and the opportunities afforded by a large community sharing a common technology base, as well as the fact that more and more developers will grow up with our technology, we’ll all benefit from what Project Anarchy brings.

They also have a launch trailer showcasing Project Anarchy on mobile.


News


10. April 2013

Now that I am actually setting off to create a mobile game, it dawned on me I don't have any current iOS devices to develop and test on.  I have an iPad 1, that my daughter has pretty much co-opted, and an iPhone 3g, which is absolutely prehistoric at this point.  I have zero desire to own an iPhone ( wayyyyyyyyy too small for me ) so I decided to pick up this iPad mini last weekend.  I figured it was a good base-line target device, as it shares the same basic components as the iPad 2.  Besides, I was going to be buying one for ShadowRun eventually anyways!

 

Codea

Of course, with a shiny new toy, I pretty much spent the weekend playing with it.  So i've been installing the various games and applications that aren't available in Android land.  

 

One such application I eventually installed was Codea.

 

If you've never heard of it, Codea is a Lua based game development system that is run on the iPad.  That's right, it's a full IDE, code editor and game library that you run on your iPad to make games for your iPad.  As you may know I am a pretty big fan of Lua game engines and amazingly enough, Codea is pretty good.  After I installed it, the next couple hours just disappeared.

 

Codea comes with a pretty extensive number of demos and a great deal of art assets for you to get started with.  You also have the ability to publish to the app store.  The documentation is pretty good, although locating it from their website isn't immediately obvious.  You can take a look at the reference here, although it uses Sencha touch, so it will only run on webkit browsers ( Safari & Chrome ).  Again there are a number of demo applications with complete source code included as well.  Pretty much everything you need is actually included.  Perhaps coolest of all, there is even a book available, although only a chapter is dedicated to Codea.

 

So, what you may ask, is it like to program on an iPad?  Pretty freaking terrible actually.  I've never been a huge fan of the iOS keyboard, now imagine writing code with it.  Codea do have a toolbar that make accessing special character and navigating between text ( think Home and End ) easier, and it does help.  They've also made a number of things very touch friendly, like colour selection bringing up a colour select dialog or touch and drag to change a numeric value.  There are also drag and drop snippets that make the process quicker.  At the end of the day though, you still have to type a fair bit and with the onscreen keyboard it's kinda frustrating.  Codea does about everything it can to help you, but in the end, they are at the mercy of the device they run on.  You really want a bluetooth keyboard if you are going to do serious work, if only just to reclaim screen space.

 

I am actually rather hooked.  I can't see myself using Codea for a full release project, but as something to play or prototype with when out and about away from my PC it's great fun.  I think it would also be a good app for someone just learning the basics of programming.  This app is easily worth the 10$ cost.  As I am going to be playing with it a bit more, I might as well do a review… expect one shortly.


4. April 2013

Well, this certainly wasn't expected, and I double checked the calendar, it's no longer April 1st...

 

Introducing Corona SDK Starter

Okay, so here’s where it gets really exciting. From very early on, we have focused on democratizing app development. We felt (and still do) that anyone could create the next great app with Corona. Since then, Corona has been embraced by indies and your apps have hit the top of the charts.

Indies are a key part of our community, so today, we are taking that vision a step further. We are announcing Corona SDK Starter – a completely FREE version of Corona that lets you publish to all the platforms we support without paying us a single cent.

With Corona SDK Starter and the Starter tier of Corona Cloud, you can publish amazing, connected apps faster and more affordably (free!) than ever before. We are the only platform that lets developers do this. A lot of other products have hidden fees or force some sort of watermark/splash screen. There is no such restriction with Starter. That’s the difference between “fake free” and a true free option.

So, what's the catch?

If you want to access certain specific features like in-app purchase and analytics, you’ll need to subscribe to a paid plan. You can still build with those features on your own device, but you can’t publish apps to the store if they use those premium features. Daily builds are also only available to paying subscribers.

Not really much of a catch in the end, at least so far as existing Corona goes.

 

There is however also a "coming soon" Corona, that will be available in the Pro version:

Graphics

As I talked about last week, our bleeding-edge OpenGL-ES 2.0/shader-based graphics engine is in the works. You are going to be blown away with what you can do. I’ll talk about that more later but I did want to give you a teaser.

If you watch this week’s CoronaGeek episode, you’ll be able to see 5,000 fish running at 60 fps! It may be hard to tell from the video, but this is what I showed to a lucky few at GDC. I recommend watching the whole show, but if you’re pressed for time, you can skip to roughly the 35:00 mark.

Plugins

Second, there’s Project Gluon, a.k.a plugins. We’ve done a ton of plumbing work so that you’ll be able to do integrate 3rd party services and functionality into your app, and do so painlessly from the comfort of the Corona Simulator.

Now there’s good news and bad news here. There are a lot of moving parts, so plugins didn’t quite make it to the public release — and yes, I’m disappointed too.

But the good news is that plugins are coming very soon! We’re getting ready to seed this to beta testers this month. We are actively building a library of plugins that will be hosted on our servers. We’re working with folks like Amazon to get you more monetization options. We are acutely aware that this is a big issue for a lot of you.

Device Access

Lastly (for now), we have found a way for you to access certain Java and Objective-C APIs from Lua! On the Android side, we already have the foundation there thanks to Enterprise, and we’re looking at how we can accelerate bringing those Enterprise innovations down to Pro developers. In parallel, we also have a proof-of-concept on the iOS side, so I’ll have more news once we’re past the research phase.

The pro version is going to have a 599$ a year price tag, but existing customers will be able to subscribe for 349$.

 

So, nutshell version is… the product we know today as Corona is now available for free, minus some web services.  Their is a new more powerful version coming soon, at it will be a paid only version with a price increase.

 

So basically, if you haven't used Corona, it's great news.  If you are an existing subscriber, not so much.

 

You can read the entire release here.

News


GFS On YouTube

See More Tutorials on DevGa.me!

Month List