How do you trigger the random pathing / mapping ? Do you use a system for this ?

Feel free to take a look at the system in my map, but be warned it's a bit messy.

What you want is a labyrinth generating algorithm. Google it, you should be able to find some simple descriptions of how to make one.

Balancing creep waves is very difficult tho. Only testing and mathematical calculation can lead to success, I guess. Do you have a recommendation ?

Here's my method:

All towers are balanced around one figure: damage done during a round per gold spent. This is the total damage a tower will do to the creep wave during a round, and you can record this to easily analyse it. E.g. a watchtower with 5dps hits the creeps for 20 seconds to give a total of 100 damage done during the round. It costs 10 gold, so it has a DPG (damage per gold) of 10.

Once you have this value for all towers, you can calculate how strong a player's defense is.

If the player starts with 100 gold and all towers have a DPG of 10, that player is expected to deal 1000 damage during the round. In this round you can give the creeps a total life of 1000, and the player should survive perfectly.

If you want to different types of waves, for example a swarm wave with double creeps or a boss wave with just 1 creep, it gets a little trickier. At first glance a swarm wave with double creeps could easily be balanced by giving each one half life, but consider these two options:

Option 1 - the creeps will still spawn at the same interval, e.g. 1 per second. This causes the creep "convoy" to be twice as long, which means your towers will spend more time hitting the creeps, thereby increasing their DPG.

Option 2 - you spawn the creeps at a faster interval to make the creep convoy the same length. Now you have a new factor: towers with splash damage will be MUCH more effective and have a much higher DPG than single-target towers.

The way I address this is by having a different DPG value per tower per creep type.

So my watch tower has 100 DPG against a normal wave, 70 DPG against a swarm wave and 30 DPG against a boss wave, while my cannon tower has 50 DPG against a normal wave and 250 DPG against a boss wave.

A tower's true value will be the average of these DPG values, and this will tell you how much the tower should cost. You can make it even more accurate by weighting each of these DPG values by the frequency of each wave type.

I'm planning to make a proper mathematical formula that takes DPS, splash and range into account for my own TD, if I ever get around to it I'll share the formula with you.