Aller au contenu

Photo

XP OnDeath Only awarded for Participants in Combat


  • Veuillez vous connecter pour répondre
44 réponses à ce sujet

#1
henesua

henesua
  • Members
  • 3 858 messages

I have long wanted only to reward XP to actual participants of a combat. Typically rewards are handed out only to the killer of a creature, or alternatively only to party members, or possibly nearby enemy PCs. I think all of these are kludgey, and would like a better solution.

 

Are there any solutions to this posted anywhere?

 

Whats a good way to go about it?

 

I've decided to try to tackle this in the following way:

  • Whenever a harmful spell is cast at an NPC, time stamp the NPC with the ID of the spell caster.
  • Whenever an NPC is damaged, time stamp the NPC with the ID of the damager.
  • When an NPC dies, loop though all PCs in the module, and check for time stamps for the IDs of each PC on the NPC. If any timestamps are recent enough for a given PC, reward them.

  • WhiteTiger aime ceci

#2
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

What about simply setting setting each PC that damages/casts a spell/attacks (otherwise a wizard could shoot a crossbow and keep missing and thus never get XP) as a local object on the NPC with a local int to track how many PCs have been assigned so far?  So after 3 PCs you'd have...

 

sPC1 = Bob

sPC2 = Jill

sPC3 = Mark

nPCs = 3

 

Then loop through that psuedo-array of objects OnDeath for the XP.  Can also clear the array if the NPC exits combat for 2+ rounds or something.


  • henesua aime ceci

#3
henesua

henesua
  • Members
  • 3 858 messages

The problem with the pseudo-array is the lack of a timestamp. I can look into your suggestion about measuring time out of combat as an alternative to a timestamp. Perhaps that would be best.

 

I considered using the attack event as well, but don't see how a character can be considered to have meaningfully contributed if they attack but never damage the NPC. More important would be to include PCs who have been attacked.



#4
WhiZard

WhiZard
  • Members
  • 1 204 messages

Okay, a few things to think about:

 

1) I am a high AC build.  I go into improved expertise mode and begin fighting a creature.  I score no hits on it, and it does not hit me, but others are able to take down the creature from a distance with ranged weapons.  Do they get all the XP?

 

2) I am a cleric. I buff my friends and heal them during combat.  Because I have the healing domain, I have a large assortment of spells able to aid others.  Do I get any XP in these fights?

 

3) I am a summoner.  Due to the way my PW is scripted, I can summon many creatures and buff them.  My creatures fight for me.  Do I get XP from their kills or should I just cast a single AoE spell to secure that I am properly registered as a killing factor for many enemies?

 

4) I am a bored player that loves to leave lingering AoEs across the server to make things look pretty.  Here a darkness there a vine mine; but I am really not about fighting anything.  If a battle should occur in one of the AoEs that I left a while ago, well I guess I get XP rewards for the kills. Right?


  • henesua aime ceci

#5
henesua

henesua
  • Members
  • 3 858 messages

Thanks Whizard. I have considered those.

 

As for #1, I mentioned to MM that recording when a creature attacks a PC is important. I'm just not sure where the best place to capture this is. I wish PCs had the same events that creatures do. Thoughts on how to achieve this?

 

#2: yes I need to figure out how best to use spell hooking when a caster buffs a PC in combat, and connect them with the creature(s) that are engaged with that PC. Not easy to do. I'm thinking that I would time stamp one PC as 

 

#3: already handled with what I outlined above.

 

#4: The character gets no XP for kills in this fashion. But this raises a problem I have not considered AOEs. They do not trigger the spell cast at event. This means that I need to capture AOE effects on NPCs in combat and timestamp those NPC with the ID of the caster of the AOE.



#6
WhiZard

WhiZard
  • Members
  • 1 204 messages

#4: The character gets no XP for kills in this fashion. But this raises a problem I have not considered AOEs. They do not trigger the spell cast at event. This means that I need to capture AOE effects on NPCs in combat and timestamp those NPC with the ID of the caster of the AOE.

 

 

Odd, darkness does a signal event in its on enter event, and vine mine does this on enter and on heartbeats.

 

