- Joined
- Feb 27, 2007
- Messages
- 5,578
If you built some sort of angle bias function into this I think it would be both more visually appealing and functionally useful. Depending on random walks for random directions is kind of boring to me (as a player) since whether I succeed isn't dependent on using it skillfully but rather just RNG luck. But say you restrict the possible random angles in some intelligent way to make the waves generally travel approximately in the direction of the cast or towards a specific type of target. I immediately think of 5.5 ways:
- Save the original angle between caster and cast point. When randomizing new angles, reject any that are within a sector directly opposite the original cast angle. Vary the width of this sector (in degrees) to see what works best and choose that. 15°, 30°, 50°, 90°, 120°? When a rejected angle is found just randomize new ones until you don't reject it.
- Only randomize a new angle within a (relatively) small sector around the current angle. Try different angular widths as before.
- Apply tracking towards targets instead of any specific angle rejection. You could compute a new random angle with no bias and then take some sort of weighted average between that angle and the angle towards, say, the closest enemy unit. Or the closest building. Or towards the caster or whatever else; pick different types of targets and see about the behavior.
- Give the angles a fixed angular increment in a specific random direction every time they 'end' their current travel. This would give it a curved shape in a particular direction depending on what specifically is chosen to be randomized, so specifically restricting that randomness to only some of the projectiles (to give the others consistency) would probably be good.
- Scale the distance a projectile can travel inversely with how far the random angle is from the original cast angle, such that projectiles will travel large distances close to the angle and only short distances approximately opposite it.