Uncategorized

RSS feed for this section

Fuel Consumption Ratings for Canadian Vehicules in 2014

I’m currently following a course called Data Analysis in R on Udacity. Part of the course involves loading up a dataset found online, doing some exploratory data analysis, and publishing my results.

I used the dataset called “2014 – Fuel Consumption Ratings” available on this page:

http://data.gc.ca/data/en/dataset/98f1a129-f628-4ce4-b24d-6f16bf24dd64

As per the description: “A yearly data set of all passenger vehicles sold in Canada based on their fuel-consumption ratings, estimated carbon-dioxide emissions and annual fuel costs.”

I use this command to load the dataset:

fuel <- read.csv("http://www.nrcan.gc.ca/sites/www.nrcan.gc.ca/files/oee/files/excel/MY2014%20Fuel%20Consumption%20Ratings.csv");

Here’s a few commands to clean up the data frame:

names(fuel) <- c("Model.Year", "Manufacturer", "Model", "Vehicle.Class", "Engine.Size.L", "Cylinders", "Transmission", "Fuel.Type", "Fuel.Consumption.City.L.100km", "Fuel.Consumption.Hwy.L.100km", "Fuel.Consumption.City.Mpg", "Fuel.Consumption.Hwy.Mpg", "Fuel.Ly", "Co2.Emissions.g.km");
fuel <- fuel[2:1068, ];

Let’s load up the ol’ ggplot, as well as gridExtra for added flavour:

library(ggplot2);
library(grid);
library(gridExtra);
theme_set(theme_gray(base_size = 6));

First let’s coerce some rows from factors to numeric, to make plotting easier:

fuel[, "Fuel.Ly"]                         <- as.numeric(as.character(fuel[, "Fuel.Ly"]));
fuel[, "Engine.Size.L"]                   <- as.numeric(as.character(fuel[, "Engine.Size.L"]));
fuel[, "Co2.Emissions.g.km"]              <- as.numeric(as.character(fuel[, "Co2.Emissions.g.km"]));
fuel[, "Fuel.Consumption.City.L.100km"]   <- as.numeric(as.character(fuel[, "Fuel.Consumption.City.L.100km"]));
fuel[, "Fuel.Consumption.Hwy.L.100km"]    <- as.numeric(as.character(fuel[, "Fuel.Consumption.Hwy.L.100km"]));
fuel[, "Fuel.Consumption.City.Mpg"]       <- as.numeric(as.character(fuel[, "Fuel.Consumption.City.Mpg"]));
fuel[, "Fuel.Consumption.Hwy.Mpg"]        <- as.numeric(as.character(fuel[, "Fuel.Consumption.Hwy.Mpg"]));

Let’s plot a few variables to get a feel for the data:

fuelLY <- qplot(
  data = fuel, 
  x = Fuel.Ly, 
  binwidth = 100,
  xlab = "Fuel (L/year)",
  ylab = "Count"
);

co2emiss <- qplot(
  data = fuel, 
  x = Co2.Emissions.g.km, 
  binwidth = 8,
  xlab = "CO2 Emissions (g/km)",
  ylab = "Count"
);

fuelconscity <- qplot(
  data = fuel, 
  x = Fuel.Consumption.City.L.100km, 
  binwidth = 0.5,
  xlab = "Fuel Consumption in City (L/100km)",
  ylab = "Count"
);

fuelconshwy <- qplot(
  data = fuel, 
  x = Fuel.Consumption.Hwy.L.100km, 
  binwidth = 0.3,
  xlab = "Fuel Consumption on Highway (L/100km)",
  ylab = "Count"
);

grid.arrange(fuelLY, co2emiss, fuelconscity, fuelconshwy, ncol = 2);

Rplot

Looks like these variables (fuel per year, co2 emissions, fuel consumption per km) are all roughly normally distributed, and the all have a slight skew towards the left. This is a very interesting pattern. It could represent the car maker’s recent effort to make models “greener”, pushing the overall fuel efficiency up.

Let’s look at the media fuel consumption in the city broken down by manufacturer:

fuel$Manufacturer <- factor(fuel$Manufacturer); #To reset the factors

firstPlot <- qplot(
    data = fuel, 
    x = Manufacturer,
    y = Fuel.Consumption.Hwy.L.100km, 
    binwidth = 0.3,
    xlab = "Manufacturer",
    ylab = "Fuel Consumption (L/100km)",
    geom= "boxplot"
) + coord_cartesian(xlim = c(0, 16.5));

secondPlot <- qplot(
    data = fuel, 
    x = Manufacturer,
    y = Fuel.Consumption.Hwy.L.100km, 
    binwidth = 0.3,
    xlab = "Manufacturer",
    ylab = "Fuel Consumption (L/100km)",
    geom= "boxplot"
) + coord_cartesian(xlim = c(16.5, 30.5));

thirdPlot <- qplot(
    data = fuel, 
    x = Manufacturer,
    y = Fuel.Consumption.Hwy.L.100km, 
    binwidth = 0.3,
    xlab = "Manufacturer",
    ylab = "Fuel Consumption (L/100km)",
    geom= "boxplot"
) + coord_cartesian(xlim = c(30.5, 40));

grid.arrange(firstPlot, secondPlot, thirdPlot, nrow = 3);

ok1 ok2 ok3

 

(I apologize for the small images. Please click on them to see higher resolution…)

There’s many manufacturers compared to the number of 2014 models they each have, making the data a bit hard to read. Of the bigger manufacturers, Mini, Mazda and Honda have the most models with low fuel consumption, with a median near 6.

So this concludes my exploratory data analysis. Hope you enjoyed it.

My Totally Realistic Blog Name Generator

Here it is:

Click Here to Refresh

Blog Name Generator

GameDevelopersWeb.com Merger

I recently decided to merge my other blog, gamedevelopersweb.com, with my personal one. I was tired of having to manage both separately, and I feel like my other interests (biology, web development, learning) could have an overlap with game development.

For those interested, in order not to lose my SEO ranking for gamedevelopersweb.com, I followed these steps:

  1. I exported all the posts/comments/categories from GameDevelopersWeb.com and imported into a local installation of WordPress
  2. I reworked the categories and adjusted the theme to fit my personal website blog
  3. I exported them from my local installation into MichelCarroll.com
  4. Quickly after, I added a .htaccess 301 rule for each page and article on GameDevelopersWeb.com, including the root domain
  5. I logged into Google Webmaster Tools, and advised them that the domain name change had been made

I’ve yet to see the results of this, so I hope the domain change will go seamlessly.

What’s Indie Game Development?

Short Answer: An indie (independent) game developer is an individual, or a small group of individuals, who come together to make a video game, often with a small budget.

Long Answer: Indie game development is a rather new concept in the game industry. Since the game industry is now moving out of the basement and into cubicles, the world of  bedroom coders is now falling back on smaller scale operations to satisfy their creativity. Instead of focusing on ground-breaking graphics technology or cookie-cutter million dollar MMORPGs, it often concentrates on simplicity, innovation, and healthy addiction.

Some big players in the industry started off as independent game developers (look up the story of Casual Collective). Games don’t need to cost thousands of dollars to be fun.

What successful independent game developement teams need is:

  • Passion into making fun games
  • Determination
  • Artistic abilities
  • Programming abilities
  • Teamwork

One word of warning: Don’t jump into the indie movement thinking of making lots of money from very start. You might not earn a penny until 1-2 years into the business.

20 Tips for Newly Graduates

Although directly unrelated to game development, I thought it would be important for me to pass on some valuable wisdom from a fellow newly graduate.

Treking out into the modern age world can be exciting, but also quite intimidating. I hope these pieces of advice will help some of you be successful in your own personal ways.

  1. There’s no such thing as a free lunch.
  2. Try to keep in touch with your college/university friends.
  3. Keep work problems at work. Keep personal problems at home.
  4. Don’t be afraid to keep learning. Be a life-long learner.
  5. Beware of offers “too good to be true”. Remember: There’s no such thing as a free lunch.
  6. It’s never a bad time to make a budget.
  7. A word for the adventurous: Don’t fall into the notorious “syndicated white collar” mentality. Don’t get too confortable for too long.
  8. Actively find others with the same interests as you in your region. Unlike in school, it’s highly unlikely you’ll simply run into eachother.
  9. Now is a perfect time to follow your hobby.
  10. A word for the ambitious: Take the bull by the horns. You’re young enough to recover from falls (provided they don’t put you 10,000$ in debt).
  11. On debts: Make it your budgetary priority to pay them off.
  12. You reap what you sow.
  13. Keep in touch with your family.
  14. Don’t forget to enjoy your youthfullness while you still have it.
  15. Don’t ever resent your degree. A lot of time and sweat was put into it, making it an icon of your determination.
  16. Always improve on your ability to work with other people; this is something that’s always going to be invaluable to your career.
  17. If you never did, now’s a good time to start reading books.
  18. Try to get as many hours of sleep each night. You may not notice it, but you get much less done in a day when you havn’t had a good night’s sleep the last night.
  19. Reflect on what you want to see yourself doing in 3-5 years, and aim your efforts towards it.
  20. Subscribe to my blog. You won’t regret it.

