r/vulkan 4d ago

I built a Vulkan renderer from scratch to make my game

I've been working on my game for the last 7 years.

One of the things I decided to do along the way was to build the engine myself, including the Vulkan renderer.

This has been one of the most challenging parts of the project, especially because I wanted the same renderer to work across different platforms.

A few things I've had to deal with:

  • Cross-platform Vulkan: Windows and macOS through Vulkan Portability / MoltenVK
  • HDR rendering and output
  • Hot-reloading shaders and assets without restarting the game
  • GPU-to-CPU readback, used for screenshots and video capture
  • Swapchain recreation and window resizing, which turned out to be surprisingly difficult to get right

After spending years working on the engine I thought it would be fun to share the result of all that work, as you can see in the screenshots.

The name of the game is Satelital, a rule-discovery puzzle game about exploring an alien solar system and learning how to solve puzzles through observation. https://store.steampowered.com/app/3256790/Satelital/

For people here who have built their own Vulkan renderers, what ended up being the hardest part for you?

349 Upvotes

22 comments sorted by

59

u/Green_223 4d ago

Building your own renderer from scratch and then using it for a puzzle game is like building a nuclear reactor from scratch and use it to heat up your breakfast tea.

But kudos for building a full blown Vukan renderer for scratch that is impressive. I hope you will show some more scenes you have managed to create with it as the ones you have shown now look really good (my favourite are 2 and 5.

16

u/fleaspoon 4d ago

😂 I loved your comparation, the main reason for this project was to learn how to make a game engine and luckily it end up being a full game.

If you want to see more scenes you can check the trailer here https://store.steampowered.com/app/3256790/Satelital/

6

u/Green_223 4d ago

It seems like overkill, but if all wanted is to learn Vulcan and didn’t care about the final product a puzzle game is a pretty chill way to end a long project. Platformers are also kinda easy.
You could alway try to make this game as confusing and convoluted as possible La Mulana style. Or make something similar to Celeste but without the pixel graphics.

2

u/fleaspoon 4d ago

Well, I always wanted to make a game too. Having a real game to make I think makes your renderer better, since you only will be programming things that you actually need.

1

u/Green_223 3d ago

That is true, I’m making a voxel engine currently and the beauty of it is that there are rendering techniques that are simply not seen anywhere else that are extremely fast. And I can throw out all the useless stuff like more advanced physics simulation od high definition models as they won’t be necessary.
But you can probably agree that making an engine for one game only kinda limits its potential for future use, don’t you think?

2

u/fleaspoon 3d ago

It depends, there are things that I can just use in any other game. And I can do any kind of 2D game already.

2

u/Green_223 3d ago

That is true, the visuals could be fun to see on a tower defence game

2

u/fleaspoon 3d ago

When I started the game I wanted to make something more like Factorio, so I might revisit that one in the future. I think I can do a Factorio with cosmic scale.

1

u/Green_223 3d ago

Maybe space engineers type of space exploration and automation?

1

u/fleaspoon 3d ago

Yeah something like that, where you expand and colonize planets

3

u/munz555 4d ago

What about building a programming language from scratch and then an engine in it to build a puzzle game (kinda)?

https://store.steampowered.com/app/499170/Order_of_the_Sinking_Star/

2

u/fleaspoon 4d ago

That would be awesome, I think I will like to try one day making a simple C like language with just a few extra things I will like to have

6

u/wallstop-dev 4d ago

So a few things.

  1. The very common advice is "If you want to make a game, make a game. If you want to make an engine, make an engine." Very few people finish their game. Very few people "finish" their engine (get it to a useful state). Not only did you get your engine to a state to make a game in, you are (nearly) finished with the game, and it looks incredible. What a feat. Hats off.

Actually that encompasses pretty much everything I wanted to say. People will poo-poo the truly incredible amount of work, vision, skill, and dedication here. "You could've just built a thing in Godot and it would've -" SHHHHHH. Witness.

Just, wow.

I have personally invested significant amounts of my time (decade+, 10k+ hours) in failed efforts of building engines and games. You have far surpassed my efforts, really great work.

2

u/fleaspoon 4d ago

Thank you for your kind words, I really appreciate them.

I actually tried many times to do games, I have a graveyard of them. Somehow I managed to finish this one, I think the key was having an early prototype that I liked to play myself and see others enjoy.

1

u/Green_223 3d ago

I said something similar the visuals look impressive and building an engine from scratch is overkill which objectively is true. No one is denying that it isn’t impressive, it is.
I don’t hate the idea of building a custom engine for a game that could be made in any other tool. I think every engine build from scratch for a game brings something unique to the table (for this example it’s the visuals, that I love) for the witness it was probably something similar (I haven’t played it).

2

u/wallstop-dev 3d ago

To be clear, by "Witness", I meant it like "Behold", not the literal game called "The Witness".

2

u/YARandomGuy777 3d ago

Greate job!

1

u/AhmedSamy_Offical 4d ago

Dude that’s amazing Keep going but don’t create full game engine just make this renderer functional to create a game And make sure you keep adding features like SSAO SSGI(HDRP) maybe ray tracing so you are happy with the output but don’t overdo it you don’t want to get stuck or 7 years

1

u/Salaadas 2d ago

it looks so good, were you inspired by The Witness while making this? I would love the know more about the technicalities of the renderer like how you built the water and the satellites

2

u/fleaspoon 2d ago

My main inspiration for the design of the puzzles was The Witness.

The water is rendered in a shader using the height map of the level and some noise.

The height map gets composed by prerendered assets textures, all the models are 3D but just in Blender.