Hacker News new | past | comments | ask | show | jobs | submit login
Google's New Cross Platform Gaming Library PlayN (developers.google.com)
133 points by EwanG on March 9, 2012 | hide | past | favorite | 57 comments



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.


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


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.


> 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.


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


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.)


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.


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


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.


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?


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


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.


AngryBirds for Chrome and Android is built using this lib


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?


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


iOS port is in the works, it's not done yet, but there's a few people working on it, there's already a set of instructions in the google group on how to test a basic example of iOS, but it's not as complete as HTML and Android ports.


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-...


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.


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...


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?


No. This is GWT :p


i'd bet on google way before i'd bet on adobe.


Shitty development language and no iOS support. No thanks.


What do you think they would use? Objective C? O_o


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


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.


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.


> 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.


Well sure there's no silver bullet here. But still doesn't make me like Java more. C# works well for Unity and it's a better language than Java. Another alternative would maybe me Lua and go the Corona SDK route. Corona SDK looks quite nice and supports iOS & Android. I'd find it more exciting with something else besides Java, even Dart would make me more excited about it.


Additionally you can look at Moai. (http://getmoai.com) It allows you to write your game logic in Lua and compiles to Android, Native Client and iOS. There also is a hosted cloud that allows you to write your game's backend logic in Lua (I work for Zipline Games and head up the cloud development team)


Wow! This looks really good! I always wanted to try out Lua, maybe this is a good reason to do so.


Mine would have been Javascript.


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.


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


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


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



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.


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?


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.


Why does Google still seem to love Java so much?


Their entire mobile development toolchain is based off of it?


Right, but that's part of my question.


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.


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


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.


Pretty much there with 3.5 release.


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?


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.


I just happened to see a thread about that. Apparently it will work fine on JVM/Android/iOS since those targets use Java bytecode. It won't work on HTML5/Flash since those use the original Java source.

http://groups.google.com/group/playn/msg/c01cb315ec4dc8f5


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


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.


It was originally shown off as ForPlay at Google I/O '11. Here is a video of the talk: http://www.youtube.com/watch?v=F_sbusEUz5w

I'm really glad they changed the framework name too =D


It's not new at all!


Haxe + HaxeNME is a very capable alternative to this.


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


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.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: