Close
Advertise Here
Page 1 of 6 123 ... LastLast
Results 1 to 10 of 57

Thread: Baby steps

  1. #1
    OUYA Devotee Juggle's Avatar
    Join Date
    May 2013
    Location
    Yuma, AZ
    Posts
    169


    Baby steps

    I got a message from EdK asking if I was working on anything for the Ouya. My answer was "not yet but if and when I can I'll be sharing it on ouyaforums".

    And I was honest when I said I didn't know if or when I'd be able to share. But that message kind of lit a fire under me. A co-worker and I have been talking for a few years about branching out into doing some simple games. We've done a few simple flash projects together and are both gamers ourselves, but he has no coding experience and while I may have majored in photography in college my artistic skills are nothing compared to his. I'm a sloppy lazy coder who's never been a huge fan of Java, but I love android (he's an iOS guy) and it got me over my active dislike of java enough to code up a few sample apps even before I had an android device to run them on.

    I'm frighteningly close to 40 and wrote my first basic program before I was 10, but I'm still really new to java and android development. But I've taught myself to write games before and am up for a bit of a challenge. Even before EdK contacted me I was researching what path I'd want to take to get code running on my Ouya. We're not looking to make huge games yet - just some simple atari 2600 level gameplay but with nicer graphics to get our feet wet. If we can make some small but fun to play samples then we'd get serious about putting some of our bigger ideas on the table. So for now we're working with no budget and whatever spare time we can come up with. I looked at gamemaker and while it has a lot going for it it also appears that to build for Ouya will cost a couple hundred dollars - more than I can spend for what we're looking to do. I looked at Unity, and even downloaded the free version, but even more expensive to buy and $75 a month adds up quick - not looking to make commitments like that right now.

    I looked at the option of doing something like construct2 and then phonegap to get it running on the Ouya...but that's just too many things to go wrong and too many layers of abstratction.

    I finally decided that libGDX looks like it's going to do what I want and need for free and matches a lot of what I already know how to work with.

    When I found out I had a four day weekend this weekend I got excited, until I learned my wife has to work all 4 of those days So I'm watching our 3 year old. Tough to get much coding done while giving her attention But there are naps, and bedtimes, and a few hours in the morning mom isn't at work...and today school is open so I have a bit of time available.

    Yesterday I was eventually able to get my dev environment setup. I started just trying to update the versions of Eclipse, the various plugins for it and my Android SDK - and quickly got into update hell. They were all way too far out of date and causing crazy dependency issues. So halfway through the day I decided to start from scratch and just installed a fresh copy of eclipse, the ADT and GWT plugins, and got the Android SDK updated. By evening I was ready to start making code. But didn't have time to try until late. Even so in just an hour or two I was able to work through this tutorial and get code up and running on the desktop and my phone - woo hoo! It's just the first 'far enough to run' bit of putting something on the screen so far - long way from being a game. But given how many mistakes there are in the code shown on that webpage and how many tricky bits there are in eclipse and android development in general I'm pretty stoked to have it running. The rest is all stuff I've done before - just in a new language with a new framework, this was the BIG hurdle for me.

    But it still wasn't running on Ouya. My dev computer is in a different room. I didn't want to setup a full dev environment on the computer in the room with the Ouya. But it was enough to easily connect the Ouya, root it (again, lost it in the last update), and turn on wireless adb. Back to the back room with a quick "adb connect" then play in eclipse...there's the Ouya as an option...and by the time I walked over to the room the Ouya is in....my code was running!

    Damn that felt good.



    Now on to the boring part - getting more familiar with a new to me IDE, a language I'm still learning to accept, and a framework I've never touched before. Want to get far enough to get Ouya controls working today which is the next big challenge I'm looking at tackling.

    I won't say it's been easy to get this far...but it has been easier than I expected. I didn't expect to find so many errors in the tutorial I'm following, most (maybe all) of them are solved in the discussion at the end but the page itself could use some updating. But I actually had fun finding them and fixing them myself, Eclipse really does make that kind of thing easy masking a lot of the things about Java that have always left me pulling my hair when trying to develop in it in the past.

    Ok - back to the code, I've only got so many hours until the end of the school day!

  2. #2
    OUYA Fan Kevin Dekkers's Avatar
    Join Date
    Dec 2012
    Location
    Amsterdam Area, Netherlands
    Posts
    22


    Good read, good luck with your endeavours!
    On the subject of Unity, the newest version supports mobile development for free. Not sure where you're getting your numbers from it doesn't require you to buy the Pro version to release at all.

    LibGdx is a good platform for Java. If you don't like Java there's plenty of alternatives. For example, there are a bunch frameworks for C++ available which support android. Other than that, I'm a pretty big fan of Adobe AIR.

    Anyway, as I said, good luck

  3. #3


    Cool! It's tough trying to fit coding in around everything else life throws at you, but definitely really rewarding

    It sounds horrible, but just remember to limit your ambition and start with really small, basic games (not like me ) so that you can finish a whole game, learn lessons and slowly move onto bigger and better things
    @JamesACoote
    Executive Star now available on OUYA Discover

  4. #4
    OUYA Devotee Juggle's Avatar
    Join Date
    May 2013
    Location
    Yuma, AZ
    Posts
    169


    I thought the free version of Unity would do it...but couldn't tell for sure. It was still too much and too many layers of abstraction for my tastes. I'd like to get into it down the road. But for now and with my current goals and aims - it's just too much.

    Android being Android I'd rather stick with java, I've done a project or two in AIR but don't think I'd want to use it long term. C++ would be nice but I mess with Java way more often than C++ anymore. So while I'm not a big fan of Java I have pretty much come to terms with it. I keep going back and forth between praising Eclipse when it auto completes/includes/frameworks something for me - and then cursing at Java when eclipse isn't smart enough to read my mind

    I've got input controls working for touch and keyboard...but haven't quite got my head around the libGDC controller stuff enough to implement it yet. Probably won't get to it today either.

    As for my ambitions - they're very limited. I've done simple games before and that's what I'm aiming for. My plan is to something similar to the old 2600 kaboom first since it's one of my all time favorite games and usually the first I try to replicate in any given language. But I'm going to go through this whole tutorial first - then get it working with the Ouya controls - then try my own thing.

    Got a lot done today, but not as much as I'd hoped so we'll see how I'm doing by the end of the weekend. I'd really like to be moving an animated sprite around the screen with the controller and doing some collision detection before I go to bed Sunday. Should be able to do that...but not sure if I'll have time to tackle the controllers or not. Would put time into packaging a .apk so I could install it on my phone and show my co-workers before I'd put time into getting the Ouya controllers working

    --------

    Well, was able to get a bit more done last night. Realized that the apk is left behind on the device after running it from in Eclipse (told you it's been awhile since I did any android development) and worked through the rest of the tutorial.

    So I've reached a point where I have (and almost entirely understand how it was built) the first steps towards a game:


    Right now I only have controller support because apparently through some quirk of android/ouya/libGDX the left analog stick and dpad both seem to map the same as the keyboard direction keys that I'm currently looking for as input. I'm still working on getting my head around the actual GDX controller libraries and how to implement them correctly.

    My co-worker came over yesterday as well and got to try the Ouya for his first time and was impressed. He's got a bunch of ideas and some pent up creative energy and is really excited to take some simple game play and dress it up nice.

    I'm going through a few other sample projects today and getting a feel for how some of these are put together and comparing ideas. May start my own thing today still...but don't want to get into it right now (nap just started but that's only about 2 hours of time max) so will probably hold off until tomorrow morning. I'm pretty sure I understand enough at this point to put sprites on the screen, animate them, control them and detect collisions....might do a bit more playing with the tutorial code first.

    ----------
    Going through those other sample projects was quite an eye opener. The samples included with GDX really show off just how easy it is to work with this library. After looking at a few of them I felt like I had started the hard way with the tutorial I followed.

    And to be honest I can see good and bad things about either as a learning resource. The samples that come with GDX are really bare bones and more like test code than actual functional games...not that the code from the tutorial is yet complete enough to be anything I'd consider a game. But at least the tutorial does a good job of explaining why it's structuring things the way it does and does a reasonably good job at introducing the MVC pattern (though it seems the person writing the tutorial doesn't do a very good job of keeping their controller code in their controller letting it leak into their view...I'm just not sure yet if this is a side effect of libGDX requirements/limitations or if it was the fault of the person writing the tutorial. Like I said I'm still new to almost all of this!)

    Personally I've never been a fan of MVC for the kind of work I do. But I mainly work on small projects as the programmer and very little of what I do is complex enough to benefit from OOP let alone MVC. And while I've been working with OOP since the mid 90's I still feel that for a lot of smaller projects it just adds a lot of extra overhead and programmer busy work - though I'll also readily admit that it's a godsend for larger projects. But that's just me. I was so used to procedural programming before I had my first formal programming class that it's been a hard sell to me to embrace OOP since - and MVC just takes that all a step further.

    It's telling that the superkoalio sample in the gdx sources at under 300 lines does most of the same stuff at the same level (and then some since it an actual map and pans around it) in one 10k file as the tutorial project which takes 24k of source spread across 10 files in 9 directories.

    The big difference of course is that the tutorial breaks things out into much finer grained classes and attempts to follow the MVC pattern so it should theoretically be much easier to extend out into a full game. (except based on how much changes in the code of the tutorial on each step it sure seems like it's making more work than necessary because the author is writing as he goes instead of documenting something that's already built.)


    All that being said - I met my goal. I was able to build a playable version of "Kaboom" in under 24 hours. The "simple game" example in the GDX wiki is very close:
    https://code.google.com/p/libgdx/wiki/SimpleApp

    With what I learned from the tutorial I was able to setup the projects to build for desktop/android/html5 and get the "simple game" example code from the wiki page up and running on my desktop, phone and Ouya in just a few minutes. Seeing everything come together in one little file like that instead of spread across almost a dozen helped me put a lot of things together that I was starting to get confused about in the tutorial.

    I was also able to easily tweak that sample code with a few simple changes:
    1) I added a "dropper" at the top which moves semi-randomly around denoting where the next drop will come from instead of just randomly picking somewhere to place a drop.

    2) I added rudimentary level support so that every time you catch a set number of drops the difficulty increases (number of drops to the next level doubles, time between drops gets shorter, level counter goes up) and so that when you miss your level partly resets (number of drops to the next level drops and time between drops gets longer again.) It's really quick and dirty and has a lot of bugs, and doesn't pause when you go up/down a level...but I was just testing ideas.

    3) I added some simple on-screen displays showing the level, the number of drops to reach the next level and the time between drops.

    These changes only took me an hour or so and most of that time was just me playing around with various ways of getting the dropper to move the way I wanted it to.

    With just an hour or two of actual work I had a playable version of something starting to resemble Kaboom. And determined that it would totally suck on Ouya because a controller just doesn't cut it for that style of game. The old Atari paddles are the way to go, with touchscreen being a close second...but joystick? Nope, just doesn't cut it. (touchscreen works fairly well though - my wife was already having a hard time putting down my little demo test once I got levels implemented)

    My co-worker had a few other ideas for games we could try so we'll have to put our heads together and see what we want to try instead of fleshing out a Kaboom style game. He wants to do something like a simple choplifter and I'm open to that, he was also potentially interested in doing a simple platformer since he enjoys mapping...which is a genre I had been avoiding thinking about because I didn't want to have to make a bunch of maps I still tend to prefer procedural games that randomize their gameplay since I don't want to have to script the users experience for them. So it's nice to have him to work with since while we do have a few skills that overlap most of our interests complement each others rather than compete

    So it was a really good weekend for me. In just a few days I went from not having touch android code in almost 3 years to building two games from tutorial and a 3rd from a demo as well as getting a rudimentary framework for my own ideas together.

    This weekend the real value of the $100 Ouya has really hit home for me. With zero cost in software and extra hardware I was able to teach myself enough to start from scratch then build and deploy something onto my Ouya. Yes, there's still a long ways to go to make any of it into a playable let alone releasable game. And then a bit more work to go through to get it into the Ouya/Android stores....but I can see most of the path through to those final goals now and it's got me really hyped.

    Just wish I had four day weekends every weekend so I could get this much work done every week (even if it did make my one real day off on this extended weekend feel like just another day at the office sitting here coding, it's always easier to take when I'm coding something for myself instead of someone else!)

    Merged your posts.
    Last edited by Hydrus; 08-05-2013 at 12:04 PM.

  5. #5
    Inebriated Staff Ninja DrunkPunk's Avatar
    Join Date
    Mar 2013
    Location
    MT
    Posts
    4,945


    This is great to read! Please continue to keep us in the loop as you move forward.

  6. #6
    OUYA Devotee Juggle's Avatar
    Join Date
    May 2013
    Location
    Yuma, AZ
    Posts
    169


    So no updates for awhile but that doesn't mean I've abandoned this. Just haven't had time for any updates and not much worth updating

    For now I'm pretty focused on building my Java/ADK skills - I'm reading Thinking In Java to brush up my basic Java skills and I'm getting ready to dig into Beginning Android 4 Games Development next (I skimmed the first few chapters of the various Android game books Zechner has authored or helped author and that one seems like the most up to date.)

    At the same time I'm still playing around with turning the GDX sample "Simple Game" into a real playable game.

    I'm starting to get used to Eclipse and I've started playing around with eGit for Git integration with Eclipse and put what I've done so far up on github: https://github.com/jhitesma/ZebraDrop (though I'm still having some issues with things showing up in my git repository that are excluded in my .gitexcludes file...but I've had that problem with command line git in the past, I'm sure it's something simple that I'm missing.)

    I've pretty much decided to focus on making this first project into a polished playable game that I can put up on the Play store before I dig in on something for Ouya. This feels backwards to me though since supporting something for android in general seems potentially like a LOT more work than supporting a single platform like Ouya...but I'm not building anything I'm looking to make money off of here. Just a little freebie game to get my feet wet and see how the Play store works as a developer. And the big reason is this kaboom clone plays pretty darn nice on a touch screen but just won't cut it with a joystick so targeting Ouya isn't a great plan with this.

    Right now my little "ZebraDrop" is very playable and there are just a few more features I want to add in. But it suffers from a BAD case of "programmer graphics" - my co-worker has been waiting on me to finalize a few things before he makes me some good artwork for it. Hopefully that will happen soon since I'm almost done implementing features. The game does install and play on Ouya...but joystick is REALLY sub-optimal for it and I haven't found a way to leverage the touch pad to solve the interface issues.

    I'm going to have a week of extra free time in mid to late August while my wife and daughter take a trip to visit family and leave me here to work. So between now and then my co-worker and I are trying to finalize plans for a joystick playable game we can build. We've got lots of ideas so far but haven't picked one to focus on yet.

    But I'm not in a race here. Just taking my time and having fun with the 30-45 minutes a day I can spare for this! Once I'm done reading TIJ and BA4GD I'll have more time to spend on code and things will hopefully pick up a bit. In the meantime anyone who wants to follow along can grab the project from GitHub and see what I've been playing with. The .apk is in /zebradrop/zebra-drop-android/bin (I've been trying to exclude the /bin directories but for some reason they're still in my repo) so you don't even have to build the project yourself to give it a try. The code is UGLY and I freely admit it...but I'm not trying to make a great game here as much as just test some ideas out.

    Oh and the Zebras? In case I didn't mention it already that's thanks to my daughter who asked me to make a game with "Zebras in UFO's!" in it. So that's kind of my go to default theme for now

  7. #7
    OUYA Devotee Juggle's Avatar
    Join Date
    May 2013
    Location
    Yuma, AZ
    Posts
    169


    Managed to add a persistent high score and high level today. And got to see my daughter play a game that I wrote for the first time...it was also the first action game that she really played by herself which made it even better!

    And my wife is enjoying it enough she wants to me load it onto her phone for her

    Writing up a list of graphics for my co-worker. Should have this thing looking nice shortly!

  8. #8
    Inebriated Staff Ninja DrunkPunk's Avatar
    Join Date
    Mar 2013
    Location
    MT
    Posts
    4,945


    Quote Originally Posted by Juggle View Post
    Writing up a list of graphics for my co-worker. Should have this thing looking nice shortly!
    Very nice! Good to see that you continued down the path and now you have a whole game nearly complete.

  9. #9
    OUYA Devotee Juggle's Avatar
    Join Date
    May 2013
    Location
    Yuma, AZ
    Posts
    169


    So past few nights I've made a little bit of progress. I went ahead and registered as an official developer in the play store and uploaded my .apk as an ALPHA release along with setting up a private community in Google+ so I can give people access to it. Actually kind of surprised at how many of my friends are apparently not only active on G+ but also willing to join some random community I created Not that 15 is a lot of people but it's more than I thought I'd get on there. Most of them are iOS people but 2 of the iOS people have actually expressed an interest in getting an android device now since I'm developing for it so that was kind of neat.

    If anyone reading this wants to join the community drop me a PM on here and I'll work on getting you an invite.

    As for the game itself I found that while I've been working on extending and expanding the libGDX sample "Simple Game" that the libGDX wiki was upgraded with a part two of the simple game doing some of the same things I've been trying to figure out...only doing them better. Specifically setting up scenes so I can have a start screen, a game screen and a game over screen. The way I did this I knew was a cheap hack but turned the game into something more playable. Now that I've seen a better implementation I'm hoping to recode what I've done to match the project that got me going since their implementation is MUCH better than what I'm doing.

    I also tried to get the game running on my nook color running CM7 and ran into a problem. I suspected it was due to my textures. I knew my texture handling was very sub-optimal. I also knew I was doing something wrong because I kept getting the "textures must be a power of two" compile error and had just forced that check off and used OpenGLES 2.0 to get around it. But on the NC I just got a white screen so I figured it was time to figure out what I was doing wrong. Quickly realized that I had been misinterpreting the error message. I was reading it as "factor of two" not "power of two" for some reason (that's what happens when you only get to code late at night!) After a quick forehead smack I resized my textures just packing them with transparent padding and it worked on the NC...though performance was not great. So at that point I decided to get serious about the textures and instead of loading them all individually and padding them with transparent pixels to fill them out to a power of two sized PNG I dug in on figuring out why the GDX texturepacker and I had stopped getting along. Few little power struggles between me and the texture packer and I finally have my textures moved into a TextureAtlas and am loading them all from there - which seems to have perked up performance some. (I keep forgetting to add a FPS display to confirm things really are faster...)

    Speaking of adding display...that was something else I figured out earlier this week. How to prepare bitmap fonts for use in libGDX. And with that working I cleaned up my score and level displays quite a bit. I also had added in multiple buckets that again work like Kaboom so you loose one when you miss a drop and gain one back every 1,000 points. And I got a persistent high score working using preferences.

    Honestly right now the game is very playable and I'm having a lot of fun trying to beat my own high score (no one else who's tried it has beaten my score yet...but only a half dozen or so people have tried it so far!)

    Today I'm working on adding some sprite animations in and getting rid of the last of the graphics from the "Simple Game" sample. But my photoshop skills are rusty so it's pretty ugly stuff still. Hopefully my co-worker will come through this week with some high quality artwork for me. Once I get the original sample graphics out and my own images in I may bump it from Alpha to Public in the play store so anyone who wants to can easily grab it and try it. But I'm really not in a hurry for that....I've also started reading up on google Play game services (though this is getting OT for an Ouya forum since those aren't supported on Ouya) and am going to try and implement a leaderboard and some achievements. If I get those working and the graphics updated with sprite animations of my own design...then I'll feel better about pushing it to public on the play store. But I'm really not expecting to get that much done this weekend. If I can get achievements and the leaderboard working by the end of next weekend I'll be ecstatic.

    Ok, not a lot of nap left before my daughter wakes up...let's see if I can finish wrapping up these sprite animations....

  10. #10
    OUYA Devotee Juggle's Avatar
    Join Date
    May 2013
    Location
    Yuma, AZ
    Posts
    169


    Well, I was able to add sprite animations very easily yesterday. Took me longer to prepare my ultra lame artwork than it did to bash out the code.

    After bedtime yesterday I was also able to setup the google sample project showing how to use their game services and this morning I got it all fully configured and running. Not applicable to Ouya but just something I wanted to learn for other android devices.

    Now it looks like time to branch my code and start making the fairly major changes to correctly implement screens. Having that done will make it easier for me to add the game services stuff I want in here before making this public.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •