• Question: How are games made?

    Asked by Hasafan to Ciarán on 17 Nov 2014.
    • Photo: Ciarán O'Brien

      Ciarán O'Brien answered on 17 Nov 2014:


      Whether it’s something really really big and complex like Skyrim or incredibly simple like super Hexagon, all games are the same at heart.

      Computers and consoles are just really fast calculators. They can do lots of complicated sums really quickly. A game is like any other computer program, in that it’s written in a programming language like Java, C+ or any number of other languages, so you have to know your way around a computer and how it works to know what you’re doing. A game is just a loop of making the same calculations over and over again (Has this bullet’s movement made it come in contact with something (True/False)? The player just jumped, what mathematical equation will describe the curve he’s going to move in?) until some calculations result in a specific answer (Is the player’s health at 0 yet (True/False)? Was that the final boss of the game(True/False)?)

      A simple game would be a program that does calculations like the following:

      BEGIN LOOP:
      -Has the player bushed a button? If yes, move them or fire the weapon. If no, leave them where they are.

      -If the fire button was pushed: Look up in the database which weapon was equipped, and fire a bullet of the right type out of it.

      -Update all the enemies with new positions.

      -Update the positions of all the bullets currently flying about.

      -Do any player bullets overlap with enemy locations? If yes, look up the database again for the type of bullet and type of enemy. Will this shot kill them? If yes, remove the enemy and play a little animation. If no, keep moving the bullet next time around.

      -Do any of the enemies overlap with the player? If yes, subtract 1 from their health score. If no, do nothing.

      -Go back to the BEGIN LOOP part and calculate all of this again.

      The calculations can be very complex, like in a first-person shooter the computer has to all sorts of horrible three-dimensional sums to figure out where the player is, which direction they’re looking, what parts of the map they can see at that angle, and recalculate all of that every time they move or look around. The computer has to keep track of light sources and calculate how rays of light bounce off different surfaces to make them look reflective or wet or glowing etc. there’s a huge amount of really difficult maths like trigonometry and differential calculus happening in most games, hundreds of times a second.

      People who make games need to be very good programmers, and they need to be good at mathematics, statistics, databases and more, because a game ties all of these together to create what you see on a screen, whether that’s Pac-Man or the latest Call of Duty.

      There are a couple of universities in Ireland that offer degrees in game design these days, I’m told by friends that they’re pretty good.

Comments