alltrueist
Active Member
- Joined
- Dec 10, 2012
- Messages
- 1,424
***DISCLAIMER: I have no coding knowledge at all. Everything I've done with PureSWTOR has either been copy/pasting shit from Pure, or using Ama's framework. I lack any ability to figure this problem out myself, so I need a smart person to just show me once and I can copy that over to everything else***
Hey all,
I think I'm the last person working on Pure, which is probably not a good sign for the routine![Big Grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
Anyway, I've been getting sick of the way the bot will frequently skip higher-priority actions and get "stuck" repeat-casting a lower-priority spell. The best examples I can think of for this behavior are with Vigilance Guardians or Balance Shadows (although it happens with almost every class): the Guardian will keep casting Slash even though Master Strike/Plasma Brand/Overhead Slash/Blade Storm are off cooldown; the Shadow will keep casting Double Strike even after the DoTs have dropped off (he's supposed to re-cast DoTs with < 3 seconds left). There's nothing I can do code-wise to fix this issue, as I've tried to lock out Slash or Double Strike when the DoTs aren't up, but this just causes massive issues when the DoTs miss-- and the bot even ignores this req sometimes!
So I've been looking into Framelocking. I know Walter has mentioned this several times, which is why it came to mind. On several occasions, Walter has mentioned that Ama basically ported the Pure code from Honorbuddy, so I looked at PureRotation in depth, but couldn't find much about Framelocking. All I found was this bit of code from the RotationBehaviors file:
I ported that code into PureSWTOR, and it hasn't caused any crashes or problems:
But it also hasn't fixed anything. I tried putting this code into the RotationBase file AND into the individual Class file (Shadow Balance for testing purposes). In both cases the rotation ran fine, but I noticed not changes.
If I understand it correctly, Framelocking should cause the bot to freeze the game's frames as it completes each pass through the routine. This should potentially stop the issues I outlined above, as the bot can't get "stuck" because it only moves on after the ability has been cast.
What I need help with is understanding how the code I've found interacts with actual Framelocking. I imagine there's some element I'm missing. Google searches have been useless, and I've investigated TreeSharp, but only found something like
but I don't know how or where to utilize that, and I didn't see that function used at all in PureRotation.
So, does anyone know how we might Framelock PureSWTOR? I'd love for this routine to be as great as it can be, but I simply lack the coding knowledge necessary. I appreciate any and all help, but I find singular examples best as I can then learn through seeing/doing. As I said earlier, my knowledge of coding isn't strong enough to get into an abstract discussion![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
Thanks for all you do to keep this bot running.
Hey all,
I think I'm the last person working on Pure, which is probably not a good sign for the routine
![Big Grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
Anyway, I've been getting sick of the way the bot will frequently skip higher-priority actions and get "stuck" repeat-casting a lower-priority spell. The best examples I can think of for this behavior are with Vigilance Guardians or Balance Shadows (although it happens with almost every class): the Guardian will keep casting Slash even though Master Strike/Plasma Brand/Overhead Slash/Blade Storm are off cooldown; the Shadow will keep casting Double Strike even after the DoTs have dropped off (he's supposed to re-cast DoTs with < 3 seconds left). There's nothing I can do code-wise to fix this issue, as I've tried to lock out Slash or Double Strike when the DoTs aren't up, but this just causes massive issues when the DoTs miss-- and the bot even ignores this req sometimes!
So I've been looking into Framelocking. I know Walter has mentioned this several times, which is why it came to mind. On several occasions, Walter has mentioned that Ama basically ported the Pure code from Honorbuddy, so I looked at PureRotation in depth, but couldn't find much about Framelocking. All I found was this bit of code from the RotationBehaviors file:
Code:
#region Nested type: LockSelector
/// <summary>
/// This behavior wraps the child behaviors in a 'FrameLock' which can provide a big performance improvement
/// if the child behaviors makes multiple api calls that internally run off a frame in WoW in one CC pulse.
/// </summary>
private class LockSelector : PrioritySelector
{
public LockSelector(params Composite[] children)
: base(children)
{
}
public override RunStatus Tick(object context)
{
using (StyxWoW.Memory.AcquireFrame())
{
return base.Tick(context);
}
}
}
#endregion Nested type: LockSelector
I ported that code into PureSWTOR, and it hasn't caused any crashes or problems:
Code:
private class LockSelector : PrioritySelector
{
public LockSelector(params Composite[] children)
: base(children)
{
}
public override RunStatus Tick(object context)
{
using (BuddyTor.Memory.AcquireFrame())
{
return base.Tick(context);
}
}
}
But it also hasn't fixed anything. I tried putting this code into the RotationBase file AND into the individual Class file (Shadow Balance for testing purposes). In both cases the rotation ran fine, but I noticed not changes.
If I understand it correctly, Framelocking should cause the bot to freeze the game's frames as it completes each pass through the routine. This should potentially stop the issues I outlined above, as the bot can't get "stuck" because it only moves on after the ability has been cast.
What I need help with is understanding how the code I've found interacts with actual Framelocking. I imagine there's some element I'm missing. Google searches have been useless, and I've investigated TreeSharp, but only found something like
Code:
using (new FrameLock(true))
So, does anyone know how we might Framelock PureSWTOR? I'd love for this routine to be as great as it can be, but I simply lack the coding knowledge necessary. I appreciate any and all help, but I find singular examples best as I can then learn through seeing/doing. As I said earlier, my knowledge of coding isn't strong enough to get into an abstract discussion
![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
Thanks for all you do to keep this bot running.