Hmm, for me the first solution seems to work best, probably because the effect get's triggered every 5 seconds from each of those buildings, and there could possibly be very many of those. When I tested, the second solution had huge lagspikes every 5 seconds at 100 buildings, while the first solution only stuttered for a little at 1200.
Hmm, that seems like a very nice solution :)
Only thing I'll change is creating a global unit group variable with all the units that have the behavior in it
Seems to work flawless and fluid even with 700 (or something) of those structures on the map, though it beguns to stutter a little at 1240 (I don't think anyone would build this many, they couldn't even move..)
from a performance perspective, does it make any difference whether I use
Timer-Every5.0secondsofGameTime
And select all units with the behavior "MarketGold" in a group to do something with every single one of them
or
Environment-PlayerAnyPlayerusesEffectMarketGold
And do something with the unit that cast the effect?
(The effect MarketGold is a periodic effect of the behavior MarketGold with an interval of 5 seconds)
And do you think that such things could hurt the performance hard?
For instance, I'm creating a floating text for every single unit with that behavior, the player is basically not restricted in the number of that units (even though they cost relatively much)
I mean, using the effect as an event for the trigger seems to consume more time, and that seems only logical. But putting every unit with that behavior into a unit group to do the same doesn't seem like the best solution to me either
well my floating text just won't fade out but disappear.
It's based on the Pickup 100Minerals Floating Text Actor and Text Actor I believe, so it should fade..
I wouldn't say triggers with periodic events are laggy triggers, but everything that triggers periodically hits the overall performance at least a very tiny bit, in most cases not even noticable I'd say. For example, if you'd do extremly complex math every 0.2 seconds, yes that would lag. Probably less with an condition or so, but then it would lag every time that condition returns true (and checking the condition every time is also hitting the performace just a little bit)
Yes, the unit is cloaked and shall gain some opacity as soon as an enemy detector detects the unit. I used a buff because I didn't know how else I could accomplish this, your suggestions also don't seem to work for me, maybe I'm doing something wrong.
UnitDetectedByViewer makes the unit full opacity as soon as I see it on my screen, ModelEvent.CloakOn/Off don't do anything and the flag "visible" is always true for myself, I don't know how exactly I should compare this from other players.
I think I may just let it be, could also be better from a gameplay perspective.
Though I'm still curious how this should be done..
That also doesn't work, unfortunately.
The only solution I've found is checking the area around the unit for any detectors, but that is suboptimal as it is inaccurate (the detector range doesn't matter) and performance-hitting I suppose. Seems like a pretty ugly workaround for me
You could try adding the kills of the locusts to the Swarm Host and buff him based on his own kills, I don't know if that is even possible (should be) but it may be worth a try.
What kind of behaviors and abilities does the unit have? Is it part of some trigger?
Can't really think of what that might be, maybe with more information
I'm trying to change all the different values of this validator around, I just can't get it to work... If it really is for checking if my unit can detect other units, then it's labelled wrong. Haven't tried the Other Unit value yet, seems kinda illogical because there is no reference unit, but I'll give it a try. Thanks for your efforts.
Hey,
Is there a possibility to check if a unit is detected?
I wanted to increase the actor's opacity if detected, however the "Unit Detected" validator doesn't seem to work.
When I gave the unit a dummy-behavior with "Validator (Disable): Unit detected" and added an "behavior.off"-event to the actor, nothing happened.
But if I use "Validator (Remove): Unit detected" with an "behavior.destroy"-event in the actor it kinda works, even though my own unit also becomes opaque regardless if there is an enemy detector nearby. Also I don't know how to apply the behavior again afterwards, since it would've get destroyed.
0
@FunkyUserName: Go
I guess doing one unit per frame would decrease the performance-hit significantly, thanks for the idea :)
Edit: Wait.. no, that wouldn't work
0
Hmm, for me the first solution seems to work best, probably because the effect get's triggered every 5 seconds from each of those buildings, and there could possibly be very many of those. When I tested, the second solution had huge lagspikes every 5 seconds at 100 buildings, while the first solution only stuttered for a little at 1200.
0
Hmm, that seems like a very nice solution :) Only thing I'll change is creating a global unit group variable with all the units that have the behavior in it
Seems to work flawless and fluid even with 700 (or something) of those structures on the map, though it beguns to stutter a little at 1240 (I don't think anyone would build this many, they couldn't even move..)
Thank you very much!
0
Just a simple question,
from a performance perspective, does it make any difference whether I use
And select all units with the behavior "MarketGold" in a group to do something with every single one of them
or
And do something with the unit that cast the effect? (The effect MarketGold is a periodic effect of the behavior MarketGold with an interval of 5 seconds)
And do you think that such things could hurt the performance hard? For instance, I'm creating a floating text for every single unit with that behavior, the player is basically not restricted in the number of that units (even though they cost relatively much)
I mean, using the effect as an event for the trigger seems to consume more time, and that seems only logical. But putting every unit with that behavior into a unit group to do the same doesn't seem like the best solution to me either
0
I indeed meant the data-variant and fading in opacity, kinda unfortunate that it doesn't do that with data. Welp then I'll just trigger it, thanks.
0
Hey,
well my floating text just won't fade out but disappear. It's based on the Pickup 100Minerals Floating Text Actor and Text Actor I believe, so it should fade..
0
@joemart06: Go
I wouldn't say triggers with periodic events are laggy triggers, but everything that triggers periodically hits the overall performance at least a very tiny bit, in most cases not even noticable I'd say. For example, if you'd do extremly complex math every 0.2 seconds, yes that would lag. Probably less with an condition or so, but then it would lag every time that condition returns true (and checking the condition every time is also hitting the performace just a little bit)
Sorry for sneaking into this thread
0
@FunkyUserName: Go
Yes, the unit is cloaked and shall gain some opacity as soon as an enemy detector detects the unit. I used a buff because I didn't know how else I could accomplish this, your suggestions also don't seem to work for me, maybe I'm doing something wrong.
UnitDetectedByViewer makes the unit full opacity as soon as I see it on my screen, ModelEvent.CloakOn/Off don't do anything and the flag "visible" is always true for myself, I don't know how exactly I should compare this from other players.
I think I may just let it be, could also be better from a gameplay perspective. Though I'm still curious how this should be done..
0
That also doesn't work, unfortunately. The only solution I've found is checking the area around the unit for any detectors, but that is suboptimal as it is inaccurate (the detector range doesn't matter) and performance-hitting I suppose. Seems like a pretty ugly workaround for me
0
You could try adding the kills of the locusts to the Swarm Host and buff him based on his own kills, I don't know if that is even possible (should be) but it may be worth a try.
0
What kind of behaviors and abilities does the unit have? Is it part of some trigger? Can't really think of what that might be, maybe with more information
0
I'm trying to change all the different values of this validator around, I just can't get it to work... If it really is for checking if my unit can detect other units, then it's labelled wrong. Haven't tried the Other Unit value yet, seems kinda illogical because there is no reference unit, but I'll give it a try. Thanks for your efforts.
0
Hey, Is there a possibility to check if a unit is detected?
I wanted to increase the actor's opacity if detected, however the "Unit Detected" validator doesn't seem to work. When I gave the unit a dummy-behavior with "Validator (Disable): Unit detected" and added an "behavior.off"-event to the actor, nothing happened.
But if I use "Validator (Remove): Unit detected" with an "behavior.destroy"-event in the actor it kinda works, even though my own unit also becomes opaque regardless if there is an enemy detector nearby. Also I don't know how to apply the behavior again afterwards, since it would've get destroyed.
Is there some semi-easy solution to this?