Game Programmer – 2009 Entry Level Guide

This article is for you guys (or gals) out there planning on breaking into the game industry by becoming game programmers. It’s a very tough field, so don’t expect to get a job right away after college/university unless you’ve been planning for it all along. From my intense research, I’ve compiled a small guide to give you a good idea of what you’re about to get into.

Let’s go through the qualifications most companies look for in entry-level game programmers:

  • Intermediate C++ (or Java)
  • Knowledge of DirectX (or OpenGL)
  • Excellent Math skills (Trigonometry and Linear Algebra)
  • Having worked on several game projects in the past (approx. 1 year experience)
  • A working demo
  • Enthousiasm

Feeling overwhelmed already? For the dedicated game developer, it’s worth it.

As for the 1 year experience, that’s why I mentioned earlier how important planning is. This time can include working on personal projects, as long as you have something to show for. Expect to be asked which types of games you’ve made in the past, the techniques you’ve used, and the problems you’ve encountered. Companies arn’t looking for fresh fish; they don’t have time to waste on hopefuls.

The other specifics sometimes depend on who’s hiring. However, the C++ requirement almost never changes. Why? Because the game industry still uses C++ because of how flexible the langague is, and the number of programmers still using it to this day. If you’ve never done C++, now’s a good time to learn it; trust me, it will never go to waste.

I hope this article has given you a good idea of what to expect. Give me a shout if you think I’ve forgotten an important detail.

Flash Games – The Industry’s Freeway

If you’re like me, from one minute to the next, you’ll spontaneously get the urge to hunt flash games on the internet.

I think it’s the fact that the internet carries an infinite supply of them, and that there’s flavours to fit any gaming mood, that draws me to them. Also the fact that they barely take 10 seconds to load.

Flash games are one of the gaming industries fastest growing trends. This is due to several reasons; here are a few :

  • Flash games are relatively easy to create
  • Extremely small load time
  • Their audio-visual nature

Hundreds of games come out everyday, and 95% of them are weeded out as boring. People have incredibly low attential spans these days, so flash games need to be very addictive and distinct in order to attract visitors.

For game developers, the flash games industry is a good fit. It’s the means for a creative programmer to earn a big amount of money for something he enjoys doing.

For new players in the flash game market, Flash Game License is a great place to start out. It’s a website where developers meet publishers, and bid money on flash projects. It also includes a big and friendly community to answer questions and offer support.

Earn Money Programming Games

Did you know that Paul Preese, the creator of Desktop Tower Defense, makes around $8,000 a month?

Programming games, even as a hobby, can be lucrative. Even publishing free flash games on the internet has potential to bring in money through advertisements.

Any novice programmer has the ability to create such a game. Most addictive games are very simplistic. This includes flash games, browser games as well as some application games.

Here’s an interesting success story for you:
Chris Sawyer developed Roller Coaster Tycoon.

Alone.

Since its initial release, Roller Coaster Tycoon earned him $30 million. You may think this is a poor example, since this game came out in 1999, and times have changed. However, I’m telling you this to make my point clear about how a good game idea can go very far.

If you’re having trouble thinking of an original game idea, here are a few pointers :

  • Browse free games on the internet, and make a note of the ones that catch your eye.
  • Find a game that you can play for 2+ hours
  • Think of some universal facts to base your game around. Revenge, love, and greed are some of them.
  • Consider the importance of buzz-worthy. Are people going to want to share your game with others?

To finish off, here’s something to think about. What’s stopping you from creating a popular game? Seriously. I bet most of today’s most addictive flash games are created by amateurs. If you think you have a good game idea, good chances are that the game will catch on if developed properly.

Thanks for reading. Stay posted for more eye-opening articles.