EDIT: Pretty much all AoEs do signal the OnSpellCastAt event.  Some (like darkness, Evard's) will have the AoE object as the signaler while others (like vine mine) will have the AoE creator as the signaler.  If you are storing objects in the OnSpellCastAt event you should check the object type there (before the AoE expires) and if it is an AoE calling the event, find the creator and store that object.  Same procedure as with NPC summons, basically.  If a summon deals damage you should record the PC summoner before the summon dies.  If a summon casts a lingering AoE and dies before the AoE expires, and a creature enters the AoE....  checked looks like the AoE no longer runs its scripts is able to apply effects after the summon's death.

 

EDIT2: Edited the previous edit as I was able to capture Evard's scripts still running (I inserted a feedback string) but doing nothing as far as applying effects.



#7
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

The problem with the pseudo-array is the lack of a timestamp. I can look into your suggestion about measuring time out of combat as an alternative to a timestamp. Perhaps that would be best.

So you're concerned about someone damaging a mob, running away, the mob not getting despawned, and then someone else killing the mob but the original player gets XP too?  I'd just do a semi-recursive script on the EndCombat event -- delay 6 seconds and see if we're in combat.  If so, return.  Otherwise, delay another 6 seconds and if we're still not in combat then clear the pseudo-array.  Could adjust the time as needed, ideally could just clear the array as soon as combat drops for the NPC but if that happens accidentally while the PCs are still fighting it somehow then a failsafe would be nice.

I considered using the attack event as well, but don't see how a character can be considered to have meaningfully contributed if they attack but never damage the NPC. More important would be to include PCs who have been attacked.

Whizard gave some examples there -- and if you're a low level wizard attacking with a crossbow you very well might not ever hit the NPC OR get attacked by the NPC (since it's attacking the fighter).

As for #1, I mentioned to MM that recording when a creature attacks a PC is important. I'm just not sure where the best place to capture this is. I wish PCs had the same events that creatures do. Thoughts on how to achieve this?

The way you're trying to do this now causes a whole host of problems.

 

1. A fighter and wizard are killing a group of six mobs.  The fighter rounds them up and the wizard nukes them down -- but the fighter only has the chance to attack one out of the six so he only gets credit for one out of the six.

 

But let's say you fix that given your quote.

 

2. A fighter, rogue, and wizard are killing a group of six mobs.  The fighter rounds them up, the wizard starts AoEing, and the rogue picks them off one by one.  But the rogue only has the chance to attack three of the six mobs (and never gets attacked by any) and only gets credit for half of them as a result.

 

So here's an idea.  When the NPCs gets attacked/damaged/spellcastat/etc, see if a local object exists for an enemy PC.  If not, set it to the enemy PC.  If there is, the mob is "tagged" and we ignore another PC attacking it in terms of XP.  Then when it dies check the PCs for all PCs in the same faction of the local object who are within 40 yards and give them the XP.  We clear the local object when combat ends (or after a 6/12/whatever second delay to prevent oddities) to allow re-tagging.

 

This means all members of a party within 40 yards of an NPC will receive XP if a member of their party was the first to attack/damage/spellcastat/etc a given mob -- can't swoop in and steal XP on kills.



#8
henesua

henesua
  • Members
  • 3 858 messages

Whizard, thanks for the investigation. So while the casting of AOE spells does not trigger a spell cast event, the enter/exit events of the AOE typically (almost always) call it. I'll take a look. Thanks.

 

MM, a lot to respond to there, thanks, but I unfortunately can't right now. Instead I'll need to digest it later as I am working toward this goal. But I do want to speak to your suggestion that I capture all party members to hand out XP for kills.

 

I am revising a module that has handled things that way for many years, and I'd prefer not to. One reason is that I don't want to require players to party up, and another is that I prefer not to reward PCs merely for tagging along. I do see your points that some instances of contribution will slip through the cracks, but I would rather shore up the leaks as best I can rather than just do things the way we have been.



#9
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

I am revising a module that has handled things that way for many years, and I'd prefer not to. One reason is that I don't want to require players to party up, and another is that I prefer not to reward PCs merely for tagging along. I do see your points that some instances of contribution will slip through the cracks, but I would rather shore up the leaks as best I can rather than just do things the way we have been.

 

If you don't want to require people to party up then how do you plan to not reward PCs for merely tagging along?

 

