Lerk: circling vulture no more!
Fluid Core
Join Date: 2007-12-26 Member: 63260Members, Reinforced - Shadow
<div class="IPBDescription">Making the lerk swoop in combat</div><i>20/1-2012: Updated the code for 192 and make you able to hold secondary fire and have them fire. Latest code, forward movement increase damage, backward movement reduces damage, strafing has no effect, and damage scales with distance. Cone of fire and number of secondary spikes remains as before. Three different models. See <a href="http://www.unknownworlds.com/ns2/forums/index.php?s=&showtopic=115786&view=findpost&p=1893075" target="_blank">this post</a> for details:</i>
<!--quoteo(post=1893507:date=Jan 11 2012, 09:52 AM:name=Fluid Core)--><div class='quotetop'>QUOTE (Fluid Core @ Jan 11 2012, 09:52 AM) <a href="index.php?act=findpost&pid=1893507"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The completely physical approach with drag.
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/SpikesPhysical.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...kesPhysical.lua</a>
The semi physical approach with drag for speed damage decrease, but linear damage decrease for range.
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/SpikesSemiPhysical.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...emiPhysical.lua</a>
The mathematical approach with a sigmoid shape. The one I tested against eggs/drifters/MAC:s
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/SpikesSigmoid.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...ikesSigmoid.lua</a>
Complete file updated for 192 with the sigmoid shape.
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/Spikes.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...lien/Spikes.lua</a><!--QuoteEnd--></div><!--QuoteEEnd-->
Right now, I find that the lerk doesn't use flight to its full potential in combat. I'd like to see that changed, have come up with a solution.
<b>TL:DR - jump to the code and bold text</b>
My first memories of the lerk is staying back in vents and corridors, spiking and gassing marines from afar, using flight mainly to travel around. When the spikes were removed in favor of bite, you kept harassing with gas, and swooped in for the kill. Essentially a glorified skulk, and I understand why UWE wanted to differentiate it more from this, and reintroduced the spikes. As can be seen from the changes that the lerk has recieved during the alpha and beta, the role have been hard to get right. Spiking makes the lerk want to sit back. Sniping were removed, and the gas was changed to more obscuring rather then harassing. The lerks now have to fly close, but once there mainly just circle above the head of marines while spiking.
Why this behavior? Spikes do more damage closer, it's harder to aim while flying around, and on the floor you're a sitting duck.
The idea I had was to make spike damage depend partially on your speed. This rewards swooping and makes circling overhead not as viable.
I turned to Yuuki for some help with the coding, and the solution was suprisingly simple. After a short time the mod was done and we could try it out.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> local damage = kSpikeMinDamage + damageDistScalar * (kSpikeMaxDamage - kSpikeMinDamage)
//Yuuki: Make damage increase based on your speed
damage = 10+2*player:GetVelocity():GetLength()<!--c2--></div><!--ec2-->
This makes the damage consistent regardless of distance, but as you move faster you will do more damage. It's fixed as 10 for each spike, and with the speed cap at 13 the maximum damage potential is 36. This may sound like to much, but keep in mind that you need to fly straight at the marine for that damage. Flying sideways (or contrary to logic, even backwards) will still increase your damage, but not as much.
As a sideeffect of this, secondary got to good. The spread of the spikes were also so large that you wouldn't really hit many spikes before you got very close. We tweaked the numbers as seen below, and the result felt much better.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//Fluid Core: Reduced spread slightly and amount of secondary spikes was reduced
local kSpread = Math.Radians(6)
local kNumSpikesOnSecondary = 4<!--c2--></div><!--ec2-->
<b>This is a server-side mod. Just add or replace the lines of code that are changed or missing in the Spikes.lua file (found in ...\ns2\lua\weapons\Alien). Save it like any mod, but replacing the original would probably work fine if you want it permanent for your servers.</b>
Regards
Fluid Core
<i>
To do: Right now, if you shoot primary spikes and press secondary attack before your primary is fully released, no secondary spikes will fire, even if you keep holding secondary. Found out what's causing the initial failure (check out function Spikes:OnSecondaryAttack(player) in Spikes.lua if you're interested), but have no idea how to change the behavior while not allowing abuse. If someone got any idea on how to make holding secondary fire them -once- once primary is released, I'd like to know.</i>
<!--quoteo(post=1893507:date=Jan 11 2012, 09:52 AM:name=Fluid Core)--><div class='quotetop'>QUOTE (Fluid Core @ Jan 11 2012, 09:52 AM) <a href="index.php?act=findpost&pid=1893507"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The completely physical approach with drag.
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/SpikesPhysical.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...kesPhysical.lua</a>
The semi physical approach with drag for speed damage decrease, but linear damage decrease for range.
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/SpikesSemiPhysical.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...emiPhysical.lua</a>
The mathematical approach with a sigmoid shape. The one I tested against eggs/drifters/MAC:s
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/SpikesSigmoid.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...ikesSigmoid.lua</a>
Complete file updated for 192 with the sigmoid shape.
<a href="http://dl.dropbox.com/u/49503284/lerkSpikes/lua/Weapons/Alien/Spikes.lua" target="_blank">http://dl.dropbox.com/u/49503284/lerkSpike...lien/Spikes.lua</a><!--QuoteEnd--></div><!--QuoteEEnd-->
Right now, I find that the lerk doesn't use flight to its full potential in combat. I'd like to see that changed, have come up with a solution.
<b>TL:DR - jump to the code and bold text</b>
My first memories of the lerk is staying back in vents and corridors, spiking and gassing marines from afar, using flight mainly to travel around. When the spikes were removed in favor of bite, you kept harassing with gas, and swooped in for the kill. Essentially a glorified skulk, and I understand why UWE wanted to differentiate it more from this, and reintroduced the spikes. As can be seen from the changes that the lerk has recieved during the alpha and beta, the role have been hard to get right. Spiking makes the lerk want to sit back. Sniping were removed, and the gas was changed to more obscuring rather then harassing. The lerks now have to fly close, but once there mainly just circle above the head of marines while spiking.
Why this behavior? Spikes do more damage closer, it's harder to aim while flying around, and on the floor you're a sitting duck.
The idea I had was to make spike damage depend partially on your speed. This rewards swooping and makes circling overhead not as viable.
I turned to Yuuki for some help with the coding, and the solution was suprisingly simple. After a short time the mod was done and we could try it out.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> local damage = kSpikeMinDamage + damageDistScalar * (kSpikeMaxDamage - kSpikeMinDamage)
//Yuuki: Make damage increase based on your speed
damage = 10+2*player:GetVelocity():GetLength()<!--c2--></div><!--ec2-->
This makes the damage consistent regardless of distance, but as you move faster you will do more damage. It's fixed as 10 for each spike, and with the speed cap at 13 the maximum damage potential is 36. This may sound like to much, but keep in mind that you need to fly straight at the marine for that damage. Flying sideways (or contrary to logic, even backwards) will still increase your damage, but not as much.
As a sideeffect of this, secondary got to good. The spread of the spikes were also so large that you wouldn't really hit many spikes before you got very close. We tweaked the numbers as seen below, and the result felt much better.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//Fluid Core: Reduced spread slightly and amount of secondary spikes was reduced
local kSpread = Math.Radians(6)
local kNumSpikesOnSecondary = 4<!--c2--></div><!--ec2-->
<b>This is a server-side mod. Just add or replace the lines of code that are changed or missing in the Spikes.lua file (found in ...\ns2\lua\weapons\Alien). Save it like any mod, but replacing the original would probably work fine if you want it permanent for your servers.</b>
Regards
Fluid Core
<i>
To do: Right now, if you shoot primary spikes and press secondary attack before your primary is fully released, no secondary spikes will fire, even if you keep holding secondary. Found out what's causing the initial failure (check out function Spikes:OnSecondaryAttack(player) in Spikes.lua if you're interested), but have no idea how to change the behavior while not allowing abuse. If someone got any idea on how to make holding secondary fire them -once- once primary is released, I'd like to know.</i>
Comments
This will make spikes require a bit more skill.
Can't you, instead, take the component vector of forward flight? So flying backwards while spiking would actually <b>decrease</b> the damage dealt.
It's pretty simple:
<img src="http://i.imgur.com/P6676.png" border="0" class="linked-image" />
then:
damage = base.damage + damage.bonus*lerk.velocity.magnitude*cos(lerk.velocity.direction-view.direction)
So what does this imply?
[x] <b>Maximum forward movement</b> (cos[0]=1) :: <b>Maximum bonus</b> (base.damage + maximum.damage.bonus)
[x] <b>Standing still</b> (velocity=0) :: <b>No bonus</b> (base.damage + 0)
[x] <b>Flying perpendicular to spiking direction</b> (cos[90]=0) :: <b>No bonus</b> (base.damage + 0)
[x] <b>Maximum backward movement</b> (cos[180]=-1): <b>Maximum negative bonus</b> (base.damage - maximum.damage.bonus)
[+] <u>Also</u> that you need to specify <b>damage.bonus as "amount of damage per unit of velocity"</b>.
If you need to specify a maximum, then <i>damage.bonus = maximum.damage.bonus</i> (arbitrary) <i>/ maximum.lerk.velocity</i> (arbitrary but independent).
Maximum lerk velocity should already be in the game code.
You could either <!--coloro:green--><span style="color:green"><!--/coloro-->hard-code damage.bonus by doing the division "on paper"<!--colorc--></span><!--/colorc--> (efficient, but inflexible), or <!--coloro:#00FF00--><span style="color:#00FF00"><!--/coloro-->introduce maximum.damage.bonus and damage.bonus as global variables so that damage.bonus does the division in the code<!--colorc--></span><!--/colorc-->* (flexible, but inefficient) so that if maximum lerk velocity ever changes, damage.bonus changes appropriately (and by extension, maximum.damage.bonus does not change).
*Alternatively, rather than use a damage.bonus "intermediate", simply rewrite the above code:
damage = base.damage + maximum.damage.bonus*(lerk.velocity.magnitude/maximum.lerk.velocity)*cos(lerk.velocity.direction-view.direction)
Of course, I have a feeling that is even less efficient.
Note that the angles may be a little more complex than that, since we're working in three dimensions. But Ï´ (which I've written as "lerk.velocity.direction-view.direction") is simply the angle between two vectors, so if you can find that, then you're fine. Even if you can't (or it's not worth trying to), you could instead use the dot product of the two unit vectors (I think this was already a function in the code/engine):
|<u>a^</u>|*|<u>b^</u>|*cos(Ï´) = dotproduct(<u>a^</u>.<u>b^</u>); |<u>a^</u>|=|<u>b^</u>|=1
therefore,
cos(Ï´) = dotproduct(<u>a^</u>.<u>b^</u>)
Found it, it's something like this: <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=112427&st=20&p=1824854&#entry1824854" target="_blank">http://www.unknownworlds.com/ns2/forums/in...p;#entry1824854</a>
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->...
local barrelPoint = self:GetBarrelPoint(player)
...
local fireDirection = player:GetViewAngles():GetCoords().zAxis
...
local toEnemy = GetNormalizedVector(ent:GetModelOrigin() - barrelPoint)
local dotProduct = fireDirection:DotProduct(toEnemy)
...<!--c2--></div><!--ec2-->
but in our case toEnemy should be replaced with the lerk movement direction, " player:GetVelocity() "?, and adapt it from there, I guess.
On the other hand I don't like spikes dropping down to gravity over long distances. So i'm a bit of a hypocrit when it comes to realism in my lerk.
We did that after testing some flight modifications I made. It's a bit weird that the main weapon of the flying class do not really requires flying (it requires stationary flight). One of the goal of this modification is to make dynamic flight more useful. We tested it mainly in flight control on summit, so I'm not sure how it plays in smaller rooms. Maybe having a real flier in confined environment in not such a great idea.
Honestly I don't think the maximum bonus should be any more than maybe 2/3 of the base damage (read: cut down marine kill-time by up to 40%!). By extension, the maximum penalty is 2/3 of the base damage, so at maximum penalty you deal 1/3 of the base damage.
But frankly, it is highly unlikely that you could fly backward at maximum speed while simultaneously spiking - I don't think anyone's made that mod yet. Ergo, you would never reach this theoretical maximum penalty. Half of that, maybe, if we're generous.
On the other hand, flying forward at maximum speed is very attainable, so a theoretical maximum bonus can be a practical maximum bonus.
Honestly, I think this mod balances well. Generally, in long corridors for example, marines would have the undisputed advantage since they have the range. But you've turned that range into an advantage for lerks as well, though in a much different manner (it actually requires closing the distance). It's rather brilliant.
Regarding smaller rooms, I think it's fine: if the lerk just hovers around inside the room, his spike damage will still fluctuate around the base damage (though I imagine you'd see more bonuses than penalties); and if the lerk speeds through, and does like a strafing run, then he gets the added advantage. The beauty about this is that the bonus damage becomes a genuine bonus that results from good play, not "the status quo" that gets taken away because of "bad play". This suggestion positively encourages offensive lerks to move constantly and play aggressively, but doesn't really penalise them for hovering or circling (which may still be the smarter option in certain situations).
Imagine swooping in on an unprepared group of marines, blasting your spikes, and as you approach them you swing upwards and switch to and spam spores as you retreat.
Also, subshadow's suggestion could also be helpful to encourage aggressive behaviour (or at least fighting in close quarters), but it's a bit more of a negative encouragement than positive, so I don't like it as much. But if you did put it in anyway, you could easily just adapt the shotgun's code.
Agreed. Else it's gonna be very frustrating for shotgun wielding marines.
Anyway, one problem left, specially if you the effect of speed is not so big, is to communicate to the player that he makes more or less damage. I think it would be nice to have a bit of feedback on that.
One way would be to change a bit the sound of the spike depending on the velocity, so they sound stronger when you go fast. I have no clue how to do that though..
Anyway, one problem left, specially if you the effect of speed is not so big, is to communicate to the player that he makes more or less damage. I think it would be nice to have a bit of feedback on that.
One way would be to change a bit the sound of the spike depending on the velocity, so they sound stronger when you go fast. I have no clue how to do that though..<!--QuoteEnd--></div><!--QuoteEEnd-->
I'm thinking a "hit confirmation" sound. The spikes themselves sound the same as they leave, but upon impact the pitch changes. Faster spikes, more penetration, lower pitch. Slower spikes, lower penetration, higher pitch as if they are bouncing off the armor.
One additional sound or effect that could be interesting is when the lerk has reached a high damage threshold (90%-100% damage bonus) the spikes perform something like a sonic boom. This can be in the form of "tracers" with shockwaves in the air or impact shockwaves on the target/surfaces.
Swalk: I suspect time will tell if the bonus damage for backward flying will have to be removed. Similar to strafing, I think it can stay as it still rewards the lerk for moving around. After all, a lerk flying backward doesn't see where he is going, is slow, and fly (pretty much) straight away. They are an easy target for not much damage. I'd be more concerned about how bad the lerk will be to destroy structures. It might not be much of an issue, since it could do base harassments with speed, and would make sure that teams doesn't go all lerks.
Cataclyzm: I think it wouldn't be so hard to implement increased sound atleast. The Spikes.lua already have a code to play a sound to you if the lerks hit something far away. It shouldn't be so hard to include distance based volume too.
1. i appreciate the thought of rewarding skillfull flight in combat. however, while moving, you already have the advantage of not being hit so easily. of course you cannot hit as good yourself, but the fact that the spikes are straying partially makes up for that (i know rifle is straying too but i still think you have more control over this because you decide where to move) so in the end you are already encouraged to keep flying in combat, preferably in unpredictable ways.
2. realism aside, i'm not sure if this is intuitive to the players (meaning they might not figure it out, the game is already filled with a lot of other complex content). increased damage on a "charge" seems rather straight-forward though.
3. you will have the choice of a long-range "siege" or a more risky "charge" (which makes you an easier target, but you also have a higher damage-burst) closing in seems more entertaining than sniping to me and the sniping is already quite abusive against shotguns and flamers.
4. does overall-momentum really work well when you keep bumping into the ceiling? it might give you unintended bonus damage... if the back-and-forth cancels out the advantage with the disadvantage, that won't be a problem i guess.
5. what about buildings? if people are supposed to fly around like crazy just for shooting an extractor, some might consider this annoying.
however, even with these 5 reasons i cannot clearly say that the initial solution is not as good as harimarus suggestion. it's just my first thoughts. is there a server where this can be tested?
As for your points directly:
1. i appreciate the thought of rewarding skillfull flight in combat. however, while moving, you already have the advantage of not being hit so easily. of course you cannot hit as good yourself, but the fact that the spikes are straying partially makes up for that (i know rifle is straying too but i still think you have more control over this because you decide where to move) so in the end you are already encouraged to keep flying in combat, preferably in unpredictable ways.
1) Yes, lerks already fly in combat. But they are largely stationary and just strafing overhead.
No, straying doesn't make up for that. What straying do is that if you are lucky, then a spike will hit where the marine are even if you aren't aiming there. But it also means that even if you do aim perfectly, many of your spikes will miss. For reference, rifle has a 3 degree cone of fire, while spikes (now) have 8. What that means is that the spikes will hit a more then 7 times larger area then the marine.
2) Yuuki have pondered making it more intuitive by increasing the sound as you spike when moving faster.
3) The idea is to make people swoop instead of hover in combat. This will not make sniping any better. Each spike will only do 10 damage if stationary, and cover a 4 times larger area then the rifle, for reference. Unless you imply that you snipe when flying with full speed at someone starting from long range?
4) What lerk in their right mind would bump into ceilings? It'll slow you down and make you more vulnerable.
5) I mentioned this in my last post, you should check it out.
Harimau's remove bonus damage from strafing and lowers damage from moving backwards, as logic would dictate. In his second post he also mentioned some number tweaks. He doesn't have a different suggestion. I take up this in my last post too :)
There aren't any server that I'm aware of that have implemented this. I'm sure we might be able to try it out on a gather, much as we did for the fade blink at one point. Would be easier tho, since this is not as complex and the mod is server-side.
Harimau: If the mythbusters episode you mentioned was the one where they shoot crossbow from a moving vehicle, I just looked through it. I think it illustrates the scenario pretty well actually. What they measured was the arrow penetration though. I think we can safely agree that damage probably is best measured as kinetic energy though, for bullet-like objects. The main damage usually isn't from cutting through the body, but the trauma the shock waves send through your body, with teared blood vessels and the likes as a result. The numbers right now are probably exaggerated, but if the lerk fly almost as fast as the spikes it shoots (89% of their "vanilla" speed), then the damage numbers would be accurate.
Was pretty interesting to watch, but I don't think the episode was very telling for the actual myth. This is because arrows usually doesn't do damage in the same way as bullets do, but mainly from cutting the tissue where the arrowhead penetrates. Granted, I think the results would probably have been similar, but I think that they should atleast have used arrowheads for hunting instead of for target practice. Wouldn't hurt to have a dead pig or so as a target, as I'm fairly certain that the "body simulation" of the foam they used are comparable to a body in shock-penetration, but maybe not for cutting-penetration.
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Harimau's remove bonus damage from strafing and lowers damage from moving backwards<!--QuoteEnd--></div><!--QuoteEEnd-->
this is indeed what i was refering to, as contrast to the initially posted idea. i like the idea overall. and i'd rather have the original idea implemented than not having it.
1) by "makes up for it" i ment it doesnt matter as much if a lerk can keep his crosshair directly on the target or not, but it will matter for the marine who is trying to keep up with the lerks movement
2) that sounds like a decent solution
3) yes, the bonus for strafing will not make the sniping better. but only giving the bonus for moving towards the target will make the sniping even worse (which i consider a good thing)
4) nobody wants this to happen. but it does happen every now and then, the point is it shouldnt give you any bonus if you dont care about properly avoiding the ceiling. then again, this might not be an issue after they simplify the collision models in 190.
5) i guess you are refering to <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->It might not be much of an issue, since it could do base harassments with speed, and would make sure that teams doesn't go all lerks.<!--QuoteEnd--></div><!--QuoteEEnd-->? i dont mind the bonus damage when attacking a base (you are usually on your move then anyway) but for attacking extractors. don't get me wrong, i often move around myself when doing this because i'm often afraid some marine will empty his pistol on me from a different angle if i stand still. but i notice a LOT of people not moving or at most hovering stationary, i assume this is because they are too lazy and/or find it annoying. i can't imagine they are concered that they could miss an immobile target this big.
I'm very hesitant to hit powernodes as a fade for the same reason as you mention... Especially with the secondary pistol bug right now.
Yeah, I was thinking about this.
<!--quoteo(post=1892404:date=Jan 3 2012, 02:05 AM:name=Cataclyzm)--><div class='quotetop'>QUOTE (Cataclyzm @ Jan 3 2012, 02:05 AM) <a href="index.php?act=findpost&pid=1892404"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm thinking a "hit confirmation" sound. The spikes themselves sound the same as they leave, but upon impact the pitch changes. Faster spikes, more penetration, lower pitch. Slower spikes, lower penetration, higher pitch as if they are bouncing off the armor.
One additional sound or effect that could be interesting is when the lerk has reached a high damage threshold (90%-100% damage bonus) the spikes perform something like a sonic boom. This can be in the form of "tracers" with shockwaves in the air or impact shockwaves on the target/surfaces.<!--QuoteEnd--></div><!--QuoteEEnd-->
I like these ideas.
The only idea I could add is perhaps exaggerating the visual hit feedback as well (larger blood splatter, for instance)*. But I think that in general, the way to go is with hit feedback. Perhaps if you added an aural (whooshing sound) and visual (slight edge-of-screen blurring) effect to faster flight, it may also assist with conveying the idea, though in a more round-about manner.
*I was thinking, could you have it so that ALL** hit feedback effects scale with the damage dealt? It's outside of the scope of this mod, but it would be rather complementary.
** Are the hit feedback effects coded in per-attack or is there simply an overall implementation? This kind of stuff would be client-side right?
Fluid Core: Regarding damage numbers... honestly, it comes down to what you want to do. You could either:
1) Have a very high bonus proportional to only speed, and so moving around becomes the expected behaviour.
I don't like this so much for a couple of reasons: it pushes players to simply move around, even if that movement is erratic rather than calculated. Because of the very large bonus, it also establishes this behaviour as the status quo, and so players are effectively coerced into playing in this way, and when they don't, they lose a very large potential bonus (from 36 down to 10, means up to 72% of damage is lost). Although it applies the bonus unrealistically in the cases of strafing or backward flight, more importantly, it leads to some gameplay implications; players can retreat, circle-strafe and hover while maintaining their bonus, rather than encouraging swooping (forward aggressive) behaviour.
2) Or you could have a lower bonus (up to maybe an extra 100%, for instance; I think I said 2/3 before so that the effective backwards penalty wouldn't be so high), proportional to both speed and angle, encouraging forward motion but not discouraging most other movement.
I prefer this for pretty much the counter-reasons to 1) above: it encourages a certain type of play, forward aggression, while not imposing any artificial behaviours on players (since the bonus for erratic flight is mitigated). It is also, of course, a bit more realistic (dare I say intuitive), but more importantly it mitigates the undeserved (imo) bonus from circle-strafing and hovering, and lightly penalises the act of attacking while retreating (there is precedent for this: marines are also punished in this way, with their reduced backward movement speed). It establishes the base damage as a reasonable status quo, with certain behaviours (swooping, aggression) rewarded (bonus damage), and certain behaviours (attack-retreating) lightly penalised (penalty). And although it leads to a preference for straighter flight while attacking, it doesn't necessarily require it since up to a 60 degree! from-forward angle (67% from-forward towards-strafing), the damage bonus is still more than 50% (cos60=0.5) of the analogous forward bonus.
However, I would also make the suggestion to once again reduce the cone of fire, to perhaps close to rifle fire (3~5 degrees), since we are already positively encouraging aggressive behaviour, and no longer require negative encouragement to play in close quarters. If we still require more encouragement for close-quarter play, then subshadows' idea of damage drop-off with distance would work suitably well.
Other things of note: I think it's fine if Lerks don't have massive bonus damage when attacking structures, since there are many other classes that are better suited to attacking structures. If we go with my suggestion 2) above, then stationary firing is not hugely less. Also, lerks are, more than any other class, intended to keep moving, so having them focus on attacking structures kind of goes against that. or else you could perhaps increase the spore damage to buildings (which doesn't make a whole lot of sense, really).
(the following is only important from a realism, rather than gameplay, perspective),
Regarding the mythbusters episode, the main take-away was simply that it illustrates the added momentum (this would lead to increased penetration in the case of arrows, increased trauma in the case of bullets, but added kinetic energy in all cases), but also that the added momentum is exaggerated (as it was in the myth: it nowhere near approached twice the penetration). With your original numbers, if we consider it purely additive (as it is in the code you've written*), 10 is analogous to the speed of the spikes (since it's taking the basis of a stationary lerk), 26 is analogous to the speed of the lerk, this implies that the lerk flies at 260% of the speed of its spikes. Even if we instead consider it from a kinetic energy perspective, travelling at 89% of the speed of its spikes seems, to me, highly unrealistic. Hell, if that were the case, just flying into a marine would send THEM flying, considering the difference in mass between the lerk and its spikes. If we instead have a bonus of, say, 10 (so double the damage), we have (vLerk+v1)/v1 = sqrt(20/10) => vLerk = 0.41*v1. 41% still seems a little high, but more realistic. A bonus of 7 would mean the lerk flies at 30% of the speed of the spikes.
*For simple interest, we could re-write the code from a kinetic energy perspective:
Damage = KE = mv^2/2;
Damage2/Damage1 = KE2/KE1 = v2^2/v1^2 = (v2/v1)^2
v1 = vSpike; v2 = vLerk + vSpike
Damage2 = Damage1*[(vLerk+vSpike)/vSpike]^2
Specify an arbitrary vSpike.
e.g. vSpike = 52, Damage1 = 10
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->local vSpike = 52 // 52 m/s = 187.2 km/h = 116.3 mph = 4 times lerk maximum speed = around the speed of an arrow in real life
damage = 10 * ( (player:GetVelocity():GetLength() + vSpike) / vSpike) ^ 2
// or
damage = 10 * ( (player:GetVelocity():GetLength() / vSpike) + 1) ^ 2<!--c2--></div><!--ec2-->
<img src="http://i.imgur.com/1o1QD.png" border="0" class="linked-image" />
These posts always end up so much longer than I intend...
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> local direction = (trace.endPoint - startPoint):GetUnit()
trace.entity:TakeDamage(damage * damageScalar, player, self, self:GetOrigin(), direction)
end<!--c2--></div><!--ec2-->
If I got that right, then that might be what throws up the indication. That or it may only be what tracks what actually takes damage... I will look into it.
As for the sound, that's much clearer
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> // If we are far away from our target, trigger a private sound so we can hear we hit something
if (trace.endPoint - player:GetOrigin()):GetLength() > 5 then
player:TriggerEffects("hit_effect_local", {surface = trace.surface})
end<!--c2--></div><!--ec2-->
I think I'm done with it, though. The kinetic energy approach is pretty... interesting. But uh, it does show that at low relative lerk speeds, the damage increase is pretty damn small, but at high relative lerk speeds, the damage increase is ridiculous... (twice the speed, four times the kinetic energy, makes sense).
As for the realism, I don't think it would be analogous to have the 26 represent the speed of the lerk and 10 the speed of the spikes. As I said, damage is most certainly in the form of the kinetic energy of the object (I think spikes are pointy, but not cutting). So we go from a damage of 10 for the spikes to a damage of 36 when moving. That's an increase of 3.6 times. From now on we can ignore the actual damage. If we consider that this is linearly proportional to the kinetic energy, then we get that the kinetic energy also increased 3.6 times. With the mass of the spikes constant, we then get that the speed must have increased to sqrt(3.6)=1.897. I think this would be an exageration, but not so much. If you remember from early beta (or was it alpha then?) when spikes were actual projectiles, sure they were fast but not super fast. You could easily track one while it was flying. So I don't think the damage would be so far of. I also think that measuring penetration like that is flawed in the sense that it gets increasingly difficult to penetrate the object the further in you are. You not only have to push it out of the way for the arrowhead, you will also have friction all along the shaft of the arrow.
But enough of that, back to gameplay. Hover wouldn't actually be getting any bonus damage (ignoring the slight up and down movement). Why I've been promoting such a high bonus is to allow swoopes to be deadly, wich they really aren't at the moment. They are also very risky from a lerk standpoint. If a marine see you comming he quite easily dispose of you.
What kind of numbers do you think is good? The ones we set now ends up with a 50% increase compared to live when at full speed. I don't think you could go lower then 25% and have swooping be deadly unless you really tighten up the cone of fire. I think the maximum static portion shouldn't be any larger then 15, and at such high you start risking staying back and sniping marines (unless you put back damage reduction on distance). Even now the reduction isn't much (from 24 to 20), but the large cone of fire takes care of that. And with a large cone of fire we start to not get any hits before we are close and swooping gets drastically worse again. If we find an easy way to just have the damage increased on forward movement, then I think it's fine with the current numbers.
I've messed up my sleep...
Velocity is absolute compared to the coordinate system of the map. Trying to figure out a way to get a scalar of velocity compared to view direction.
Well, the reason I said they're analogous is that according to the code we've been using, damage (rationally: momentum) has a linear relationship with speed. y = c + m*x
m being "damage per unit of velocity", so c as base damage can be re-stated as m*z; y = m*z + m*x
z is the base speed of the spikes, x is the speed of the lerk
with m = 2 and c = 10, then z = 5
Remember that x = 13...
That means that the maximum lerk flight speed is 2.6 times as fast as base spike speed (spiking while stationary). Hectic.
Going from a kinetic energy rather than momentum perspective, you see that the relationship between damage (kinetic energy) and speed is quadratic. y = c*(a*x+b)^2
Damage2 = Damage1*[(vLerk+vSpike)/vSpike]^2
or
Damage2 = Damage1*(vLerk/vSpike+1)^2
=>
Damage2/Damage1 = 36/10 = *(vLerk/vSpike+1)^2
sqrt(3.6)-1 = vLerk/vSpike = 0.897, as you worked out.
Definitely more reasonable than the momentum perspective (though still too high imo), but not really reflected in the code.
You should have a look at the table and code I had in my previous post, which details the damage vs relative speeds (vLerk/vSpike). With a spike speed of 52 (4 times lerk max speed), that implies the maximum quotient is 25% (13/52), so the maximum damage is 15.63 (from a base damage of 10). That's kinda low, but reasonable. But let's say that the spike speed is 39 (3 times lerk max speed), then maximum quotient is 33.3% (13/39), so maximum damage is 17.78 (from a base damage of 10). That's better in terms of damage (and by extension, encouraging swooping), but implies the spikes are moving fairly slowly (just under 88 mph: no potential for time travel). Technically you could set vSpike to anything you wanted (since it has no other gameplay implications): higher vSpike = lower maximum damage at maximum lerk speed, lower vSpike = higher maximum damage at maximum lerk speed.
I actually quite like the kinetic energy implementation now...
<!--quoteo(post=1892478:date=Jan 3 2012, 11:45 AM:name=Fluid Core)--><div class='quotetop'>QUOTE (Fluid Core @ Jan 3 2012, 11:45 AM) <a href="index.php?act=findpost&pid=1892478"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I also think that measuring penetration like that is flawed in the sense that it gets increasingly difficult to penetrate the object the further in you are. You not only have to push it out of the way for the arrowhead, you will also have friction all along the shaft of the arrow.<!--QuoteEnd--></div><!--QuoteEEnd-->
Fair call. Although iirc I think the myth was about the penetration being twice as deep.
<!--quoteo(post=1892478:date=Jan 3 2012, 11:45 AM:name=Fluid Core)--><div class='quotetop'>QUOTE (Fluid Core @ Jan 3 2012, 11:45 AM) <a href="index.php?act=findpost&pid=1892478"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->But enough of that, back to gameplay. Hover wouldn't actually be getting any bonus damage (ignoring the slight up and down movement). Why I've been promoting such a high bonus is to allow swoopes to be deadly, wich they really aren't at the moment. They are also very risky from a lerk standpoint. If a marine see you comming he quite easily dispose of you.<!--QuoteEnd--></div><!--QuoteEEnd-->
Well, I've spoken at length about the gameplay/behavioural implications of high-bonus versus low-bonus and only-speed-modified versus speed-and-angle-modified damage, and I don't really have much to add. I suppose what's important is... how much do we reward swooping? Reward it too little and you don't encourage swooping, reward it too much and it becomes the status quo (that is, the standard attack simply feels deficient).
<!--quoteo(post=1892478:date=Jan 3 2012, 11:45 AM:name=Fluid Core)--><div class='quotetop'>QUOTE (Fluid Core @ Jan 3 2012, 11:45 AM) <a href="index.php?act=findpost&pid=1892478"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->What kind of numbers do you think is good? The ones we set now ends up with a 50% increase compared to live when at full speed. I don't think you could go lower then 25% and have swooping be deadly unless you really tighten up the cone of fire. I think the maximum static portion shouldn't be any larger then 15, and at such high you start risking staying back and sniping marines (unless you put back damage reduction on distance). Even now the reduction isn't much (from 24 to 20), but the large cone of fire takes care of that. And with a large cone of fire we start to not get any hits before we are close and swooping gets drastically worse again. If we find an easy way to just have the damage increased on forward movement, then I think it's fine with the current numbers.<!--QuoteEnd--></div><!--QuoteEEnd-->
I think 50% could be good. I would go as high as 100%. I think that somewhere around double damage is sufficient motivation. Although I suppose it comes down to... How fast should we be able to kill a marine while we're stationary (i.e. no risk), and how fast should we be able to kill a marine while we're swooping down on them (increased risk, and less time to execute). The important thing here is the time to execute a swoop, and a question, should you be able to kill a marine in one swoop?
What's the firing rate of spikes? Let's say that you start with a distance of 6.5 metres (is this too far?), and are moving at maximum speed (13 metres per second), it would take 0.5 seconds to complete the swoop - should you be able to kill a marine in that one swoop? Maybe: "Perfect marines" (100% accuracy) can kill skulks in a little over 0.5 seconds (9 bullets for 0.4995 seconds + delay); probably around 0.8 since there's some inherent delay. So if we set a 6.5 metre (0.5 second) swoop as the "perfect swoop" that kills a vanilla marine (160 effective hitpoints), then it should be something like: 12 shots per second (is this too high?) (6 shots total) at 27 damage each. Base damage can be, say, 15. Else increase the damage and decrease the rate of fire, or vice versa. One thing is clear to me, though: swooping needs very high acceleration.
So, considerations:
Distance = ?
Max Lerk Speed = 13;
Time to Swoop = Distance / (13) || else set Time to Swoop and test Distance
Rate of Fire = ?
Marine Hitpoints = 160;
Number of Spikes = Rate of Fire * Time to Swoop
Max Damage per Spike = (160) / Number of Spikes || else set Max Damage per Spike, determine Rate of Fire
Base Damage per Spike = k * Max Damage per Spike || (k <= 1), but Base Damage per Spike * Rate of Fire can't be too high.
// May want to set Number of Spikes to higher than is calculated, and Max Damage per Spike to higher than is calculated, to allow for some misses and some sub-optimal speed.
Regarding the hit feedback: I was actually talking about the third-person blood splatter, though it's kind of silly since you probably couldn't see it so well from a distance. But you know, exaggerating the hit-indicator (which you just reminded me of) could work quite well.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> damage = 10+2*player:GetVelocity():DotProduct(player:GetCoords().zAxis)<!--c2--></div><!--ec2-->
1) create a unit vector of the velocity; using GetNormalizedVector(player:GetVelocity())
2) do the dot product with the firing direction (already a unit vector); player:<b>GetViewAngles()</b>:GetCoords().zAxis
3) get the length of the velocity; using player:GetVelocity():GetLength()
4) multiply the length of the velocity and the dot product
when you could simply just:
1) do the dot product of the velocity with the fire direction; player:GetVelocity():DotProduct(player:<b>GetViewAngles()</b>:GetCoords().zAxis)
as you've done, since length * unit vector = original vector and dot product of unit vectors = dot product of original vectors / (length1 * length2)
Sigh, I need to go back to school.
EDIT: I'm wondering about that bolded bit, which seems to be missing from your code. Are they conceptually different but practically the same? The way I would interpret player:GetCoords():zAxis is that it just obtains the single coordinate, in the absolute frame of reference, while player:<b>GetViewAngles()</b>:GetCoords().zAxis is a unit vector I got from the flamethrower code.
So (presuming to change the numbers as well):
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->damage = 13+player:GetVelocity():DotProduct(player:GetViewAngles():GetCoords().zAxis)<!--c2--></div><!--ec2-->
(damage is between 13 and 26)
(Using the example in my previous post, that's a rate of fire of 14 spikes per second, with a tiny allowance for sub-perfect play.)
Yea, the myth was only about penetration.
<!--quoteo(post=1892492:date=Jan 3 2012, 06:32 AM:name=Harimau)--><div class='quotetop'>QUOTE (Harimau @ Jan 3 2012, 06:32 AM) <a href="index.php?act=findpost&pid=1892492"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Well, I've spoken at length about the gameplay/behavioural implications of high-bonus versus low-bonus and only-speed-modified versus speed-and-angle-modified damage, and I don't really have much to add. I suppose what's important is... how much do we reward swooping? Reward it too little and you don't encourage swooping, reward it too much and it becomes the status quo (that is, the standard attack simply feels deficient).
I think 50% could be good. I would go as high as 100%. I think that somewhere around double damage is sufficient motivation. Although I suppose it comes down to... How fast should we be able to kill a marine while we're stationary (i.e. no risk), and how fast should we be able to kill a marine while we're swooping down on them (increased risk, and less time to execute). The important thing here is the time to execute a swoop, and a question, should you be able to kill a marine in one swoop?<!--QuoteEnd--></div><!--QuoteEEnd-->
True, the hard thing to balance is static "sniping" against movement motivation.
<!--quoteo(post=1892492:date=Jan 3 2012, 06:32 AM:name=Harimau)--><div class='quotetop'>QUOTE (Harimau @ Jan 3 2012, 06:32 AM) <a href="index.php?act=findpost&pid=1892492"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So, considerations:
Distance = ?
Max Lerk Speed = 13;
Time to Swoop = Distance / (13) || else set Time to Swoop and test Distance
Rate of Fire = ?
Marine Hitpoints = 160;
Number of Spikes = Rate of Fire * Time to Swoop
Max Damage per Spike = (160) / Number of Spikes || else set Max Damage per Spike, determine Rate of Fire
Base Damage per Spike = k * Max Damage per Spike || (k <= 1), but Base Damage per Spike * Rate of Fire can't be too high.
// May want to set Number of Spikes to higher than is calculated, and Max Damage per Spike to higher than is calculated, to allow for some misses and some sub-optimal speed.<!--QuoteEnd--></div><!--QuoteEEnd-->
Live
ROF: 0.08 (12.5 spikes/second)
mnimum damage: 20
maximum damage: 24
Damage type: light
I seem to have bumped into alot of armor questions lately... I think I understand it now, but correct me if I'm wrong.
Vanilla marine got 30 armor. While you have armor, you will lose health from 30% of the damage, while 70% of the damage will affect armor. Light damage drain armor at 1/4 the rate it would drain health. That means that before the marine run out of armor, he has to take 30*4/0.7=171 raw damage. Remaining health is 100-171*0.3=49 health. Effective health then is 171+49=220. For normal damage this is 160 as you said.
Or all things included:
MarineHealth+(MarineArmor+ArmorPerUpgradeLevel*UpgradeLevel)*HealthPointsPerArmo
rLight/kBaseArmorAbsorption(1-(1-kBaseArmorAbsorption))
Backtracking we can get to that the marine only needs 58.333 armor to have full absorption, and end up with 333.333 effective health.
To your question: GetCoords() gets you 4 vectors. The origin (absolute in the map), the direction of the zAxis based on the origin (unit vector pointing to crosshair), the xAxis based on the origin (unit vector to your left), and yAxis (unit vector right-handed perpendicular to the two). By calling the zAxis you get the coordinates of in what direction you look. You can try this by playing around with Print(ToString(self:GetCoords())). Add it in any function that's regularly used, but preferably not called all the time. I choose function Lerk:ComputeForwardVelocity(input) and after the
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> if not self:GetIsOnGround() then<!--c2--></div><!--ec2-->
so that It would stop displaying if I wasn't in the air. Please do note the self: as opposed to the player: that's in the Spikes.lua file. Ekse it won't work. I've found the print highly usefull for understanding different parts of lua :)
Vanilla marine got 30 armor. While you have armor, you will lose health from 30% of the damage, while 70% of the damage will affect armor. Light damage drain armor at 1/4 the rate it would drain health. That means that before the marine run out of armor, he has to take 30*4/0.7=171 raw damage. Remaining health is 100-171*0.3=49 health. Effective health then is 171+49=220. For normal damage this is 160 as you said.<!--QuoteEnd--></div><!--QuoteEEnd-->
I see it a bit differently.
You can <u>usually</u> effectively ignore the 0.7 armorAbsorption, since the only thing that number <u>usually</u> determines is <b>how fast the armour drops</b>. That number is <u>usually</u> irrelevant to the player, in all honesty; because Health <u>usually</u> does not drop to zero before Armour does.
Effective Health = BaseHealth + Armor*HealthPerArmor
which is a simplification of
Effective Health = minimum(BaseHealth + Armor*HealthPerArmor, BaseHealth/(1-armorAbsorption))
(The damage type modifiers (HealthPerArmor) are 1, 2, and 4, for heavy, normal and light damage respectively.)
In most cases (usually) the evaluation on the left is the minimum:
Armour3 Marine, normal damage: 100+2*90 < 100/(1-0.7) :: 280 < 333.333333
Skulk, light damage: 70+4*10 < 70/(1-0.7) :: 110 < 233.333333
And I don't remember any others, but... you can test it.
iirc, Exos have a weird absorption percentage, so they should be a bit different...
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// Calculate damage absorbed by armor according to damage type
local absorbPercentage = self:GetArmorAbsorbPercentage(damageType)
// Each point of armor blocks a point of health but is only destroyed at half that rate (like NS1)
healthPointsBlocked = math.min(self:GetHealthPerArmor(damageType) * self.armor, absorbPercentage * damage )
armorPointsUsed = healthPointsBlocked / self:GetHealthPerArmor(damageType)
// Anything left over comes off of health
healthPointsUsed = damage - healthPointsBlocked<!--c2--></div><!--ec2-->
Here's an example, rifle vs skulk (ignore the table on the left, it's obsolete):
<img src="http://img233.imageshack.us/img233/6711/ns2riflevsskulk.png" border="0" class="linked-image" />
What file did you find that code in?
Also, only light damage marines have are sentry and pistol, so I don't get why you put light damage by the skulk?
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->self:TriggerEffects("spikes_attack")<!--c2--></div><!--ec2-->
"spikes_attack" is defined in AlienWeaponEffects.lua, it's a bundle of animations and sounds :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
spikes_attack =
{
spikeAttackAnims =
{
//{overlay_animation = "snipe"},
//{viewmodel_animation = "spikes_snipe", done = true},
{overlay_animation = "spike"},
{viewmodel_animation = "spikes_attack_l", left = true, done = true},
{viewmodel_animation = "spikes_attack_r", left = false, done = true},
},
spikeAttackSounds =
{
// Choose spike sound depending if we're zoomed and if we have piercing upgrade
{sound = "sound/ns2.fev/alien/lerk/spikes", upgraded = false, done = true},
{sound = "sound/ns2.fev/alien/lerk/spikes_pierce", upgraded = true, done = true},
},
},<!--c2--></div><!--ec2-->
The sounds are then played by the EffectManager (in EffectManager:InternalTriggerSound).
Then I tried to change the volume, some sounds have a volume parameter :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{private_sound = "sound/ns2.fev/alien/common/spikes_ricochet", doer = "Spike", volume = .3, done = true},<!--c2--></div><!--ec2-->
But it doesn't seem to work, printing the volume in EffectManager:InternalTriggerSound gave me always one.
You can also provide parameters to TriggerEffects, so I tried :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->self:TriggerEffects("spikes_attack",{volume = 0.1})<!--c2--></div><!--ec2-->
Printing the volume in EffectManager:InternalTriggerSound gave me 0.1 this time but the sound volume was unchanged (it's not surprinsing because the function that plays the sound don't care about the volume : Shared.PlaySound(player, soundAssetName))
Anybody knows how to change the volume of a sound ?
I strongly expect that it will need to be removed, to let shotgunners have a chance against decent lerks.
Your only reward for moving backwards should just be to increase the range between you and your target. (only good against shotgunners/flamers)
I think it's a big plus that lerks will be weaker against structures, they are an support class.
They are not supposed to be the ones taking out structures, yet they do it fine by themselves at the moment.
Swalk: As you can see from Harimau's and my latest posting session, we have managed to get the bonus damage depending on your forward speed only.
For tweaking damage we have to maintain a careful balance.
Lerks should;
<ol type='1'><li>be encouraged to to swoop at targets</li><li>reward aiming</li><li>be encouraged to get close to marines</li><li>not be overly penalized for flying smart instead of erratic</li><li>have acceptable static damage up close</li></ol>
1)The first point we address with speed granting damage. For swooping to be viable, the total damage of the spikes must be fairly large due to high risk at flying straight towards an enemy. Because we want to encourage swooping, a <b>big portion of the damage must come from speed</b>.
2)To have not have a swoop depend purely on luck, we have to have <b>smaller cone of fire</b>. If it's to large, then spikes will basically not hit at distance, with the result that you have to stay a significant portion of your time in close range. This would however make the lerk play much like it does now to do damage.
3)Since we have a smaller cone of fire, it would be easier to stay back and snipe instead, since it's generally safer. Because of this, the <b>static portion must be fairly small</b>.
4)This is where it starts to get tricky. If the static portion of the damage is to small compared to the speed one, then lerks will just fly around erratically to get that extra damage, even if it may not be the best thing to do. At the same time, if the static portion is to large, then we encourage them to not get close in the first place, and stay back and snipe. To counter this we can scale the damage with distance too. But due to our smaller cone of fire, if we scale the damage to much with distance. The problem with this is that we are doubly affected by distance, since the cone will cover less of the target. This will make swooping deal lower damage before it gets closer, reducing the benefit of swooping.
To address sniping, swooping and erratic movement, have to fulfill the following criterial
<ul><li>low static damage on range</li><li>decent static damage up close</li><li>speed damage not to small on range</li><li>speed damage not to large up close</li></ul>
You can probably already see where I'm going with this. What I propose is that the s<b>tatic damage scale substantially with distance, while the speed portion is unaffected</b>. This makes lerks more likely to swoop in from range, but not as likely to fly around erratically up close. Removing the strafing speed helps too, and I definately think that should be included. Especially since it was so easy to implement :)
5) This point is already addressed with the scaling static damage.
What kind of numbers are we looking for? I've been thinking about that, and come to suggestion. In parenthesis we can compare to live numbers.
Minimum static: 10 damage (20)
Maximum static: 18 damage (24)
Speed: 18 damage (0)
And for a few different scenarios.
Sniping: 10 damage (offset some by smaller cone o fire)
Swooping from far: 28 damage
Swooping close: up to 36 damage (only during short time)
Circling close: 18 damage
Will try to set up the code. Will probably hardcode the static damage, so that only Spikes.lua need to be changed.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> // Have damage increase to reward close combat
local damageDistScalar = Clamp(1 - (distToTarget / kSpikeMinDamageRange), 0, 1)
local damage = kSpikeMinDamage + damageDistScalar * (kSpikeMaxDamage - kSpikeMinDamage)
//Yuuki: Make damage increase based on your speed
//max damage = 18
//min damage = 10
local static = 10 + damageDistScalar * 8
local movement = 18/kMaxSpeed*player:GetVelocity():DotProduct(player:GetCoords().zAxis)
damage = static+movement<!--c2--></div><!--ec2-->
Included the first two lines so that you can compare to how the distance scaling is done in live.
Oh, my bad :P
Why try to remove erratic movement(skill based movement)?
That's generally what makes a lerk hard to hit.
Sure the lerk won't do it when it attacks(with your changes), but it will still be nessesary to do some erratic maneuvers when escaping/dropping spores.
I hope I made my intent clearer there. Erratic movements still have their place for avoiding damage and dropping spores, but it shouldn't be the only way to deal damage.
When strafing added damage you could get into the situation that you had to strafe around the shotgunner to do decent damage, whether it was smart or not. With the removal of strafe damage and higher static, that's now a choice instead of a must.