Leakage Speed
Motivation
The Speed of Elemental Leakage from Vessels is a separate and rather complex element of the entire gameplay. The game is more of a transactional system where we attempt to simulate a continuous physical process. Quite an interesting challenge!
The task was twofold – on the one hand, to make elementals a scarce resource and encourage players to engage with the game more often, and on the other hand, to ensure the possibility of obtaining enough elementals for upgrades even with minimal investment in the game.
Limitation
Elementals for upgrading the elements of the Land must be earned within each specific Land; they cannot be bought or transferred between Lands. Additionally, they cannot simply be stockpiled. However, I have mentioned this before. It’s fascinating how the algorithm for elemental leakage was born.
Initially, the concept was based on a vessel with an opening from which liquid flows. I recalled Bernoulli's equation from physics class, where the height of the liquid in the vessel affected the speed. But in our case, we needed the ability to control this speed by setting Elemental Seals and to have some guidelines on how these seals would affect the speed.
How we come to solution
During my research on this matter, I developed several models that simulated gameplay for periods ranging from six months to a year. I gathered some statistics on how quickly elementals accumulate under various leakage conditions and how many elementals are needed to upgrade the elements.
As a result of this research, I arrived at a rather simple leakage formula:
leak = 1 - (1 - K/100) ^ (T / (3600 * 24)), where K = % of daily leakage, T = time period in seconds.
This is the formula currently used in our model.
Once I settled on the formula, I began experimenting with the leakage percentages depending on the level of Elemental Seals. Again, it was necessary to encourage players to send their heroes more frequently in search of elementals at lower seal levels, while at higher levels, I had to adjust the elemental upgrade costs to keep the game engaging.
Speed constants
After experimenting, the seals and the resulting leakage rates ended up as follows:
No seal: 95% Level 0: 75% Level 1: 50% Level 2: 30% Level 3: 15% Level 4: 5% Here’s how it looks graphically: the X-axis represents hours, and the Y-axis shows the fraction of leaked elementals.
The graph clearly demonstrates the difference between various seal levels. If you don’t have a seal, when you first acquire land, you lose almost all your elementals, which can be very frustrating. However, the remaining amount allows you to make initial elemental upgrades to your land. Over time, as upgrade costs grow, you’ll need to think about where to obtain a seal because, in a day or two, you won’t be able to gather enough elementals. Higher-level seals allow you to preserve what you've gathered for a much longer period.