July 31, 2012

The Pains of Libgdx

For the most part, libgdx is an absolutely wonderful gaming framework. It provides a flexible, efficient, and easy to use framework. However, it is still is being actively developed and modified. I absolutely praise them for the changes they made in their massive re-factoring, but that came at a huge development cost for myself. The shear number of changes essentially broke most of my rendering/input code and forced me to rewrite large sections. I guess in a way it gave me time to review some of my original implementations.

Fortunately, I like to code in a very modular fashion so all of the game logic was unaffected. Then again, the game logic is probably the most trivial part of any game. Just because the code behind the scenes is well written and effective it really has no influence on how you display that information to the user. When I'm looking to create a game I focus on and overall architecture of MVC (Model-View-Controller). The idea is pretty simple:

- View: The GUI/Input handling/Resource loading
- Model: The game logic, game objects, interactions
- Controller: The loading and storing of data related to the model. Saving your progress, loading the missions/enemies/etc.

The big downfall to this approach is the View becomes a super massive object. I've seen people attempt to separate the input and graphics. This never works out well, as you find the input becomes highly coupled with the graphics anyways. For all the extra code you have to write, it really isn't beneficial.

Resource loading on the other hand can easily be moved out of the view and I have just been really lazy. I'll probably worry about this once I've finished integrating with the new stuff libgdx has decided to shove down my throat. :(

I can see myself writing some tutorials on libgdx once I am almost finished my game. The complete lack of information consolidated in a single place is really painful, so I'd like to help other people learn about how to use the framework.

July 18, 2012

New Game

After a few weeks of intense work, I'm very proud of my work in progress. Unfortunately, I'm using 'borrowed' assets to quickly mock-up and prototype everything so I can't show anything I've done yet. However, I'll be switching over to some creative common data in the near future and will be able to at least show off some of my work.

I decided to take a different approach with this game. Instead of focusing on the parts I want to finish, I'm saving those for last and working on some of the more mundane parts. Obviously, this means the game isn't really fun because those are the parts I'm not touching yet. After having experience with working on a large product I keep thinking about security, localization, usability, etc almost all the time. I also keep pushing those thoughts aside and am focusing on getting things working and functional. Following some simple rules I've come up with some pretty modular ways to create the game so coming back and cleaning things up will be easy and make things shine.

Anyways, back to the workbench for me... I got a game to craft.

July 3, 2012

Scala, JME3, Slick2D and Diablo 3

It has certainly been a while since I made any posts here but I have been very busy.

A while ago I decided to try out a few different gaming frameworks and touched some 3D. I've always been hesitant about 3D because added that extra dimension increases the complexity of the code. Complexity always means more work; naturally, I try to avoid it like the plague but I figure I should experiment a bit and learn a few new things.

First thing I have to say is the JME3 framework is very impressive, the guys have done an amazing job building a gaming framework you can easily and intuitively extend to meet your needs. The tutorials were great and I learnt many concepts about developing games in 3D. I even came across a fabulous UI framework called Nifty. Nifty is nifty, the power of easily being able to create custom UI is unmatched. While there is a learning curve to it, once you have gone through the tutorial guide, which is well written, you will see how powerful and easy it is to build complex UI without breaking a sweat. The only real drawback with JME3 was their own IDE. It was a pretty decent design environment; however, I couldn't be convinced to leave the juicy features of Eclipse. In fact that leads me to the next point, Scala.

Scala is an absolutely wonderful language that really showed me numerous weaknesses in other languages I have worked with. It really impressed me and I was considering it for future projects when a few minor issues cropped up. First of all, the complete lack of IDE support and features made the language feel archaic. Without some good re-factoring support, auto-formatting, auto-imports, auto-completion, quick fix and error handling it just really turned me off from using it. I had to spend ages finding some of the syntax errors I was making because it would break code in a few related files. I had to clean projects a few times, just to clear the cache so it wouldn't show errors where they didn't exist. The other issue was the Scaladocs, an in particular the lack of information on the collection APIs. It made the learning curve pretty steep and coupled with the lack of integration into Eclipse, the benefits of the language were quickly lost with the difficulty of working with it.

Scala has been around for a little while, but it is clear it still has a long ways to go before you could seriously use it for development. I guess if you don't normally utilize the IDE to the full extent I can see why you wouldn't notice the problems I was having with it. I'll give the Scala community a few more years before I jump back into trying it out again, but the general programming knowledge I learnt from playing with Scala was wonderful. The concurrency model in Scala is top notch, I wish I had the power of actors in other languages! Scala has a bright future ahead, but the tool support needs to catch up before I'll even consider using it for anything serious.

After monkeying around with JME3 I decide to go back to 2D and learnt about Slick2D a Java gaming framework which is an alternative to libGDX. At first I liked the API and the layout of the framework and how easy to use it was. It didn't last long when I realized they only gave you the bare-bones and everything is 'do it yourself'. I do like writing code, but having to build my own framework on top of Slick2D just to make it work decently in a true object orientated way is not a good approach. I spent a while integrating Slick2D with Nifty and a few minor road bumps and lack of documentation later I came to realize I just built what libGDX offers out of box, any libGDX offers support for android and html5 out of box as well. It just felt like a step backwards, but I did enjoy seeing a different set of API and a better rendering framework. I almost wish I could pick and choose which parts of each system to use, but we all know how much of a nightmare that could turn into.

Then May 15th hit, Diablo 3 came to life and I spent many evenings staying up late and playing far too much for my own good. I will admit, I had a blast and a couple of issues with the game didn't really upset me. Over the next month and a bit I put in well over 300 hours into the game, made back $35 and had a blast. However, after all of that I hit a point where I just got tired of killing the same things over and over without much of a reward. Sure they boosted the drop rates for good items recently, but the most glaring flaw with the game is the simple lack of content. I can play through the entire game in under 6 hours. I played the game for 300 hours. I ran the same content over and over about 50 times. Maybe not really exactly that number of times, but it sounds pretty close to the truth. I played parts I enjoyed, and eventually got bored of it. I played different and fun ways testing out unique and odd builds with various sets of gear. I played 3 different classes up to 60, played hardcore, and cleared inferno minus a few parts in Act 4 because I never got good drops which were worth the millions of gold I need to to buy gear.

I got my money's worth out of Diablo 3 and I might come back for an expansion, because the only thing really missing from the game was unique things to do. Honestly, if the game had more content I could easily see myself playing it for longer. However, I am done with it and decided it was time to jump back into development mode and I'm enjoying it again. Funny how what some people do for a living I find more enjoyable than playing Diablo 3. I guess there is a difference between having control and power over a game, and being a simple consumer. I should have a few more things to show in the coming weeks, but we shall see where I end up.