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

23,014
0
Published 2024-07-03
Hey folks! It's been a while, and I'm back with a pretty different type of video that my previous ones! In the video, I talk about my journey to create a simple 2D renderer, from a first-person perspective. It's a pretty unintuitive concept to understand in the first place, much less actually implement in code, but I'm very proud of the result I ended up with! I also spent a lot of time and effort working on the video itself, visualizations and all, so I really hope you enjoy it. I really do think this is my best video yet.
I was also very inspired by ‪@SebastianLague‬ & ‪@CodeParade‬ in making this video, so if you enjoyed it, be sure to check out their channels as well.

Support me on Patreon (and get access to the source code of this project) - www.patreon.com/NivMizGames
Join my Discord - discord.gg/nPHfcs529S
Buy my commercial game, SINGULARIUM - store.steampowered.com/app/2624410/SINGULARIUM/

Play my small games: nivmizzer.itch.io/

Video was made with Motion Canvas - motioncanvas.io/

Chapters:
0:00 - Intro
0:37 - What Does First Person Even Mean In 2D?
2:14 - Ray Marching & SDFs
5:21 - Different Shapes & Fog
7:17 - Fixing Our Performance Issues
9:29 - Fixing the Strange Flickering
11:14 - 3D Illusion
11:59 - Adding Gameplay
12:23 - Outro

#GameDev #codingadventure #maths #unity #indiegamedev #devlog

All Comments (21)
  • @whimbur
    - first person 2d game - look inside - wolfenstein 3d
  • @Mikee512
    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.
  • @Sterligs
    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.
  • this editing is phenomenal! gives me 2 hour youtube documentary about something you have no idea about vibes.
  • @darkfire_ninja
    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!
  • @lavuy6744
    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.
  • @legend644
    I've seen a million videos were 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.
  • @capnqueso
    Time for speedrunners to find a glitch to go into the third dimension... WHY YOU GOTTA MAKE MY JOB HARD
  • @steelwasp9375
    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.
  • @yoavsaporta7348
    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!
  • @TheFoxfiend
    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
  • @SecretZoneGames
    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 :)
  • @gavin5410
    It's incredible how intuitive it was the second you added the fog
  • @tackalexander
    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
  • @samucereal
    All of this is really cool, ngl, and the fact our brains can comprehend it is impresive as well
  • 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
  • @Amit180s
    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).
  • @bl4ckk
    Godly editing style, good job
  • 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.