I mean, right now you could have Bob, Bill, and Bethany working as a team to kill tough mobs and Mark tags along at a distance shooting mobs with a bow a single time when they're at 10% HP in order to get the kill experience.  Leeching the XP while not contributing.

 

And if you base the XP gained based on a percentage of damage done to the mob or something then that screws over tanks and healers (and single target classes in AoE situations).

 

What are you actually trying to accompish in this situation?  What do you want to AVOID?



#10
henesua

henesua
  • Members
  • 3 858 messages

You misunderstood me.

 

By tagging along I mean a PC who joins a party to gain XP from combat without engaging those monsters or doing much of anything other than site seeing.



#11
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

But your proposed system lets a PC get the XP for not doing anything other than sight seeing (1 attack or spell is all that's required), no?  And they can do it without even joining the party.



#12
henesua

henesua
  • Members
  • 3 858 messages

Yes, you are bringing up an edge case that is possible, but still involves participation - targeting the enemy with a hostile spell, damaging the enemy, or being attacked by the enemy (something which I am working on getting incorporated). And in any case even the rare instance that you bring up passes the criteria that I am setting so I don't have a problem with it.

 

Anyway, I am not interested in explaining my motives. I am interested in solving the technical problems.



#13
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

This is something I've wrangled with quite a lot. At present, I'm still working on how best to do a 'GetIsBot' function, to detect active combat participants. I could post our current ondeath checks, but I'd prefer to see what this thread produces first, since while that script does some of what you describe, and covers some of the cases that you outline later (#1-#4), but it doesn't go nearly far enough in my book.

 

Funky



#14
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

Anyway, I am not interested in explaining my motives. I am interested in solving the technical problems.

 

And those technical problems are entirely dependent on your motives so it is necessary to explain what your motives are (which is different from explaining why they are that way).  So far we have...
 

1. No party requirement

2. Attacking the mob, damaging the mob, casting a spell at the mob, or healing a person fighting the mob makes you eligible for experience

 

So what about my example above with the group of three?  Let's make it even simpler: Bob the fighter and Chris the rogue are fighting 3 mobs.  Bob kills one and Chris kills two.  Bob gets credit for his one and Chris gets credit for his two since they attacked those mobs.

 

Should Bob get credit for the two Chris killed?  Presumably yes since those two mobs were attacking him, though we'd need to figure out how to flag it.

 

Should Chris get credit for the one Bob killed?  Presumably yes -- but he never attacked that mob and he never got attacked by that mob.  Which means we need to either use party or we need to have something like a mob that takes damage also flags all other mobs within 20 yards as being "attacked" by the PC so he gets XP on death even if he never attacks or gets attacked the other mobs.

 

But I don't KNOW your answers for those two cases, and those are two simple cases off the top of my head.  Maybe you DON'T Chris to get credit for the mob he never interacted with -- so your motives are entirely relevant.



#15
henesua

henesua
  • Members
  • 3 858 messages

MM, I merely want to capture those that actively participated in an encounter. And while I may not be able to catch everything. I'm simply shooting for doing this the best I can. If there are other means to track participation then bring those up. Thats what I asked for at the top - or at least thats what I was trying to ask for in my usual not so clear way. :)

 

So in response to you last comment:

In addition to the criteria you mention above I also plan on tracking the event when a PC (or minion of PC) is targeted by an NPC. That counts as participation as far as I am concerned. We called this being attacked earlier, but I don't know how to track that. I think I can however track the targeting of a PC.

 

So in the example of the rogue and fighter above credit for each kill depends on the amount of interaction that each PC has with each NPC. So if say the rogue was spotted by the creatures while scouting and targeted, then the rogue would be flagged as a participant in combat with each of those creatures that targeted them. Then when the PCs attack they'll get credit for each one they damage, or target with a hostile spell.



#16
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

So in the example of the rogue and fighter above credit for each kill depends on the amount of interaction that each PC has with each NPC. So if say the rogue was spotted by the creatures while scouting and targeted, then the rogue would be flagged as a participant in combat with each of those creatures that targeted them. Then when the PCs attack they'll get credit for each one they damage, or target with a hostile spell.

 

The rogue wasn't spotted or targeted at any point.  He scouted them, the fighter charged in to distract them (so the rogue never gets attacked), and the rogue flanked them one time at a time.  He kills more than the fighter but only directly interacts with some of the mobs (say 70%ish since the other 30% are killed solely by the fighter).  Excellent tactics and an easy fight as a result.

 

Should the rogue get experience from 70% of the mobs (that he attacked) or 100% of the mobs (the mobs his team killed)?  I'm not worried about the technical implementation yet, I'm asking what you WANT to happen.



#17
henesua

henesua
  • Members
  • 3 858 messages

I would want both the fighter and rogue to be awarded equally since they both fully participated.



#18
WhiZard

WhiZard
  • Members
  • 1 204 messages

So you are saying XP occurs when:

 

Character is in close proximity of the target (likely means that combat tactics were involved)

Character conducted or received a physical attack from the target

Character cast a spell on the target

 

And XP is not rewarded:

 

When a character is in another area or a very long distance away from the target (e.g. the AoE landscaping design)

 

 

So just check creatures within a short distance (automatic XP) and within a longer distance (XP is only given if there was interaction with target).   All this would exclud would be the characters that buff long ranged attackers.  Given that summons pretty much always get close to their target, this should really only be an issue when dealing with multiple PCs.



#19
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

 

So just check creatures within a short distance (automatic XP) and within a longer distance (XP is only given if there was interaction with target).   All this would exclud would be the characters that buff long ranged attackers.  Given that summons pretty much always get close to their target, this should really only be an issue when dealing with multiple PCs.

This is a solid first-order solution. By that, I mean that it deals with the initial problem, but fails to deal with how players will adjust to it. As soon as players work out the mechanism, it becomes exceedingly easy to ex$plo#it.

 

Funky



#20
MagicalMaster

MagicalMaster
  • Members
  • 2 000 messages

I would want both the fighter and rogue to be awarded equally since they both fully participated.

 
New scenario.  There's a group of melee mobs and a mage mob at range.  On the PC side is a fighter and mage.  Fighter charges in, gets attention of mobs, mage drops an AoE.  Fighter finishes off melee mobs and runs another 20 yards to reach and kill the enemy mage.  PC mage doesn't touch the enemy mage since it's unnecessary, he just AoEd the main group.  Should the PC mage get XP for the enemy mage that the fighter kills?

 

So just check creatures within a short distance (automatic XP) and within a longer distance (XP is only given if there was interaction with target).   All this would exclud would be the characters that buff long ranged attackers.  Given that summons pretty much always get close to their target, this should really only be an issue when dealing with multiple PCs.

 

Could just put a rogue in stealth at short distance and get free XP.  Or if you check for stealth/invis/etc could just stand nearby and get XP without any interaction.

 

So it definitely excludes a lot more than just characters that buff long ranged attackers.



#21
Shadooow

Shadooow
  • Members
  • 4 465 messages

This is a solid first-order solution. By that, I mean that it deals with the initial problem, but fails to deal with how players will adjust to it. As soon as players work out the mechanism, it becomes exceedingly easy to ex$plo#it.

 

Funky

This will be always the case. Long time ago, I played at one rp server which tried to implement this and whatever they did I was always able to exploit that and abuse to powerlevelling.

 

I think that the classic method of the distance check is fine - if you make your monsters to require help of more peoples and not  to be one-shot killed its a good chance the second pc will join the battle as well. Or if you rescript the monster targetting from nearest to most vulnerable. Instead of checking whether the second PC cast spell or damaged monster physically, make the moster to cast spell/damage him!

 

I believe this is problem only for a very static and hack&slash style of areas/modules. This is why diablo sucks so much and is overcrowded with bots.  BTW Funky when you say bots, you mean secondary logins with autofollow or your really found an automated bot playing as regular PC on your server?


  • WhiteTiger aime ceci

#22
WhiZard

WhiZard
  • Members
  • 1 204 messages

 

So it definitely excludes a lot more than just characters that buff long ranged attackers.

 

You got the opposite.  Stealthers that go near the target will be included.  Buffers of long ranged attackers too far away would be excluded.  The inclusion problem is a separate issue.



#23
henesua

henesua
  • Members
  • 3 858 messages

 
New scenario.  There's a group of melee mobs and a mage mob at range.  On the PC side is a fighter and mage.  Fighter charges in, gets attention of mobs, mage drops an AoE.  Fighter finishes off melee mobs and runs another 20 yards to reach and kill the enemy mage.  PC mage doesn't touch the enemy mage since it's unnecessary, he just AoEd the main group.  Should the PC mage get XP for the enemy mage that the fighter kills?

 

No, because the PC mage did not engage the NPC mage.



#24
WhiZard

WhiZard
  • Members
  • 1 204 messages

This is a solid first-order solution. By that, I mean that it deals with the initial problem, but fails to deal with how players will adjust to it. As soon as players work out the mechanism, it becomes exceedingly easy to ex$plo#it.

 

Funky

 

Servers can also have policies too.  Scripts can't do everything.  If there is a stealther hidden next to the killed creature, it is difficult to ascertain by scripting if he was or was not intended in the strategy of the kill.  The fighter and rogue strategy that MM brought up could apply to a single creature.  A rogue is hidden and the fighter attacks the creature allowing for the rogue to sneak attack. However if the fighter dev crits it initially there is nothing for the rogue to sneak.  Henesua's interpretation leans on participation in the tactics, if things are coordinated then XP should be given.  From a scripter's angle one cannot tell the difference between participation and non-participation unless specific agreements (parties or the like) were known before hand.  If an independent hidden character is there, then he might not be accounted for in the attack and might suffer from AoEs, a risk he would likely have to assume.



#25
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

This will be always the case. Long time ago, I played at one rp server which tried to implement this and whatever they did I was always able to exploit that and abuse to powerlevelling.

 

I think that the classic method of the distance check is fine - if you make your monsters to require help of more peoples and not  to be one-shot killed its a good chance the second pc will join the battle as well. Or if you rescript the monster targetting from nearest to most vulnerable. Instead of checking whether the second PC cast spell or damaged monster physically, make the moster to cast spell/damage him!

 

I believe this is problem only for a very static and hack&slash style of areas/modules. This is why diablo sucks so much and is overcrowded with bots.  BTW Funky when you say bots, you mean secondary logins with autofollow or your really found an automated bot playing as regular PC on your server?

It's not always the case, actually. It will of course always be a factor, but there are many things you can do to hinder ex@plo&it)ers besides throwing your hands up and declaring it inevitable. It just takes a lot more thought and a lot more complicated coding. In pretty much every area we've tackled in that regard, we've managed to come up with an acceptable compromise between cost and benefit that dealt with the issue at hand pretty effectively. The question is not if it's possible, just how, and at how much cost in development time.

 

In this case, my fear is that it's going to cost rather a lot. I'll elaborate on that after I explain my situation.

 

We have a pretty large playerbase, even now, and they're fairly adept at finding and using exploits, as many of them are pretty veteran gamers, familiar with programs like C**********e. They also tend to possess nifty toys like programmable gaming keyboards, with some pretty amazing macro capabilities. They use them to play up to eight characters at once, in some cases, and a number of them can play two characters simultaneously pretty much flawlessly.

 

My goal isn't to single out all such cases, which would be an enormously difficult and time-consuming undertaking that would no doubt create an immense amount of overhead and likely some skewed incentives to boot. My goal is just to single out characters that are effectively leeching, or being dragged along for reasons I consider invalid. In particular, I want to avoid creating an incentive to drag additional toons along on runs in our forthcoming area set, Limbo, because I want to introduce a WoW-like quest reward system that gives currency-style items to players simply for completing runs. Absent some discrimination between bot and non-bot, that would introduce an incentive to drag along excess bots up to the party limit simply for more loot.

 

Like the OP, I'm not much interested in debating 'can' or 'should', only 'how'. I'm still hoping for an elegant low-dev-cost solution, though I anticipate having to involve a fair number of events (ondeath, ondamaged, onspellcastat, the spellhook, etc) to do this type of detection. I've looked through dozens of player-generated logs from runs done on the server, and the bots are readily detectable to the human eye in terms of a number of vectors like damage output, kills, deaths, damage taken, and so on, but some of the things their loggers scan through are not directly accessible to nwscript, which is why that approach is likely going to take rather a lot of time, and why I'm looking for alternatives.

 

Funky