Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Getting to other Platforms (iOS/HTML5 etc) - TouchAPi  (Read 7548 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2011-10-30 17:36:53 »

I've been asked a few times to describe how I'm getting legends of yore on to different platforms. The important part to me is to keep one java code base for the game. One set of feature development and one set of bugs. If something goes wrong it should go wrong everywhere - and the fix apply everywhere. It's working out ok in this regard.

So, here's a quick run down. I have a single simple API which the game (and my other recent projects conform to). It's quite limited and thats intentional to cut down on the complexity when moving to different platforms. The javadoc for this API is here:

http://www.legendsofyore.com/doc

The API is implemented in a bunch of different technologies as shown below. The use of these compilers and SDKs, and the packaging of the applications is all wrapped up in a set of ant scripts. When I build a version I run a command like:

1  
ant clean applet application android android-paid ios ios-paid gwt flex 


And the distributions pop out in the target directory ready for upload to various appstores. Where possible I've automated the upload process too.


Not sure what else to say about the implementations. I'm open to questions of course.

Status

  • Application/Applet/Android/iOS are working and have been released and selling ok (tm)
  • HTML5 version is up and selling, also available from Kongregate as of yesterday
  • WebOS version is built and I'm just sorting out the finer details of integration with the TouchPad (that HP sent me for free! Smiley)
  • Flash version is in progress but I'm having some reasonably bad rendering issues

Limitations

  • Performance - it's massively variable across the different platforms and techs. I'm only focussing on turn based or puzzle games, so it doesn't worry me
  • Limited SDK - You can only use a limited Java SDK without implementing parts of the different platforms. I manage just fine and you can imagine legends of yore isn't completely simple or small inside
  • Debugging - it's hard to debug across all the platforms. Once it's right, you only have to debug on one but getting there can be tricky
  • Platform Features - each platform has different features which are complicated what you support where. I've not limited myself but it might have been sensible to cut down the features to a core set
  • Costs - Commercially using the flash conversion stuff costs $99 a year. Android and iOS markets have their costs also.

Technologies


Links

The main game is available in several forms at http://www.legendsofyore.com
The HTML 5 version is live at http://www.legendsofyore.com/js
The in progress Flash version (don't expect too much yet) is available at http://www.legendsofyore.com/flex

If anyone is interested in any more information, just let me know.

Cheers,

Kev

Online Riven
« League of Dukes »

JGO Overlord


Medals: 798
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2011-10-31 01:12:34 »

You picked a project name that sure will be hard to find through google Wink

Seeing as the Flash/Flex platform is performing significantly slower than the HTML5 version, I can't help but wonder why you're putting effort in that platform. I've never seen acceptable performance in Flex btw.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2011-10-31 06:42:16 »

It's only flex atm, flash is coming. It's all in progress, so I'm not sure what state it'll be in by the end.

I'm doing it because several large portals (newgrounds and addictinggames) only accept flash. I'd like to be able to harness their audience.

Cheers,

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Stevo86

Innocent Bystander





« Reply #3 - Posted 2011-10-31 13:22:21 »

I'm one of your Twitter followers and I actually just joined to say that I'm really impressed with your dev process. As an indie, covering so many platforms is just damn impressive and I'm sure having such a widespread market is helping your sales considerably. Not to mention the free gadgets you get for testing! Quite a brilliant strategy to say the least.

Anyways, keep up the good work, your tweets always inspire me.
Offline Breakfast

Senior Member




for great justice!


« Reply #4 - Posted 2011-10-31 15:09:21 »

So what comes out of TouchAPI? I mean whereabouts is the interface between that and the platform-specific stuff?
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2011-10-31 15:12:18 »

The TouchAPI is just a set of interfaces. Each of the sub-blobs convert to the appropriate platform.

So in the case of Applet/Application a Jar pops out the end after build.
In the case of Android/Android-Paid an appropriate APK pops out.
In the case of iOS an XCode project pops out that needs building (that's also automated but thats a separate thing)
In the case of HTML/JS/WebOS a zip containing the web page directory structure and all contents comes out
In the case of Flash a set of SWF files and a bunch of Javascript

Does that help at all?

Cheers,

Kev

Offline Gornova

Senior Member


Medals: 1
Projects: 3



« Reply #6 - Posted 2011-10-31 15:15:36 »

Hi! Kev Cheesy
good to see some sort of explanation Cheesy

About flash version: why do you have this kind of problems? On my computer at first take a big amount of time to load it and then start to "flash" on screen

Blog | Last game Drone Defense 0.2 | In progress Drone Defense
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #7 - Posted 2011-10-31 15:17:22 »

Yeah, the flash version isn't any where near right yet. I'm still working on that piece atm.

It's much more likely it's my shabby coding than it is the technology in use.

Cheers,

Kev

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #8 - Posted 2011-10-31 23:38:55 »

This is quite cool. Is your toolchain available for others to use?

See my work:
OTC Software
Offline Breakfast

Senior Member




for great justice!


« Reply #9 - Posted 2011-11-01 00:13:07 »

Yeah, the flash version isn't any where near right yet. I'm still working on that piece atm.

It's much more likely it's my shabby coding than it is the technology in use.
It's a few years since I used Flash, but it's quite plausibly not just your coding by any means...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CommanderKeith
« Reply #10 - Posted 2011-11-01 01:49:40 »

Amazing work, I don't know how you hold down a full time job and develop a successful game on 5 different platforms as a one-man band.

Do you think that in say 1 year you will ditch the platforms that prove to give negligible sales? HTML 5 and flex seem like a double-up. In fact if HTML 5 takes off there'll be no need to for any other platform I'm guessing?

Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #11 - Posted 2011-11-01 03:58:18 »

O__O There will always be a need for Java I hope! Tongue

Offline thaaks

Junior Member


Medals: 1
Projects: 1



« Reply #12 - Posted 2011-11-01 10:11:31 »

This is quite cool. Is your toolchain available for others to use?

What Eli says  Cheesy

Have you ever thought about monetizing your tool chain? I think you could sell this to quite a bunch of developers. At least I would pay for it  Grin

Cheers,
Tommy

PS: Legends of Yore is great and works fine on my cheap Android!

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2011-11-01 10:45:36 »

Quote
This is quite cool. Is your toolchain available for others to use?

"Quite cool" - why thank you! Smiley

Quote
Do you think that in say 1 year you will ditch the platforms that prove to give negligible sales? HTML 5 and flex seem like a double-up. In fact if HTML 5 takes off there'll be no need to for any other platform I'm guessing?

Problem with HTML5 at the moment (and I suspect for a while) is that the big portals (other than Kong) won't take it - and they have the mass web game market. If you're expecting to make some money from your games (no matter how little) you have to play ball - this means flash right now. Maybe in 5 years we won't see it as a games platform any more but right now I'm just not so sure.

Quote
O__O There will always be a need for Java I hope

Thats sorta the point for me. To me, Java can be viewed as a few things:

  • A language - it's a fantastic language
  • An SDK - it's got an amazing and massive SDK
  • A VM/deployment - it's got a great VM but a terrible deployment. Unreliable and massive. Thats the sticking point for most
  • Tooling - best tooling by far over any language. Eclipse = godly

So, the only bit I don't find conducive to games development is deployment strategies. I want to keep using my knowledge of java (which isn't too bad now). I want to keep utilizing the SDK (though thats limited with this approach). I especially want to keep using the tools.

Java is the win for development Smiley

Quote
Have you ever thought about monetizing your tool chain? I think you could sell this to quite a bunch of developers. At least I would pay for it  

I've been down this route a couple of times. The problem with open sourcing everything and/or selling it on is the support. As noted above I'm a one man band (always have been) trying to produce both games and cross platform libraries. Slick absorbed so much of my time that I stopped writing my own games - at which point, why bother?

So I'd be happy to sell the integration scripts and framework on, but more as an example of how to do everything rather than some generic ongoing tool chain.

In addition you really need to consider whether this sort of things works for you. Limitations for certain platforms limit your types of games you can build successfully. That said, any one of the platforms is quite cool - being to code in Java and deploy for flash is pretty great from a making money point of view straight away Smiley

I'll be building some other same games as I go along (once I've got the next legends update out) so time will tell I guess.

Thanks for the feedback/comments everyone.

Cheers,

Kev

Offline thaaks

Junior Member


Medals: 1
Projects: 1



« Reply #14 - Posted 2011-11-01 11:24:14 »

Java is the win for development Smiley
Agreed! Still my favorite dev environment.

Quote
So I'd be happy to sell the integration scripts and framework on, but more as an example of how to do everything rather than some generic ongoing tool chain.
I would be fine with that.

Quote
In addition you really need to consider whether this sort of things works for you. Limitations for certain platforms limit your types of games you can build successfully. That said, any one of the platforms is quite cool - being to code in Java and deploy for flash is pretty great from a making money point of view straight away Smiley
I'm aware of the limitations of some platforms. But creating and monetizing flash games with Java is pretty tempting  Grin
And having one code base for several platforms (I know that Java promises that for a long time now but we all know it's not quite true for some of the platforms you already seem to support with TouchAPI) is even more tempting!

Quote
I'll be building some other same games as I go along (once I've got the next legends update out) so time will tell I guess.
Does that mean we have to wait longer? Starting this thread about TouchAPI is just to make us envy you? How cruel!  Wink

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #15 - Posted 2011-11-01 11:29:02 »

Quote
Does that mean we have to wait longer? Starting this thread about TouchAPI is just to make us envy you? How cruel! 

Lol, well I wasn't going to big it up but I got a few requests to explain how it was working and I couldn't think of a better place than JGO Smiley

As to waiting, well, I don't really know. Right now I wouldn't know how much to charge or how to license stuff. It'd be pretty much just a dump of what I have I guess. And how to license etc. I guess I'd just go - donate - get zip - here's a bunch of stuff. It'd need a sample game though (you're not having legends Wink).

Cheers,

Kev

Offline loom_weaver

JGO Coder


Medals: 17



« Reply #16 - Posted 2011-11-01 12:43:39 »

Just wanted to chime in and say this has been really useful.  I was wondering how you got Java running on iOS.

What did you do about gestures and other features only available on a subset of platforms?  Just not use them?
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #17 - Posted 2011-11-01 13:20:42 »

Glad it was useful Smiley

I support some gestures, I map from the gesture response handler in the platform specific code into a control being pressed in the game code. So on iOS I might map pinch to Control.ZOOM - then the game can react to zoom. Then on desktop later I might map scroll wheel on the mouse to the same control so zoom then gets support there too - if you see what I mean. It's about abstracting what things actually mean I guess.

Cheers,

Kev

Offline thaaks

Junior Member


Medals: 1
Projects: 1



« Reply #18 - Posted 2011-11-01 15:22:38 »

Where does the server stuff reside? Or at least the communication with the server? All via HTTP?

Things like login, saving games/highscores and such? I guess basically all the Google App Engine stuff  Wink

And what about the payment interface PurchaseListener()? Is that implemented for Android and iOS only? Using their APIs? How does this work for the applet?

This IS interesting stuff, my brain's running in circles and I'm still at work  Roll Eyes

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #19 - Posted 2011-11-01 17:16:25 »

It's all via HTTP yep, originally hosted on Google App Engine - but due to their pricing changes moved over onto PHP on a VPS.

PurchaseListener is only supported for in-app purchase on Android and iOS. Thought I plan to add support for application in-app via paypal web.

Cheers,

Kev

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #20 - Posted 2011-11-04 10:31:31 »

For those still interested, I got the flash version working:

http://www.legendsofyore.com/flex/

It's got performance issues and the standard set of flash issues (doesn't run well on OSX). I'm working with the GWT4Flash to improve things but it's definitely a possible pipeline Smiley

Cheers,

Kev

Offline thaaks

Junior Member


Medals: 1
Projects: 1



« Reply #21 - Posted 2011-11-04 12:41:57 »

Cool progress! Definitely too slow right now (even on Windows) but I'll bet you'll work that out  Wink


Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #22 - Posted 2011-11-04 12:44:30 »

Chrome seems to give the best results by the way, it's at least a consistent lag between clicking and response then.

Cheers,

Kev

Offline thaaks

Junior Member


Medals: 1
Projects: 1



« Reply #23 - Posted 2011-11-04 13:09:12 »

Confirmed. Firefox is much slower than Chrome, at least on my machine here.

Chrome can be considered "nearly playable"  Grin

Offline thaaks

Junior Member


Medals: 1
Projects: 1



« Reply #24 - Posted 2011-11-04 14:23:48 »

I have a question regarding different screen/device resolutions. What is the best approach to deal with them for TouchAPi?
I assume you have some scaling mechanism builtin. But is it smarter to code and create graphics for a higher resolution (say IPad) and scale down on Android or old IPhone OR is it better to create the game for a low resolution and let TouchAPi scale up?

Can an app using TouchAPi have different resolutions on different devices (like 1024 x 768 on desktop app and something like 480 x 320 on Android or IPhone 3)?

Offline Cero
« Reply #25 - Posted 2011-11-04 14:25:13 »

seems fast enough on Opera - only the lick lag, but its like 800ms
playable
not that fast of a game anyway =P

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #26 - Posted 2011-11-06 10:57:51 »

Had a look at another way of converting from Java to AS3. This one converts the Java source to AS3 source:

http://dl.dropbox.com/u/1668516/flash/index.html

There's a tool called Java2AS3 which get you about halfway. Then I use JAD to decompile compiled java to remove some of the more annoying incompatibilities between Java and Flash. Finally some resources embedded scripts and some minor token replaces to get to AS3 - which I come with the open source AS3 compile and bing Smiley

Unfortunately, it relies on having some conventions in your java source (can't use method overloading for instance) so you'd really need to know you were targetting flash from the start or have a bit of rework to do on your code base (hence this isn't going to work for legends in the short term).

Still, nice to know there's another alternative. Plus side is of course that the code performs as well as any flash application and that the packaging looks exactly like a flash game, i.e. a single SWF. I expect to be using it for a few mini games in the future.

Cheers,

Kev

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #27 - Posted 2011-11-07 14:56:04 »

Just added some minor performance improvements.

Cheers,

Kev

Offline CommanderKeith
« Reply #28 - Posted 2011-11-08 01:24:16 »

That is cool, much faster start-up than java with no annoying logos.

So is this the tool that you are using to go from Java to SWF? I can't see any downloadable files or browse CVS.
http://sourceforge.net/projects/java2as3/

I also notice that there is this:
http://thunderheadxpler.blogspot.com/2007/11/java-to-as3-on-air.html

And this too:
http://wiki.eclipse.org/E4/SWT/Running_the_demos

Which all seem unrelated to each other.

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #29 - Posted 2011-11-17 14:09:09 »

I've done a bit more work using the Java2AS3 stuff and made stuff work a bit better. Here's a comparison page between Java Applet / HTML5+JS and Flash:

http://www.cokeandcode.com/fruitypops/

Be warned, running a bunch of different techs in the same page like that can have some annoying side effects. However, it tries to show the differences in performance, stability and start up time.

One java code base for all deployments. Android, iPhone, WebOS and Desktop outputs would work fine.

Cheers,

Kev

Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (23 views)
2014-09-12 09:08:26

Norakomi (56 views)
2014-09-10 13:57:51

TehJavaDev (69 views)
2014-09-10 06:39:09

Tekkerue (34 views)
2014-09-09 02:24:56

mitcheeb (56 views)
2014-09-08 06:06:29

BurntPizza (40 views)
2014-09-07 01:13:42

Longarmx (26 views)
2014-09-07 01:12:14

Longarmx (32 views)
2014-09-07 01:11:22

Longarmx (31 views)
2014-09-07 01:10:19

mitcheeb (39 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!