Skip to main content

05.04.2024 - New Spawnsystem / Adjustments

We have now tested the new version of the game on two evenings, and after encountering a few bugs and minor issues, this version is now the basis for further development.

The cause of the memory leak discovered on Wednesday was identified fairly quickly and fixed.

New Version

The new version mainly features a massive rebuild of several core systems that have existed since the beginning and were rather primitive due to lack of expertise.

Spawn System

The core of a tower defense game is the spawn system, which determines when, where, and which enemies appear on the battlefield. The old system offered few options:

  • Which enemies can appear
  • How many per wave
  • Spawn interval

In this case, the chosen types of enemies were random, and for most situations, it was sufficient. However, it wouldn't have been possible to spawn a boss with 10 other enemies because randomness would have determined the number of bosses.

The new spawn system is much more sophisticated:

  • Which enemies can appear
  • Whether they should be randomly chosen or the number should be fixed
  • Spawn intervals
  • Sub-waves - It is now possible to define additional waves with their own intervals, delays, etc., which appear parallel to the main wave. This allows for an infinite chaining of various spawn behaviors within a wave.
  • Where should the enemies spawn: randomly or sequentially

The new spawn system will naturally be further expanded over time, but the groundwork for a highly extensible system has been laid. The most important extension now is the ability to save entire rounds as templates and simply load the desired template at the start of the game. Thanks to the templates, it would now be possible, for example, to define a unique gameplay flow for each map or to implement game modes with an endless mode without having to delete and reconfigure all waves each time. It would also be possible to have zombies as enemies today and demons tomorrow. However, for now, there is only one template in the proven configuration with a few minor adjustments.

Adjustments

The lightning tower has been revised and no longer fluctuates as much in its damage output. The technical process is relatively simple:  Due to its ability to shoot chain lightning, this tower is actually designed to hit the maximum number of targets, but for a boss, for example, this is not possible. In the past, the lightning tower received a damage bonus against bosses so that it wouldn't be entirely useless, but the solution wasn't optimal either because this rule applied to all levels.

Now, just before firing, the lightning tower determines the number of possible targets and grants a damage bonus based on the number of targets. So, if the tower can hit 10 targets and there are only 8 within range, all 8 targets will receive increased damage. The fewer targets, the higher the bonus. The bonus also corresponds to the maximum damage:

If the lightning tower can hit 10 targets, each dealing 1000 damage, the damage pool is 10,000. If it can only reach 5 targets, each enemy will suffer 2000 damage. For a boss, it would then be 10,000 damage with a single hit - the full blast.