Raised This Month: $51 Target: $400
 12% 

VSH A new backstab formula.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 11-13-2013 , 12:20   A new backstab formula.
Reply With Quote #1

Flaminsarge, you should add this to your changelist.

new Float:changedamage = ( (Pow(float(HaleHealthMax), (0.784314)) + 512.0) - (float(HaleHealthMax)*(Stabbed/90)) );

0.784314 = 1/1.275

A friend of mines (ミツ) whose helping me with some of my dev stuff (mostly answering my small silly questions like how to solve a mis-match error) proposed a better scaled formula for me when I wanted to make market gardeners do a static 2048 damage for market gardens. I tweaked it a little to make an improved backstab formula. Against a Hale vs 31 players, it does just about the same damage as it did previously. Spy 1v1 Hale however, can now kill him in 3 stabs instead of like 15.

Here's a graph to show examples on how damage scales with health (provided by ミツ):


~34000hp being about 4100 dmg.

The closer the divisor in the exponent is to 1, the higher the damage is based on health. Anything below 1.2 becomes insane damage at high health levels (5-7k at 32k health). The minimum value is affected by the +512 after it.
__________________

Last edited by Chdata; 11-13-2013 at 12:49.
Chdata is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-13-2013 , 12:28   Re: A new backstab formula.
Reply With Quote #2

If you're rebalancing, wouldn't it be better to make it take MORE backstabs to kill Hale with more players for balance reasons?

10 backstabs to kill Hale on a 32 player server is just a touch cheesy no matter how you look at it.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 11-13-2013 at 12:29.
Powerlord is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 11-13-2013 , 12:30   Re: A new backstab formula.
Reply With Quote #3

Maybe. Currently at 2046 hp hales backstabs do about 44%-38% and at ~34000 they do the usual 12%-5%. It can be modified to change the max by increasing the 1.275 and the +512.

For example:

x^(1/1.5) + 800

961 dmg vs 2046hp (46%)
1850 dmg vs 34,000hp (5.4%)

x^(1/1.4) + 600

832 dmg vs 2046hp (40%)
2325 dmg vs 34,000hp (6.8%)

etc

Edit: With the one that starts at 5.4%, you'd want to also increase Stabbed / 90 to something like Stabbed / 180 or something because you'd actually be healing Hale after a certain amount of damage. (Technically, you'd do negative damage). Even at 6.8%, with Stabbed/90, your 6th stabs would do 436 damage.

Or aim for a bigger max stab.

x^(1/1.3) + 600

883 dmg vs 2046hp (43%)
2873 dmg vs 34,000hp (8.4%)

Edit: Or just reduce the number of times we increase Stabbed, I should've thought of that first derp.

Instead of

Code:
                    if (Stabbed < 5)
                    {
                        Stabbed++;
                    }
You could

Code:
                    if (Stabbed < 3)
                    {
                        Stabbed++;
                    }
Meanwhile, I can't figure out how to play sounds or send text to the client (as the result of a market garden, but I do have damage modification working). Or read from timers (like HHH's stun timer). Does Timer_StunHHH store how long he's stunned ;?
__________________

Last edited by Chdata; 11-13-2013 at 15:47.
Chdata is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 11-13-2013 , 15:45   Re: A new backstab formula.
Reply With Quote #4

Printing something to the client:
http://docs.sourcemod.net/api/index....d=show&id=114&

Playing a sound:
http://docs.sourcemod.net/api/index....d=show&id=681&

Also changed the Stabbed[index], will test it and revert if necessary.
__________________
~Wliu

Last edited by Wliu; 11-13-2013 at 15:53.
Wliu is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 11-13-2013 , 15:51   Re: A new backstab formula.
Reply With Quote #5

Nah I already know about that, it's just that if I add those after the code that changes my market gardener damage, it seems to break it entirely, not play a sound, not write text, and not even modify my mg damage.

Code:
                    case 416:           //Market Gardener
                    {
                        if (GetRJFlag(attacker))
                        {
                            damage = someformula;
                            //Here is where I tried some EmitSounds that I literally copied from
                            //other parts of the Hale mod that use it
                            //and under it, a CPrintToChat();
                            return Plugin_Changed;
                        }
                    }
Trying to do that within public Action:OnTakeDamage(); seems to make it so none of that happens whatsoever. It doesn't crash my server, it just breaks my case for the market gardener.

I tested removing the printtochat, and the sound still doesn't play. I forget if I tried testing sending text alone without sound, but I have never gotten it to send chat anyway.
__________________

Last edited by Chdata; 11-13-2013 at 15:52.
Chdata is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 11-13-2013 , 15:55   Re: A new backstab formula.
Reply With Quote #6

Are you sure you're formatting the message correctly? (eg CPrintToChat(attacker, "somemessage %i", someint);)
__________________
~Wliu
Wliu is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 11-13-2013 , 16:21   Re: A new backstab formula.
Reply With Quote #7

Ah, I may have used CPrintToChat instead of CPrintToChatAll. Otherwise it was formated fine.

Edit:

Simply adding

decl String:t[80];
CPrintToChatAll("{plum}%t{linen} just marketed Hale!", GetClientName(attacker, t, 80));

makes market garden hits not work (as in, my damage = does not even apply, nor does a message appear in chat).
__________________

Last edited by Chdata; 11-13-2013 at 16:33.
Chdata is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 11-13-2013 , 20:46   Re: A new backstab formula.
Reply With Quote #8

There's your problem.
%t is used for translations, use %n for names. You're lucky your server didn't crash.
https://wiki.alliedmods.net/Format_C...mat_Specifiers)
__________________
~Wliu

Last edited by Wliu; 11-13-2013 at 20:47.
Wliu is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 11-13-2013 , 20:58   Re: A new backstab formula.
Reply With Quote #9

Ah, that fixed it. Though it seems like there's no difference between using %s after GetClientName and using %N I suppose?

Next is to figure out sounds.

Edit: It may be that I just used \ instead of / for filepaths.

Edit 2: Nope.

Code:
EmitSoundToAll("player/doubledonk.wav", client);
EmitSoundToClient(client, "player/doubledonk.wav");
Code above and below it works fine, but the sounds don't. This same thing works just fine for the short circuit as well. I can even /play @me player/doubledonk.wav just fine.

Code:
EmitSoundToAll("weapons/barret_arm_zap.wav", client);
EmitSoundToClient(client, "weapons/barret_arm_zap.wav");
wat
__________________

Last edited by Chdata; 11-13-2013 at 21:57.
Chdata is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 11-13-2013 , 22:26   Re: A new backstab formula.
Reply With Quote #10

Why would you emit sound to client after emitting it to all?
The client will hear it when their entity emits it.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode