Author Topic: XP OnDeath Only awarded for Participants in Combat  (Read 1094 times)

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #30 on: April 26, 2014, 12:41:43 am »


               


I am not sure you will be able to help me, MM, until you understand this


The criteria for a reward is active participation.




I absolutely don't understand that, hence my questions.  I'm trying to find out what you mean by active participation.


 


The rogue attacked and killed four enemies during a single combat but also gets credit for a fifth enemy the fighter killed on his own during the same combat.


 


The mage attacks and helps kill a group of enemies with AoE during a single combat but does NOT get credit for another enemy the fighter killed on his own during the same combat.


 


Both would seem to have active participation in the fight, but you say they do not.  I'm not claiming you're wrong, but I don't understand what distinction is and that's something that has to be figured out for this system.  We need to figure out how to indicate the rogue WAS an active participant for the enemy he didn't touch but the mage WASN'T an active participant for the enemy he didn't touch.  What is our general criteria here?



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #31 on: April 26, 2014, 01:06:41 am »


               

Ah.


 


Well participation includes damaging an NPC, being targeted by them, casting spells at them, attacking them, and any other engagement with an NPC foe that we can think of and we can capture via one event or another.


 


Also it is important to point out that I am tracking participation in combat per foe rather than per "encounter". So each NPC records each PC they engage with (a PC is also recorded as a participant if any of their minions are engaged in combat with the NPC), and so when they die all PCs that are recorded as participants are rewarded Combat XP.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #32 on: April 26, 2014, 01:47:55 am »


               


Well participation includes damaging an NPC, being targeted by them, casting spells at them, attacking them, and any other engagement with an NPC foe that we can think of and we can capture via one event or another.


 


Also it is important to point out that I am tracking participation in combat per foe rather than per "encounter". So each NPC records each PC they engage with (a PC is also recorded as a participant if any of their minions are engaged in combat with the NPC), and so when they die all PCs that are recorded as participants are rewarded Combat XP.




Okay, so why is our rogue considered participating for the NPC he didn't damage, didn't get targeted by, didn't cast a spell at, didn't attack, and didn't engage in any sense (because he was busy killing other mobs that were also attacking the fighter)?


 


Don't get me wrong, I agree that the rogue should get credit conceptually (otherwise you get stupid things like the rogue trying to attack each target rather than focus one down at a time)...but I'm trying to understand why you think he should in your system.  What is going to flag the rogue as being engaged with an enemy he didn't engage?


 


And given that, how is that NOT going to flag the mage as being engaged?


 


For example, one might say "Whenever a PC attacks/damages/etc an NPC it flags that NPC and any other NPC within 40 yards as the PC getting credit."  This would give the rogue credit but also give the mage credit, which you say you don't want.  But if we reduced the radius to like 10 yards then people fighting enemies at a distance (like an archer picking off another enemy archer) would have issues.



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #33 on: April 26, 2014, 02:06:32 am »


               

Participation is the criteria. You described the rogue as participating. Perhaps I misunderstood you. In either case. It doesn't really matter.


 


The criteria is active participation.


 


I think the problem here is that you are leading with thought problems which aren't going to result in what I need. I've already thought about this and arrived at general criteria. What remains now is to wrap my head around all of the events I can make use of so that i can code the system close as I can to the goal.


 


So far I have captured:


  • NPC AI onSpellCast - caster of a hostile spell is recorded on the NPC

  • NPC AI onDamaged - damager is recorded on NPC

  • NPC DetermineCombatRound() - a valid target is recorded on the NPC

this is working well so far. I could add the OnAttacked event as well because a PC is participating if they attack. But I feel that it provides a loophole for a PC that knows they can simply ineffectually attack once then run away while the epic angel PC kills the dragon. Whereas if that ineffectual character is targeted as a result of their attack... they have influenced the combat enough to risk their death, and thus deserve a reward.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #34 on: April 26, 2014, 03:01:34 am »


               

So far I have captured:
  • NPC AI onSpellCast - caster of a hostile spell is recorded on the NPC

  • NPC AI onDamaged - damager is recorded on NPC

  • NPC DetermineCombatRound() - a valid target is recorded on the NPC

this is working well so far. I could add the OnAttacked event as well because a PC is participating if they attack. But I feel that it provides a loophole for a PC that knows they can simply ineffectually attack once then run away while the epic angel PC kills the dragon. Whereas if that ineffectual character is targeted as a result of their attack... they have influenced the combat enough to risk their death, and thus deserve a reward.




Scenario: sword and board fighter with an archery rogue against 3 mobs.


 



Fighter charges in and starts attacking mob 1.  Rogue picks off mob 2 with sneak attacks.  Fighter keeps attacking mob 1.  Rogue picks off mob 3 with sneak attack.  Fighter finishes off mob 1.


 



Result...


 


Fighter has damaged mob 1 and has DetermineCombatRound triggering for mobs 2 and 3.  He gets XP for all three mobs.


 



Rogue has damaged mobs 2 and 3.  He gets XP for two mobs.


 



Is this a situation you're happy with?



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #35 on: April 26, 2014, 04:03:28 am »


               

yup.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #36 on: April 26, 2014, 05:36:55 am »


               

Okay, so you changed your mind since the previous page?


 




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.




 




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




 


Can you see why I'm confused about what you're trying to have happen?  You've done a 180 on us.  Which is fine, of course, just very confusing.



               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #37 on: April 26, 2014, 03:15:16 pm »


               

Just a couple of things:


 


Why have it loop through the entire mod to check PCs rather than just the current area?


 


Why not tie XP to the ondamaged event rather than the ondeath?


 


