Found two major flaws in my spellcasts that led to the horrendous lag people have noticed. After correcting them, play is *much* smoother.
1) I used an inherited group for a handful of sets that the code potentially depends on, but didn't want to force people to remember them or need to add them for irrelevant stuff. Well, Spellcast, when it's searching for a set, searches the entire base group before searching the current group. With 5-10 sets searched for on every action (due to the way I construct $CurrentSet), this increased the amount of searching Spellcast had to do a good bit.
Fix: I no longer use the Base-Group. I'll keep it in the include for reference, and then just copy all those sets when constructing a new xml. The other derived groups (eg: Abyssea-Group, Salvage-Group, etc) will still go through this process, but since most of the sets will be in the base group that's being searched (rather than almost none of them), while the number of sets in the child group are small, this should have a much lower impact on performance.
2) When finally equipping sets, I had the following code in the Include file:
Code:
<if status="resting">
<equip when="all" set="Resting-$RestMode" />
</if>
<else>
<equip when="idle|engaged" set="$CurrentSet" />
<!-- Change to <equip> line if you want to test current direct lag. -->
<!--<equip when="aftercast" set="$CurrentSet" /> -->
<command when="aftercast">$UpdateAftercast</command>
</else>
This seemed reasonable, as I expected it to do nothing with the "idle|engaged" equip command for any normal actions. Turns out I was wrong. $CurrentSet was expanded and constructed for that line even though it wasn't being used. Essentially, it was doing a whole lot of wasted work that was just getting thrown out, and all that work really bogged things down.
Fix: Rewrote that section to:
Code:
<if status="resting">
<equip when="all" set="Resting-$RestMode" />
</if>
<elseif Spell="Autoset">
<equip when="idle|engaged" set="$CurrentSet" />
</elseif>
<else>
<!-- Change to <equip> line if you want to test current direct lag. -->
<equip when="aftercast" set="$CurrentSet" />
<!-- <command when="aftercast">$UpdateAftercast</command> -->
</else>
A test run on thf in Dynamis, where I've been having a lot of this lag problem lately, pretty much cleared out the problems entirely.
Note: I also switched away from the aftercast command that was previously used to (hopefully) alleviate lag. With this change it isn't needed anymore (at least on my system).
Aside from that I also streamlined a bit of the normal processing code, so might get a tiny bit faster from that.
Anyway, I'm noting this here so that people can tweak their own copies and receive the benefits of this change. Unfortunately I'm also in the midst of two other changes to my code, so just uploading my current copies will break things for people.
Other changes I'm working on:
At Yugl's suggestion, I'm splitting up my Include file into two files: Mote-Config-Include.xml (which just includes vars and set definitions) and Mote-Rules-Include.xml (which just includes rules). I think this will be a bit easier to manage. Be sure to get both files when the changeover occurs.
I'm changing several custom trigger parameters to start with periods if they were previously single words. This is to prevent problems with Spellcast automatically matching it with the name of a player, mob or object nearby. EG: "Manual" -> "Field Manual"; changing to ".Manual". "On" -> "Clionid"; changing to ".On". Etc.
That will also require changing some of the keybinds I suggest in the reference notes.