So over the week since I decided to come back to blogging I realized that of I was going to make sure I posted regularly I need to work on my projects to find something new and insightful to write about. Hopefully I’ll find the time to work on my projects enough to post something once a week. So what does any of this have to do with the title of this post? What is “Haggle”?
Haggle is my white whale in a sense, it is the project I have never finished, the game that I have used to learn about all sorts of game development platforms but never could get far. The game consists of rapid trading in order to get a full hand of one type of card.
The major goals in the development process are:

  1. Multiplayer
  2. Speed
  3. Mobile or mobile friendly


Making a game that has really quick controls that work well for mobile is incredibly difficult. The very first versions of Haggle were developed for Android but never got far because the card selection process was to slow to me. I tried to leave it alone and come back to it while working on the basics of a server for multiplayer functionality but I lacked the experience to make any good progress. (I also realized a couple months ago that in my previous attempts that I was focusing way too much on details of how to scale up the servers and the graphical effects instead of implementing the core gameplay.).That was when I gave up the first time.

A few months later I was already back to making Haggle, this time for my AP CompSci class as a final project. This time I was still using Java but instead of the Android canvas I was using the Java Swing libraries. The server I had mostly copied from my last attempt but I never really worked on this version much because I felt like it just looked terrible and using images was a pain from what I remember.

HAggle got put on the shelf for a while at that point. I focused most of my time working on trying to make a turn based strategy game in HTML5 and canvas but the team I was working on didn’t get me much support in front end development and things just started moving super slowly. Fortunately, I still learned a lot about rendering in the canvas tags and what i would need to do in order to properly manage game state. When this project started falling apart I started to mess around with WebGL rendering. I decided to use Babylon.js because I had already gone through a short course on how OpenGL and WebGL work at the basic level and I wanted a decent amount of abstraction (but with shader access of course). This lead to a version of Haggle that was almost just purely visual experiments and animations ect. When I couldn’t get the exact look for the game that I wanted without some heavy handed shaders I decided to drop this version (this is where I began to realize that I was focusing too much on certain details before I even wrote any gameplay code.)

Soon after this realization I said that I would try a different approach to making the game. At this point I had gotten a fair share of JavaScript experience (thanks to my internship as well as the demos I did), and I wanted to try my hand at writing a Node.js server. This is where the current iteration of Haggle stands. I had over the course of 2 weeks ripped through all the core features that Haggle would need from the multiplayer server and created a method of local testing so that I could create, join and start games. I was trading cards between players pretty quickly after that. I had to constantly prevent myself from starting to add new features that weren’t needed in the core to make sure I wasn’t getting caught up in unnecessary details. Socket.io helped me get working connections that handle reconnecting really fast, and overall working with Socket.io’s WebSockets was great. I have started working on the client side for this new version of Haggle that will interact with the server I wrote. MY current choice of libraries is CreateJS for handling asset loading, and for the nice Flash-like graphical API (being a AS3 veteran is nice), and RequireJS to separate all the different JavaScript blocks I want to use. Using Node.js really showed me how useful splitting my code is in JavaScript, because my turn based strategy project got very unwieldy, very quickly. I’m currently working on figuring out how to use RequireJS to help with state management, which is normally the most annoying thing for me.

Progress is slow though, with the end of the semester coming, and my laptop needing a a replacement SSD I have to put this project almost entirely on hold. Hopefully, I will have something new to say about the project next week though. This post has gotten quite a bit longer than I expected it to be, and my writing has gotten a bit aimless at points but I think its a good start for this blog. Thank you for taking the time to read this, or at least parts. If you want to know how I use these libraries or how to set up a project like this let me know and I’ll write something about how I set things up.


Leave a Reply

Your email address will not be published. Required fields are marked *