| |
 |
 |
Applied Academics
Pixelmaniacs |
Computer Game Designer
Applications of Mathematics 10 |
Lesson Idea by: Van McPhail, Okanagan Mission Secondary School,
Kelowna, B.C.
Computer game designers create concepts for new computer games. Designers work with programmers, artists and sound technicians to create a game, although in smaller companies, designers will end up programming the game themselves.
"Most games are models of something, either a reality (like a fighter simulation) or a fantasy reality (like a role-playing game)," says Mark Baldwin, an award-winning computer game designer. "And since these are models of the world in the computer, math is the tool for managing these models."
Baldwin says designers use all kinds of math. "Gads, we use basic math all over the place. And trig and calculus crop up quite often
even lighting effects on a graphic screen (require an application of mathematics)."
In groups of three or four, discuss the following:
- Think about all the different elements, visual effects and features found in a computer game. How do you think a computer game designer would use mathematics in the design of these elements?
- Can you think of any other situations where you may use the same type of math as used by a computer game designer?
- How would you program an object (such as a ball, bullet, or spaceship) to move across the computer screen?
- How would you change the speed of the object?
In small groups, perform the following tasks:
- Select a 5 metre length on the floor. (An uncarpeted floor will work best.)
- Use strips of masking tape to mark the 0, 1, 2, 3, 4, 5 m distances.
- Measure the time it takes for a moving object (basketball, marble, or toy car) to travel the 5 m distance.
- Repeat above step four more times.
- Calculate the average time needed to traverse the 5 m distance
- Record data on chart below.
To complete the following activities, you will need to know the following principles:
1. Methods of conversion
i) metric unit to metric unit
ii) imperial unit to metric unit
Remember: To convert imperial into metric, or vice versa, multiply the value to be converted by the "conversion unit." The conversion unit is always written as new (or desired) unit divided by old (or existing) unit. In other words, the conversion unit is written as the number of desired units per one of the existing units.
| The conversion unit looks like this: |
new unit |
| |
old unit |
For example, you want to convert 6 miles to kilometres. So you write 6 miles multiplied by the conversion unit. In this case the conversion unit is kilometres (desired unit) divided by miles (existing unit). You know that there are 1.6093 kilometres for every mile, so:
6 mi. ( ___________ km / mi.)
6 mi. (1.6093 km / 1 mi.)
The two mile units cancel each other, leaving kilometres as the unit. Multiply for the solution.
6 x 1.6093 km = 9.66 km
6 miles is equivalent to 9.66 kilometres.
| 2. Formula for velocity |
|
v = d |
| |
|
t |
3. How to calculate an average.
(In the example below, the sum of the trials divided by the number of trials).
Complete this chart with your data:
| Time |
|
| trial 1 time __________ |
| trial 2 time __________ |
| trial 3 time __________ |
| trial 4 time __________ |
| trial 5 time __________ |
| |
|
| average time __________ |
| |
| Calculations |
|
| a. velocity of object in |
min. |
|
__________ |
| |
sec. |
|
|
|
| b. velocity of object in |
min. |
|
__________ |
| |
hr. |
|
|
|
| c. velocity of object in |
km. |
|
__________ |
| |
hr. |
|
|
|
| d. How long would it take the object to travel 1 m? __________
|
| e. How long would it take the object to travel from the 3 m to the 4 m mark? __________
|
| f. If a camera was set up that had a field of view from the 2m to the 3m mark, how often would it need to take a picture to ensure that it got a picture of every object passing between the 2 marks? (Hint: Assume they are travelling the same speed as your object or slower.) __________
|
| g. How many pictures would the camera take per minute? __________
|
|
You've come up with a new war simulation game. According to your storyboard, a tank will move across the screen from left to right at 10 mph. The screen represents one mile. The screen itself is 500 pixels (locations) across. The game updates the screen 10 times a second.
What is the tank's speed in pixels per minute? How many pixels has the tank moved in 0.3 minutes? (Using a piece of graph paper with each pixel being represented by a square will help you visualize this problem)
How many pixels has it moved at 4.5 minutes?
Taking into account you don't want to calculate the tank's position any more often than necessary, how many game cycles (screen refreshes) can you skip before calculating the tank's position such that it moves from each location to the next? This is to ensure that we see the tank at each pixel as it moves across.( Hint: This is the same type of question as in f and g in the Learn section above.)
Additional Activity
Complete the calculations as above, using a screen size of 600 pixels and a tank speed of
| Course/Grade: Applications of Mathematics 10 |
Curriculum Organizer:
Problem Solving, Shape and Space |
Curriculum Sub-organizer(s):
apply previously acquired knowledge when solving problems
adapt problem-solving strategies to new and unrelated problems
apply mathematics to solving problems in other disciplines
demonstrate group skills that encourage the extension of each person's ideas
select and apply appropriate instruments and units of measurement for determining length, area, volume, time, mass, and rates |
Prerequisites:
Number operations, units of measure |
Resources:
· masking tape
· floor space
· objects like marbles or balls
· access to phones for price quotes |
Solution to Learn
a) What is the tank's speed in pixels per minute?
To discover what the tank's speed is, change
1 hour = 60 minutes
The tank is moving at 0.166 miles per minute.
Now convert the distance to pixels.
1 mile = 500 pixels
| 0.166 (500 pixels) |
| minute |
So at 0.3 minutes, the tank will be at:
| 0.3 minutes x 83.33 pixels |
= 25 pixels |
| minute |
|
At 4.5 minutes, the tank will be at:
| 4.5 minutes x 83.33 pixels |
= 375 pixels |
| minute |
|
b) If the screen refreshes at 10 times a second, (taking into account you don't want the computer to calculate the tanks position any more often than necessary as it slows down the computer), how many game cycles (screen refreshes) can you skip before calculating the tank's position such that it moves from each location to the next?
Convert the "velocity" of the tank from pixels per minute to pixels per second.
1 minute = 60 seconds
| 83.33 pixels |
|
= |
83.33 pixels |
= |
1.38 pixels |
| minute |
|
|
60 seconds |
|
second |
10 refreshes per second.
Assuming that the velocity is the minimum refreshes per second, then the screen needs to refresh 1.38 times per second. So you can skip 8.62 refreshes per second. The computer can do less work by recalculating the tank's position less frequently.
"But skipping 8.62 refreshes makes no sense in the real world -- you can skip eight or nine, but not 8.62," says Baldwin. So convert 8.62 to an integer, that is, 8.( You must round down to a number less than 8.62 or it will not refresh often enough.) The computer can do less work by recalculating the tank's position two times per second instead of 10.
Computer game designers work to optimize the speed and minimize the amount of work that a computer has to do. This makes the game faster and more efficient. And math plays an important role in this. "Math is the tool for managing these models," says Baldwin. |
|
|
|
|