A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
New Unity Live Help updates. Check them out here!
Discussion in '2D' started by philiptm93dk, Feb 14, 2020.
hi all I have be wondering if it’s possible to create an fps entirely through 2d in unity ?
You mean like old school fake 3d Wolfenstein kind of game or something else?
yes that is exactly what i mean. no 3d models just good old 2d
I'm not sure if that is doable in practice, maybe someone who knows better can answer?
But in general you can draw to textures (Texture2D) pixel by pixel (SetPixels for example).
That retro one point perspective can be done with some sort of ray casting / ray tracing, which I don't know about anything else...
Maybe it could be doable in low resolution?
But like I said - I have no idea if that would really work or would it be way too slow, I've only use textures for creating bitmap based tile map editor, which worked just fine, as the resolution wasn't too high.
Whether or not Wolfenstein or Doom used "true" 3D doesn't really matter in my opinion. They can be considered 3D in that they have 3 perceived dimensions of movement and visuals. Back then, they may have been severely limited by technology, having to emulate 3D to the best of their ability with a 2D game engine.
But with Unity, there's no reason to impose those limits on yourself (unless you like a challenge?). You can make the same looking game way more easily with a fully 3D environment, and then use 2D sprites rotated to face the camera for characters/enemies.
You would create a sprite for each direction the enemy will appear to be facing (probably 8 directions as per the old games). The actual enemy gameobject can rotate around while it moves, but the sprite as a child object will always face the camera. Then you swap the sprite based on the angle to the camera & the direction the enemy is facing, so if viewing the enemy from the back, it uses the back sprite, etc. That involves a little bit of math, using the Dot Product to compare two directions.
So to answer your question, yes it's possible, but you can get the same result using 3D in far less time.
This was my thoughts, but I like to have a challenge as well. Just because its easier or faster doesn't mean you "should" do it that way. Good explanation for how it would be done.
@philiptm93dk You can do anything any old game has done in any modern engine. Probably not the same way, but it can all be done. And in any case trying to copy it you may find out something new and interesting.