- Joined
- Feb 9, 2009
- Messages
- 1,800
Hot dang you posted it!
Only the pure and righteous love shields...
Only the pure and righteous love shields...
(4 ratings)
Not necessary at all. Instead of:
- Beware of unusual interactions with recursion (or lack of) if damage is done immediately in shield events.
- Really, just delay damage by 0.00 seconds if you have to, or deal damage with custom projectiles.
exitwhen udg_ShieldIndex == 0 or udg_SystemShieldIterationStop == true
SystemShieldIterationStop
is being compared to the value true
. The comparison can be removed, leaving only SystemShieldIterationStop
BlzGroupUnitAt(group, index)
and BlzGroupGetSize(group)
.If you use Lua Damage Engine with Lua Fast Triggers, nothing will be evaluated or executed - only called.Added those optimizations, but also included the older disabled GUI versions of the triggers in case someone unfamiliar with JASS wanted to look through it. Unlikely, but possible. Might rewrite more parts in JASS, but will probably also keep GUI variants around somewhere.
There are probably more optimizations that could be possible, but would otherwise sacrifice some friendliness to more basic users snooping around trying to understand it.
Also did some testing with the shield display. It was unbearably laggy with only 100 shields updating 32 times a second. Reduced bars from 66 characters to 50 characters (132 characters to 100 since '|' requires "||" to display), increased font size slightly to compensate. Changed around part of the shield system, added the "shield health modified" generic event, and updated the current default display system.
You can see how laggy it is by typing "-shieldall" in chat. It's still very bad, but it stops lagging once the shield bars stop updating, due to now only updating the string/texttag when necessary, rather than all the time.
Short of redoing everything in Lua, for faster string manipulation, and better data manipulation (no need for linked lists, dynamic arrays + cache benefits, etc), I can't think of other ways to get meaningful speed increases out of it.
One such possibility was to do everything in trigger conditions, or rather, all the TriggerExecute() calls could be swapped for TriggerEvaluate() (which for whatever reason is faster), but GUI users can't actually do things in the condition part of a trigger, unfortunately.
Damage Engine has a Lua Unit Indexer included in the Lua demo map.Requirements:
So there is mutually exclusive items.
How i can install both, if Damage Detection working in Lua mode and Indexer in JASS ?
So while this is nifty and all, it lags like snails, tortoises and even absolute zero if there are too many units (tried with the peasants+12x12 footmen) on the map with shields on at the same time.
Not only that but floating text has a limit of appearance. Only about a certain number of them can be seen/created at the same time.
It's good for about 10 heroes/units or so at a time but can't be used for full scale battles like in StarCraft.
I 99% use GUI.Too many events. Lua allows function calling to replace the trigger evaluations, so that's not a blanket solution.
I 99% use GUI.
Can Lua bypass the floating text appearance/creation limitation or the staggering of units due to multiple commands when they are 100+ under one player?
Well that's your opinion, but since WC3 is far more sluggish since the introduction of the latest patch, people are noticing performance issues where there previously were none. With Damage Engine the performance of the event execution sequence is very critical. The minor performance delta in coding with GUI or script is nothing compared to being able to prevent trigger execution spam many times per second in battle.I don't know the system but I believe there exist more critical performance issues in GUI, other than calling function vs trigger evaluations.
You're evidently stating something as you know for sure that the Lua way of calling functions is the fix for having lags. And I'm saying there may be other potentials risks. Unit group operations by its nature for example have and had always perfomance issues, when done too often. Especially in GUI.
Eh? How? You can't attach them to units. They're basically some default dead things effect. You can't scale them, you can't move them only destroy and recreate them, I don't know... Do they always stay on top like health/mana bars and floating text? They're basically images. You can't manipulate them as in change them according to integer/string variables.For the other two, no, but Ubersplats can work as a text tag alternative.
I have no idea what my memory just conjured up then - I tried Googling what I understood was the source of that info but definitely nothing.Eh? How? You can't attach them to units. They're basically some default dead things effect. You can't scale them, you can't move them only destroy and recreate them, I don't know... Do they always stay on top like health/mana bars and floating text? They're basically images. You can't manipulate them as in change them according to integer/string variables.
function Trig_DisplayUpdateForUnitVisibility_Func002A takes nothing returns nothing
local integer i=0
set udg_ShieldUnitIndex=GetUnitUserData(GetEnumUnit())
loop
exitwhen i > bj_MAX_PLAYERS
if IsUnitVisible(GetEnumUnit(), GetLocalPlayer()) then
call SetTextTagVisibility(udg_UnitShieldTag[udg_ShieldUnitIndex], true)
else
call SetTextTagVisibility(udg_UnitShieldTag[udg_ShieldUnitIndex], false)
endif
set i=i + 1
endloop
endfunction
function Trig_DisplayUpdateForUnitVisibility_Actions takes nothing returns nothing
call ForGroupBJ(udg_SystemShieldedUnits, function Trig_DisplayUpdateForUnitVisibility_Func002A)
call EnableTrigger(gg_trg_DisplayOnPostPeriodic)
endfunction
//===========================================================================
function InitTrig_DisplayUpdateForUnitVisibility takes nothing returns nothing
set gg_trg_DisplayUpdateForUnitVisibility=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(gg_trg_DisplayUpdateForUnitVisibility, 0.03)
call TriggerAddAction(gg_trg_DisplayUpdateForUnitVisibility, function Trig_DisplayUpdateForUnitVisibility_Actions)
endfunction