

Google's New Cross Platform Gaming Library PlayN - EwanG
https://developers.google.com/playn/

======
Fargren
I think it's important to mention the the performance constraints of different
platforms are very different. When I tried porting a Flash game to iOS using
AIR to target it, this became apparent as the cost of creating new objects in
iOS was huge compared to what it was in the browser, forcing me to use object-
pooling, which has a memory cost that could be prohibitive in a different
paltform.

This can probably work for simpler games, but I expect the performance and
platform-specific bugs to be huge deterrents.

~~~
nailer
I believe it was used to create the (very slow, even in current Chrome) HTML5
version of Angry Birds. So yes.

------
jiggy2011
Excellent, I hope this takes off.

It seems to be unreasonably difficult at the moment to create a simple 2d game
that is cross platform and mobile friendly without using Flash.

Having said that I hope adobe provide some quality cross platform tools for
creating content for things like this.

It looks like google is gearing up with it's "chrome as a platform" paradigm
to pull Microsoft's dinner table right out from under them.

~~~
eropple
> It seems to be unreasonably difficult at the moment to create a simple 2d
> game that is cross platform and mobile friendly without using Flash.

It really is. The only options you've really got (unless you want to use
somebody else's engine in its entirety) are C++ or C# with Mono (OpenTK on OS
X, Linux, iOS, and Android; OpenTK or DirectX on Windows).

If this targeted iOS, I would be all over it. (I know there's a port in
progress--I look forward to it!) As it is, however, I don't find it terribly
useful; if I want to write for Android (I really don't care about the
platform) I'd use libgdx.

~~~
Egregore
Why you would use libgdx and not andengine (for example)?

~~~
eropple
Because an Android-dedicated framework is of no use to me.

Android will not, in the near future, be a platform I care about supporting
more than casually. Game sales tend to be questionable on Android phones and
almost nonexistent on Android tablets; the same can't be said about iOS. And
while I own Android devices, they gather dust because of my general distaste
for the platform's design decisions and goals; while I do not begrudge Android
users their decisions, it's become clear to me that, personally, it's very
hard to develop for a platform that makes me (literally-literally) sad and
unhappy to use.

My primary platform of interest, however, remains OS X and Windows, and I'll
consider Linux if I can get it for an expenditure of nearly zero effort. If I
for some reason decided that I needed to target only and solely Android for
mobile devices, libgdx lets me trivially write code for the platforms I
actually care about at the same time.

(But I'm more likely to use C++, where I can target iOS, or
MonoTouch/MonoDroid, where I can target both iOS and WP7, instead.)

------
mark_l_watson
I set up an IntelliJ project with the demo games several weeks ago and I have
spent some time kicking the tires. It feels comfortable because it is GWT
based, which I have used a lot.

I was in the game business (dev for Nintendo and Disney) for 2 years, but that
was about 15 years ago. Currently, my granddaughter wants us to write a game
together, so I have been looking for a platform to do that.

There are a lot of cross platform options, including straight up HTML5, so I
wouldn't bet that PlayN gets a lot of traction.

~~~
currywurst
Making a game with your grand kid !? Wow .. all the best on the effort! I
would love to know how it turned out ..

------
acron0
No offence Google, but I think I'll take my game middleware
from...y'know...people who make games for a living.

In seriousness, this has no hope of contending in an already crowded space.

~~~
MatthewPhillips
This is a good point. I'll take it further, Google rarely seems to participate
in the platforms they create. Look at Android, is there is a single pay app by
Google? How many non-stock apps have teams dedicated to them (in other words,
not 20% time projects)? Why would I invest my time in a platform when the
parent company won't do the same?

~~~
skybrian
Google Maps, GMail, Calendar, YouTube, Google+, and a bunch more. Why do you
rule out "stock" apps?

~~~
MatthewPhillips
I'm not ruling them out, I'm just saying that they invest only the bare
minimum into their own platforms. Not a single pay app?

Look at what Microsoft did when they created a gaming platform. They bought
Bungie.

Then look at Google and Chrome OS. They created 1, _1_ new app for it (Google
Talk), the rest were all existing applications built for backwards
compatibility with older browsers.

------
Drbble
Scattered thoughts:

Nice idea. I stuck with Phonegap in the past, because I cared more about
portability (including desktop/open web HTML) than features or profits for my
little Set playalike game 3qual.

Which has a larger audience for games that fit the limitations (low power
2-D?): Java plus HTML5 plus Flash plus Android, or iOS? Or Windows/Metro?

If Google is serious about growing the N in playN, integrate with phonegap or
equivalent to get onto iPhone and Windows Mobile too.

Does the GWT/Java replace HTML/JS/CSS (which would be a step backwards IMO) or
host HTML/etc for UI? Or developer's choice?

~~~
ZeroGravitas
It does Flash, and you can still deploy AIR apps on iOS, so I assume this is
targetting iOS too.

------
aSig
This looks like the evolved "ForPlay" tool Google demoed at IO 2011 its built
on top of GWT. I'm glad to see its been officially released, something like
this has a lot of potential.
[http://www.google.com/events/io/2011/sessions/kick-ass-
game-...](http://www.google.com/events/io/2011/sessions/kick-ass-game-
programming-with-google-web-toolkit.html)

------
jamesu
Anyone remember when game developers would outsource platform porting to other
developers? A lot of the time they didn't even end up using the same code!

How times have changed...

------
keyle
I am failing to see how this is great. Sorry but didn't just Adobe fix all
their issues with cross platform AIR and Stage3D?

Adobe's demos are stunning... this is rather.. underwhelming. Also I'd rather
invest in a proven technology with many resources on tap than yet-another-
frameworkish-lang.

Is this running Dart?

~~~
dlss
No. This is GWT :p

