Showing posts with label RPG games. Show all posts
Showing posts with label RPG games. Show all posts

Sunday, August 31, 2014

My lesson plan

It's been awhile since I've posted (or really been able to work on my coding for that matter) so I decided I would try to post an update today and lay out a general guide I plan to follow. As much as anything, this post is just to lay out my plan and to create something a little more concrete, but maybe you'll find something of interest :)

At the end of July I made a trip to Vegas and then the following weekend made a trip home & I pretty much got completely derailed. While I did do some studying this month, I got out of my routine for coding, and now its time to jump back into it!

A question I commonly hear from new developers that are trying to teach themselves is "Where do I start?" or "What language should I learn first?". There tends to be a LOT of confusion on exactly how to go about teaching yourself. I have the benefit in that I sit around a ton of bright software developers, and thus have a better idea of what I should be teaching myself. In the near future I have a whole other post on that topic so stay tuned.

For now here is my plan: 

As much as I would love to spend countless hours each week studying & coding, I do have a full time job & other hobbies to balance as well, but I am hoping to dedicate on average 15 hours per week (min 10 hours per week) over the course of the next year (or however long it takes me). Two key areas I've been told to focus on - Data Structures & Algorithms, and Object Oriented Programming/Design. My focus over the last few months was to dive in on one topic until I completed it, but one of our Engineers brought up a good point last week; if you're in school you study multiple subjects at once, and he encouraged me to do the same.

I feel fairly confident that I can dedicate at least an hour and a half each night Monday - Wednesday with Thursday left open for Trivia and Friday is sometimes a go out night. That gives me between 4.5 - 6 hours between those three nights. Weekends will be heavier and I plan to spend 3-4 hours each day on Saturday and Sunday for another 6-8 hours total. Finally I'm hoping to have 30 minutes four days of the week either early morning before work or during my lunch break which adds up to another 2 hours. If I only hit the minimum on each of those time slots it still adds up to 12.5 hours per week of study time, but I do feel most weeks I can hit more.

Based on books I'm working on at the moment, my plan of attack is:

Monday - Data Structures & Algorithms in Java - 2nd Edition by Robert Lafore

  • This is a pretty intensive textbook I plan to study through, but I will also be implementing the various algorithms in not only Java (which the textbook shows you how to do) but also in one other language, most likely Ruby. This will help me to not only solidify my understanding of the concepts, but also help me to pick up syntax of another language at the same time.
Tuesday - Head First Object-Oriented Analysis & Design

  • Same general idea, study the textbook but work on implementing the solutions as well. I believe this book does a good job of giving you various problems & projects to work on.

Wednesday - Agile Web Development with Rails 4

  • My plan is to go through the book once to build their Depot application, and then I want to go back through the book again to do my other app for storing recipes.
Weekends - Saturday and Sunday will be left a little more open but I'll probably split the time evenly between studying material in the textbooks versus working on some coding whether its the depot app or my RPG game that I still have to finish

Early Mornings/Lunch - I'll probably do either CodeAcademy tutorials or other light reading as I can't dive too deep in 30 minutes. But it will still be a good opportunity to refresh and read up on certain things.


I'm going to give this a go until I start to get through some of these books, and then I'll re-evaluate and see how its working out.

Saturday, July 26, 2014

The "ABL's" of Programming

For anybody familiar with Sales, you've probably heard of the "ABC's" of selling which stands for "Always Be Closing". For people not familiar with sales, its basically the concept that if I were trying to sell you a tennis ball, and you objected and said you really don't like green tennis balls, I would ask you a clarifying question to understand what colors you might like, and then I go right back to the close with something like "so which would you prefer, a tennis ball of color 'x' or color 'y'?" Basically, as you uncover information about your prospect, you're still pushing for the close every step of the way.

As I was driving home yesterday and thinking about a good topic to write about, the ABC's kind of popped into my head and it made me think of a good acronym that applies to anybody that codes, "Always Be Learning" or as I titled it, the "ABL's" of Programming. I thought of this both because of some of my recent struggles, but it's also been a consistent theme on a Ruby Rogues podcast I've been listening to recently.

So how does it apply to me recently? A few weeks back, I had this idea to try and program a basic Text based adventure game in JavaScript that would present you with various scenarios and options, and based on your choices you'd progress through the game. I knew it would test my knowledge of several concepts like For Loops, While Loops, Iterations, etc. Well the first weekend I dove head first into the game and felt like I made a ton of traction. It almost seemed like a relatively easy concept that I would be able to finish and release within maybe a week's time frame. Well here I am about 3 weeks later, and still no working version of the game!

