💡 About this topic
In this topic, you will explore game development through four different skills. Each lesson will focus on different skills:
- The Agile Methodology
- Gameplay and Critical Analysis
- Programming and Theory
- User Experience and Visual Design
🎯 Learning Objectives
After this lesson you should be able to:
- Explain what gameplay is, and what playing games involves.
- Use real-world examples of successful games to explore the basic principles of modern game development.
- Understand the need for current games to evolve and change, undergoing continuous development.
- See how concepts such as seasons and DLC are a product of iterative development.
- Learn about the Agile methodology and key ideas behind it.
💬 Key Vocabulary
- Interactive
- State
- Player
- AI
- Agile
- Sprint
- Iterative Development
- Stand-Ups
- Project Management
Introduction
In this lesson, you will:
- Explore what gameplay is
- You will try some games for yourself and then deconstruct them, analyse them, and write critically about them.
- You will work out what factors can make a game successful and fun.
- Learn about Agile and why it is a key part of making games that are successful today, particularly in terms of updates
- Use some case studies to answer questions about Agile and development
In previous years, you…
- used a text-based programming language (Python) to create programs that involved:
- variables, operators and expressions
- sequence, selection, and iteration
- used a block-based programming language (Scratch) to create a game based around a virtual pet
- used a text-based programming language (Python Turtle) to handle simple shapes and graphics
In this unit, you will…
- use Python and Pygame to develop programs that also involve interactivity
- understand that programming bridges the gap between ideas and a finished game
- use objects and states within the context of games
- Analyse, evaluate, and criticise games as a medium
- Demonstrate a range of practical skills applicable to developing games, but that also transfer to any technological project within a modern workplace.
🎮 Starter Activity
- Let’s see what you know already about gameplay. Create a new folder in your Year 9 folder called Games Development.
- Click the link below to play a simple game, called Plink. Then, try and answer the questions about it in a new Word document. You do need headphones to get the most out of this experience.
- Video games, just like any other medium, can be analysed. The sort of skills to do this are actually ones you’ll have used in English lessons, but this is not an English lesson, so don’t fear!
- How does the game work?
- What kind of game is this? Could you put it into a category or genre?
- How did you learn how to play it?
- How does playing this game make you feel?
- Would you play this game again? Why/why not?
Now spend a few minutes thinking about what this kind of analysis is for, then have a look at the answer below.
Click here for the answer
Critical analysis is about understanding how something works, and also being able to classify or judge it against some measure, perhaps in terms of its worth, its cultural significance, or its success. It’s about picking something apart to assess the choices the creator made, and then being able to explain why – for example, you might have looked at the choice of words in a poem, and thought about why a particular word was selected over others with a similar meaning.
We can do exactly the same thing when it comes to video games, and in order to design good games, we should!
📝 Activity 1 – Quick Draw
- Later on in this this unit you will be working on a project as a group. This project aims to give you a range of skills, including working with software development, working within a team, and project management.
- Each person within the group will be expected to make a contribution of a similar proportion, quality, and level to your finished project at the end of the term, although this does not necessarily mean that everyone in the group will be expected to do a similar quantity of programming, as there are other tasks that surround this which are key to a successful project.
- You will alternate between roles.
- For now though, we’re going to build the skills needed to work in a sucessful group, starting with some more programming.
- Let’s extend this template together to build a simple program.
- Note: We’re using Pygame here, so if you copy it into another editor you need to ensure you have this available.
Task 1
First, we’ll learn how to draw shapes. We’ll start with a red 50×50 rectangle at the coordinates 30,40, where it says # your code starts here
. In order to do this, let’s talk about drawing.
Pygame has a built in rectangle drawing command. The template for it is as follows: pygame.draw.rect(where, colour, (x, y, x size, y size) )
. We need to fill in each of the inputs, or arguments, with values relevant to our program or it will not work.
The way this works is that we first need to input where to draw. This should be the screen, which helpfully we called… screen
.
Next we need to give it a colour. Pygame colours are in RGB (red-green-blue) notation, with each colour from 0 to 255. If we wanted yellow, we would pick a lot of red and green, and little to no blue. (235,232,52)
would be a nice sunny yellow, for example. For convenience, we can also save coordinates as variables. Look at lines 12-16 and you will find some of these already there. Add a colour of your own choosing too if you like.
Then we need to give it two kinds of dimensions in their own set of brackets. The first two are the location and the second two are the size.
The location of a shape is the coordinates of a fixed point. For rectangles this point is the upper left corner. The zero or origin of our screen is also the top left, rather than the bottom left as we might expect. This is normal in most computer game engines. So if we put our rectangle at (0,0), the corner will be at the zero point of our screen. We’re going to pick the point (30,40), which is close to the top left corner.
We also need to give it a size, this is just an x length and a y length. Put 50 for both.
Our final code will look like this:
pygame.draw.rect(screen, red, (30, 40 , 50, 50) )
Task 2
Now we’re going to draw a circle. The syntax for this is surprisingly similar: pygame.draw.circle(where, colour, (x,y),radius)
. However, there are a few catches:
- Unlike the rectangle, only the coordinates are together in the brackets, the size is a fourth quantity.
- The fixed point of a circle is its centre, which is not the same place as the rectangle.
- Circles also only need one size measurement, their radius or the distance from centre to edge, so this will be the same in both directions. Note we’re using radius not diameter, so it’s centre to edge, not edge to edge. If we want it 50 tall, the radius is 25.
So a 50×50 red circle at (100,100) would be: pygame.draw.circle(screen, red, (100,100), 25)
Draw a circle too.
Task 3
We’ve not made a game yet, this is just some shapes on a screen. Our next job is to make things move. We’re going to make the square bounce from side to side.
To do this, we need to change the coordinates it’s at every time it’s drawn. Our game draws the screen 60 times a second, and will get the coordinates each time it does.
First, let’s move the current coordinates to variables and then use those. This will make them a lot easier to modify.
At the top of our code, after the colours, add:
shapeX = 0
shapeY = 0
shapeSize = 50
shapeSpeed = 5
Now we can use those in our draw command in place of putting in raw numbers: pygame.draw.rect(screen, red, (shapeX, shapeY, shapeSize, shapeSize) )
Much clearer, and easier to edit.
Now, each time we redraw the screen, we’re going to add the shape speed to the value of shapeX, which will change the coordinates by that amount each update. A larger value means it moves further, and further in the same time is more speed.
After the draw command, add: shapeX += shapeSpeed
Run the code. See what happens.
Task 4
Now we’ve got another problem, our shape becomes a smudgy line. Any idea why?
We need to blank the screen after each time we draw, otherwise we’re drawing over what’s already there.
This needs just one extra thing. Before the draw, add: screen.fill(black)
This will empty the screen. Our shape should now move.
Task 5
Uh-oh, it doesn’t stay on the screen! Thankfully, this isn’t too bad either. We just need to check if the rectangle has reached the edge of the screen and do something about it if/when it has.
Check if the right edge has been reached. Remember, we’re using the coordinates of the left corner so we need to do some maths – the right corner is the X coordinate plus the size of the shape: shapeX + shapeSize
. We’ll stick that into an if
statement and compare it to the screenwidth: if (shapeX + shapeSize) > SCREENWIDTH:
To make it go back, we just need to start subtracting the change instead of adding it. The simplest way to do this is to cheat, and just make the speed negative by multiplying by -1: shapespeed *= -1
Now the other edge. This one we just check if shapeX is < 0:
. If it is, we multiply by -1 again.
See the code below:
if (shapeX + shapeSize) > SCREENWIDTH:
shapeSpeed *= -1
if shapeX < 0:
shapeSpeed *= -1
Extension
If you’re done, add this to your code, after the other shapes, before the # your code ends here
:
pygame.mouse.set_visible(False)
cursorX, cursorY = pygame.mouse.get_pos() # set the cursor coordinates to the mouse coordinates
cursor = pygame.draw.circle(screen, red, (cursorX, cursorY), 20)
What does it do? Can you figure out how it works?
📖 Agile
- This project will follow something called the Agile methodology. Rather than working towards a final product immediately, development is in steps.
- At the end of each step, you should have something that works, even if it does not meet the final goals yet.
- A part finished product can be released for ordinary people to use, with the promise of more features later on.
- This contrasts with a more traditional waterfall method, where a product is only made available when it is completely finished.
Agile is what is known as an iterative development style. That means that rather than attempting to make the finished project in a single process, it is reached through a series of small steps. The idea is that at the end of each of these steps, something which “works” is reached, even if this is not anywhere near the finished project. Someone in the team, called the product owner, knows what the finished project should look like, and suggests to the team what they should work on next in order to reach the end goal. They also decide if the work done by the team during the step meets the expected quality.
Each of the individual development stages is known as a sprint. Each sprint starts with a short planning phase. A sprint should have a single goal, aiming to add or improve one feature or one section of the project. At the end of the sprint, the team meets again and evaluates whether it was a success. This allows for more creative freedom, more experimentation, and the possibility of attempting greater challenges. In an Agile team, everyone is responsible for their own work, and can set their own deadlines, which agree with larger group-set deadlines, called milestones. Everyone can contribute ideas, and roles are flexible.
📝 Activity 2 – Case Studies
- Read through the case studies below and choose one of them to use when answering the questions.
Case Study 1 – Marc
Building a game that’s popular is hard work these days, you can’t just release a finished game and never look at it again. Players expect updates and new content all the time, so we have to provide a constant stream of new features to keep them interested in playing. There’s an art to getting these right, you know. Too much change and players find it alienating, it’s not the game they know and they have too many new things to learn at once, it makes them stop playing. But the same is true if there’s not enough change, players complain that the game is boring or tired, or that the new content just recycles old ideas.
The challenge for us is not only being able to constantly build in new content that keeps the game feeling exciting and fresh, so players come back for more, but also to do this on schedule. We aim to release new content every few weeks, any longer and players get impatient and start looking at other similar games to get that “new stuff” feeling instead.
We pride ourselves on making a great game, and being able to quickly respond to what players want has been really important in achieving the success we have had. For a game to be as popular as ours is, for as long as ours has been, means we can’t afford to stand still. When Battle Royale became the must-have feature a few years ago, we worked out how to fit it into our game and now it’s a main mode of play.
We have to be able to cope with fast changes and growth to our playerbase. This happens in terms of raw numbers, but also in terms of regional popularity, as well as a change in how people interact with our game. Last year, we had a popular streamer in a different country showcase our game to their fans. We’d not really had players there before but overnight we gained tens of thousands, all hoping for our game to be available in their language rather than relying on their ability in translating English – we got a localised version out in 48 hours, giving us extra coverage in local news and even more players. It was the best thing we could have ever asked for, an explosion in popularity and not a single penny paid in advertising!
Speaking of streamers – streaming and eSports have really changed how people play our game, and we’ve had to work on making our game better optimised for being viewed not just by the person playing, but by people watching them play. That’s needed a lot of rethinks, from ensuring that the streamer’s camera doesn’t block vital player stats (such as health or ammo), through to making sure that the whole screen is visually interesting as a huge audience means there’s people watching every part of the same picture, not just the main focus.
Likewise, we’ve had to make sure that when we release new updates, they don’t change the core balance of the game – if a new item is too powerful, too rare, or otherwise makes a big change to how the game is played, it can really upset the professionals. We’ve invested a lot of money into play testers who try and spot these unplanned opportunities before we release to players. Last month, they showed us how a new weapon we’d planned could be used to increase player jump height, which would have given players access to a high up area where they couldn’t be reached by players without that weapon. That could have been a disaster for us if it had been released.
Case Study 2 – Jun
Computers are more important to this business than ever, and one computer can now trade as efficiently as a whole room of human traders did a few years ago.
If you’ve never experienced the world of stock trading, let me explain. It’s like buying and selling in any other online way, such as eBay, Depop, or Etsy, but the speed is higher, the prices much bigger, and the portion of profit much smaller. Maybe you made five dollars by buying a vintage t-shirt from a local charity shop and selling it online two weeks later for slightly more, say buying at $10 and selling at $15. Trading is much the same, but instead of two weeks, it’s under two seconds, and you made that five dollars from buying a million dollars worth of shares in a company and selling them on for a million and five when the price of a single share rises even a tiny amount.
Prices change constantly, sometimes up, sometimes down, and the changes can be small or very large. It’s impossible to predict, the aim is to guess correctly and when you do this often, you make a lot of money. This means the pressure is very high, and it’s also important that your trading software is reliable, if it breaks, instead of selling for a small profit you could be making a huge loss.
I don’t trade myself now, I write a program that helps other people trade instead. This program analyses prices of hundreds of companies on stock markets around the world and makes suggestions about what to buy and sell. In fact, it works so fast that most of the time, it just trades by itself and the trader just has to watch and make sure it’s doing the right thing.
To make our software work, we build an algorithm that is able to make all these guesses super fast. This algorithm is constantly changing and so we need to update the software several times a day. When we do, it has to be as bug free as possible, and if there are bugs, we need to fix or undo the update in as little time as possible. Just a few seconds of the system being offline can cost our clients tens of millions of dollars, and even if it doesn’t, it might lose us their trust, and they take their business elsewhere.
We sell this software to companies all over the world, and we make our money from a small share of the prices they sell at – if they sell for a thousand dollars, we get a dollar from that sale. Collectively, our clients put hundreds of billions of dollars through our system every day, and keeping them happy is very important. When a new client joins, they often want our software to be customised to their company, including special features, extra options, or connectivity with other systems. In most products, this would be a deluxe feature that cost a lot extra, but in our industry, where there are billions of dollars on the line, it’s a given for every customer.
Case Study 3 – Marie
As a company, people ask how we make money when we don’t actually seem to sell anything. Well, the answer is that we do sell something, it just doesn’t look like a product. We make software-as-a-service, meaning that other companies use our software to build a web platform for themselves.
Our software allows restaurants and takeaways to add online sales to their websites, and also gives them the ability to get customers through our centralised app. You can download our app on your phone and then order through any outlet that has subscribed to our service. We don’t really do anything more complicated than taking orders on the web and sending them to the restaurant, but it makes it a lot easier for small businesses to compete with the larger chains. There are no extra charges or steps for the customers, the restaurant simply pays a fee to join our platform, plus a small percentage of any sales they make through us. They can also pay a little extra to use our delivery drivers instead of having to hire their own, if they’re in an area where we offer that option.
This is something our competitors started doing, and we were able to modify our system within a week or so to allow us to offer the same service. We don’t employ the drivers/riders directly, they have a second version of our app and work like freelancers – when they’re looking for jobs, they simply turn on the app, then it tracks where they are. When delivery requests come in, we match these with the nearest few available drivers and offer them the job, they see where it’s going to, where it’s picked up from, how much they will be paid, and decide themselves if they want it.
My role as Project Manager is to keep a team of developers on track. We have a long-term plan of where our platform should go, and in the short-term we add in new features that give us more options, more functions our customers ask for, and that help us stay ahead of our competitors.
There’s lots of things we have to anticipate in terms of how business changes. Over the last year, as people work more and more from home, we’ve seen a rising demand in some parts of our app, particularly in areas outside of city centres. From a practical point of view, this has meant we have had to redesign some of our delivery job offering systems and the algorithms we use to select drivers, because one thing we have learned is that unlike in a city, nearest does not always mean fastest in suburban and rural areas!
We’ve also built in new features that allow restaurants to have finer control over their day-to-day opening hours and availability, as well as tackling problems related to delivery rider demand – a lot of city riders in the past have been students on bikes, which has been great for us because there’s been a surplus of riders to jobs, and their availability in the evening has lined up with the largest demand – late dinners. However, working patterns have changed and we’re now seeing a greater demand at earlier times of day, like lunch, and we don’t have the same number of delivery slots available, not least because the students are not coming to the cities. One of my tasks this year was working out how we could build a more efficient system for stacking delivery jobs together, to get the same number of deliveries from a smaller number of people.
Questions
For your chosen case study:
- How is Agile contributing to this person’s work?
- Why does this person benefit from working in an Agile style?
- What examples do they give of needing fast, rapid change in their companies?
- Why does working in an Agile way make their product more reliable?
- How does Agile allow them to apply creativity and experimentation to their product?
💬 Summary
In this lesson, you…
- Analysed an existing game
- Brushed up on your Python skills and built a simple demo
- Completed a case study on Agile
In the next lesson, you will…
- Build some more simple games
- Explore the concepts of states and objects
- Learn about user experience
🏅 Badge it
🥈 Silver Badge
- Upload your completed answers about Plink to the Silver badge task on Bourne to Learn.
🥇 Gold Badge
- Upload a screenshot of your Python code to the Gold badge task on Bourne to Learn.
🥉 Platinum Badge
- Upload your completed case study to the Platinum badge task on Bourne to Learn.