Thank you very much Sebastian! I'm a huge fan of your videos! I took a lot of inspiration from your own raymarching code for this project, it was a big help in getting everything to work properly haha
@RenderingUser Wolfenstein 3d is also technically 2d, the difference to this is the height of each screen column is dependent on distance from the player
@@4Kslimythis is very uninformed way of looking at this. There's no such thing as half a dimension. Wolfenstein 3D is actually a 2D game with a 3D renderer. DOOM is actually a 3D game, as the game logic actually accounts for all three dimensions. The 3D renderer is rather limited, hence the simple level geometry and objects rendered as sprites. But objects actually do move in 3D space, i.e., movement up and down is possible and accounted for. This is not the case in Wolf3D, where the game all takes place in two dimensions and then projects a 3D image to the screen.
@@4KslimyThis is closer to Wolf3D, but if Wolf3D only ever printed one pixel (or a single coloured vertical line) for each horizontal position on-screen.
How to make 1D game Step 1: take one row of pixels from a 3D game Step 2: stretch the row of pixels to be visible Step 3: add fog You have now made a 1d game!
Holy hell man the editing on this is crazy. The entire video is really high quality, and overall it’s great. Everything is explained well, edited well and it’s awesome. Props to you.
We had to read Flatland in high school. I had very low expectations: 1: it's old 👵 (1884), and 2: it's a math book 🥱. Turns out it reads in a surprisingly modern way, and is written in an engaging "storytime" sort of way. I recommend checking it out if any of that seems remotely interesting.
I honestly loved it! Honestly, I wish I had to do an assignment on it because, asides from mathematics, there's so many themes! How people automatically distrust anything they don't understand, how one can start to think about complex situations, how people also seem to dismiss theoretical possibilities just because they haven't yet viewed it.
You should not be using a line for 2D. It should fill in the whole width of the screen. A flatlander have no perception of height and hence it can only be described as bands filling whole viewport. Cheers
I've seen a million videos where people randomly talk about ray marching, but this is the first time the explanation actually hit me correctly. Congrats man, this is actually a great explanation of it The thing that snapped me out of it, was the explanation of signed distance functions. It finally makes sense that the proportional distance motion is actually computationally good, this is very cool.
So when we say we watch a “3D” movie with two different images that merge in our brain, it would be like these flat land creatures saying they are watching a “2D” movie by watching this type of content with a different image in each eye to give depth perception to this line.
I don't think sdf is necessary here. Visually each object is made out of lines that have a gradient to them, you can probably just render them back to front like a normal polygonal game and it would probably take less processing power. Video was well put together though!
If a Flatlander has two eyes, he could in principle get stereoscopic vision, with each eye creating its own line,which is slightly different from the one from the other eye. Using the parallax effect, that could result in him seeing the world in some kind of weird, but true 2D. It won't be the 2D version that we are used to, as he cannot see what is on the other side of object, from his vantage point, nor can he see what is inside the outlines of shapes, like we can. But he would be able to see shapes (at least the front part of them) and evaluate the distance to them.
Dude this video is amazing, I never would have known how much thought needs to go into something that sounds very simple - rendering some 2D shapes and walking around. The editing and explanations were also top tier, and have massively improved since you've started posting. Definitely one of the better videos you've made!
I got this recommended and watched through the whole video without realizing it's not a million views video from a huge channel. Good job, It was super interesting and informative! You gained a follower :)
I think the fog and colors can be tweaked a bit, no, a lot, to make it more readable. Fog could be the loss of saturation to an extent, going to blackness only at an extreme range, or if there's no source of light. Try adding sources of light, cause why not. It's confusing when the shadows move when you move, light and fog should be different. How about expanding FOV using the thickness of the line to represent what's in front and what's peripheral vision? Try to make a building, like the one in the Flatland cover. To balance it so the objects, sizes and stuff make sense. Make a kind of boundary around the camera/eyes of the character, so you can't or it's obvious when you stick your face in something making the visibility null. Kind of like inverse fog or a character's visual or non-visual sense for distance. Using Y axis and patterns, perhaps like a checkered transparent pattern of increased intensity for the object too close. Or add a second eye, making parallax possible. Run it cross-eyed, or... It's still a 1d game, even if you need 3d setup to run it with parallax.
I explain the difference in the video, the most basic form of raymarching is just that - marching along a ray, with a constant length. Distance-Aided Raymarching, or Sphere-Assisted Raymarching, is the style you mention and that I implement later in the video!
I luv the idea of a world just a line And I love the game you made .. ... I actually tried to imagine how it would be if I was in a 2d world before .. And came to the conclusion that it is impossible .. In order for a line to exist in the real world it should have a height (the third dimension) no matter how thin the line is When the height is 0 it basically disappears..... .. 2d is only possible in math and Measurementing ... But its still fun to imagine yourself in a really thin world.. like having my eyes in the edge of my body in order to see lmao....and can't have a Digestive system or a mouth because that will divide my body into 2 parts💀
I love how most of the comments i see either have a creator comment or a creator like, and it shows the actual passion that he must put into his community. i think that deserves my subscription
@nivmiz0 I love the way you portrayed this topic I've seen it done before but never quite as well as you have like it answered some questions that had been left unanswered before or undressed so I hope I get to see more of this quality content you are making and please keep up the most amazing work.
You extended the height of the render and suddenly I was reminded of how the rendering on Wolfenstein 3d was done. So yeah... I think the game you described has already been done. XD
at the start i though you were insane for starting this, and actually seeing something, but as the video progressed, at around 4:30, i understood, this is so awesome, very good job man
So what I’ve discovered from watching this 3D see things in 2D (if you look with 1 eye there is no depth perception) our eyes are like the camera, since we have two there are two cameras 2D beings see things in 1D because it’s a single line 1D beings would be blind because they see no dimension
You're absolutely right! Things that see, see in one dimension less than they exist in. However a small correction would be that a 1D being would see in 0 dimensions, which is usually interpreted as being a single point. So the vision of a 1D being would be one point (or, if we're talking a video game representation, it could be a single pixel).
well I mean, 2D and 1D are fairly simple, and we're built to understand the comparatively more complex 3D. However, it is impressive that we're able to understand the vastly more complex 4D
@@ack7 I know about 4d golf. same principles apply: you still cant get a full visual of the scene like a 4d being would. the ghosts are decent at providing one, but they still cant be seen when they overlap objects in your current 3d slice, you cant tell whether theyre coming from ana or kata, and the opacity isnt that good at telling you how far they are. you also still need to look around the 3d space whereas a 4d being would be able to see it all at once
Awesome video you make! I think Mar1d have proved that it is possible to make a true 2d game, with perspective, by making the lines smaller in distance. Thanks for the explanation! I subscribed your channel. :-)
I had a lot of fun optimising my 2.5D raycaster. It calculates intersections with line segments after making a few attempts to do basic culling. The main issue is that the floorcasting texture isn't correctly aligned.
This is literally what I always tought for a long time, but I would think it as a vertical “line” because I was thinking it from a side wiew perspective
@RBXDEV2024 do you care to elaborate? Very few things are impossible to think about mathematically. A 1d world would have a position for every number on the number line and a 1d 1st person perspective would be drawing rays between positions. So a 1d being would see one color on their left and one on the right and as they move and as they moving closer or farther the color gets dimmer or brighter.
I think it would make more sense to stretch the line to the full height of your screen/window, because imo an infinite "height" of just the same repeating line makes more sense of representing something that has no "height" variation than a limited height view does. It could also be interesting to see a 2d patformer from first person, where the width is infinite.
I made a game for school that was very similar to this concept, it was just a simple game where you had to find the exit portal in randomly generated mazes, I didn't know about ray marching, but I implemented the simple marching with fixed size steps, I also added height that varies with distance to help with depth perception
This is really interesting to me for the connection to 2d SONAR arrays... the output is very similar to your games display, except you usually have the previous outputs scrolling down the screen so you can see the relative movement
This was super interesting! The editing and graphics really helped me understand this better (because it was *really* hard to grasp when we talked about it lmao).
It's totally possible to remove that edge distortion from high FOV. It's a solved problem for raycasters and it involves either spacing out the rays unevenly so they land on the view plane with an even spacing, or emitting them from a view plane (although this would presumably harm perspective projection).
@@Uni_974 maybe, maybe not. Ultimately what really matters is how used our brain is to that particular projection. Since it differs from the projection we're used to seeing it looks weird, really we'd need a brain with eyes that worked like that. Not a necessary or sufficient trait of being 2D.
you could just use tall 3d models with base of needed shape and apply depth buffer in shader. the result would be the same if not smoother gradient for rounded shapes and much more performant. also mask could be applied to control players visibility
Yeah, but what would be the fun in that? I was trying to make a true 2D/1D engine, not to fake it! If I was trying to make a GAME in this perspective, I'd probably lean more towards your idea, but that really wasn't the goal here haha.
@@nivmiz0 hehe. can't remember who exactly said it: "we are not in a business of making engines, we are making games". anyway video was super entertaining
There is perspective in 2d, since the rays coming out of the camera aren't parallel. Beings in flatland would be able to tell distance like that, and they could also use stereoscopic vision if they had more than one eye.
I’m surprised you went with ray marching and signed distance functions. I think rasterization (project and draw the objects into the scene) or ray tracing (perform ray-object intersection tests analytically) would be much more efficient and perhaps easier to program too.
I think you would not need raymarching for that. You can simply created a 3d environment in unity, and a camera moving around like a player, but it can only move on a plane. Then only show the center row of the render output and override all other pixels to black using post processing?
5:16 if im reading this right (havent read sources) youre actually doing a panoramic projection of the scene, not a planar one so the shapes are distorted and bendy. its harder to tell because 1d but if you were to add tops/bottoms to the "walls" like wolf3d then youd be able to see it
it sounds and looks like they are doing a planar projection, as I'm pretty sure that a panoramic (or I suppose circular, really) projection would preserve shape at the edges of the screen.
can you create Mario or Flappy Bird with vertical line renderer with Mario or bird's point of view. I mean, now that you've made a top-down game with a horizontal renderer, can you make a side-view game with a vertical renderer?
Have you ever heard of Wolfenstein 3D and the raycasting method it used to build it's "3D" environments? basically what you did, but the pixel's height is dependent on it's distance to the camera. Also you might want to consider shading one side of the shapes darker than the other to help with readability.
Neat!!! I saw someone else do the same thing with the 1D view, but they never really elaborated on it, nor did they include any game mechanics. Really impressed that this wasn't just a repeat of that video! I already typed a prior comment that joked that your video was clickbait(yeah I've become a bit of a squidward cause of the clickbait & (bad)commentary slop online that I've bore witness to), glad I deleted it. Will refer back to a copy of its contents to remind myself of my cynical nature & that I need to get better and touch some grass every once in a while.
Nice project. The only criticism I have, is that the "flatlander" is walking on empty space. In reality, it would need some kind of surface/planet to traverse on, and the planet would just be a massive circle the same way that gravity makes our planets massive spheres.
In a 3D world, having 2 eyes is what allows us to see 3D. If we close 1 eye, we just see a 2D image. Similarly, in a 2D world, a character with only 1 eye sees 1D. But if they also have 2 eyes, they could actually see 2D. This could perhaps be somehow interpreted as line thickness.
Really Really Impressive to me, just before the end i was actually just thinking, what if he stretched the entire window's height? and also the bullets thing which i swear i actually tought he was gonna add that before i reached to the end, but still impressive work!
interesting. it's cool to see people experiment with spatial dimensions like this. reminds me of SCP-3966, which iirc also took inspiration from Flatland one thing im curious about is why you're using ray marching at all. would it not be easier to, for each pixel, perform a ray/object intersection test against every object in the scene, remembering which one is nearest? though i suppose SDFs might not be usable that way; you'd need a unique ray/intersection test for each shape or, failing that, a ray/edge intersection test used once per edge per object. hm... math was never my strong suit anyway, fascinating project
I think what you said about depth in the fog section is questionable since your game did have perspective and depth before adding the shading Edit: for instance, you can tell something is further away from how little its size changes when you move, and you can tell what shape something is by viewing it from many angles. You should be able to tell apart the regular polygons by measuring how the width varies with distance and angle, even without a static reference point I didn’t make it clear im talking about mathematically rather than practically
Thank you! I think different dimensions are an amazing mathematical concept and I've always been interested in visual representations of them. As for why I used raymarching, I've wanted to experiment with the algorithm for a while, and I felt like using it in this context would give it my own unique twist! It was a really fun project to make, and an interesting coding challenge. Plus, it's an excellent system for rendering! It works great, it's quite fast when run on the GPU, and it can render many more shapes than most other techniques, with minimal performance difference. There are of course many other ways to solve the problem I solved here, but I really do think my implementation is a pretty good one.
I talk about that illusion later in the video! I left it as a thin line for a lot of the video because I feel it's probably more faithful to the book, but stretching them totally makes a really cool effect!
It's a cool project. I think you should make a game out of it. For example, a FPS with wall-like covers and AI enemies, that use pathfinding. I also recommend adding a multiplayer.
Did you fix the fisheye effect? Because of the perspective, it's hard to be sure, but there were a few times that it looked fisheye-ee. Without fixing the fisheye effect, it's possible to see a bright spot in the middle of an edge and think that there is a vertex in that bright spot.
id love to play a game like this, though i find it a bit strange that you cant really tell where vertices are, for example if you see a cube in a 3D world on a 2D plane its very clear where the edges n vertices are since theyre typically darkened or theres a significant change in brightness due to how shadows work, i think that wouldve been quite helpful to help visualize the surroundings
Implementing light and shadow properly in a world like this has its own issues, which I may go into in the follow up video. It has to do with the fact that if a light were to be obscured by a single object in flatland, it would cast a shadow behind it for the length of the entire world. Anyway I'm tackling the issue of differentiating between shades at the moment!
the line is too flat for our eyes but if you add some height it will just feel like Doom. and Doom is technically 2D first person it uses ray casting for rendering, the space itself is 2D but graphic looks 3D that's just illusion
Nice work! :)
Thank you very much Sebastian! I'm a huge fan of your videos!
I took a lot of inspiration from your own raymarching code for this project, it was a big help in getting everything to work properly haha
WHERE DID YOU COME FROM SEBASTIAN LAGUE
whens the next digital logic sim video coming out
- first person 2d game
- look inside
- wolfenstein 3d
This game is still 2d tho
@RenderingUser
Wolfenstein 3d is also technically 2d, the difference to this is the height of each screen column is dependent on distance from the player
@@TheJas-vr2vrSo just like Doom it’s 2.5D because it uses some 3D aspects but it has some 2D parts as well
@@4Kslimythis is very uninformed way of looking at this. There's no such thing as half a dimension. Wolfenstein 3D is actually a 2D game with a 3D renderer. DOOM is actually a 3D game, as the game logic actually accounts for all three dimensions. The 3D renderer is rather limited, hence the simple level geometry and objects rendered as sprites. But objects actually do move in 3D space, i.e., movement up and down is possible and accounted for. This is not the case in Wolf3D, where the game all takes place in two dimensions and then projects a 3D image to the screen.
@@4KslimyThis is closer to Wolf3D, but if Wolf3D only ever printed one pixel (or a single coloured vertical line) for each horizontal position on-screen.
How to make 1D game
Step 1: take one row of pixels from a 3D game
Step 2: stretch the row of pixels to be visible
Step 3: add fog
You have now made a 1d game!
that's pretty much exactly what i thought would be done lol
Step 4 give 2D being a GUN
Oh no, i edited the comment and the heart i got from it got deleted :(
is that not still a 2d game?
How about a first person 1D game...
It would just be one pixel.
this editing is phenomenal!
gives me 2 hour youtube documentary about something you have no idea about vibes.
Lmao, that's basically how it felt making it. Massive deep dive into a SUPER niche subject
Wait you mean that’s possible? Time for me to make some videos!
Holy hell man the editing on this is crazy. The entire video is really high quality, and overall it’s great. Everything is explained well, edited well and it’s awesome. Props to you.
Thanks so much! It took like 10x longer than my other videos to make, glad it seems it was worth it!
@@nivmiz0 What is your strategy?
We had to read Flatland in high school. I had very low expectations: 1: it's old 👵 (1884), and 2: it's a math book 🥱. Turns out it reads in a surprisingly modern way, and is written in an engaging "storytime" sort of way. I recommend checking it out if any of that seems remotely interesting.
I absolutely fell in love with it! Cool to hear you did too (:
I honestly loved it! Honestly, I wish I had to do an assignment on it because, asides from mathematics, there's so many themes!
How people automatically distrust anything they don't understand, how one can start to think about complex situations, how people also seem to dismiss theoretical possibilities just because they haven't yet viewed it.
What do ya mean a "math book" I've read it and I don't remember anything math related
@c7iC--s7ick because it addresses the theory of multiple dimensions and it's listed as "mathematical fiction"
@@jadecboom8638 what i meant was i only remember it telling the story like a "fantasy" fiction novel (nothing smart sounding)
You should not be using a line for 2D. It should fill in the whole width of the screen. A flatlander have no perception of height and hence it can only be described as bands filling whole viewport. Cheers
I've seen a million videos where people randomly talk about ray marching, but this is the first time the explanation actually hit me correctly.
Congrats man, this is actually a great explanation of it
The thing that snapped me out of it, was the explanation of signed distance functions. It finally makes sense that the proportional distance motion is actually computationally good, this is very cool.
You have no idea how happy I am to hear that! Thank you!
It's incredible how intuitive it was the second you added the fog
the section at 11min where u talk about it being a 3d illusion looks pretty similar to how we originally did the first 3d games.
I had that thought to actually! reminds me of Wolfenstein & Doom
Brother basically created doom
Doom is 2.5D
@4Kslimy Doom is fully 3D. Just limited. Dont believe me?: ua-cam.com/video/ZYGJQqhMN1U/v-deo.htmlsi=0GS7_rNc6hjIqBNw
@4Kslimy Doom is 3d but limited. Theres a video on this on yt but i cant send the link here
A 1D fatality would be kinda dope though
Nah that'd be more like wolfenstein.
Time for speedrunners to find a glitch to go into the third dimension... WHY YOU GOTTA MAKE MY JOB HARD
Nuh there going to glitch walk perpendically instead
So when we say we watch a “3D” movie with two different images that merge in our brain, it would be like these flat land creatures saying they are watching a “2D” movie by watching this type of content with a different image in each eye to give depth perception to this line.
I don't think sdf is necessary here. Visually each object is made out of lines that have a gradient to them, you can probably just render them back to front like a normal polygonal game and it would probably take less processing power.
Video was well put together though!
1:10 But the games are 2D, the only thing that isn't 2D here is us. Just because the game is not perceived in 2D doesn't mean the game isn't 2D.
If a Flatlander has two eyes, he could in principle get stereoscopic vision, with each eye creating its own line,which is slightly different from the one from the other eye. Using the parallax effect, that could result in him seeing the world in some kind of weird, but true 2D. It won't be the 2D version that we are used to, as he cannot see what is on the other side of object, from his vantage point, nor can he see what is inside the outlines of shapes, like we can. But he would be able to see shapes (at least the front part of them) and evaluate the distance to them.
in the book they only had one so yeah
i cant imagine what it would be like to live in 1d
Dude this video is amazing, I never would have known how much thought needs to go into something that sounds very simple - rendering some 2D shapes and walking around.
The editing and explanations were also top tier, and have massively improved since you've started posting. Definitely one of the better videos you've made!
Thank you so much yoyo
I got this recommended and watched through the whole video without realizing it's not a million views video from a huge channel.
Good job, It was super interesting and informative! You gained a follower :)
Thank you so much! That's such high praise (:
Yeah seeing more 1D content does put a smile on my face :)
I think the fog and colors can be tweaked a bit, no, a lot, to make it more readable. Fog could be the loss of saturation to an extent, going to blackness only at an extreme range, or if there's no source of light. Try adding sources of light, cause why not. It's confusing when the shadows move when you move, light and fog should be different.
How about expanding FOV using the thickness of the line to represent what's in front and what's peripheral vision?
Try to make a building, like the one in the Flatland cover. To balance it so the objects, sizes and stuff make sense.
Make a kind of boundary around the camera/eyes of the character, so you can't or it's obvious when you stick your face in something making the visibility null. Kind of like inverse fog or a character's visual or non-visual sense for distance. Using Y axis and patterns, perhaps like a checkered transparent pattern of increased intensity for the object too close. Or add a second eye, making parallax possible. Run it cross-eyed, or... It's still a 1d game, even if you need 3d setup to run it with parallax.
Thanks for the suggestions! These are really interesting. If I make a follow up I'll for sure look into them!
This is actually super neat. I wonder how other characters would appear and how would they be distinct from non character shapes.
It's an interesting challenge for sure!
Rays in raymarching don't step by a constant amount, they step by the distance to the closest object ( minimum of all objects' distances )
I explain the difference in the video, the most basic form of raymarching is just that - marching along a ray, with a constant length. Distance-Aided Raymarching, or Sphere-Assisted Raymarching, is the style you mention and that I implement later in the video!
I luv the idea of a world just a line
And I love the game you made
..
...
I actually tried to imagine how it would be if I was in a 2d world before
..
And came to the conclusion that it is impossible
..
In order for a line to exist in the real world it should have a height (the third dimension) no matter how thin the line is
When the height is 0 it basically disappears.....
..
2d is only possible in math and Measurementing
...
But its still fun to imagine yourself in a really thin world.. like having my eyes in the edge of my body in order to see lmao....and can't have a Digestive system or a mouth because that will divide my body into 2 parts💀
I love how most of the comments i see either have a creator comment or a creator like, and it shows the actual passion that he must put into his community. i think that deserves my subscription
I appreciate that so much!
@nivmiz0 I love the way you portrayed this topic I've seen it done before but never quite as well as you have like it answered some questions that had been left unanswered before or undressed so I hope I get to see more of this quality content you are making and please keep up the most amazing work.
Using SDFs for this feels like shooting sparrows with cannons. Ray-casting would be way more efficient giving you the same results. Nice video though.
Very cool concept, man. The final result was impressive
You extended the height of the render and suddenly I was reminded of how the rendering on Wolfenstein 3d was done. So yeah... I think the game you described has already been done. XD
at the start i though you were insane for starting this, and actually seeing something, but as the video progressed, at around 4:30, i understood, this is so awesome, very good job man
Thanks so much, this means a lot!
There's a guy named MashPoe who made a whole 1D game exactly like this, this kinda reminded me of it
the non "distance aided" raymarching isn't called raymarching, it's ray stepping
So what I’ve discovered from watching this
3D see things in 2D (if you look with 1 eye there is no depth perception) our eyes are like the camera, since we have two there are two cameras
2D beings see things in 1D because it’s a single line
1D beings would be blind because they see no dimension
You're absolutely right! Things that see, see in one dimension less than they exist in. However a small correction would be that a 1D being would see in 0 dimensions, which is usually interpreted as being a single point. So the vision of a 1D being would be one point (or, if we're talking a video game representation, it could be a single pixel).
''We viewing a 2D world with a 1D view on a 2D screen in a 3D world through a 2D viewpoint'' I love it😂🔥
Godly editing style, good job
Thanks man! Appreciate that.
Yoooo this was sick dude! I would love to see you expand this! And maybe make a real game from it!
It would be interesting to see how it looks for you to move the 2d plane through a 3d space, could be pretty cool
In order to see in 3 dimensions you have to be a 4 dimensional being yourself
All of this is really cool, ngl, and the fact our brains can comprehend it is impresive as well
I really agree! It's pretty insane that we can just use these simple tools to pretty accurately simulate living in a different spatial dimension!
well I mean, 2D and 1D are fairly simple, and we're built to understand the comparatively more complex 3D. However, it is impressive that we're able to understand the vastly more complex 4D
@@ack7we cant fully understand 4d, although we can calculate it and understand facets of it
@@circumplex9552 Me who has played 4D Golf: *Foolish Mortal, you have not one modicum of the understanding I possess*
@@ack7 I know about 4d golf. same principles apply: you still cant get a full visual of the scene like a 4d being would. the ghosts are decent at providing one, but they still cant be seen when they overlap objects in your current 3d slice, you cant tell whether theyre coming from ana or kata, and the opacity isnt that good at telling you how far they are. you also still need to look around the 3d space whereas a 4d being would be able to see it all at once
What ist that Song/piece at 11:37 called 😃
It's called Allégro by Emmit Fenn (:
@@nivmiz0 thanks👍
Awesome video you make!
I think Mar1d have proved that it is possible to make a true 2d game, with perspective, by making the lines smaller in distance.
Thanks for the explanation!
I subscribed your channel.
:-)
waiting for flatearthers to show up...
I had a lot of fun optimising my 2.5D raycaster. It calculates intersections with line segments after making a few attempts to do basic culling. The main issue is that the floorcasting texture isn't correctly aligned.
Amazing video! That really reminds me of the way Doom projects 2D map as 3D environment. But rather than adding a dimension, we remove one.
Thank you!
This is literally what I always tought for a long time, but I would think it as a vertical “line” because I was thinking it from a side wiew perspective
Futurama delved into this concept, where you can’t see around something in 2D Space.
Wait is that a 3D and 1D game
so it's basically what people would call a 1d game
1d can’t technically exist
@RBXDEV2024 do you care to elaborate? Very few things are impossible to think about mathematically. A 1d world would have a position for every number on the number line and a 1d 1st person perspective would be drawing rays between positions. So a 1d being would see one color on their left and one on the right and as they move and as they moving closer or farther the color gets dimmer or brighter.
I think it would make more sense to stretch the line to the full height of your screen/window, because imo an infinite "height" of just the same repeating line makes more sense of representing something that has no "height" variation than a limited height view does.
It could also be interesting to see a 2d patformer from first person, where the width is infinite.
I made a game for school that was very similar to this concept, it was just a simple game where you had to find the exit portal in randomly generated mazes, I didn't know about ray marching, but I implemented the simple marching with fixed size steps, I also added height that varies with distance to help with depth perception
So cool to hear you did something similar!
Or you could render standard 3d but don't allow up/down pan and only display the center scan line...
As someone who read flatland in my physics class, this is cool
This is really interesting to me for the connection to 2d SONAR arrays... the output is very similar to your games display, except you usually have the previous outputs scrolling down the screen so you can see the relative movement
For more context to what I'm getting at, you can look up "passive sonar waterfall display"
Man, who would knew that making a 2d game with a 1d perspective would take this much time
The video took AGES
This was super interesting! The editing and graphics really helped me understand this better (because it was *really* hard to grasp when we talked about it lmao).
I think it would be a bit better if you used the distance to the shape to smooth it out a bit more
It's totally possible to remove that edge distortion from high FOV. It's a solved problem for raycasters and it involves either spacing out the rays unevenly so they land on the view plane with an even spacing, or emitting them from a view plane (although this would presumably harm perspective projection).
Or you could get a 2D brain works too
@@Uni_974 maybe, maybe not. Ultimately what really matters is how used our brain is to that particular projection. Since it differs from the projection we're used to seeing it looks weird, really we'd need a brain with eyes that worked like that. Not a necessary or sufficient trait of being 2D.
you could just use tall 3d models with base of needed shape and apply depth buffer in shader. the result would be the same if not smoother gradient for rounded shapes and much more performant. also mask could be applied to control players visibility
Yeah, but what would be the fun in that? I was trying to make a true 2D/1D engine, not to fake it! If I was trying to make a GAME in this perspective, I'd probably lean more towards your idea, but that really wasn't the goal here haha.
@@nivmiz0 hehe. can't remember who exactly said it: "we are not in a business of making engines, we are making games". anyway video was super entertaining
There is perspective in 2d, since the rays coming out of the camera aren't parallel. Beings in flatland would be able to tell distance like that, and they could also use stereoscopic vision if they had more than one eye.
”A first person 2d game is the easiest 3d game to create from scratch”
5:22 isn't there some correction for this kind of distortion that is occurring at the edge of the FOV to make it appear more natural?
this is awesome, loved the video :)
From the perspective of a 3D creature watching at the side, yeah, that's accurate.
You should try porting this to 3ds, the need for fog would be mostly eliminated.
Reminds me of a scratch tutorial I watched once, they also used raycasting but the final effect was „3d“
When NivMiz mentioned rays my immediate thought was "I've used a simple version of that in Scratch!" haha
I’m surprised you went with ray marching and signed distance functions. I think rasterization (project and draw the objects into the scene) or ray tracing (perform ray-object intersection tests analytically) would be much more efficient and perhaps easier to program too.
I think you would not need raymarching for that. You can simply created a 3d environment in unity, and a camera moving around like a player, but it can only move on a plane. Then only show the center row of the render output and override all other pixels to black using post processing?
5:16 if im reading this right (havent read sources) youre actually doing a panoramic projection of the scene, not a planar one
so the shapes are distorted and bendy.
its harder to tell because 1d but if you were to add tops/bottoms to the "walls" like wolf3d then youd be able to see it
it sounds and looks like they are doing a planar projection, as I'm pretty sure that a panoramic (or I suppose circular, really) projection would preserve shape at the edges of the screen.
Now do a 1D game from the point of view of a non one dimensional creature
I've thought about this before. The entire screen is one color
So how we can look into 4 dimensions shape in 3 dimensions view then?
He does realize that you also can't tell the shape of a 3D object with our eyes if there is no form of shading.
extrude the row upwards than divide the height by the distance of said pixels for a doom like 3d effect, I've used this for 3d in scratch
This is so cool, i hope I'll see complete game.
Thanks so much!
Can't you sum up the ray step lengths to figure out the distance to the camera?
That's actually a great idea! I'll have to check it out to see if it improves performance in any way.
Wow, I can't phrase how much i appreciate this channel for making such high-quality videos and aspiring to grow better every time!! #thefogiscoming
The fog is coming.
this is great! i bet sebastian lague would dig it
3rd person 2D game
Honestly a raycast maze game on Scratch fits the definition of a 2d game really well.
Dangerous drinking game: take a shot every time compute shaders come up on gamedev youtube.
can you create Mario or Flappy Bird with vertical line renderer with Mario or bird's point of view. I mean, now that you've made a top-down game with a horizontal renderer, can you make a side-view game with a vertical renderer?
That's a really good idea!
Have you ever heard of Wolfenstein 3D and the raycasting method it used to build it's "3D" environments? basically what you did, but the pixel's height is dependent on it's distance to the camera.
Also you might want to consider shading one side of the shapes darker than the other to help with readability.
Can you do " for each ( ray in raycasts ) { run raycastTest(ray); } to speed up the process ?
Neat!!! I saw someone else do the same thing with the 1D view, but they never really elaborated on it, nor did they include any game mechanics. Really impressed that this wasn't just a repeat of that video! I already typed a prior comment that joked that your video was clickbait(yeah I've become a bit of a squidward cause of the clickbait & (bad)commentary slop online that I've bore witness to), glad I deleted it. Will refer back to a copy of its contents to remind myself of my cynical nature & that I need to get better and touch some grass every once in a while.
Really appreciate that! Glad you ended up liking it, regardless of the slight clickbait 😉
Nice project. The only criticism I have, is that the "flatlander" is walking on empty space. In reality, it would need some kind of surface/planet to traverse on, and the planet would just be a massive circle the same way that gravity makes our planets massive spheres.
you can just think of it as floating
or if you want to make it more believable that it can propel itself, maybe its swimming
In a 3D world, having 2 eyes is what allows us to see 3D. If we close 1 eye, we just see a 2D image. Similarly, in a 2D world, a character with only 1 eye sees 1D. But if they also have 2 eyes, they could actually see 2D. This could perhaps be somehow interpreted as line thickness.
Really Really Impressive to me, just before the end i was actually just thinking, what if he stretched the entire window's height? and also the bullets thing which i swear i actually tought he was gonna add that before i reached to the end, but still impressive work!
Having a 2D gun is a staple in most 1D games 🔫
you made a 1D game in a 2D world. You see in 2D but you are in a 3D world.
interesting. it's cool to see people experiment with spatial dimensions like this. reminds me of SCP-3966, which iirc also took inspiration from Flatland
one thing im curious about is why you're using ray marching at all. would it not be easier to, for each pixel, perform a ray/object intersection test against every object in the scene, remembering which one is nearest? though i suppose SDFs might not be usable that way; you'd need a unique ray/intersection test for each shape or, failing that, a ray/edge intersection test used once per edge per object. hm... math was never my strong suit
anyway, fascinating project
I think what you said about depth in the fog section is questionable since your game did have perspective and depth before adding the shading
Edit: for instance, you can tell something is further away from how little its size changes when you move, and you can tell what shape something is by viewing it from many angles. You should be able to tell apart the regular polygons by measuring how the width varies with distance and angle, even without a static reference point
I didn’t make it clear im talking about mathematically rather than practically
I think you should have the pixels stretch to fill the screen since that's easier to see and more like what a flatlander would see
Very nice to see more people branching out to make games in other dimensions. But I'm curious, why did you use raymarching for your rendering?
Thank you! I think different dimensions are an amazing mathematical concept and I've always been interested in visual representations of them. As for why I used raymarching, I've wanted to experiment with the algorithm for a while, and I felt like using it in this context would give it my own unique twist! It was a really fun project to make, and an interesting coding challenge.
Plus, it's an excellent system for rendering! It works great, it's quite fast when run on the GPU, and it can render many more shapes than most other techniques, with minimal performance difference. There are of course many other ways to solve the problem I solved here, but I really do think my implementation is a pretty good one.
Rather than a thin line you should stretch it to fill the whole screen but each column of pixels is a single color.
I talk about that illusion later in the video! I left it as a thin line for a lot of the video because I feel it's probably more faithful to the book, but stretching them totally makes a really cool effect!
It's a cool project. I think you should make a game out of it. For example, a FPS with wall-like covers and AI enemies, that use pathfinding. I also recommend adding a multiplayer.
2D Doom 🔫
NEW NIVMIZ VIDEO LETS GOOO 🔥🔥🔥🔥I DONT GET HES TALKING ABOUT BUT LETS GOOOO 🗣🔥🗣🔥🗣🔥💯💯
Cool information illustation, and now I finally know of a way of doing that myself, thanks for the link
That's really cool to hear, good luck with your own implementation!
Did you fix the fisheye effect? Because of the perspective, it's hard to be sure, but there were a few times that it looked fisheye-ee.
Without fixing the fisheye effect, it's possible to see a bright spot in the middle of an edge and think that there is a vertex in that bright spot.
id love to play a game like this, though i find it a bit strange that you cant really tell where vertices are, for example if you see a cube in a 3D world on a 2D plane its very clear where the edges n vertices are since theyre typically darkened or theres a significant change in brightness due to how shadows work, i think that wouldve been quite helpful to help visualize the surroundings
Implementing light and shadow properly in a world like this has its own issues, which I may go into in the follow up video. It has to do with the fact that if a light were to be obscured by a single object in flatland, it would cast a shadow behind it for the length of the entire world. Anyway I'm tackling the issue of differentiating between shades at the moment!
@@nivmiz0 oh that's true, and if the shadow of one object gets cast onto another object it makes it very hard to tell whether it's a shadow or an edge
"if you play any FPS games"
*Shows footage of Minecraft*
You could actually do path traced lighting for a game like this, that would be pretty funny
This is crazy, loved the video
the line is too flat for our eyes but if you add some height it will just feel like Doom. and Doom is technically 2D first person it uses ray casting for rendering, the space itself is 2D but graphic looks 3D that's just illusion
the game shown is more like wolfenstein and not doom.
doom while limited, and uses a 2d map, is still 3d, it renders floors and heights and stuff.
I think Carmack mentioned Wolfenstein 3-D is actually based on a top down ("2D") game with similar gameplay, Catacomb.
11:06 Ah, I just figured that you would have a strange fog look.