Roku development III: untouchable!

by Niels Brouwers 15. August 2014 06:06

Here we are with part 3 of the ongoing process with the Roku port! First a small note: each of these posts describe a step in the process of bringing the Carter Jones Adventures to the Roku device, however please keep in mind that I can not spend more than about an hour a day on this project because I have a family and day-time job to take care of as well. Thus, each post represents about an hour of real work.

So, after getting things up and running, the first thing to do was map some keys to the Roku remote control so I could navigate to the gameplay part and see how that looks/performs. Doing that was pretty straightforward: just adding in some

s3eKeyboardGetState() 

calls to pick up on the keypress events and we had a game running on the big-screen. Check my Twitter (also on the right of this page for a neat picture of my TV with the Roku just visible on the bottom right). Nice, I could play the first level, albeit with some hick-ups and weird initialization things going on!

Next step was developing some logic for handling the navigation in the user interface. Carter Jones was built for touch-devices and my TV certainly is no touch device. So, I started on the title-screen, introducing something of a 'focus-concept', where I highlight the selected user interface element and when OK is pressed a 'tap' is registered on that element and the corresponding logic is executed.

I could have made some nice generic framework code to handle this, but because the number of user interface elements in the entire game is relatively small I decided to program this out for each screen separately. This will be a bit more manual labor but it is a proven solution and it does the job (I always tend to embrace the KISS principle here, even if it means a little more 'work' for me). 

So for now, the title screen is ready. The following screens are still on the to-do list: levelselect, credits, options1, options2, gamescreen, game-over, level finished. I think I can probably delete the option screens because I can't adjust the sound from my code and there is no touch-screen, so that leaves little to configure!

Tags:

Roku development II: unlock your device!

by Niels Brouwers 12. August 2014 22:46

Ok, so I got the Roku and after playing around with it for a while I decided to see if I could download the Carter Jones Adventures on the little device. I fired up Visual Studio, then did a fresh build and hit publish. The marmalade deployment tool popped up and after configuring the deployment for Roku the package was successfully built.

I then started reading on how to get the zip file to the device (of course I could have done that already...) . To start with, you need a Roku developer account which you can request / configure through the Roku website. Through the same website, you can enable your device for development, which I also did.

Once your device is configured for development, you can telnet to it (for debugging, you can open telnet on port 8085). Also, enabling your Roku for develpoment, opens up a neat little webservice that enables you to download your application to it. I figured I was all set and ready now, so I downloaded the executable to the Roku, that worked fine. Then on the device (on my TV using the Roku remote), I went to 'My Channels' and selected the app I just downloaded.

The result was an endless 'Loading' in the top left bottom of the screen.....huh?

So I tried the 'Hello World' example, same thing....weird! Then I checked the debug information in the telnet, it said this:

------ Running ------
Starting.
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.

Current Function:
001: Sub Main()
002:     print "Starting."
003:     ndk = CreateObject("roNDK")
004:     retval = ndk.start("pkg:/app",["--debug"])
005:     print "Returned - " ; retval
006: End Sub
'Dot' Operator attempted with invalid BrightScript Component or interface refere
nce. (runtime error &hec) in ...AAU2vt0i/pkg:/source/main.brs(4)
004:     retval = ndk.start("pkg:/app",["--debug"])
Backtrace:
Function main() As Void
   file/line: /tmp/plugin/KBAAAAU2vt0i/pkg:/source/main.brs(4)

Local Variables:
global   &h0020 rotINTERFACE:ifGlobal
m        &h0010 bsc:roAssociativeArray, refcnt=2
ndk      &h0080 Invalid val:invalid
retval   &h0000 <uninitialized> val:Uninitialized
BrightScript Debugger>

------ end ------

The above message is pretty non-descriptive, but as I learned, it means that the Roku device is not yet enabled for development by the Roku team. So, just beware, if your device is not white-listed by Roku for development, you can 't actually use it to deploy / side load your application!

After figuring that out, a quick email exchange with Roku whitelisted my device, and I was ready to go!

 

Roku development I: unboxing

by Niels Brouwers 8. August 2014 20:40

The great people at MadeWithMarmalade sometimes collaborate with platform vendors who wish to increase the amount of Apps / Developer adoption of their platforms, this results in the so called developer offers. The Carter Jones Adventures was initially released under such an offer (for the BB10 platform).

It is pretty safe to say that without these kinds of incentives, my endeavours in the games/app development would never have been made public like The Carter Jones Adventures is now. I am just the kind of person that needs some external pressure to get things finished and pushed out to the public.

So, now there is a new developer offer and it involves the Roku - a pretty unknown device in the Netherlands but in the US it apparantly is, it is often compared to the Apple TV or Google Chomecast line of products. In short, it is a small device that plugs in your TV through HDMI and makes your TV smart by adding media streaming capabilities (netflix, hulu, etc.) and....games!

I will be porting the Carter Jones Adventures to this little box, using the crossplatform MadeWithMarmalade SDK. To get started, I received my Roku 3 last week.

 

 

The connector was flat, so that required a converter but that was quickly solved. Once I hooked it up, I noticed that this device is rather snappy - unlike, for example, the Sony Bravia smart televisions that we use at our office, this device responds instantly to a button press. Setting up for consumer usage is pretty easy and I was quickly adding channels and checking out the features. Impressive little device, so far.

 

In my next post, I will get a bit more in-depth describing how to set the thing up for development and some issues that I ran into with that.

Back from holidays!

by Niels Brouwers 15. July 2014 05:33

And they were great!   Just before I left I managed to push The Carter Jones to the Android store, that makes four in a row:

 

 

 

 

 

All made possible through the magic of cross-platformness by MadeWithMarmalade - they have actually made the 'starter' version free now for everyone to use! That is some pretty cool tech that they are giving away right there: develop your game/app on windows and publish to all the stores with the push of a button, so easy - and so native!

I don't work for them, but used their SDK for The Carter Jones Adventures and they are really supportive and just a cool bunch, be warned though, it is C++ you will be coding in and that is not for kids.... (unless you choose some of their alternatives which I never tried, so no opinion about it).

Anyway, I think we got all bases covered, right? A port to Tizen failed, after multiple submissions and vague reports with failure descriptions that made no sense to me. A Windows Store port is still on my wish list....Amazon / Nook maybe? Who knows, I'll dig into it once I get some time!

 

 

Oh right, my website!

by Niels Brouwers 22. March 2014 06:11

Yeah, I should post a lot more here....I know, I know!

Just some quick Carter Jones news: last weeks I have been toying with some ad providers for the Android version and it looks like I have found a pretty decent one (that is, one that's working without too much trouble/hassle). I am still not really happy with having to show ads in my game, but maybe it will generate some money, which would be a nice change :-).

Also, putting ads in the game means it will be free and that lowers the barrier for the people who want to play the game. We'll see how it will go, expect a release for Android pretty soon!

I have also been chugging away on the Windows Store version, porting the C++ code over from Marmalade to Microsoft C++ was pretty easy. Now all I need to do is get it back to working again, this means replacing all the Marmalade stub functions I made with working equivalents. I would also like to include some form of joystick/controller support (my XBox 360 controllers will be useful for that!), so there is still some work to do on that front.

That's all for now, next time I'll have a new image for you, promise!