top of page

King's Haven

My current solo project. It's a mechanics and system heavy deckbuilder / kingdombuilder.

 

I've done everything in this project myself, my biggest learnings have been with scalable systems and shaders. I've also made a custom tool to script cards right from the inspector.

  • c# Logo
  • 62e131df7fe3599fdd46ecb3
  • FMODlogo
  • steam logo

General development and improvements

King's Haven is a solo project I've been working on consistently since October of 2024, Its a system heavy roguelike deckbuilder with citybuilder elements.

This project was started at a time when i knew considerably less about programming, but has grown along side me as a programmer and developer.

Much of the older code has been refactored time and time again as I've improved and learned. Working on this project for as long as I have, has shown me where I could have writen better code and prepared better for the future. I now have a very good grasp on what makes scalable and modular systems.

I've also developed a strong work ethic. Working on a project, solo, for this long has been challenging, and not all work is equally fun. I work based on dicipline, not motivation, which means that even when I'm not motivated by a task, I will still get work done. I can also work without needing to be supervised, I take responsibilty for my tasks and can set deadlines for my work.

I've brought my game to playtest sessions in person, iterated on feedback and even found a publisher to help me distribute the game.

Screenshot 2024-12-09 100241.png
KHSS.jpg

Card scripting from the inspector

The main reason I started this project was to make a scalable workflow for creating 100s of cards with unique effects.

To make card creation fast and designer friendly, I made a system for scripting cards in the inspector.

 

Each card is a scriptable object, essentially a data container, that has exposed enums for creating effects. With editor coding I hide the fields that are not relative to the current effect being scripted. 

 

This means that instead of hard coding each card and each card having its own individual script, there is an effect manager that recieves flags from the card data and performs the effect.

Screenshot 2026-02-24 160237.png
Screenshot 2026-02-24 160329.png

The editor script is not the prettiest, it uses a lot of if checks to determine what to show in the inspector.

That in turn makes the inspector a lot cleaner.

Here are a few card examples and how the inspector looks for that card.

Screenshot 2026-02-24 140848.png
Screenshot 2026-02-24 135830.png
Screenshot 2026-02-24 140917.png
Screenshot 2026-02-24 135724.png
Screenshot 2026-02-24 141040.png
Screenshot 2026-02-24 140522.png

Grass and leaves (GPU Instancing)

To spawn grass I have a 2D "bound" over the landscape, over this area rays are sent straight down, if it collides with terrain a blade of grass is spawned. To make it more natural, a small random offset is set per ray.

For leaves it's a bit different, it takes in the mesh for the tree crown. It then spawns leaves across it by randomizing points within each triangle of the icosahedron.

For both grass and leaves, I use a billboard shader to allign the foliage to the view of the camera. However, for lighting calculations I don't want the foliage to be treated as though it is facing the camera. I therefor set the foliage mesh rotation to the normal of the triangle it is spawned on. It then uses that normal for lighting calculations before rotating to face the camera.

Slowed down debug spawning grass and leaves

image_edited_edited.jpg

Each grass and leaf is added a list and is sent as a batch to be rendered all at once GPU Instanced.  

image.png
bottom of page