u/Few-Reference360

random spawn of monsters on the map

Recently, I changed the way monster generation works on the map. In the previous version, I manually configured a layer containing X,Y vectors to define the points where monsters could spawn. However, I quickly realized that this approach was not ideal, since I would need to manually configure every map in the game with possible spawn positions.

This ended up not making much sense, because the map itself already has a configuration indicating whether it is a safe zone or not. In other words, if the map is not safe, then it should automatically allow monsters to spawn.

To solve this, I replaced the fixed vector-based configuration with an algorithm that automatically analyzes all collision vectors on the map, such as trees, rocks, and map boundaries, and identifies the free points within the playable area. This allows me to obtain all valid positions for safely generating monsters without the need to manually configure each map individually.

In the video below, the algorithm is already working. The current map configuration is set to populate 2% of the available area with monsters, and this was the result.

u/Few-Reference360 — 26 days ago

It's been a while since I last posted any updates about the game's progress, but development is still going strong. Recently, I finished adding support for 5 more skill types, bringing the total to 7 different categories.

I’d also like to share a bit about the system I developed to make skills fully data-driven and highly configurable.

To avoid writing backend code for every individual skill, I started parameterizing all skill attributes and using NCalc (NuGet) to dynamically process mathematical expressions based on custom parameters.

One example of this is the Fire Bolt skill.

Its damage increases per level using the following expression:

p1 + (p2 * lvl)

Where:

  • p1 = base skill damage
  • p2 = damage increase per level
  • lvl = current skill level

Example:

  • p1 = 20
  • p2 = 2

So:

  • At level 1, the skill deals 22 damage
  • At level 17, it deals 54 damage

With this system, I can configure virtually any skill behavior in a simple and flexible way, including:

  • Damage
  • Passive and active attributes
  • Synergies
  • Range
  • Duration

As a bonus, NCalc also supports functions like min() and max(), which makes it much easier to limit values when needed.

Example:

min(p1 + (p2 * lvl), 100)

In this case, the skill damage will be capped at 100, even if the calculation exceeds that value.

This approach is making the system extremely flexible while greatly reducing the need for custom code for every new skill.

u/Few-Reference360 — 1 month ago