-
December 21st, 2022, 06:36 #21
Not sure this is relevant but AURA just got a make over and part of that was to speed it up. It was processing a ridiculous amount of trivial onMove's and now only processes if it has moved from last reported position more than 1/2 a grid unit (Kluding where it will err on the side of processing).
Here is the crappy kludge that helped speed up the massive campaigns I run... (also carrier will soon be doing this same thing - prints showed both AURA and Carrier were receiving an insane amount of moves on certain maps)
Code:local TokenMoveArray = {} local function tokenMovedEnough(token) -- cleanup after every 20 tokens received - we are not looking for perfect just trimming down processing time if #TokenMoveArray >= 20 then TokenMoveArray = {} end local imageControl = ImageManager.getImageControl(token, false) if imageControl then local x, y = token.getPosition() for i = 1, #TokenMoveArray, 1 do if token == TokenMoveArray[i].token and imageControl == TokenMoveArray[i].imageControl then -- Determine if moved more than 1/2 the grid unit local nGridSize = imageControl.getGridSize() * 0.5 if (x - TokenMoveArray[i].x) ^ 2 + (y - TokenMoveArray[i].y) ^ 2 < nGridSize * nGridSize then return false end table.remove(TokenMoveArray, i) break end end table.insert(TokenMoveArray, { token = token, imageControl = imageControl, x = x, y = y }) else return false end return true end local onMove = nil local function auraOnMove(tokenMap, ...) if onMove then onMove(tokenMap, ...) end local nodeCT = CombatManager.getCTFromToken(tokenMap) if Session.IsHost and nodeCT then if tokenMovedEnough(tokenMap) then local rActor = ActorManager.resolveActor(nodeCT) if rActor then -- Debug.chat("onMove aura update", tokenMap) notifyTokenMove(tokenMap) end end end end
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
December 21st, 2022, 14:01 #22
Thanks. The jiggle was how I forced it to update prior to 4.3.1, but it no longer works. Tried upping the jiggle from 1 pixel to 1 square and back, but to no avail. Any chance we could get something added in the future to force a redraw (like an invalidate call)?
-
December 24th, 2022, 01:47 #23
Okay, found a workaround, which is far from elegant but seems to work. The jiggle back and forth right next to each other doesn't work but moving the token by one pixel (not back again) does. On the next adjustment to height, I move it back, which updates the arrow again. So basically, if token is centered on a half-square grid, move it by one. If not, move it back to be centered. Had to snap to the center in my distance calculation, but not a bad thing to do. So looks a bit odd but all the behavior is correct, so not too bad. Would still be great to be able to force a pointer update, though.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks