[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Vamp over cap/marker  XML
Forum Index -> Druids RPG
Author Message
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

As it now stands, Vam uses an inventory item (a "marker") to handle its cap. It works like this:

1. Instigator does damage
2. Instigator.Health is raised regardless of cap
3. Instigator's Marker is informed of health raised
4. Retaliation and all other abilities that can harm upon being damaged take effect immediately
5. The next Tick, Marker checks Instigator.Health. If Vamp has healed player since last Tick and Instigator.Health is over Instigator.HealthMax, Instigator.Health is reduced by the lesser of Vamp max or the amount of health originally restored.

Proposal:
Modify the order of things here. If it is decided that Retaliation > Vampirism, we can simply set it so that the health is given and that's the end of it. Else, if we keep it the same as it is (Vamp can counteract Retaliation), there are three possibilities to follow to prevent Vamp from going over cap.

First, what we could do is move the point the health is actually given to the next Tick as opposed to immediately. This will cause a one frame delay in Vamp's action.

Second, the method I think is best, what could be done is simply add one additional variable in the marker. Then, it would work like this:
1. Instigator does damage
2. Instigator.Health is raised (cap is taken into account)
3. Retaliation counts against cap.
4. Instigator's Marker is informed of Instigator.OriginalHealth (BEFORE Vamp) AND HealthRestored.
5. Next Tick, Marker checks to see if Instigator.Health - HealthRestored = Instigator.OriginalHealth. If not, it's corrected.

This method would still not eliminate the correction of health numbers, as done now, but at least it would be done far, far less - and almost never on the DC server.

Third, Retaliation could be modified to check for Vamp, but that would involve adding more code than the relatively simply changes I have proposed to Vamp (checks to the health of the player doing the vamping and calls to their Marker would be required.)

This will result in players not going over their health cap. I know it's a fantastically minor bug, but to me it's all about polish on this one.

P.S. Dru, have you had a chance to look at Medic Awareness? I'd like to contribute, I'd like to help out with testing and CVS, but it's been a month...

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

Hey - if you've already been in the code, and can edit it appropriately, attach the .uc in question to a message here.

Otherwise it might be a while before I get to looking at it myself.

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

Can you actually vamp over the max amount?

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

TheDruidXpawX wrote:
Can you actually vamp over the max amount? 


That's exactly what it does right now - intentionally. Then it brings it back down. I just thought there had to be a more refined way to handle it than having the one frame lag where you're over cap, since it's really noticeable especially on machines handling Tick() more often (like mine). I'll record a demo here in a minute and attach it. Then, I'll make the code changes and do some testing.

Darn you, insomnia!

Edit: Cancel the demo. Since it happens within one frame, it's not recorded, and for some reason Fraps doesn't work with UT2004. Arg.

This effect is most visible when spectating someone with a lower framerate than you. Since Tick() is called every frame on the local client, it's really obvious on someone with a slower computer (Sorry, Untamed!)

To test this yourself, create a 1v1 deathmatch with a really stupid bot. Grab some health vials, then go kill it with the flak or something that will give you a one hit kill. Watch closely when you vamp. You will see your health numbers change twice, not once, over the course of two frames.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

Okay, too tired to wrap my head around the math. I want to ensure I'm not counteracting any damage caused by the next Tick, and that we'll only check based on pre vamp and post vamp values.

I've done no testing yet, but I do have most of the code changes done. I'll look at this when I wake up

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

It probably doesn't help that this spawns thousands of markers either, however, I'm sure Mysterial did it this way for a reason.

That's not to say that I'm not up for changes in this depot, I just wanted you to know that Mysterial had to work hard to get it not to go over the limit.

Dru

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

It's in place this way so that Vampirism counteracts Retaliation. Let's say that it didn't use a marker or anything. Player A with Vamp 1 is at their cap, 150, and damages Player B, who has Retaliation 1, for 100 points. Player A gets 5 health from the vamp, but is at their cap. Player B damages A for 5 points, leaving A with 145 health.

As it works now, A would have their health upped to 155, B damages them for 5, and then the marker checks, sees that A is at 150, and does nothing.

I'd be perfectly happy to eschew the marker. Your call, though.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

Can you think of a way to do it without the markers but in such a way that retaliation damage wont vamp?

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

It's cake to do it without the marker. As of now, retaliation damage won't vamp, but the question is whether you're willing to allow retaliation to ALWAYS hurt on vamp. If so, I'll attach the corrected code, sans marker, in a few minutes here.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

Okay, here's the new code. It doesn't use Mysterial's patch for retaliation and, therefore, doesn't use a marker. Overall, it's FAR smoother and looks much better than the marker-based system. I tested it in a 75 point deathmatch with two stupid bots (winning without dying r fun.) It works with both vamp weapons and the skill.

Oh, while I was in there, I also patched AdjustableStartingDamage to work with an .ini file, as this was brought up as a bug a couple weeks ago.
 Filename DruidVampire.uc [Disk] Download
 Description
 Filesize 2 Kbytes
 Downloaded:  185 time(s)


Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
 
Forum Index -> Druids RPG
Go to: