Oregon State University|blogs.oregonstate.edu

We’ve finally broke out of Breakout!  March 7th, 2025

This week we concluded our development for this this term with a great product to showcase next term. Working on this project was my first choice and I was more than delighted when I found out that I was going to be apart of it. I originally chose it because it had to do with recreating a game in Unity which was something that I wanted to do and also it had machine learning also wrapped up in it, which also was another one of my interests. And thus far it has more than met my expectations. I have had a blast being part of the development team. The things that we have accomplished and the final project have been quite worth the journey, and it was a fun journey to boot! I think one of the most difficult parts of working on the project was understanding how the machine learning agent was interacting with Unity application and being able to manipulate it to fit our needs. We ended finding a couple of guides that really paved the way for our success. All in all it has been a great ride!

Thanks,


Unity for the Win!  February 7th, 2025

While working on our Atari Breakout clone we have rebuilt the game in the Unity Engine. Unity is a Microsoft product and it integrates well with the C# code that runs a lot of the backend of the game. I have been really impressed by how well the two integrate with each other! For instance I can simply create a public variable in one the C# code files and save it and it shows up on the Unity Engine when I switch back to it. That quick and seem less integration between the two environments has definitely won my praise for ease of use!

Like any editors or development environment there is a steep learning curve. I have at least 20 hours of training in different aspects of the Unity game engine, just so I could be efficient in it’s operations. I can’t begin to describe you the amount of options and variations that are available at your finger tips! And the best part is that there are thousands of training videos that Unity has created to help you through all of these options. It just takes a bit of time in the beginning, and then only your mind and imagination are the limit.

I believe that our team as well has really enjoyed the Azure DevOps experience that we choose for the tech stack. The integration of all Microsoft products just seemed right and has made our life pretty easy for getting things rolling. All in all it has been a great experience so far and I’m excited to see it through to the end!

Thanks,

Tyler


Let us code clean!  January 17th, 2025

Clean coding is a concept that is constantly at the forefront of my mind on a daily basis while smashing keys and trying to change the world. How often have you gone out to create or update a method or function and realized very quickly there was an easy way to do it and there was a harder way to do it? And then how many of those times was the harder way the right way that creates clean code, and the easy way creates those smelly codes. This post will attempt to describe one of the most recent clean coding principles that I have run across, single responsibility principle (SRP). SRP is defined by Caltech as each module or class should only do one thing [a]. This often starts off as simple additions a line or two here and there to an existing methods until you eventually have a 300 line long method that originally started out as 15 longs line [b]. I can honestly say that this has happened to me more times than you would think. And I find it is easy to do this unless you are constantly of the mindset that you should write the code as a test driven approach. If I had to write a unit test for that method that was 300 lines long how complex or nearly impossible would it be to test every branch and every possibility? So text driven coding practices I believe really help to avoid these situations.

Another way to help aid in the trap of bloating out your methods is dependency injection. With dependency injection I can create an interface that has the method definitions, and then inject that interface into my classes and functions to perform the tasks that I need to do. For instance below we a simple code that I have written to show this. We create our dependency ILoveToLogStuff and inject it into the constructor of the LetsDoSomeWork class and assign it to the logger variable in our class. Now we can use that logger anywhere in the class! There’s no overhead of instantiating an instance of the logger class or anything. And if you want to change the logger now, you just change the simple logger and don’t have to refactor your working method! It’s really a great thing once you really start getting into dependency injection and it’s power.

Well that pretty well wraps up this iteration of Scripts of the Shire, and as Gandalf would say to some bad code smells “You shall not pass!”.

public class ILoveToLogStuff
{
    public bool LogMe(string stuff)
    {
        // log some stuff
        return true;
    }    
}

public class LetsDoSomeWork(ILoveToLogStuff logger)
{
    public ILoveToLogStuff logger { get; } = logger;

    public bool WorkWork(MoreWork work)
    {
        // Do some work on things
        logger.LogMe(work.IDid);
    }
}

Citations

[a] Caltech, “Clean code principles,” Caltech Professional Education. [Online]. Available: https://pg-p.ctme.caltech.edu/blog/coding/clean-code-principles. [Accessed: 16-Jan-2025].

[b] Refactoring Guru, “Code smells,” Refactoring Guru. [Online]. Available: https://refactoring.guru/refactoring/smells. [Accessed: 16-Jan-2025].


Atari is getting fancy!  December 2nd, 2024

We have continued to push forward and make significant improvements to the game. Ben and Caden have been ploughing ahead on the clone side even including audio! Jack has been getting along well with the AI side, and I was able to get the first draft hosted in the cloud, so it could be played from web browser. Here is the URL if you want to see it https://mlbreakout.azurewebsites.net/ . It really is shaping up very quickly!

The next big chapter for our team is going to revolve around the Machine Learning Agent, finalizing the clone, and the automated build pipelines. The ML side of the project will allow various models to be trained to showcase different tasks of the system, the finalizing will include all the bells and whistles that you would expect with a game like victory screens, your high scores, etc. And the pipelines will allow an automated path for the deployment of changes.

Can’t wait to see ya on the next update!

Thanks,


Machine Learning and Atari  November 12th, 2024

For my project I was put in the group that is going to be cloning the classic Atari Breakout game, and then using Machine Learning teach an agent to play it and beat humans and possibly other machine learning agents. This was honestly my first choice of a project so I was very excited to be apart of it. To aid in my enjoyment as well our team is also pretty awesome. I feel like all four of us complement the different pieces of the team very well, and contribute nicely to the end goal!

We choose to use Azure DevOps for our tech stack. This is a Microsoft product, so it integrates well with Unity, and Git. In Azure DevOps (ADO) the git piece is called repos, but it acts identical to how a git repo would act, with pushes, pulls, pull requests, etc. Furthermore you can really begin to do some cool stuff with pipelines and integrating deployments into your pipelines. Not to mention it also allows you to create agile style boards to track all the project management side from epics, user stories, bugs, and many more with the pull requests or pushs that fixed or completed those stories! It is honestly a very powerful product!

Well stay tuned for the next installment of using Machine Learning with old school Atari!


About Me  September 29th, 2024

Hello, my name is John Kinkade but I actually go by my middle name Tyler. My Dad is also named John as his first name and my mother wasn’t keen on calling me junior, so instead I was always called by my middle name. I grew up in mid Missouri what most people would call the “country” but I always felt like growing up it was a mix of city living and country living. We weren’t necessarily farmers, although we did raise cattle for a few years for meat only, not for a living. We did own a tractor but it was more for general use around the property and not necessarily for livestock. My high school school had a graduating class of over 600 people, which is not a small town vibe sort of school. I suppose I grew up in between the two worlds, I spent nights out in the woods freezing my butt off in a sleeping bag, but also stayed up all night slamming Mountain Dews with my friends playing the newly released game on our original Xbox’s with cables pulled throughout the house to system link them together, that was hitting the shelves called Halo. I guess looking back I was destined to go down an “IT” profession.

After a mediocre finish to high school, emphasis on mediocre, I decided to try and work full time at a steel beam manufacture and go to school full time in the evenings for Computer Information Systems degree. Life has taught me since then this was not a good idea… After two years of schooling and nearly $30k in student load debts, I had nothing to show for it, and a 2.2 GPA. I knew I needed to do something drastic to kickstart myself into doing something. I decided to join the Navy in their Nuclear Propulsion Program, because it sounded cool! This would be one of the best decisions I have ever made to date in my life. I have no doubts in my mind, that if I wouldn’t have left the world I was in at the time, I would have ended up in terrible trouble of some sorts. Decisions of the bad variety were being commonly made in those two years of my life.

After less than a year in the Navy I married my high school sweet heart. We are still married to this day after 16 years. We welcomed four children into our lives during my time in the Navy. 3 girls and one boy, and the boy is the youngest. I was stationed in Charleston, SC for 2 years for schooling, then 5 years in Kings Bay, GA onboard a submarine, then another 2 years after that back in Charleston as an instructor teaching Reactor Theory, before finally separating from the Navy after 9 years. It was a bittersweet separation, as I will always miss the comradery but will never miss the politics of the military. To put this into perspective, I had a Supervisor after the Navy, tell me a story of being stationed down in the south east as a helicopter repair, on a base where there were no helicopters…. for 2 years! That story in my opinion explains how disconnected the “upper brass” (pentagon level leadership) can be from the sailor or infantryman just trying to make it day by day. Furthermore, I have yet to work for another organization that promoted purely based on the writings of a piece of paper, without actually interviewing an individual. This in my opinion is one of the biggest mistakes I saw made, but I digress.

After the Navy I found myself working for Nucor Steel, in one of their mills in nowhere Arkansas. I initally came in as a shift electrician, after 8 months had promoted up to a day electrician, and after another 6 months had promoted up to a lead electrician. Side note, I’ve always found that if you put in just a little more effort than what your job requires, you can stand out so easily. You don’t have to go the extra mile per say, just go the extra 10 feet is all I’m asking! That’s all it takes, because the majority of the people are just going through the motions until the next paycheck.

After 2 years in Arkansas I had the opportunity to transfer up to mid Missouri to help build a brand new steel mill for Nucor, right next to where I grew up. For the next 3.5 years, I pretty much didn’t see my family. Don’t get me wrong, I was making extraordinarily great money, especially for the cost of living for the area, but I was never home. I worked anywhere from 50 to 90 hour weeks with an hour drive each direction, which meant at least another 10 hours of driving maybe 12 – 14 if we worked on the weekends. My final breaking point was on my birthday in 2022. I got home late, my wife was stressed out from also working and having to take care of the kids pretty much by herself for the last 13 years while I was in the Navy and Nucor, so I ended my birthday with a night of reflection of how our lives needed to change.

Insert drastic change number 2! The following Monday after that night I put in my two weeks notice with Nucor. I had at this point already applied and been accepted by OSU but hadn’t started classes yet. I left Nucor with no job, and no idea how I was going to support my family. I had enough money saved for us to last for a few months, but that was it. After a month or so of looking for jobs and applying I got what would be a huge break and great opportunity. I accepted a job at the State of Missouri that was a 75% pay cut from leaving Nucor to get my foot in the door with software development. I was hired on as a associate developer in asp.net C#. I had never developed in C# or MVC or web applications in general. The programming experience I had was all in PLC (Programmable Logic Controllers) while at Nucor, and they are a different beast all together. I was there for only 6 months before being picked up by a private company as a Application Developer in C# asp.net again. I’ve talked to my current supervisor about why he hired me, being so green with no degree, and his response was because you said you found what you wanted to do with your life and it showed. What he meant by this was I often joke around now that it took me 35 years to figure out what I wanted to do in life. And once you find that, the sky is the limit! It has been so easy for my to excel now. I study materials at school at night and then apply them during the day at work.

Since I left Nucor I have become far more connected with my wife and children. I don’t usually miss games or recitals or concerts anymore, I’ve missed enough! We moved houses that was more beneficial to our family, I stopped using all tobacco or nicotine products, and no longer keep alcohol in the house, meaning I’ll have a beer or two once a month instead of 6 a night. I feel like I’ve improved in every facet of my life, because I started filling my glass with the important stuff first, vice trying to fill it with money first. I guess the moral of this about me rant is that, don’t give up, don’t settle, and keep looking until you find that passion that makes getting up and going to work everyday a beautiful morning for the right reasons!

Thanks,


Scripts from the Shire  September 29th, 2024

Welcome to Scripts from the Shire by John Kinkade. This is a blog dedicated to the advancements of knowledge in regards to software development with a twist of Tolkien thrown in! I hope you enjoy the reads and bid you well on this journey of “The One Code to Rule Them All”.