Shadows - Faith in Despair Devlog #6


Once the game was in 3D, I quickly noticed that something was missing: Shadows.

To add shadows to all cards, I needed to convert the background image from a Sprite to a mesh with a texture. Then I added a directional light, but nothing happened yet.

Sprites can't cast shadows, so each card needed a mesh as well, at first I tried just using a rectangular shape, but that looked fairly strange, because the cards have rounded corners.

Luckily, I learned to use Blender before Faith in Despair, so I created my own card mesh based on an imported card sprite for reference. Here it is, in all its glory:

It has 76 triangles, which is probably a bit too much. I tried just having a two-sided plane (no back culling), but apparently that's more expensive than a copied plane with real edges, so I did just that. I did use the lowest possible bevel for the corners, so that it still looked okay when the shadow is cast. I doubt this will ever be a problem for performance either way.

Once finished, I added this mesh to the card prefab, and voilà, all cards now cast a shadow:

Drag & Drop

The next thing I wanted to tackle was dragging and dropping cards. Up until now, you could only click a card, and then click the target. But for a mouse user it may be a bit more natural to drag cards around, so I implemented that as well.

It was a bit weird to add it to my existing UI system, but I managed to do it in a mostly non-invasive way. The code definitely didn't change that much, and it still works with controller and keyboard without having to drag & drop.

Lacrima Relations

Shops can offer lacrima now that are related to the ones you already have. This can lead to better synergies, as I've talked about before. For example: If you already have "Gain Gold", the shop now offers you "Steal Gold", "Block Damage With Gold" or "Turn Excess Damage To Gold".

Enemies can also now carry lacrima that work against you, i.e. if you have Weak, they can spawn with a "On Weak" trigger to react. This is not something low level enemies do, but elite and boss fights definitely have this.

The implementation works with a JSON file that looks like this:

When starting the game, the card manager imports that JSON file and creates a dictionary from it. That way, I can simply look up an entry with the key "OnHeal", and then check for Synergistic or Antagonistic, depending on who's asking (enemy, shop, treasure chest, etc.). Then I just pick a random one from the array, and return it. The returned string is then converted into the respective enum of the lacrima, which can then be used by the game's systems.

This is currently only used very sparingly, because I'm not too sure of the effects it will have on the game, but from what I can see, the few times it already triggered correctly, it did result in some pretty fun situations.

Bugs and Features

Once again, I fixed a handful of bugs that aren't really worth mentioning (lots of fine details or edge cases).

Apart from those, I also made it so the cards are now a bit rotated when facing down. This creates a more natural feel, I believe. You can see it here on the map screen and if you look at the deck in the lower right (I got this idea from Aces & Adventures).

Poison and Regeneration deal damage like in other deckbuilder games now, that is, they use their remaining turns as values, instead of percentage of max health. I originally wanted them to be like in Final Fantasy 7, but the overall values aren't high enough to merit a percentage (i.e. in FF7 poison deals 1/32 of a creature's max health every turn, which is not a lot if your creature has 30 hp).

Speaking of status effects, they are now shown on the right side of the cards, which feels a lot better. They also still needed to be turned into Images (instead of SpriteRenderers) to work with the new canvases. They still require individual icons, but that's something for later. 

And finally, Blessings now have names, but they aren't used yet. Need to make sure they aren't too long for the card header.

Starter Packs

I'm not sure if I have mentioned this before, but Faith in Despair will have different starter packs, which come with different starter blessings. The current one now has a blessing with "Gain Mana 1" at beginning of turn, so basically a low mana regeneration.

I don't know how many starter packs I will add in total, but 5 sounds like a good number to aim for. Each pack will require to be balanced carefully though, so it will take a while to get to 5.

Next Up

This week I will finally be able to add the first boss demon, and I can't wait. It's going to be interesting to see how the game changes with a fixed boss encounter, my hope is that it adds a bit of a handcrafted touch to it.

I keep reading articles and watching videos about roguelikes and balancing, and I also started reading Ask Iwata, which already had some good insights, although not directly game-related. It's still very motivating though. Iwata just wanted players to have fun, and it's such a good reminder.

Everything I do in Faith in Despair is about making sure the player has fun. And I hope you'll be able to experience that yourself once it is playable.

🧙‍♂️ To be continued...