What does a Game Engine actually do?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I get it it's a miracle that any video game has ever worked and it's all thanks to game engines like unity and unreal and a third example but like what actually is a game engine what does it do because if you ask a game developer they'll say something vague like okay so it's like the basic software of a video game and that's unhelpful so you look it up and Google says that it's the basic software of a video game V unhelpful by that definition literally any anything could be a game engine so long as somebody used it to make a video [Music] game okay so first we'll need a game idea Excel is remarkably unequipped to be a game engine so we will keep this very very simple maze Simulator the player starts somewhere in a maze and then they walk around until they find the exit and then they win that is it the game has to work in a Microsoft Excel spreadsheet we are aiming for the smallest thing that could technically be called a game to make this work we'll need to break the maze simulator down into its core components the most obvious component is the maze itself we need a way to represent the maze so that Excel can understand what it is this might seem like a really difficult problem but it really just comes down to a text file Excel is very good at reading text out of a text file so let's make a maze. txt we'll put W's where we want walls and dots where we want empty space then we can tell Excel to run through this text file character by character line by line where it sees a w it colors the corresponding cell green and where it sees a dot it colors the cell brown with this little text file to color tool we have maze technically okay it's not a very good maze but writing these W's and dots is kind of a pain so again smallest possible thing that could be considered a game now we need a player who can explore the maze this ends up being a similar problem how do we explain what the player is to excel who doesn't even know that a video game is happening let's start by adding a new letter into maze. txt P for player we can then tell Excel to draw the corresponding cell as blue to Mark where the player should begin the game now we just need to tell Excel how the player moves but we run into an issue the player is ultimately just that letter P in maze. txt so if they press the up Arrow to move upwards we would need Excel to delete the dot above them replace it with a p then delete the P where they just were and replace it with a DOT this sucks it's unwieldy at best at worst it risks permanently deleting game data as the player travels through the maze instead we'll have excel track two numbers X and Y rather than drawing a blue cell directly where the p is written we can start X and Y where that P is and then find the Cell at coordinate X and Y and color it blue initially this is just a more complicated way to load the player's starting position but it pays off once the player starts moving instead of changing the characters in maze. txt we can Define movement as adding or subtracting from these X and Y values this means we only ever change the data that will get reset at the start of the game regardless of what bugs could occur from here we really only have one more problem to solve which is the fact that players can just walk straight through walls this is a pretty easy fix because the player is locked into moving on a grid of cells all we have to do is check for a wall in the cell where the player is trying to move if there is a wall cancel the movement but if it's clear then let them move finally we can add an e to maze. txt to designate where the end of the maze is and tell Excel to do a little Victory message when the player reaches that cell all right maze is done player is done game is done we have proven that Microsoft Excel is technically a game engine but one little amazing then you win I mean that's not a game we should at least string a couple of Mazes together so we can change maze. txt to maze 1.txt then make a maze 2 and a maze three these new mazes follow the same structure W's and dots to define the maze a p to Mark where the player should start in an e to Mark the exit now we can tell Excel to keep track of which maze the player is currently in if they reach the end of that maze it should load the next one in the list instead of ending the game so three Maps instead of one gives the game a little more meat but the Simplicity of The Mazes is a real problem adding more mazes doesn't make the game better if each maze is laughably easy to solve we need bigger more complex mazes but the problem is that sitting here and typing these mazes out sucks it takes forever it's incredibly easy to make a mistake and when you do mess up it's hard to track down where the error happened what we need is a way to draw a maze and then automatically convert it to the W's and dots that our game is expecting luckily we have a great place to make that happen another Excel spreadsheet let's call it the map editor once we've drawn a fancy new maze in our map editor we can reverse the process we already made to write this new maze into maze 1.txt so rather than coloring cells based on the text file we create the text file based on the colors of the cells in an instant the maze gets recorded with no chance for human error then we can go back to the game view spreadsheet and Run the game it does exactly what it did before looks into Maze 1.txt and draws a maze based on what it sees but instead of seeing our tiny manually typed maze it now sees the characters that the map editor just wrote into this text file so with an easier way to make bigger Maps we can create that classic structure of rising difficulty with an easy medium and hard maze now that we can make bigger and better maze is we really shouldn't limit ourselves to exactly three maps I mean what if we wanted five Maps or 10 or even just two it's not great that adding Maps would require us to change the systems we built to read these Maps it's also not great that our maps have to be named maze 1 maze 2 maze 3 and so on it might work for low numbers but if we're making a game with 10 or 20 Maps it'd be nice to name them something a little bit more descriptive luckily we can kill two birds with one more spreadsheet we'll call this one game settings and for now it'll just have one important column map order we can type out the name of each text file in the order we want them to occur in the game then when the game starts Excel can look at this column starting at the top it reads the text in each row and looks for a text file of the same name once it finds it it loads that text file into the map list with this tool in place we can create a whole new maze place it between the first and second ones and Excel understands that we want this new maze to be loaded second once we play the game all of this happens without the user ever having to understand how Excel is creating reading and interpreting these text files somebody else could make a maze simulation of their own and never even know what Excel is doing under the hood okay let's not get too excited this mapless system system is cool but it still has one more glaring limitation these Maps can only link to one other map and it is a oneway connection you play a map then you play the next one and you cannot go back this limitation goes well beyond branching paths and replay value once you have full control over how Maps link together you can make literally any structure that you want a series of strange worlds to explore each connected by a cozy Hub world world that's just several linear games that all Branch out from a single map file a Dungeon Crawler with lethal traps lurking around every corner create each rooms separately and then link them all together at the doors an open world adventure with magical secrets to uncover make a file to act as the world map and then link to points of interest at smaller scales I'm sure you get the point if we can figure out a way to specify which exit leads to which map then the number of games Excel can handle will Skyrocket to do this we will need to slightly rethink how we store our map data and I do mean slightly right now Excel reads these Maps character by character that's been fine so far because each character can only represent one of four options but now we need a new character for each map even worse what happens in the extreme case where we have like a 100 Maps but we don't have 100 unique characters to work with we need something more robust than A Single Character enter the comma more specifically putting a comma between each important piece of information that's it that's all we have to do to solve this problem for the stuff we've already made nothing has changed Excel sees there's a w between these commas and knows to draw a wall but now when it gets to an exit everything after this last comma will be read as a single instruction so we can put anything we want here say for instance the name of another map in our map list now when the game is running and the player reaches a cell that's marked with a map name Excel knows to look for that map in the map list and then load it next in the map editor we can allow the user to type a map name into a cell marked as an exit when Excel exports this map it can write that destination into the text file so the game knows which exits lead to which map just like that we've opened up basically any structure that we want for AAS simulator it feels natural to use that Hub World structure from before so we'll create a single map to act as the Hub just a simple room with three exits the exit furthest to the left will lead to a series of easy mazes the second exit will lead to medium mazes and the last exit will lead to the hardest mazes okay cool that is objectively a video game we can call it complete and walk away and be proud that we have proved a ridiculous Point kind of weird that all the maps look the same though right I mean the whole appeal of the Hub structure is that each World feels unique we don't have to go crazy here just some choice in colors would be nice of course Excel is still just reading abstract data out of text file FES so we would need a way to tell it which colors it should use when it draws a map colors are ultimately just RGB values so there's nothing stopping us from putting a few at the top of each map file and then telling Excel to use those colors instead of course we would also need to make a column of display colors in the map editor because writing those RGB values is tedious so we want Excel to do it for us okay okay okay I'm done I'm done hands off the easy Maps can keep the green the hard Maps will be colored like it's hell and the mediums will be I don't know the blue I guess Maps can have different colors nice done finished publish I am not concerned about the fact that it feels weird that hard mazes get this ominous hellish red now when realistically it's not a very hard maze seriously pause the video and try to solve this maze did it take you more than a minute or two no it didn't because you didn't stop the video and you didn't solve the maze because solving a maze from a top down perspective isn't fun but what's the alternative to a top down view we we cannot render a firstperson perspective into a Microsoft Excel spreadsheet well I mean actually we could hear me out what if we scaled the cells in our game view spreadsheet way down and we used way more since each of these cells can have their own color they effectively become pixels on a screen so we just need to figure figure out how to color in the sky floor and walls to create the illusion that you're standing inside of the maze this might seem like a ridiculously difficult problem but we can cheat a little bit let's just color the top half of the screen as sky and the bottom half as floor and assume that the game is set in a maddening flat void now we just have to figure out how to draw the walls and really draw the walls ends up breaking down into two more steps step step one find the walls that we actually need to draw and step two draw the walls bigger or smaller depending on how far away they are from the player so imagine for a second that we only cared about drawing the wall that is directly in front of the player to make that work we could fire a line out the front and center of the player the line starts exactly where the player is it goes in the direction that they are facing and it keeps getting longer until it hits a wall once it does we know that the wall it hits is in the player's view if there was a closer wall blocking it then the line would have hit that one first this line also tells us how far away the wall is from the player the longer the line the further the wall and that's all the information that we need to draw the walls now we do run into two more problems one finding all of the walls that we need to draw and two dealing with these weird walls that need to be drawn with depth how we solve these two problems is unfortunately beyond the scope of this video but the general concept is that instead of firing one of these wall finding lines we fire one per column of pixels rather than trying to explain this I think if I just show it to you in action you'll get a visual intuition for what's going on here [Music] so once we go through the process of telling Excel how to do all this measuring of lines and coloring of cells our goofy little Microsoft Excel video game goes from this to this [Music] what's really cool about all of this is that Excel is still just interpreting text files that means that all of the tools that we've built to create those text files still work we can make a map however we want in Excel and Excel will figure out how to draw a firstperson perspective of that map now realistically the fact that you can see each frame as it renders is less than ideal there's not a ton we can do about that turns out Microsoft Excel was not designed to render a pseudo 3D video game I for one choose to see it as a Charming nod to the absurdity of the project because otherwise it's a fundamental flaw with the initial concept [Music]
Info
Channel: Ellie Rasmussen
Views: 101,463
Rating: undefined out of 5
Keywords: game, video game, game engine, engine, excel, microsoft excel, programming, game design, game development, development, developer
Id: 9wGCRU6onXg
Channel Id: undefined
Length: 16min 44sec (1004 seconds)
Published: Fri Apr 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.