some quick findings with interrupt code...

Discussions on various DOL development features

Moderator: Support Team

some quick findings with interrupt code...

Postby ontheDOL » Tue May 23, 2017 12:40 am

firstly, this could all be bullsh*t , as i've been known to post stuff that I very quickly test... :D

anyway, I took a look at interrupt code as I was trying to improve my caster brain.

first thing i saw was this method thats is only called within SpellHandler by CasterIsAttacked
Code: Select all
public virtual bool ChanceSpellInterrupt(GameLiving attacker) { double mod = GetConLevel(attacker); double chance = BaseInterruptChance; chance += mod * 10; chance = Math.Max(1, chance); chance = Math.Min(99, chance); if (attacker is GamePlayer) chance = 99; return Util.Chance((int)chance); }
The logic doesn't seem too bad until the "if (attacker is GamePlayer) chance = 99;" . As there is no override of this method in GamePlayer.cs, all PvP attacks are sent here and results in a level 1 player can interrupt a level 50 everytime.

So I put an override in GamePlayer, creating some calculation and tested again. Level 1 player was still interrupting level 50.
Which brought me to this method
Code: Select all
public virtual void StartInterruptTimer(int duration, AttackData.eAttackType attackType, GameLiving attacker) { if (!IsAlive || ObjectState != eObjectState.Active) { InterruptTime = 0; InterruptAction = 0; return; } if (InterruptTime < CurrentRegion.Time + duration) InterruptTime = CurrentRegion.Time + duration; if (CurrentSpellHandler != null) CurrentSpellHandler.CasterIsAttacked(attacker); if (AttackState && ActiveWeaponSlot == eActiveWeaponSlot.Distance) OnInterruptTick(attacker, attackType); }
using breakpoints, this was always being called "InterruptTime = CurrentRegion.Time + duration;" ( its above the spellhandler code after all)
I could time my key press on the spell every second or so and I constantly had a 2 second interrupt timer. If i spammed the spell I could sneak a spell in, but i think this method gets called a few times during a spell cast (could be wrong)

anyway I rearranged this a little bit and it seemed to work ok (super quick test with my new override logic in Gameplayer)
Code: Select all
public virtual void StartInterruptTimer(int duration, AttackData.eAttackType attackType, GameLiving attacker) { if (!IsAlive || ObjectState != eObjectState.Active) { InterruptTime = 0; InterruptAction = 0; return; } if (CurrentSpellHandler != null && CurrentSpellHandler.CasterIsAttacked(attacker)) { InterruptTime = CurrentRegion.Time + duration; return; } if (ChanceSpellInterrupt(attacker)) InterruptTime = CurrentRegion.Time + duration; if (AttackState && ActiveWeaponSlot == eActiveWeaponSlot.Distance) OnInterruptTick(attacker, attackType); }
anyway, just some ramblings! like I said, could all be bullsh*t!
- Unty -
Model Showroom and DOL guides
http://losojos-001-site1.btempurl.com
User avatar
ontheDOL
Developer
 
Posts: 311
Joined: Fri May 20, 2016 4:21 am
Location: Australian abroad

Re: some quick findings with interrupt code...

Postby Graveen » Tue May 23, 2017 12:41 pm

Darwin made tests long time ago, and it appeared there was an interrupt system working by 1/3:
1/3 you start casting and can being rupt
2/3 you cannot been rupt but move will still rupt your own spell
3/3 nothing rupt spell will be launched w/e you do

Well it appeared the DOL code was not livelike. On my side i'd suggest:
- rupt in all cases except spell/ability is specifically marked "not rupting" (which should be a property of the spell/ability, like insta debuff received / being healed / entering into sprint etc...)
(i still dunno if DOT ticks above 1st are interrupting or not ^^)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: some quick findings with interrupt code...

Postby Leodagan » Tue May 23, 2017 3:32 pm

Be careful on the logic there :

A spell cast being "Interrupted" in Phase 2/3 has a high chance of not interrupting the current cast and launch the spell anyway...

BUT the Interrupt timer is still started (this is live like) and your next cast will have to wait for the Interrupt Timer to expire !

I remember a recent Grab Bag discussing this matter on the official web site, try to lurk through their recent history :D
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: some quick findings with interrupt code...

Postby ontheDOL » Tue May 23, 2017 4:15 pm

Aye , the interrupt timer still needs to be started, but only if it is "successful" after being checked by a interrupt method(chancespellinterrupt?). Currently , a grey con mob attacking me (even "missing" the attack) is still starting the interrupt timer.
http://imgur.com/a/xm2Ud

now, Im just going off memory ( This can be a very bad way to do things :D ) but casting with a grey mob/player attacking you, you have high chance of success, scaling up through green/blue/yellow with yellow almost 100% chance of interrupt and certainly oj+ 100%

this is not only for the spell to not be interrupted mid cast, but also to NOT have an interrupt timer already blocking the next cast (what the grey con is doing currently)
- Unty -
Model Showroom and DOL guides
http://losojos-001-site1.btempurl.com
User avatar
ontheDOL
Developer
 
Posts: 311
Joined: Fri May 20, 2016 4:21 am
Location: Australian abroad

Re: some quick findings with interrupt code...

Postby Leodagan » Wed May 24, 2017 5:26 am

Yeah I don't think a grey con mob should prevent you completely from casting any spells...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: some quick findings with interrupt code...

Postby Shursan » Tue Jan 26, 2021 6:03 pm

As i remember, rupt code is only firing if you are actively casting a spell.. we changed it to fire a rupt also when you are not casting..
Origins/Genesis Administrator
Shursan
Server Representative
 
Posts: 375
Joined: Mon Jun 22, 2009 8:25 pm
Location: France


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 1 guest