------
sdoowpilihp
I had a chance to mess with PlayN a number of months ago. I was drawn to
trying it after I had heard that the Chrome version of Angry Birds was built
using it. From my experience with it, it seems to work about as well as any
other multi platform game framework. For most games, it's good enough.

------
nixarn
Shitty development language and no iOS support. No thanks.

~~~
thoradam
What is your preferred language for simple, cross-platform game development?

~~~
moonchrome
C#/Mono with Unity, or just plain Mono/.NET. Unlike this it's actually cross
platform (ie. you can use it on iOS, Android, all desktops, browsers via
plugin, and the consoles), it's been used/tested by many companies, it comes
with development tools, etc.

If I want a HTML5 game I'll write JavaScript or CoffeeScript, it's going to
have wildly different performance characteristics over other platforms anyway.
Java sucks for game development, eg. no operator overloading or value types,
it's insanely verbose, and this uses GWT to compile down to JS anyway so it's
not going to get any performance benefits from being written in Java over JS.

~~~
bermanoid
_browsers via plugin_

Avoiding a browser plugin is precisely the reason anyone would ever go with
something like this.

As for writing plain old Javascript or CoffeeScript, I'd be all for it in
principle, but the game libraries are still a bunch of fairly weak offerings,
at least when it comes to general-purpose game middleware. I'm not sure if
PlayN is much better feature-wise, but if you're planning to target Android
anyways (and hence get your hands dirty with a bunch of Java code), I can
definitely see value doing it through PlayN to get a browser version "for
free". Doubly so if you've already got a lot of experience and tooling set up
for doing games in Java (probably for Android).

Also, PlayN is not exactly unused/untested: Angry Birds for Chrome uses it
(<http://chrome.angrybirds.com/>), and it seems very solid. It's a huge
testament to the quality of GWT's compiler that they pretty much cut and
pasted JBox2d into PlayN (IIRC they only had to alter a couple of threading-
related classes when they brought it in) and it performed on par with the
Javascript ports, despite the fact that the port was written exclusively with
desktop Java in mind.

~~~
nailer
> Avoiding a browser plugin is precisely the reason anyone would ever go with
> something like this.

There's already WebGL exporters for Unity made by the J3D (which is JS, not
Java) team. I'd be surprised if Unity weren't doing something official.

> Angry Birds for Chrome uses it (<http://chrome.angrybirds.com/>), and it
> seems very solid.

My experience (2010 Macbook Air, latest Chrome) differs from yours.

------
nextparadigms
Wouldn't it have made more sense to use NativeClient throughout all their
platforms? It's not like a more advanced 3D game that you develop for Android
will work just as well in HTML5 when you port the code. With NativeClient it
could be a different story. Plus, most 3D games are already written in C++ for
Android. I suppose they could still do this later on though.

~~~
marcocampos
Native Client only works on Chrome so it's not exactly cross-platform.

~~~
nextparadigms
I know, but I was thinking they are going to port NaCl to Android to make
their games cross-platform.

~~~
azakai
NaCl is x86 and x86_64 only, so it can't run on Android on ARM anyhow.

~~~
ephemient
Not true: ARM can run PNaCL.

[http://www.chromium.org/nativeclient/pnacl/building-and-
test...](http://www.chromium.org/nativeclient/pnacl/building-and-testing-
portable-native-client) <http://www.chromium.org/nativeclient/reference/arm-
overview>

~~~
azakai
PNaCl is not NaCl. None of the NaCl apps in the Chrome App Store are PNaCl
apps - which isn't surprising since PNaCl isn't ready.

------
jmitcheson
It used to be ForPlay but now it's PlayN. The basic idea is you write Java and
it can output Java desktop, HTML5, Android, Flash, but I heard the flash
export was broken?

~~~
braco_alva
Last week someone did a major fix to flash export, I haven't tested yet since
it's not in the maven central repo yet, but if you use source code in google
code, maybe you could test the state of flash now.

------
mistercow
Why does Google still seem to love Java so much?

~~~
pixelbath
Their entire mobile development toolchain is based off of it?

~~~
mistercow
Right, but that's part of my question.

~~~
nailer
Larry came of age during Java's rise. There's old usenet posts about changing
the useragent in a Java HTTP library from him when making the original search
engine.

------
braco_alva
In case you're trying to go to the getting started page in the overview it
seems like it is broken, here is the getting started page in google code
<http://code.google.com/p/playn/wiki/GettingStarted>

------
Roritharr
Once again, there are not many good alternatives to Unity3D for real
multiplatform development, and once their flash exporter is ready for prime
time this becomes even more true.

~~~
acron0
Pretty much there with 3.5 release.

------
Egregore
Does it compile jdk bytecode or just java source code? For example can I
generate the bytecode with scala and then use it with PlayN?

~~~
kodablah
It appears to use GWT for the HTML application, so it works on the Java source
itself, NOT the JVM bytecode. It's probably possible to target Android only
with the framework and then use another JVM language.

------
rprime
Well, isn't PlayN old news? I remember playing with it somewhere last year.

~~~
braco_alva
Yes, we have been using PlayN for a few months right now, it is true that it
is not as complete as other cross-platform tools, but it is starting to get a
really good shape, someone just made a C-ish backend last month and got a
working example on iOS, but this backend could help us with ports to WP7 and
consoles.

------
buenofelipe
It's not new at all!

------
fufulabs
Haxe + HaxeNME is a very capable alternative to this.

------
robwgibbons
I was half expecting to see Dart powering this sucker. Looks like a lot of
fun.

~~~
sek
Dart is not ready yet and not even full specified. In long therm dart should,
as successor of JS, be the ultimative multi plattform language. For games i
think this will take almost a decade, i mean look at the performance of
android devices now.

