Sunday 28 June 2015

A bit of background

Self learning ain't easy

Being a self taught programmer and game designer is definitely not going to be easy, I am already finding the task of finding good material to learn from to be a problem. Often when I am finished with one resource, the next either assumes a greater level of knowledge or falls back to basics.

My main resources for learning Java have so far been:
  • Codecademy: My first look at coding was the Javascript track which I began playing with just from curiosity. While this is not the best track to learn programming, at the time this was the only one available. Ruby and Python came later with redesigned tracks to support the programming route as a whole.
  • CS106A Stanford Programming Methodology: Lectures by Professor Mehran Sahami
    This series of lectures is available on Youtube and has assignment material available via the Stanford website. This course first introduced me to Java with Karel, the little robot.
  • Java - An introduction to Problem Solving and Programming: Walter Savitch (5th Edition)
    This textbook was donated to me by a work colleague who had taken the course as part of her university education but had no interest in pursuing it further. The book helped me to move away from the safe environment of Stanford's custom Java work space and onto making my own applications within Eclipse. I am currently using Eclipse Luna version 4.4.1
  • TheCherno: Youtube Game Programming series
    This series was a love/hate one, I enjoyed the coding and following along with a project and being able to tinker was very fun, but I think while the aim was for newer programmers to use this series as an introduction to game programming, it sometimes left me wondering what the heck I was doing. I stopped following this series after about 60 episodes but it definitely contributed to inspiring my continuation of studies.
  • After a period of stagnation and loss of direction, I finally found Head First Java, which took a couple of attempts for me to work with. At first I found the quirky sense of humor to be annoying and tired of it. It took another couple of months before I gave it another try (following some reddit advice) and got through my brick wall.

Recently my studies in Java and Android have also been accompanied by a read through of Fundamentals of Game Design by Ernest Adams. Reading this has helped me to pin down the vocabulary I need for my designs and also given me new ways to examine the games I draw inspiration from. So far I'm into the third chapter. I plan to give the book a good read through and then return to it when I put my ideas down to make sure I am doing what I need in an industry standard way.

The game I am working on designing and coding is an economic simulation in a food service setting. My ideas have been littered around my apartment in different forms without any direction, but the book is helping me to organize my approach. It's still important to write down or doodle my ideas, but I am now trying to keep the wild "this feature would be amazing!" type ideas from taking up too much time. Once I have a working prototype and my core mechanics working properly, then the features will be tested and discarded or developed as necessary.

I have also been looking into keeping an offline private wiki as a means to keep all ideas and documents I write accessible from one place. For this I have started learning to use a program called Wikidpad. With such little organization so far, there's not much to put into a wiki but as I bring my design ideas together and throw away the garbage, I intend to post snippets of wiki pages for people to read here too.

Simulations

My main interest is in simulations, and as I have gained new skills I have done my best to create small scenarios in code that behave in ways typical of simulations. For instance, once I learned about ArrayList and the QueueBlocking Arrays, I put together a background service in the mini restaurant testing program I have to create parties of guests at random intervals, assigning them to different Queues based on the size of the party, and limiting the combined total number of queueing parties. When a "table" became available, the service (nicknamed the Hostess) would assign an appropriate sized party to the empty table and free up a space in the queue.

More recently, while learning about serialization techniques, I created a mini simulation based on the classic fantasy triangle of damage. Warrior > Ranger > Magic User > Warrior. This is a common strengths/weakness model, most notably for me found in Runescape. The simulation pitted armies of each type into a war where each of the three types is randomly paired into a skirmish with a member of one of the other armies. Their fight gave an outcome and eventually all members of an army died and the results were saved out to a text file.

An example of the output is shown to the right, of a battle between 50 "mobs" per army. It was very fun to tweak some of the stats I had given each class to see how the outcome was affected. Getting the numbers to become pretty fair was surprisingly sensitive, as even a slight increase or decrease to a stat sometimes swung the outcome a completely different direction.

This type of simulation taught me a lot about how to work with arrays and random number generation. Having to check the arrays for "dead" mobs and delete them, creating damage and damage absorption that is calculated on the fly in each skirmish and even adding in a dodge and accuracy stat really mixed up the outcomes.

Starting simulation: Number of Combatants per army = 500
Ending simulation: Number of Skirmishes = 2806
Time taken: 0.279sec


Moving forward

My intention with this blog is to create a place for new programmers to look to see my trials and tribulations. If anyone can gather any knowledge, resources or inspiration from me then this blog will have served a purpose. For my own needs, I want to use this as a place to summarize my studies, hold myself accountable, and also to see where I was at a particular stage of my journey. Please feel free to get in touch if you have any questions or comments. Thanks for reading!

No comments:

Post a Comment