I ask the last one because it seems to me, that actually damaging something should be worth some amount of XP, seeing as the action was successful.


 


If a monster has a set amount of XP it can reward, then the on damaged event could reward a % based upon the amount of damage inflicted, and give that amount to those present where it could be 80% of the reward goes to the damager, and the other 20% goes to the rest of the PCs in the area. A system such as this wouldn't worry about who is doing what, but primarily would reward the highest to the one that does the most damage to a monster.


               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #38 on: April 26, 2014, 03:25:10 pm »


               MM, I think you missed this

Participation is the criteria. You described the rogue as participating. Perhaps I misunderstood you. In either case. It doesn't really matter.

might have just been a misunderstanding.
 

Why have it loop through the entire mod to check PCs rather than just the current area?

GetFirstPC()
GetNextPC()

Why not tie XP to the ondamaged event rather than the ondeath?

Because this is about overcoming challenges. Tying XP to the damage event provides an unlimited supply of XP for PCs who torture a single foe.
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #39 on: April 26, 2014, 10:27:03 pm »


               


MM, I think you missed this

might have just been a misunderstanding.




Okay.  You realize a consequence of your current goal is that players will attempt to damage each enemy so they get credit for all of them rather than focus enemies down one at a time?  The rogue in our case will sneak attack mob 1, then immediately switch to mob 2 (without finishing off mob 1), then immediately switch to mob 3 (without finishing off mob 2).


 


It gets even messier if we add a third party -- imagine we have a fighter and 2 rogues.  You could wind up with a situation where there are five enemies, the fighter gets credit for all five (damages one and is attacked by all five) but each rogue only gets credit for two (each kills two) using reasonable tactics.  So 100% XP for the fighter and 40% XP for each rogue.


 


If that's acceptable for you, fine, you have a working system.  If it's not, we need to adjust the criteria somehow to make it so the rogues get credit for actively participating in the fight.



               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #40 on: April 27, 2014, 05:57:15 pm »


               




Because this is about overcoming challenges. Tying XP to the damage event provides an unlimited supply of XP for PCs who torture a single foe.




Actually, I think ondamaged is superior to onattacked in this regard, as it sets a higher bar. FWIW, you're running into the same difficulties I've been juggling. I'll post our current code when I get home, as I think it forms a useful baseline.


 


Past that, you would want some GetWasPCActiveAgainst check for mobs looped through in the ondeath where xp is given. My problem is a step harier in that regard, as I need to aggregrate data over a run. On net, though, I think active participation over a run might be easier to guage than in a single combat, depending on your metrics. Hmm. At least, it's easier to rule out one-time 'thought experiments' of certain types, and focus only on broadly cost-effective strategies for toying with the system.


 


Funky


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #41 on: April 27, 2014, 07:00:29 pm »


               

Oh btw henesua, the DetermineCombatRound is not a good place to track whether NPC attacks a PC. Afaik, merely all physical attacks on npc will cause the DetermineCombatRound to trigger with the attacker in it. Or its only ranged+melee behavior, not 100% sure at this moment. But you should take a closer look at this (yes hard to test).



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #42 on: April 27, 2014, 08:40:55 pm »


               

Actually, I think ondamaged is superior to onattacked in this regard, as it sets a higher bar. FWIW, you're running into the same difficulties I've been juggling. I'll post our current code when I get home, as I think it forms a useful baseline.




Funky, I am using the ondamaged event to determine when a PC has participated in the combat, but I am not handing out XP with every damage event as the poster I responded to was suggesting.


I look forward to seeing your code.

 



Oh btw henesua, the DetermineCombatRound is not a good place to track whether NPC attacks a PC. Afaik, merely all physical attacks on npc will cause the DetermineCombatRound to trigger with the attacker in it. Or its only ranged+melee behavior, not 100% sure at this moment. But you should take a closer look at this (yes hard to test).




Hmm... I will have to look at this more carefully then. I did have my doubts. This is the part of the function I stuck my flags in:



    // ----------------------------------------------------------------------------------------
    // DetermineCombatRound: ACTIONS
    // ----------------------------------------------------------------------------------------
    if(     GetIsObjectValid(oIntruder)
        &&(     GetObjectSeen(oIntruder) //1.71: AI passed an unseen intruder
            ||( GetHasFeat(2016) // Henesua - added ability for creatures with scent to sniff out an enemy
                //&&  GetObjectHeard(oIntruder)
              )
          )
      )
    {
        // anyone who participates in combat is flagged as a particpant (for the reward of XP later)
        if(GetIsPC(oIntruder))
            SetLocalInt(OBJECT_SELF, "COMBATANT_"+ObjectToString(oIntruder), GetTimeCumulative());
        else
            SetLocalInt(OBJECT_SELF, "COMBATANT_"+ObjectToString(GetMaster(oIntruder)), GetTimeCumulative());


               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #43 on: April 28, 2014, 12:54:00 am »


               

I see a few problems with this.


 


1) Characters in darkness can engage creatures in combat without being seen.


2) If a wizard/sorcerer possesses a familiar then the familiar would be the PC and the master would not be a PC.


3) A henchman's summon (or even a summon's summon) does not affect the PC's XP.



               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
XP OnDeath Only awarded for Participants in Combat
« Reply #44 on: April 30, 2014, 04:35:16 pm »


               

Here's our current ondeath:


 


http://pastebin.com/cgxYqwT5


 


It handles all sorts of situations where characters should not get xp, including some fairly clever ex^plo_its. It does not, however, do much in the way of bot detection. Sorry for the delay in posting, it's been a busy week.


 


Funky