Next Broadcast

2D Tilesets to 3D FPS tool

Dilem GameDev DK30 Spring 2021 1 1

Description

This month I want to try my hand at creating a system/tool that would allow me to create a level using Unity’s 2D tilemap and then use the data from that tilemap to render an FPS game. The idea is to have the player be a 2D sprite that’s moving through a 2D space, but player is seeing it all rendered from a 3D first person perspective.

Recent Updates

Dilem 4 years ago

I have hope, but it’s hard Image from Gyazo

Dilem 4 years ago

Rotation is pretty much read! Image from Gyazo

Dilem 4 years ago

Made some more progress since. Managed to sort out correct scaling (as far as I can tell), based on distance between player and tile. and currently working on doing angling correctly: Image from Gyazo

Dilem 4 years ago

Did a bit more work. I can now do position and size/depth of the texture. I have also started working on faking the rotation of the texture, width change is working, just need to do different height based on how close the endge of the texture is to the camera. Image from Gyazo

Dilem 4 years ago

Haven’t made much progress, have been mostly figuring out how exactly I want to make this work. One way to do it is to project a ray per pixel of the screen, figure out what it intersects with and draw the color that the texture should be at that point. I think this is the correct way to do it, but I have an alternative idea that might work too. However first I need to figure out a way to draw the texture exactly where I want it to be. which I managed to do tonight. Image from Gyazo The gif shows me manipulating the position of the texture through code. Now that I understand how to draw a texture in a specific position, I will need to figure out scale, which should be easy and angled textures, which might be a bit more difficult, but should still be doable. Once I got those I will start working on detecting which faces player can see.

Dilem 4 years ago

Making some progress, managed to figure out how to pass the texture the player is currently looking at to the compute shader and display it on the screen.

Left is scene view and right is the game view: Image from Gyazo

Dilem 4 years ago

I have hope, turns out my suspicions were correct and I can use shaders, more specifically compute shader in my case, and render texture to override what the camera is displaying Image from Gyazo

Now I just need to figure out what data I need to feed it and how to interpret it.

Dilem 4 years ago

For the base game I decide to go with a simple maze game. Quickly thrown together placeholder art and a very basic that lets player move, but not move through walls.

Image from Gyazo

Estimated Timeframe

Mar 1st - Mar 31st

Week 1 Goal

  • Coming up with an idea for a base game that would work even if there was no conversion to 3D.
  • Developing a very simple game to function as a placeholder, because while I want to make a tool, I also want to have a game that it will serve once it’s done.

Week 2 Goal

  • Research into replacing camera rendering.
  • Working on getting camera to output the data I give it instead of what it would actually see.

Week 3 Goal

  • Crating a system to read the data about what is in front of the 2D character.
  • Converting that data into something that can be used to feed to the camera and make it display what I want.

Week 4 Goal

  • Creating levels for the game and playtesting.
  • Polishing any issues and fixing bugs.

Tags

  • Unity
  • GameDev
  • Game Dev
  • Game Dev Tools
  • Rendering
  • Tools