A truly 2D game isn't what you think it is...

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024

Комментарии • 382

  • @SebastianLague
    @SebastianLague 2 месяца назад +110

    Nice work! :)

    • @nivmiz0
      @nivmiz0  2 месяца назад +19

      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

    • @BurgerSoda
      @BurgerSoda 2 месяца назад +3

      WHERE DID YOU COME FROM SEBASTIAN LAGUE

    • @a2kvarnstrom80
      @a2kvarnstrom80 Месяц назад

      whens the next digital logic sim video coming out

  • @whimbur
    @whimbur 3 месяца назад +385

    - first person 2d game
    - look inside
    - wolfenstein 3d

    • @RenderingUser
      @RenderingUser 3 месяца назад +6

      This game is still 2d tho

    • @TheJas-vr2vr
      @TheJas-vr2vr 3 месяца назад +27

      @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

    • @4Kslimy
      @4Kslimy 3 месяца назад +5

      @@TheJas-vr2vrSo just like Doom it’s 2.5D because it uses some 3D aspects but it has some 2D parts as well

    • @ErdrickHero
      @ErdrickHero 3 месяца назад +26

      ​@@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.

    • @ErdrickHero
      @ErdrickHero 3 месяца назад +5

      ​@@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.

  • @cosmiccoruption5145
    @cosmiccoruption5145 3 месяца назад +67

    this editing is phenomenal!
    gives me 2 hour youtube documentary about something you have no idea about vibes.

    • @nivmiz0
      @nivmiz0  3 месяца назад +15

      Lmao, that's basically how it felt making it. Massive deep dive into a SUPER niche subject

    • @KillerKatz12
      @KillerKatz12 2 месяца назад

      Wait you mean that’s possible? Time for me to make some videos!

  • @Mikee512
    @Mikee512 3 месяца назад +87

    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.

    • @nivmiz0
      @nivmiz0  3 месяца назад +12

      I absolutely fell in love with it! Cool to hear you did too (:

    • @jadecboom8638
      @jadecboom8638 2 месяца назад +3

      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.

    • @c7iC--s7ick
      @c7iC--s7ick 2 месяца назад

      What do ya mean a "math book" I've read it and I don't remember anything math related

    • @jadecboom8638
      @jadecboom8638 Месяц назад

      @c7iC--s7ick because it addresses the theory of multiple dimensions and it's listed as "mathematical fiction"

    • @c7iC--s7ick
      @c7iC--s7ick Месяц назад

      @@jadecboom8638 what i meant was i only remember it telling the story like a "fantasy" fiction novel (nothing smart sounding)

  • @Sterligs
    @Sterligs 3 месяца назад +74

    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.

    • @nivmiz0
      @nivmiz0  3 месяца назад +5

      Thanks so much! It took like 10x longer than my other videos to make, glad it seems it was worth it!

    • @LebatrowAndSqueak
      @LebatrowAndSqueak 2 месяца назад

      @@nivmiz0 What is your strategy?

  • @vjay4297
    @vjay4297 Месяц назад +9

    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

  • @darkfire_ninja
    @darkfire_ninja 3 месяца назад +188

    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!

    • @jayyusi
      @jayyusi 3 месяца назад +12

      that's pretty much exactly what i thought would be done lol

    • @Uni_974
      @Uni_974 2 месяца назад +1

      Step 4 give 2D being a GUN

    • @darkfire_ninja
      @darkfire_ninja 2 месяца назад +1

      Oh no, i edited the comment and the heart i got from it got deleted :(

    • @silverkip2992
      @silverkip2992 2 месяца назад +3

      is that not still a 2d game?

    • @vinsplayer2634
      @vinsplayer2634 2 месяца назад

      How about a first person 1D game...
      It would just be one pixel.

  • @lavuy6744
    @lavuy6744 3 месяца назад +39

    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.

    • @nivmiz0
      @nivmiz0  3 месяца назад +13

      I had that thought to actually! reminds me of Wolfenstein & Doom

  • @HowdyYT
    @HowdyYT 3 месяца назад +234

    Brother basically created doom

    • @4Kslimy
      @4Kslimy 3 месяца назад +21

      Doom is 2.5D

    • @noob-killer
      @noob-killer 3 месяца назад

      ​@4Kslimy Doom is fully 3D. Just limited. Dont believe me?: ruclips.net/video/ZYGJQqhMN1U/видео.htmlsi=0GS7_rNc6hjIqBNw

    • @noob-killer
      @noob-killer 3 месяца назад +18

      ​ @4Kslimy Doom is 3d but limited. Theres a video on this on yt but i cant send the link here

    • @Uni_974
      @Uni_974 2 месяца назад +2

      A 1D fatality would be kinda dope though

    • @Damian-cilr2
      @Damian-cilr2 2 месяца назад +7

      Nah that'd be more like wolfenstein.

  • @capnqueso
    @capnqueso 3 месяца назад +30

    Time for speedrunners to find a glitch to go into the third dimension... WHY YOU GOTTA MAKE MY JOB HARD

    • @Uni_974
      @Uni_974 2 месяца назад

      Nuh there going to glitch walk perpendically instead

  • @steelwasp9375
    @steelwasp9375 3 месяца назад +14

    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.

    • @nivmiz0
      @nivmiz0  3 месяца назад +4

      Thanks for the suggestions! These are really interesting. If I make a follow up I'll for sure look into them!

  • @legend644
    @legend644 2 месяца назад +13

    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.

    • @nivmiz0
      @nivmiz0  2 месяца назад +1

      You have no idea how happy I am to hear that! Thank you!

  • @yoavsaporta7348
    @yoavsaporta7348 3 месяца назад +7

    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!

    • @nivmiz0
      @nivmiz0  3 месяца назад +1

      Thank you so much yoyo

  • @ImmortalTimothyM
    @ImmortalTimothyM 2 месяца назад +1

    This is actually super neat. I wonder how other characters would appear and how would they be distinct from non character shapes.

    • @nivmiz0
      @nivmiz0  2 месяца назад

      It's an interesting challenge for sure!

  • @bl4ckk
    @bl4ckk 3 месяца назад +3

    Godly editing style, good job

    • @nivmiz0
      @nivmiz0  3 месяца назад

      Thanks man! Appreciate that.

  • @gavin5410
    @gavin5410 2 месяца назад +7

    It's incredible how intuitive it was the second you added the fog

  • @FireDasher22
    @FireDasher22 2 месяца назад +1

    Rays in raymarching don't step by a constant amount, they step by the distance to the closest object ( minimum of all objects' distances )

    • @nivmiz0
      @nivmiz0  2 месяца назад +2

      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!

  • @pfannkuchengesicht42
    @pfannkuchengesicht42 3 месяца назад +11

    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.

  • @tackalexander
    @tackalexander 2 месяца назад +1

    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
      @nivmiz0  2 месяца назад +2

      I appreciate that so much!

    • @tackalexander
      @tackalexander 2 месяца назад

      @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.

  • @rerere284
    @rerere284 2 месяца назад +3

    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!

  • @VGamingJunkieVT
    @VGamingJunkieVT Месяц назад

    Futurama delved into this concept, where you can’t see around something in 2D Space.

  • @ezram.4484
    @ezram.4484 3 месяца назад +2

    As someone who read flatland in my physics class, this is cool

  • @dipperconte124
    @dipperconte124 2 месяца назад

    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

  • @moonyl5341
    @moonyl5341 2 месяца назад +8

    so it's basically what people would call a 1d game

    • @RBXDEV2024
      @RBXDEV2024 Месяц назад

      1d can’t technically exist

    • @fakegandhi5577
      @fakegandhi5577 Месяц назад

      ​@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.

  • @jonsteensen7706
    @jonsteensen7706 2 месяца назад +2

    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.

    • @LucasBucur
      @LucasBucur 24 дня назад

      in the book they only had one so yeah

  • @Erstus
    @Erstus Месяц назад

    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.

  • @tjb3171
    @tjb3171 Месяц назад

    this is awesome, loved the video :)

  • @spygun21
    @spygun21 3 месяца назад +1

    Man, who would knew that making a 2d game with a 1d perspective would take this much time

    • @nivmiz0
      @nivmiz0  3 месяца назад +1

      The video took AGES

  • @multiplysixbynine
    @multiplysixbynine Месяц назад

    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.

  • @fedo18
    @fedo18 3 месяца назад +1

    Reminds me of a scratch tutorial I watched once, they also used raycasting but the final effect was „3d“

    • @cyberneticsquid
      @cyberneticsquid 3 месяца назад +1

      When NivMiz mentioned rays my immediate thought was "I've used a simple version of that in Scratch!" haha

  • @kbkmn
    @kbkmn 3 месяца назад +1

    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

    • @nivmiz0
      @nivmiz0  3 месяца назад +2

      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.

    • @kbkmn
      @kbkmn 3 месяца назад

      ​@@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

  • @theneonbop
    @theneonbop Месяц назад

    You could actually do path traced lighting for a game like this, that would be pretty funny

  • @AmodeusR
    @AmodeusR 2 месяца назад +2

    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.

  • @ruzgar1372
    @ruzgar1372 2 месяца назад +2

    In order to see in 3 dimensions you have to be a 4 dimensional being yourself

  • @oliverdowning1543
    @oliverdowning1543 3 месяца назад +1

    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
      @Uni_974 2 месяца назад

      Or you could get a 2D brain works too

    • @oliverdowning1543
      @oliverdowning1543 2 месяца назад

      ​@@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.

  • @przecinek-ly9ko
    @przecinek-ly9ko 2 месяца назад

    you made a 1D game in a 2D world. You see in 2D but you are in a 3D world.

  • @m.hosseinmahmoodi
    @m.hosseinmahmoodi 2 месяца назад

    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.

  • @segganew
    @segganew 2 месяца назад

    "if you play any FPS games"
    *Shows footage of Minecraft*

  • @xXrobloxpro123Xx
    @xXrobloxpro123Xx Месяц назад

    wipsom
    -
    Today at 12:05 AM
    The psychology behind Red Dead Redemption 2 is actually quite genius, I wouldn’t be surprised
    if psychologists had been part of its development. The game starts by introducing you to the protagonist, Arthur Morgan, but tells you very little about him. He is nothing more than a stranger, a mere fictional character to the player. The player, therefore, has no problem with cold-blooded murder and other heinous crimes. But then, the player begins to see how they can relate to Arthur. How he has his ups and downs. How he has friends, some closer than others. Even subtle things, such as his movements, body language, or facial expressions. Even how he forgets the lyrics to songs he’s singing with other camp members. The player begins to get attached to him, get immersed in the game and its realistic graphics, see him as a friend, perhaps. This is usually timed perfectly with when Arthur realizes that he is a bad man, and that he needs to change. The player, who now also sees the extreme realism contained within the NPCs, mere background characters, who have lives, families, jobs, in this virtual world, begins to feel bad for what they do to NPCs, and also feel that it is not right to let Arthur do something wrong. They want to help a friend, as all good friends do. WARNING: SPOILERS! On the final mission, when Arthur loses his horse, the player may not know that Arthur will die in just a few minutes. They will be angry, and sad, that their horse has been killed, completely out of their control. Then they will see Arthur give his stuff to John. This is when they will realize what is coming and that they cannot stop it. They will either choose to help John or go get the money. Whatever they do, they will fight Micah, and they will lose. They have no other option. They will see the person that they have spent every moment of the game with, die. Out of their control. They will be sad that he died, and also sad that the game is over. But then they will see that they have come back. As John. And they will be happy that there is more game, but still sad that they can no longer play as Arthur, even though they were wishing they could play as John again in the beginning of the game. One failing point, however, is the gang members, especially Hosea and Lenny. The game makes it clear that their deaths hit Arthur pretty hard, but the game doesn’t have you interact with them enough to make it hit the player. Lenny was many people’s favorite gang member, but his death should have impacted the player just the same as Arthur’s death. Hosea was even worse. The player only knew Hosea as the man who raised Arthur, but never got to interact with him much. At least Arthur and Lenny had fun at the saloon in Valentine.

  • @AmaroqStarwind
    @AmaroqStarwind 3 месяца назад

    Don’t forget to look at Mashpoe’s 1D game as well, it’s similar to this implementation. He also has a stereo anaglyph mode for it!

  • @no.992
    @no.992 Месяц назад

    This is so cool, i hope I'll see complete game.

    • @nivmiz0
      @nivmiz0  Месяц назад

      Thanks so much!

  • @SecretZoneGames
    @SecretZoneGames 3 месяца назад +5

    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 :)

    • @nivmiz0
      @nivmiz0  3 месяца назад

      Thank you so much! That's such high praise (:

    • @Uni_974
      @Uni_974 2 месяца назад

      Yeah seeing more 1D content does put a smile on my face :)

  • @Amonimus
    @Amonimus 2 месяца назад

    Also known as FPS Raycasting tutorials except leaving walls untextured.

  • @supermaximglitchy1
    @supermaximglitchy1 Месяц назад +1

    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

    • @nivmiz0
      @nivmiz0  Месяц назад

      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).

  • @collin6526
    @collin6526 Месяц назад

    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.

  • @tonycrawl5300
    @tonycrawl5300 Месяц назад

    Hmm...neat but my question is how are you gonna handle background and skyboxes or...ya know that thing that isnt the ground...cause with the idea you're going in i feel like that would be impossible

  • @James2210
    @James2210 3 месяца назад

    I think it would be a bit better if you used the distance to the shape to smooth it out a bit more

  • @cube2fox
    @cube2fox Месяц назад

    If (non first person) 2D games show a true 2D slice of a 3D world, you should be e.g. able to see the insides of Mario, of enemies, of question mark blocks etc. Also, you shouldn't be able to see any background or foreground stuff like clouds or bushes. Everything should look like a slice of an MRI scan. 🤔

  • @Neptoid
    @Neptoid Месяц назад +2

    3rd person 2D game

  • @1kayo
    @1kayo 2 месяца назад +1

    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💀

  • @kyokajiro1808
    @kyokajiro1808 2 месяца назад

    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

    • @nivmiz0
      @nivmiz0  2 месяца назад

      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!

    • @kyokajiro1808
      @kyokajiro1808 2 месяца назад

      @@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

  • @geeteevee7667
    @geeteevee7667 2 месяца назад

    6:11 the fog is coming

  • @Johan-rm6ec
    @Johan-rm6ec 2 месяца назад

    It's about 2D movement not about the visual aspect of a game.

  • @sabriath
    @sabriath 3 месяца назад +1

    uhh, why use raystepping? That's entirely unnecessary and loops way too much. All you need to do is calculate from each point on the polygons to the camera, which will give you the distance, and therefor the color at that point along with the angle....then you interpolate the color between each 2 points in the polygon, ignoring drawing any negative direction (back culling) along the polygon list (also ignoring any angles outside the field of view). For circles (or any polygons above a certain threshold), you only need to find the 2 tangent and change the interpolation for color to that of a curve. So if you have 20 triangles, that's only 60 calculations per frame, not thousands.
    If you store the distance for each pixel as you draw it in a parallel array, then you have a z-buffer that you can check against when drawing to ensure you are not overwriting pixels of further objects on top of closer objects.
    If you put a height to the pixel based on the distance, you will have something similar to wolfenstein. congratulations, welcome to the 80s

  • @diegocolmenero8696
    @diegocolmenero8696 3 месяца назад

    This is crazy, loved the video

  • @mynameisben123
    @mynameisben123 Месяц назад +1

    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.

  • @Bruno_Swag
    @Bruno_Swag Месяц назад

    Great video! But as a nitpick: sidscrollers and the like are 2D they just don't come from the perspective of something in that 2D world. Its effectivly like being a god looking at our world. We still are in 3D just being observed by something outside of those 3D constraints.

  • @lunarvoidvr
    @lunarvoidvr 3 месяца назад

    i love how i had this idea for a vr horror game

  • @Yippie515
    @Yippie515 2 месяца назад +2

    There's a guy named MashPoe who made a whole 1D game exactly like this, this kinda reminded me of it

  • @NoVIcE_Source
    @NoVIcE_Source 3 месяца назад

    I would ACTUALLY play a game like this !!!
    Stretching the screen isn't cheating imo, when it comes down to perception who is to say that a 2d creature wont see it like this?
    Also is there a reason why you're not just using raycasting tho?

  • @karlcole5617
    @karlcole5617 2 месяца назад

    a few of us already knew that, and it became patently obvious given the thumbnail.

  • @dagamerboi
    @dagamerboi Месяц назад +1

    the non "distance aided" raymarching isn't called raymarching, it's ray stepping

  • @SquaredNES
    @SquaredNES 2 месяца назад +1

    You should try porting this to 3ds, the need for fog would be mostly eliminated.

  • @holymonke2703
    @holymonke2703 3 месяца назад +2

    NEW NIVMIZ VIDEO LETS GOOO 🔥🔥🔥🔥I DONT GET HES TALKING ABOUT BUT LETS GOOOO 🗣🔥🗣🔥🗣🔥💯💯

  • @Nugget11578
    @Nugget11578 2 месяца назад +1

    Why not use raycasting lol. This is just wolfenstein but with a vertical resolution of 1. Really cool though

  • @finminder2928
    @finminder2928 2 месяца назад +2

    Now do a 1D game from the point of view of a non one dimensional creature

    • @owerio
      @owerio 2 месяца назад

      I've thought about this before. The entire screen is one color

  • @samucereal
    @samucereal 3 месяца назад +5

    All of this is really cool, ngl, and the fact our brains can comprehend it is impresive as well

    • @nivmiz0
      @nivmiz0  3 месяца назад +1

      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!

    • @ack7
      @ack7 3 месяца назад

      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

    • @circumplex9552
      @circumplex9552 2 месяца назад

      ​@@ack7we cant fully understand 4d, although we can calculate it and understand facets of it

    • @ack7
      @ack7 2 месяца назад

      @@circumplex9552 Me who has played 4D Golf: *Foolish Mortal, you have not one modicum of the understanding I possess*

    • @circumplex9552
      @circumplex9552 2 месяца назад

      @@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

  • @jonwatte4293
    @jonwatte4293 3 месяца назад +1

    Or you could render standard 3d but don't allow up/down pan and only display the center scan line...

  • @Korimi01
    @Korimi01 3 месяца назад +1

    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?

    • @nivmiz0
      @nivmiz0  3 месяца назад +1

      That's a really good idea!

  • @shardscape
    @shardscape 2 месяца назад +1

    It would be interesting to see how it looks for you to move the 2d plane through a 3d space, could be pretty cool

  • @Ryöken17
    @Ryöken17 2 месяца назад

    Can you do " for each ( ray in raycasts ) { run raycastTest(ray); } to speed up the process ?

  • @TheFoxfiend
    @TheFoxfiend 2 месяца назад +1

    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

  • @wermaus
    @wermaus 3 месяца назад +2

    ok 2 cameras in 2D to get 2D binocular vision vision using 3d glasses

  • @HomeofLawboy
    @HomeofLawboy 2 месяца назад

    Can't you sum up the ray step lengths to figure out the distance to the camera?

    • @nivmiz0
      @nivmiz0  2 месяца назад

      That's actually a great idea! I'll have to check it out to see if it improves performance in any way.

  • @jonaykon
    @jonaykon 2 месяца назад +1

    ”A first person 2d game is the easiest 3d game to create from scratch”

  • @RenderingUser
    @RenderingUser 3 месяца назад +2

    >Makes 2d game
    >calls it 1d game
    Average RUclips video

    • @nivmiz0
      @nivmiz0  3 месяца назад

      Idk about average lol I think only like one other person has made this type of 2D first person game
      Either way yeah, I called it a 1D engine in the title because calling it a 2D engine would I think lead people to misunderstand me. In the video I made sure not to call it that though!

    • @RenderingUser
      @RenderingUser 3 месяца назад +1

      @@nivmiz0 you could have just called the video, 2d game, but the axis is width and depth.
      It's not really that hard to make a decently interesting 1d game either. I've made a 1d game called Color dash 1D

    • @circumplex9552
      @circumplex9552 2 месяца назад

      ​@@nivmiz0call it a first person 2d game

  • @tytustaksobie
    @tytustaksobie Месяц назад +1

    waiting for flatearthers to show up...

  • @cubefromblender
    @cubefromblender Месяц назад +1

    i cant imagine what it would be like to live in 1d

  • @capitanes_de_los_juegos
    @capitanes_de_los_juegos 2 месяца назад

    Great now do a 1d first person view (a single pixel changing colour)

  • @Garfield_Minecraft
    @Garfield_Minecraft 2 месяца назад +7

    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

    • @potolog101
      @potolog101 2 месяца назад +2

      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.

    • @cube2fox
      @cube2fox Месяц назад

      I think Carmack mentioned Wolfenstein 3-D is actually based on a top down ("2D") game with similar gameplay, Catacomb.

  • @justinsemple7454
    @justinsemple7454 3 месяца назад

    You could recreate the pentagon shaped house on the cover of flatland.

    • @nivmiz0
      @nivmiz0  3 месяца назад

      Totally! That's the power of SDFs, you can make practically any shape you want.

  • @kenleong1110
    @kenleong1110 2 месяца назад

    So are VR games literally fourth dimensional?

  • @DavidJCobb
    @DavidJCobb 2 месяца назад

    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

  • @davidbrinnen
    @davidbrinnen Месяц назад

    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?

  • @lh8841
    @lh8841 2 месяца назад +2

    What ist that Song/piece at 11:37 called 😃

    • @nivmiz0
      @nivmiz0  2 месяца назад +2

      It's called Allégro by Emmit Fenn (:

    • @lh8841
      @lh8841 2 месяца назад

      @@nivmiz0 thanks👍

  • @McGoomba
    @McGoomba 2 месяца назад +1

    Wait is that a 3D and 1D game

  • @research417
    @research417 3 месяца назад +2

    I've seen this type of representation for 2D a couple of times and there's one thing that doesn't sit right with me. Your renderer aligns to what a character in a top-down world would see (e.g. Binding of Isaac).
    However, wouldn't it make more sense from a gameplay perspective to do a side-view inspired rendering system, similar to what Mario would see? The camera would be vertical rather than horizontal, and you would be able to look up and down. You could move forward and back, and you'd be able to jump. You could even allow the character to flip vertically and turn around like Mario can, if you want the player to be able to see where they're going when they move backwards.
    With that type of world, you could actually implement gravity, and consequently, a physics system. You'd be able to represent many games more easily. You could also place your 2D character in a 3D world and add back in left and right mouse movement, and it would translate to that medium easier than with a flat plane system.

    • @nivmiz0
      @nivmiz0  3 месяца назад +1

      Yep, that's another legitimate interpretation of "First-Person 2D". But I think you may be slightly overlooking the problems of turning around, getting past objects in front of you and parsing the view to understand what's going on. This view is, at least in my opinion, a more intuitive way to explain the concept.
      However, I still think your version is interesting! I may make an implementation of it in a follow up video.

    • @research417
      @research417 3 месяца назад

      ​@@nivmiz0 You'd have to rethink the way depth is represented because you can't really feel out objects in the same way. I think a fog effect or something like that would work. Objects far away are dark/foggy and as you get closer they become brighter.
      I can imagine you'd be able to at least do Mario style parkour like that. And jumping would help a player feel out the level too as you can reveal more/less of an object by viewing it from lower or higher positions.

  • @valedesardi6252
    @valedesardi6252 2 месяца назад +1

    ''We viewing a 2D world with a 1D view on a 2D screen in a 3D world through a 2D viewpoint'' I love it😂🔥

  • @woekin
    @woekin 2 месяца назад

    isn't doom93 technically 1d for shooting then, if you only display the center horizontal pixels.

    • @nivmiz0
      @nivmiz0  2 месяца назад

      Sort of! It's a 2D game, which you play in first person! However, because it uses sprites and such to display things on screen, I wouldn't say it's exactly a Flatland-like accurate representation of a 2D character's view.

  • @freescape08
    @freescape08 Месяц назад

    There are so many holes in everything you're saying, I get the point,and i like the concept, but:
    1. 2D games are in fact 2-dimensional, its just that basically all of them are 3rd person view.
    2. This has been done before, and I 've seen it explained better before. People in the comments have noticed, this is how doom works.
    3. The edge-of-screen stretching effect is actually due to a mismatch between rendered FOV and display FOV (angle of your visual field taken up by the display you're viewing). This is why your arc visual of the raymarching is confusing. The display should be represented as a straight line. That is, unless you use a curved monitor, but then your raymarching ahould reflect that choice by matching the pixel-by-pixel layout of the monitor in your field of view.
    4. Perspective does not give us depth information; two compared perspectives give us depth information. The same can be done with a 1st person view of a 2D world, though it's not likely to be as helpful as a depth buffer. Obviously a depth buffer irl would also give enhanced depth perception, because it's usually scaled to distance in a more useful way, say exponentially.

  • @jackys_handle
    @jackys_handle 2 месяца назад

    8:19 it really isn't. Yes, there's a lot to optimize, but the vast majority of phones are equipped with an at least (very roughly) 500 GFLOPS CPU. Assuming you want to run at 60 fps, that's 20'000×60=1'200'000 FLOPS, or 1.2 MFLOPS.
    If it's lagging like crazy, then there's another reason.

  • @Snowmon89
    @Snowmon89 2 месяца назад

    Okay, I'm sorry but the one major flaw in Flatland's logic is that there is no 3rd dimension, thus you CANNOT SEE in Flatland. Why? Because there is no width from which you'll be able to see the world by. We see a line on a page because just like the computer screen we have a third view of which to see from. However, if you try to see that same line on the page while it's perfectly flat, it too would be indistinguishable from the rest of the paper. Mind you, it might help if we were the same "thickness" as the paper, but even then you'd perceive NOTHING.

  • @Pechugo83
    @Pechugo83 Месяц назад

    I'm not a coding expert, but couldn't you simply trace rays from the player to every corner in the game? Then, the rendering would simply boil down to making colored segments over the angle generated between every 2 conected corners of the same polygon. You'd probably have to make some adjustments if 2 shapes collided or if any shape was concave; but none of that happens in the video
    Awesome work tho! Really great explanation and graphics

  • @leviofun210
    @leviofun210 2 месяца назад

    What is your character standing and walking on? Border to 3rd dimension? Then try to push yourself off of a border to 4th dimension while flying in space! Topdown-like true2d game is not accurate because it implies existance of floor which is located outside two dimensions. Sideview-like is correct model of 2d universe with floor, gravity and jumping being a part of it. Let the buddy see the floor!

  • @TearfulZorua
    @TearfulZorua Месяц назад

    I disagree, a 2d game takes place on a 2d plane. We dont call a drawing 3d, even though we view it from a different angle than the paper. Essentially we, in a 3d environment, are observing and controlling a 2d world. Similar to controlling a 3d game, we are observing from a different existence the world of the game. A true 3d game would be first person btw, as we are in the 3rd demension ourselves. From the perspective of a 2d game character the world would simply be 1 dimensional, despite them being able to walk in 2 directions horizontal and verticle. They have no depth to their world, thus theyd only see one line ahead of them. A line is one dimensional because it doesnt have a width or height, only a length. Thus you describe what would be a 1 dimensional game, or a regular game for a 2 dimensional being. After all, we humans only see in 2d, despite being in a 3d environment.

  • @VolumetricTerrain-hz7ci
    @VolumetricTerrain-hz7ci 2 месяца назад

    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.
    :-)

  • @jesusvera7941
    @jesusvera7941 Месяц назад

    so... why is this computationally exhaustive? i never thought pixels would require that much computational power, i mean, minecraft runs pretty good and i dont think it is casting rays from the camera, from what i understood, after doom, quake introduced a very interesting 3D rendering which based on vertex position, not ray tracing as wolfenstein.

  • @porky1118
    @porky1118 2 месяца назад

    6:06 I'm not sure about that. We have perspective, haven't we? If the shapes were colored, for example striped like the bork of a tree, And I know how they're normally srtiped, I would know which one is closer.
    Also you might have lighting/shading.

  • @stm7810
    @stm7810 Месяц назад

    I think thickening the line to be the full height of the screen is more accurate to a flat lander, because just like how we don't have empty grey space for the 4th dimension, their whole vision is this line.
    I'd love to play this as a full game, be it a shooter, an RPG or anything, just feeling like a resident of this world. maybe even have the flat land experience of learning what the 3D world looks like to your 2D character when the sphere shows up and lifts you.

  • @TessaLucy
    @TessaLucy Месяц назад

    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