I Made a 1D Game 🎮

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
have you ever wondered what it would be like to live in a 2d world you've probably played an assortment of 2d video games but those almost never portray an accurate picture of what 2d life would really be like in order to properly show you what life would be like in two dimensions i've decided to create a one-dimensional game and if that sounds bizarre just wait until you try playing my 1d game with a pair of 3d glasses my game is free to play and i've tried to make it as accessible as possible so you'll be able to play on your phone or pc in your browser side note if you don't own a pair of 3d glasses hang around i can help you with that too ok back to this concept of a 1d game it might seem like a 2d game should be viewed as a 2d image but this idea kind of falls apart when you realize that 3d games are also viewed as a 2d image our vision is basically just 2d sure if both your eyes work properly you probably have decent depth perception which means there is a 3d aspect to your vision but you can never see the whole of a 3d object all at once humans also don't have any problems playing 3d games that don't have any depth perception it is possible to have depth perception in a video game if you use a vr headset or if you have a pair of 3d glasses in a game that supports them regardless i think it's correct to say that everything we see is just an interpretation of a 2d image in fact there are endless optical illusions that exploit the way our brains interpret 3d objects 2-dimensionally in a similar way to how we live in a 3d world but can only see 2d images an organism in a 2d world will only be able to see in one dimension which is basically just a line this is the main premise of my 1d game my game takes place in a 2d world but you only get to see it in 1d from the perspective of a 2d organism this might seem unplayable but when demonstrating my game to people after a few moments of getting oriented their brains were able to adjust and comprehend what was happening now you might be inclined to say this game is technically 2d because after all it does exist in a 2d world but i have my own reasons for calling it a 1d game which i will get into later in the video so please watch till the end before leaving an angry comment i started my development process by creating a world that consists of tiles which the player cannot pass through but otherwise can freely move around on a 2d plane next i decided that in order to see what the player sees i needed to employ a technique known as raycasting this means that you have to simulate an invisible ray coming out of the player's eyes to see if it hits something and if so how far away that thing is if the ray does hit something then you know the player should be able to see that thing one ray isn't enough to encompass the player's entire field of view because it can only collide with one part of an object when there could be many objects in the player's field of view at any given time the next step was to cast a bunch of rays at different angles to encompass the player's entire field of view and there we go you can see a single line of pixels that represent what the player should be able to see from their 2d perspective it's not really comprehensible to humans however so let's just stretch that out vertically so you can actually see what's going on i think this is justified since you need some height to actually see what's going on anyway and even the one pixel has some height to it as long as there is no variation on the vertical axis it is 1d just like how barcodes are considered 1d the raycasting totally worked and you can navigate the level without the 2d display although it might take some getting used to i gave the walls a yellow stripe texture so you can actually see what's going on and i made everything get darker the farther away it is which basically makes it look like a foggy room see this tile in front of the player on the 2d display you can see it in front of the player as a vertical column spanning the entire height of the screen and you can see the walls in the background which are a bit darker and since they are farther away the yellow stripes on them are smaller navigating this world somewhat resembles walking around in a 3d world but there are a few distinctions which will become more obvious as we add more features to the game there are games such as the original wolfenstein 3d that are similar to this game in that you can only move around on the 2d plane but what makes that game 3d while this game isn't is the fact that there is vertical variation as well as horizontal variation shown on screen to illustrate how this makes a difference let's say you were walking through a forest and you saw a bear if you didn't have any depth perception you would still have a pretty good idea of how big it is and how far away it is by comparing it to your surroundings the bear on the right probably looks a lot larger than the one on the left but they both take the same amount of horizontal space on your screen all that is needed to create this illusion is to move the bear on the left lower down in the image in the 2d world of our game there is no concept of height so if an enemy was in front of you you would have no way of knowing how far away it was unless you knew how big it was and vice versa especially with this fair analogy not knowing something size and distance can be detrimental to your chances of survival that's one of the reasons i added a fog effect but in practice a 2d life form might not always be able to rely on fog for measuring distance and that's where the 3d glasses come in our two eyes give us the ability to tell the distance and size of something without any prior knowledge and this ability would be even more essential in a 2d world our two eyes provide us with depth perception by allowing us to look at the world from two slightly different angles when comparing images that are taken from two different angles objects that are closer to the observer move more than objects that are farther away and our brains can use this information to convey depth to us 3d glasses allow us to put images from two different viewing angles on the screen at the same time all you have to do is remove all of the green and blue from the left viewing angle and all of the red from the right viewing angle and then overlay the two images each lens will filter out the image from the opposing viewing angle so you only see the correct view through each lens all i had to do to put this in my game was to cast rays from both the player's eyes and then remove the corresponding colors from each viewing angle the 3d effect is optional in this game so you don't need 3d glasses to play it but i do recommend trying it because everyone i've shown it to says it works although i wouldn't call this 3d since the game is normally viewed in a one-dimensional display and the glasses only add a second dimension to your view which makes it more of a 2d effect if anything even with the 3d glasses the game was a little bland in its current state so i decided to add more features to it the first thing i did was create a system for randomly generating levels i just used a generating algorithm i made with my friend a few years ago and put a portal at the end of each level so you can advance to new levels it can be difficult to navigate through the mazes the farther you get into the game so i left an option in the game to view the 2d display alongside the 1d display in case you get stuck it's pretty fun to try and navigate through these mesas for a few minutes but it needed something more i decided to add enemies that will chase after you and more of them will show up the further you get into the game i also added bullets so you can shoot at the enemies and it made the game a lot more fun the bullets and enemies really show the restrictions of a 1d view since you can't see over or under them and they obstruct a lot more of your view as a result at this point my game does a lot more to show some of the difficulties of 2d life which was the main purpose of this project i also added a few more features like a menu that allows you to select different wall textures but i recommend using these with caution if you are sensitive to flashing colors especially with the trippy effect there is also a slider which allows you to adjust the render quality of the game you will likely get better frame rates with a lower render quality especially when viewing the game in 3d mode when i was making the 3d mode i myself didn't have a decent pair of 3d glasses so i got a pair online i decided to order a ton of them at a bulk rate so i could pass them on to my viewers too for much less than they could find them anywhere else if you'd like to order a pair to see what this game looks like in 3d mode and also support my channel you can get a pair for just two dollars with free shipping through the link in the description you can also play my game in your browser right now whether you're on mobile or desktop just click the link in the description to play i will also link the source code but be warned it's pretty messy compared to my usual stuff now i want to finish my video by explaining why i decided to call this a 1d game since 3d games are rendered to a 2d display but are still considered to be 3d you could make the argument that my game is 2d even though it's rendered to a 1d display which is basically just a glorified barcode normally i would agree with that point but the meaning of the phrase 2d game is already well understood to be something completely different from what you see in my game traditional 2d games are always viewed in third person instead of first person and just like 3d games they usually have some sort of depth to them even if it's just an effect for example in super mario bros even though the sprites are all technically rendered as 2d images there is depth to the world such as clouds and hills in the background some 2d platformers even have a parallax effect which makes things in the background move slower than things in the foreground which is most certainly a 3d effect of course you can only move in two different axes in these kinds of games but there is still visually a third dimension an even more extreme example is a link to the past which is a 2d zelda game but it allows you to move along three different axes you can walk on a normal flat surface in that game but you can also climb up stairs and walk on higher levels this isn't just an in-game illusion you can actually walk under bridges and then go across them both the game mechanics and the visuals in the zelda game are 3d but the game is still 2d the difference is ultimately the rendering techniques because the lack of perspective in certain situations set this game apart from traditional 3d titles even though there are some instances of perspective i don't think i can call this game 2d since traditional 2d rendering is completely different and obviously i think the definition gets more blurred if you use the 3d glasses but since everything is ultimately shown in a 1d barcode-like display i think calling it a 1d game is a fair definition i will concede that this is just an opinion but i think it's a fair one like i said earlier all of the useful links are in the description i plan on making more video game related content in the near future especially my 2d sandbox game which i will resume work on once react os 0.4.14 comes out if you don't want to miss out on any more content like this then please consider subscribing
Info
Channel: Mashpoe
Views: 1,706,734
Rating: undefined out of 5
Keywords: programming, gamedev
Id: 3xx7sgNVE-A
Channel Id: undefined
Length: 11min 17sec (677 seconds)
Published: Tue Mar 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.