how the same video game is coded for different platforms

427 views

how the same video game is coded for different platforms

In: 8

8 Answers

Anonymous 0 Comments

At the end of the day, all programs break down into a complex series of MILLIONS Of individual actions. Each system’s processor has a list of instructions, think of it like a table:

Instruction 1: Add two numbers
Instruction 2: Move a number from one place to another
Instruction 3: save a number to memory
Ect…

When we write programs, GENERALLY, we u se what is called “High Level Language”. this means we write a program in terms of actions, rather than instructions Individual lines.

As a simple example, let’s say we wanted to add two numbers. We would write something like “x = number1 + number2”, as opposed to the individual instructions to load each number from storage into the adder, combine them, take the result out and move it to storage, ect.
We then rely on something called a compiler to convert this human written code into the series of instructions. By using a different compiler for each platform, you get a game that works on multiple platforms!

However, this is only part of the story. Different CPUs might be able to do some kinds of math much faster, and other kinds much slower. What will often happen is that developers need to use a different approaches for the same thing (like, say, the way they load a texture), to play to the strengths of a given system. Famously, the PS3 was FAR more powerful than the XB360, and yet a lot games in that generation ran much MUCH better on 360 because the PS3 was a very complex system that was tricky to code for. You had to use special techniques to get the most out of it. For this reason, platform differences are often different in code too, not just when compliled.

As an example of how this manifests, let’s take two systems. One is capable of loading textures from storage very fast, but does not have a large “cache” (place to store something close at hand that is very quick to read). The other has a fairly large cache, but access to storage is slow. You might write a game that loads textures as needed, only to find this causes loading times and popup on system 2 to be bad. So you modify the build for system2 to “cache” some commonly used textures, improving it’s performance

You are viewing 1 out of 8 answers, click here to view all answers.