Mathematics serves as both a practical tool and an artistic medium in game design, enabling developers to create meaningful, enjoyable gameplay experiences that express complex scientific concepts. Games like Asteroids demonstrate topology through wraparound mechanics, while Portal uses level design to teach the physics of the 'fling' move through carefully structured challenges. The Doppler effect can be expressed through audio feedback in games, and mathematical patterns like Penrose tilings have been used in Islamic art for centuries. The key insight is that game designers should actively express the mathematics underlying their engines in mechanics, as this transforms technical systems into engaging, educational experiences that can make scientific concepts accessible and enjoyable for general audiences.
Mathematics in Game Design: From Asteroids to Portal | Indie Game Lecture
Added:I'm Hamish Todd and I want to offer you all some ideas about how to design fun levels in video games and that sounds like a simplistic intention but it's an assurance you might need to keep in mind i'm going to be talking about some strange stuff, Islamic architecture the relationship between art and science and global warming but all of this has one central concern which is fun design I'm going to start by describing what I believe was a very proud moment for our industry, the video games industry this was at 9:30 thursday morning May 2006 and this was an episode of radio 4's In Our Time, someone was trying to describe the shape of our universe and that's quite a difficult thing to do and so they draw an analogy, it happened to be an analogy with a video game now the strange thing about the shape of our universe is that it seems to have no sides if you go a million billion light-years in that direction you're not going to hit the side of the universe and instead it's theorized that you'll actually come back in this direction at some point the same is true if you go in that direction you'll come back to this direction. same, whatever direction you like. some people have a lot of difficulty with this idea though but building a mental model of this is relatively easy if you've ever played the Arcade game, Asteroids so when Atari were designing Asteroids in the nineteen eighties it was decided that any entity that goes through the top of the screen would come out the bottom and any entity going through the left would come out on the right this was a clever decision for a number of reasons it means that no entity will ever leave the screen which in a game about crowd control is a tough but appropriate decision and no entity will leave the screen until you deal with it somehow so it makes it tough but it's also makes the game easier in some sense because you will never be cornered in the game as you would be if the sides were solid because you can always go just like that and best of all this sort of wrapping effect makes the movement of the entities in the game interesting and challenging to predict and principally easy to understand and easy to program now in addition to being very fun Asteroids presents a perfect two dimensional caricature of the idea of the Sideless Universe the idea of a finite space that has no boundaries Asteroids allows you to experiment with the implications of this concept and if you want to get a high score you're forced to build a mental model of it, so art has always been capable of expressing mathematical ideas with a clarity that academics should envy this video was made by a woman called Vi Hart - she describes it as a visual and musical expression of mathematical symmetry groups a symmetry group is a very mathematically deep mathematical construct, you can find them in engineering, in biology in chemistry and these things often require an understanding of symmetry groups but despite the depth and importance of these wonderful things normal people are seldom given opporunities to think about them properly they are brought out beautifuly in this combination of animation and sounds they're also brought out beautifully by islamic art and that's another art form that i'm going to be talking about later relating symmetry I'm going to show you another video now another piece of music this is a more conventional piece of music than Vi Hart's this is the seventh part of a series of contrapuntal pieces by Johann Sebastian Bach the mathematical exploration performed in this piece of music is much more fluidly decorated and more comprehensive than Vi Hart's it's also in a lot of ways more beautiful and some pianists will tell you that it's the most sublime piece of music of all time at the beginning of this piece you heard the subject of the piece that's a series of notes and sort of W shape in the visualization that subject is being turned upside down and stretched and squashed and all of these things are being appended to one another or layered on top of each other the result of this process is a piece that I considered to be full of insight in seeing how the layers things can come together you learn something about the symmetries and about the real world I wonder how much it would surprise you all to hear me say that there is something like contrapuntal music to be found in the Castlevania series so the original castlevania is a towering piece of fun game design there is a famous enemy in it this one its called the Medusa head now the pattern that the Medusa head moves in is called a sine wave and it is no co coincendence that in addition to presenting fun gameplay possibilities the sine wave is an object of great mathematical depth and beauty this is a very infamous part of the original castlevania getting through this challenge involves navigating four superimposed danger zones prior to this room all of the separate axioms of this engagement were introduced to the player in a safe environment and so when they are brought together the player is very capable of analyzing the labyrinthine results that's one level that uses the Medusa head well but I brought castlevania up in relation to contrapuntal music and there's a place that I want to make a direct.. there's a level that I want to make a direct comparison with contrapuntal music this is castle proserpina at final level of castlevania bloodlines and parts of this level are augmented similarly to what you'd find in music so for example in this room you've got to accomplish platforming challenges with the screen or as vertically flipped in another room you face the same challenge a number of times but with a specific step up in tempo each time but the most extraordinary part of the level is this one, this requires a little bit of explanation thought, in this room the screen is split into five separate viewports it's a long horizontal lines you can see that the character is split away from his feet and the tip of his spear because he's standing at the interface of these separate parts now this is very interesting you've got to think of this room partially as two separate locations and partially as one you've got to think about how the vertical position of an entity affects the horizontal position that you will perceive and if you fail to think about these things then you will miss a platform that you're aiming for and plunge to your death almost inevitably and there is only one enemy that was deemed worthy to appear in this strange environment it's the Medusa head you can see just like just one over there, the Medusa heads trajectory it now looks like this that's quite a sophisticated thing for the player to understand and only the Medusa head it's possible to predict it with great precision, it is very recognizable. the Medusa head was the only enemy that fit the requirements for this level when they were deciding what entity they wanted they needed something that was able to move in two dimensions because if it was just moving up and down or it was just moving side to side then there will be almost no effect and you also need something very recognizable because we want the player to be thinking about what does this visual effect do to the entities movement rather than having to think about what is the movement in itself so a complicated AI would not be suited to this place there's quite a lot of physical creativity in Castlevania bloodlines it's full of rooms like this one it's got lots of rotating objects and screen filling effects and strange enemies like this one this enemy moves in a sort of quintuple pendulum if you imagine a pendulum attached to another pendulum attached to another and so on and it moves all of these simultaneously it's very interesting why is there so much physical creativity in this game I think that the answer is that the makers were thinking about what can we do with the platform that this game is on the second mega drive or the Genesis for the Americans in the audience and what can we do with the Sega Genesis that we cannot really do easily in any other platform there was an intimate relationship in Castlevania bloodlines between the capabilities of the hardware and the code and the challenges and decisions that the code bore out this is a tradition in engineering that I feel has been some in some ways neglected by the games industry there are some very very interesting things happening in the code that is pushing technology today people who are usually interested in pushing technology today, they invest themselves in graphics or load times or maybe AI at best but this is a tragedy there is so much fascinating maths in the code that underlies a lot of games i'm going to give you a example that I like a lot which is radiosity radiosity is an effect which some of you might know causes the color of an object to affect the color of the light around that object and while implementing radiosity in their game engine the guys who are making battlefield 3 made use of these fascinating mathematical constructions they have a beautiful name they're called spherical harmonics naturally while the developers of battlefield 3 were implementing spherical harmonics in their algorithms there was a back-and-forth between them and a bunch of particle physicists who are using the same techniques to study quantum mechanics but you know after they were done studying the fascinating things that underpin our universe our programmers work was used to tart up the shooting galleries of another dull and derivative first person shooter and John Carmack who made this game rage and also doom and Eric Malafeew who made dance central and guitar hero programmed on central guitar hero these people are literally rocket scientists and and the maths that they put in their games engines would astonish their audiences if only they were given access to it. I have a cautionary tale to tell to programmers we must learn to express the mathematics of our game engines well the cautionary tale i want to tell you comes from islamic art there's a group of artists this is a group of artists who were looking at the same problems as game programers today who failed the world in the same way islamic artists are forbidden to depict nature and so they usually tend towards depicting abstract shapes and properties of abstract shapes, this is Jacob Bronowski by the way who presented the astonishing documentary the ascent of man and in this fascinating episode Bronowski is looking at the properties of crystals he asks you know what is it that makes crystals so regular and so sharp and have the certain properties that make them useful in industry and for improving our quality of life the answer is essentially symmetry it is symmetry in nature that causes crystals to take on this appearance and in order to illustrate that he went to the Alhambra in southern Spain and looked at patterns like this one and he talks about this feature and that feature and how they might come together to imply some third feature and that's a mathematical analysis there. now this is another man, this is Roger Penrose another Idol of mine in 1973 at the same time that Bronowski was making the ascent of man Roger Penrose was sitting at the kitchen table with his father playing with the mathematics of tilings and a brief word on tilings now this is a tiling it's a very familiar example we're just talking about shapes coming together with no gaps essentially this is a honeycomb tiling there are two features that will help draw your attention number one it's not hard to imagine this tiling going on infinitely just forever and ever in every single direction and that's quite a profound and useful thing to know about the honeycomb tiling another thing that I'll tell you about is, if i were to pick up this picture move it along just slightly move it along by one hexagon and set it down again there will be very little change in the appearance of the tiling so Roger Penrose was interested in the question can you have a tiling that goes out forever infinitely but never repeats itself in the way that the honeycomb tiling does it goes on forever but there's no point that you can pick up move it along and set it down and it will look the same and he came upon this the beautiful Penrose tiling the Penrose tiling again is quite sublime and deep it's been used in medical equipment it has been used to make toilet roll and what was the other one, I have forgotten this and I actually encountered the Penrose tiling while studying viruses this is polyomavirus which its shell is sort of made out of these Penrose tiles now this reason I bring this up in relation to islamic art this is the Darb-e Imam shrine in Isfahan and I want to draw your attention to a paatern that's on the top right above an arch marking the entrance this is quite a beautiful pattern here and you might have guessed it's a Penrose tiling obviously this was made several hundred years before Roger Penrose was born and after mathematical analysis we can learn a lot about the tiling from this it's actually two Penrose tilings layered on top of one another this big one and then these small ones and it's actually illustrates a property of the Penrose tiling which is that one Penrose tiling can be made out of smaller Penrose tiles that's quite a sophisticated thing to understand and here again it's being expressed very beautifully and it's again a tragedy that the people of Iran had this profound statement expressed in this artwork under their noses they couldn't really understand what was going on here the artist that made this could have done better they could have made it more accessible they might have made it more beautiful in the process now the question here though is this is the most important question how do we express the mathematics in our game engines how do we do it the answer is level design and now i'm going to talk about the game Portal for a while this diagram depict something that they call the fling move, which is a fascinating possibility within the game and the level design is constructed very intelligently to bring out this possibility and make it accessible, portal on the surface you would think that it's a game about changing your position but the fling move is about changing your direction and repurposing gravity to shape your ends, these are the levels that introduced to the fling move two things i want to draw to your attention just now is that these are in two separate parts of the game test chamber 10 is quite far away from test chamber 15 but there's a reason for that in the first half of the game the player only controls one of their portals while the other is sat down immovably by the designers and that's a limitation upon the player which is used to make your education more fluid, the other thing is that these champers are all essentially 2d you don't lose very much in my drawings here we know from the designer commentary on the game that every red herring every single thing that the player could get stuck on apart from the answer was removed from these levels again in order to make your education more fluid and that apparently extended to making these get them removing any motivation that the player might have to move or turn left or right that's what makes a three-dimensional Game two dimensional so this is the first level, this is the first part of your education it's a very very simple room indeed and it's only features are this ledge which is slightly too high to jump onto and this thrust forward panel that you can see here which has the orange portal, crucially it's very simple to move through this room all you have to do is put your portal anywhere you put the portal that you control anywhere you like and go through it couldn't be simpler it's barely even a challenge or a puzzle but just because it's trivial to move through doesn't mean that it's ill-considered this room successfully introduces an action the action of moving forward out of an orange portal across a gap to somewhere you can't reach and it associate that action with the thrust forward panel which will become a motif, here is the second room which you go into directly into after that one again pretty bare, you'll notice first that it's tiled almost exclusively with black tiles which are resistant to portals you can't put your portal on them again the only features really is the thrust forward panel and then this pit which has the white which has the white texture at the bottom and you'll notice that this part here is shaped like a diving board associating it with the idea of diving and also it's a very narrow platform so if you stand on it then you're likely to fall off so the player is essentially being invited to fall into the pit here and when the players on the bottom of the pits there's not much they can do except for trying to get themselves out which is which they have to do by putting their portal on the floor beneath them and then if they do that by the way the sort of plop out of this panel here and and that is part of how you solve the puzzle the way that you solve this puzzle is to jump from the diving board onto a portal on the floor and in falling you'll gain a bit of momentum which will take you coming out of here and will take you all the way across the room as opposed to the plop which would just take you to here so by getting stuck in the pit you put your portal on the floor and you're drawn closer to the solution so the designers here are making very perceptive use of a mistake to guide the player towards a solution here's the third part of the progression here is the now-familiar panel and the pit first thing to notice that the orange portal the one that is laid down by the designers is now at the bottom of the pit as opposed to the panel so to complete this challenge the player has to put their blue portal on the panel that thrust forward so the player has to engage with both sides of this action the solution here is to like this first one, like the second one sorry jump into your portal through here come out through there at which point the top panel will come forward then you jump into this portal again come to the portal that you placed on here and that takes you to the end and this particular part is about playing with the variables of the fling our pit is deeper our gap is longer our destination is elevated our panels are moving so we're playing with the numbers of this equation and that's a step towards the player being able to control those numbers themselves and that's quite a difficult thing for the player to understand because bear in mind that the fling when you do it when you're passing through the air it's very sort of disorientating and so it's nice to have things laid out for you in this way now we are making a great big step forward in the game, this is chamber first part of chamber 15 so the player is in control of both portals again we've got this thrust forward panel but there is no pit which presents us with a problem because we need a descent to give us the momentum that we need to go far that we need to cross over this barrier to the other side of the room the elegant solution to this puzzle is to place a portal on the floor go through it fall out of this panel with a plop you don't make it as far as the barrier but you come out of the panel and you go straight into your portal again and that time you've used the descent to cross the room and you'll notice that the first half of this room is white and the second half of this area is sorry is sort of black so the midpoint is marked and it just so happens that the player if they come out of the portal with very low momentum they also would have plopped down to this exact halfway point so the graphics are suggesting to the player you know, you might want to double what you've just done you are halfway through solving this puzzle speed is the only difference between the plop and the movement all the way across and so speed is what the player is being forced to acknowledge here. here is the final part of your education this part is like the first one but if you plop this time out of the panel so you come out of the portal with very low momentum you'll just hit the black surface down here which is another problem the solution here is to go into this separate room where there is a slight dip here just a slight one you put a portal down there you jump into it you come out of the panel you don't go all the way across the barrier but you do make it at least as far as this part of the room which has a little bit of white on it and if you put a portal in the place where you're about to land you'll come out of the panel again and this time you'll have the velocity you need to complete it this room puts into place the last parts of our tool the player is now trained in repositioning a portal while in the air you can divide your descent up into two separate parts and and you can use the resources of two separate rooms to put your plans in action and now you've got that tool in the game at some other points will make you clarify it by doing it a couple more times but then it also plays with the concept as well there's this rather elegant puzzle where you've got to do a fling move but your floor space is highly limited so it's a sort of delicate kind of fling then here is another part where you've got a skewed panel and that's when you fling from here it sends you careening a very long way which is quite interesting then there's this magnificent room which turns the fling through a right angle with some very interesting results now when i was studying maths at university I had a course mate who was studying wormholes actual wormholes for a real project and he assured me that if Einstein equations of general relativity are to be believed then there are almost certainly real wormholes to be found somewhere in space and this is very moving to me that a video game was enabling normal people to play around with these magnificent structures now I'm going to talk to you about my game for a little bit. there's one particular set piece in it this part of my game has taken more than a year of iteration but i believe it expresses something interesting with a good degree of clarity first I need to describe a phenomenon called the Doppler effect I want you to imagine two objects one of them is sending out signals with perfectly regular intervals which are received by this object now imagine our two objects are moving apart and this one continue sending out regular signals, but the reception of this by this object of the signals will have greater intervals in time between those signals being received that's caused by the velocity to give you an example imagine you are next to a road and a car goes past you and it'll make a very particular noise which is embarrassing to imitate but I'll do it anyway it sort of goes neeeeEEEAAAAWWWwww, now sound is a series of waves and the further apart those waves are the lower the pitch of the noise you hear is the closer they are the higher the pitch and when the car is moving towards you the sound waves that it emits are squashed together by its velocity and when it's moving away from you that stretched apart that explains the difference between the mm mmm, now my game is about bouncing bullets and still the working is in progress by the way you shoot bullets you can walk back and forth and up and down ladders, when your bullets hit a surface it plays a glockenspie note and your goal is to hit, your goal is to hit these angels who have a certain amount of AI which does its best to escape from your shots now apart from you and your bullets and the angels the only other objects in the whole game are these sort of blocks here which descend, they are pulled down by gravity they'll keep descending unless they are caught by an angel now here's something that I here's a little thing I'm going to show you it I found it while I was thinking about the Doppler effect and seeing if it was possible within my game watch and listen to the yellow bullet so what you've just seen there is a cute phenomenon which is something like the Doppler effect the idea of the Doppler effect is sort of completed by the rest of the game but finding a cute phenomenon in the context of your game engine is the first step toward constructing a meaningful puzzle the second step is to find some use for the phenomenon that you have found some use that the player that which will force the player to acknowledge its existence so what we require here is a scenario in which the player must realize that as a block descends a bullet that is hitting the block will make noises at increasing intervals if the block is moving and depending on how fast the block is moving and so here is a rather plain looking room it's not much to see here and there are only two shots that the player can make they can either shoot up here or they can shoot down there when you shoot downwards the angel bullet can leans around and the angel is moved into that place where you can't really reach them so you kind of screwed yourself up here and if we restart and we think about the timing of this use both of our bullets and there it is here's another room in a very similar style almost identical the only differences are that now the path of this bullet if we fired down its gonna take is going to go all the way off screen before it comes back again and also, when the players at the bottom of the screen they can't see the top of the level they can we see the feet of the angel but that's all that they need they shoot down and we wait for a little bit for the bullets to come around again we are aware of when the angel starts moving we can do this now here's the next advancement of it and this time the entirety of the top part of the level is completely hidden so what we going to do well you know again the bullet goes all the way off screen but when we go up here we see that there's another angel we can make short work of her and we've created this insistently loud structure here you know the angel, but that structure changes when that angel starts moving away so how about this we're going to restart go back up here set up a structure shoot downwards, wait wait wait wait for the changing sounds that will mark that the angel has gone so that's a nice puzzle in fact I'm quite proud of this progression I'm more proud of it than I am of almost any other part of my game my game which i have spent about a seventh of my lifetime making this challenge is very thoroughly play tested there's a lot of advice that I could give you from the process that I went through while making it one piece of advice stands out sort of this is what the level originally looked like it's extraordinary messy this level is trying to do the same thing to what I just showed you very messy very inelegant and here is to clarify what it looked like finally the difference the gigantic change that the game went through allowing me to change it so much was that music of the spheres it was originally a stealth game the angels can shoot you if they see you but they can only shoot you in a straight line, the original goal of the game was not to shoot the angels but to get from the entrance of a level to the exit of a level without them seeing you and that requires moving them around in certain ways but you know eventually I realized how difficult it was compromising these line of sight problems you know allowing the angel to see the Avatar compromising those problems with the complicated bullet patterns that the avatar or the player is going to have to think about, when I realized that it was better off as a game where you've got to think about where your bullets are instead of where the avatar is so instead of being a stealth game it's sort of more of like a more of a shooter and i was able to move it in this elegant direction so the piece of advice i'll give you is that you need to think quite hard about the broader goal of the puzzle the broader goal of a game sorry and when I say broader goal i mean in the sense that the broad goal of portal is to get to the exit of a level the broad goal of tekken is to reduce your opponent's Life to 0 and you know there's a lot of lot of scope for what a broad goal can be this is quite a pleasant game it is called the greedy spider and the broad goal of it is to stop the spider from getting to these guys by modifying the web and the spider has a certain amount of AI and that's a very sort of obscure and strange goal but it leads to some moderately decent puzzles and in addition to that you want to minimize the amount of actions that the player goes through as the number of actions that a player carries out in implementing a solution to a problem as they perform more actions they become more and more worried about whether everything is going according to plan even if it is going according to plan reduce the number of actions and you will allow them to focus on whatever wonderful thing it is that you are trying to Express so we have seen that video games are capable of lifting ideas out of the domain of science and making it possible for the fun in those ideas to be found for all the world to see this is Incredipede, a game about designing animals that walk in interesting ways this is Braid a game about time manipulation and that's The World of Goo which is about construction and the relationship between different materials the world ought to see these things and the most inspiring achievements of our time are essentially all scientific in my opinion when scientists sent humans to the moon I think that most people agreed with me that science is where the most exciting things our culture is doing ot happening I don't think that people feel it so strongly today science is so obscure think about the large hadron collider and the things that are happening in the large hadron collider are no less impressive and no less difficult than sending people to the moon but it is so obscure even though it's quite profound a more scientifically literate population would be a happier and more perceptive population given that the formidable threats facing our population are ecological or macroeconomical in other words they require an understanding of science given that these threats and these moral problems are so are required the scientific understanding i think we are in desperate need of a more scientifically literate population and I dream of more games like portal that will propagate the euphoria of scientific literacy and there I'll stop thank you do we have any questions what oh I'm probably going to leave the games industry now I'm going to be releasing music of the spheres pretty soon and I have every reason to believe that it's not going to make any money at all no problem thank you very much
Up Next

Mimar Sinan: Ottoman Architecture & Imperial Legacy Documentary
@buyukustamimarsinan6648
68.5K views•2015-08-29

IFS Therapy Demonstration: Complete Session with Unburdening
@IFSCA
95.9K views•2021-01-13

FastAPI vs Flask vs Django: Choosing the Right Python Web Framework
@TechWithTim
302.5K views•2024-05-26

Game of Thrones Opening Credits: A Cinematic Analysis
@gameofthrones
46.3M views•2011-04-18
Related Study Plans & Knowledge Roadmaps
Structured learning paths in General & Interdisciplinary Studies










![GEOMETRIA - Geometría del espacio [HD]](https://i.ytimg.com/vi/UZMBqyfVDuo/maxresdefault.jpg)




























