HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Setting Max Hitpoints and Handicap oddities

07-27-2004, 05:43 AM#1
Grater
I decided it would be fun to make a TD where nearly all properties of creeps are determined on the fly by formulas so that changing the hitpoints of every round for balance is as easy as changing a single constant. For example, I gave all the creeps 100 hitpoints, then used a formula like this to set the handicap for a given round, to increase HP's:

Hitpoints =100 x r + 10 * r*r
(example only - actual formula uses power function)

In this TD the previous round doesn't have to finish before a new round so I used a trick to prevent the old creeps hitpoints changing with a new round, I created the creep for Neutral Extra, set the handicap for Neutral Extra, then transfered the unit to Player 12.

The next problem I ran into was that the creeps hitpoints wouldn't exceed 10000, for some reason the handicap trigger doesn't like increasing the multipler above 100, this stumped me for about a day until I decided to do some serious testing.

Turned out the solution was pretty simple, a unit that is created under a certain handicap %age is subject to the 10,000% cap, but when the handicap is applied to already existing units, there is no such cap.

The process therfore to create a unit with arbitrary hitpoints from a unit with 100 hitpoints goes like this:
Create the unit for Neutral Extra
Set handicap to arbitrary/desired Amount (old handicap doesn't matter)
Transfer the unit to it's proper owner

And thats all there is to it.