While I made a lot of progress that first weekend, my code gradually became more complex, and it started getting harder to keep things straight or decide how to pull the information I needed. After getting some advice from a developer that sits by me, and studying further into the CodeAcademy JavaScript tutorial, I then realized I could re-structure my game to follow a more traditional "Object-oriented" fashion and take advantage of JavaScript's Prototypal/inheritance nature. That led to a whole weekend of diving in, getting really confused, and then slowly figuring out how to once again structure my game and make it work. However, I learned a ton and my code was far better off because of it!

Well now I've run into another issue where one of my iterators keeps looping and is not escaping, so I worked briefly with another of our Software Engineers yesterday, and he mentioned that an "alert" method I'm using does not work well with browsers, and that I should strongly use jQuery for what I was trying to do. So now after about two weeks, I'm diving into a completely different area and once again deciding to re-structure my game to make it work better and become easier to work with moving forward.

I spent yesterday researching how to implement the jQuery library, which then also led me to pull in HTML/CSS and changing my game to a more graphical nature in the browser rather than being completely text based from JavaScript functions. While it's not absolutely necessary that I do this, I do envision where this is going to make certain aspects of my game a lot easier and a lot more efficient to code. I even learned how to make my page somewhat "responsive"! That basically means that if you were to start with a full screen, and start to shrink the screen, the elements will shrink along with it so that the page remains readable and functional. Especially since a web page can be accessed by so many devices including tablets, phones, laptops, etc. all of which have different size screens, implementing responsive design is an absolute must.

So basically what started as a simple JavaScript program with basic "for loops" & "iterators" has now evolved to be so much more. At least I've learned concepts and a little bit about other languages & libraries that I've been able to apply to my code. I've faced some type of challenge on an almost daily basis, but I've learned something new every step of the way and feel so much more confident today than I did a few weeks back when I started the game!

Software Engineering is definitely a field and skill set that requires you must "Always be learning!".


Sunday, July 13, 2014

Lessons learned

I've recently been working through the CodeAcademy JavaScript tutorials, so I randomly decided on Friday I would try to build a text based RPG game using the stuff I've been learning. Mainly, I've been learning about functions, arrays, objects, for loops, while loops, etc. I figured what better way to see what I've actually absorbed than to push my skills to the max by building a simple game that leverages these concepts. (If you aren't familiar with an RPG game - it means Role Playing Game. Essentially, my program provides you with a Scenario and then gives you various options. Depending on what option you choose, your game can have different outcomes). 

Here are some things I've learned this weekend:

  1. The internet is such a huge resource when you get stuck! I ran into an issue on Saturday that I worked and worked on, but could not figure out how to solve. I posted my question on Twitter and within 10 minutes had a conversation going with 4-5 other developers and I learned a few possible ways to solve it. The nice thing though, apparently my question wasn't a complete newbie question and actually posed some challenges to think about.
  2. While programming, when working on logic and flow statements, it's IMPERATIVE that you read your code with an empty & fresh mindset with no preconceived notions. If you think you know what the outcome should be, it can make it very difficult to effectively follow along in your code and troubleshoot.

    I'll try to give an example in layman's terms, which is actually the problem mentioned above:

    A user is presented with options 1, 2, 3, and 4 and each option routes to a different scenario. I wanted to ensure they selected one of the four options and didn't try to select 5 for example. My logical flow was:

    if userOption is not equal to (1 OR 2 OR 3 OR 4) then that is a bad result

    I spent at least 30 minutes reviewing through this line of code and trying to figure out why it was not working. And then finally the light bulb went off! My program was checking to see if userOption was not equal to any of those options; so for example, if I selected 3 (which I wanted to give a good result), it still compared it to 1, saw it was not equal to, and returned a bad result.

    The correct logic is .... ("userOption is not equal to 1" AND "userOption is not equal to 2" AND "userOption is not equal to 3" AND "userOption is not equal to 4") then it returns a bad result.

    That may look confusing, but the first one returned a bad result if "ANY" of the four were true (i.e. 3 is not equal to 1 --> true) and the second returned a bad result only if "ALL" of the four were not true.

  3.  I learned how to use the "Inspect Element" to see where I was having issues with my JavaScript. Ok so this wasn't something completely new to me. I had been told about this feature and have used it some to review my HTML. However, after struggling all weekend to figure out which part of my code I broke, it finally hit me Sunday morning to review the "Inspect Element logs" which tell me exactly which line my error was on. This would have saved me a considerable amount of time if I had used it all weekend. Live and learn right?

Well that's about it for this weekend. Stay tuned for my CodeNinja Adventure RPG game! I've finished a lot of the basic flow but still have a lot to build out. I'm hoping to wrap up the game within the next week or so and I'm going to try to embed the code within my blog so you could just click a link and launch the game. 

I definitely feel like my knowledge of JavaScript and troubleshooting errors has come A LONG way this weekend. Overall, I'd consider this weekend a success!!