Spell FarSightBJ

Bribe

vJass errors are legion
Reaction score
67
Fair enough.

Then I don't get why you are not using just using a customized dust of appearance, plus a fogmodifier. Because the dust of appearance sets a unit detected without making it completely visible.

You could make a dust of appearance with max predicted radius, for example, with a custom buff. And pick all units in that radius and remove the buff if they are not in the dynamic range. That's one, simple way to do it.

Although it still would not be modular enough to be a system, it could at best be a spell.
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
Ok an update:

1. Now uses a multiplayer compatable/sync TSA aka PolledWait with nulled timer.
2. Also uses the proposed method by Bribe for invisible detection [tnx =) Bribe] and his optimization for only creating 1 rect and just "spamming"/using SetRect.
3. It now uses 1 xecast instance which could be thought as an optimization as well.
 

Bribe

vJass errors are legion
Reaction score
67
You do this whole thing completely overkill and it bugs.

Dust of Appearance with collision 32 could affect flying air units above, for example.

Is its buff really hardcoded? That's quite depressing. So even removing the buff from unwanted units == false.

You don't need a region and a bunch of rects in this, better to just use a periodic group enum check, say every 0.5 seconds should be enough for this one.
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
Bribe:
1. Dust of Appearance with collision 32 could affect flying air units above, for example.
2. You don't need a region and a bunch of rects in this, better to just use a periodic group enum check, say every 0.5 seconds should be enough for this one.
3. So even removing the buff from unwanted units == false.
4. You do this whole thing completely overkill and it bugs.

1. Well after a copy of Dust of Appearance ability is made it's pretty easy to change the targets allowed.
2. I don't think so. It would be inaccurate and slower.
3. I've never seen the detected buff being used in any UMS map, so I don't think this is a problem.
4. Bugs?
 

Bribe

vJass errors are legion
Reaction score
67
Note that "bugs" came right before saying how the AoE will be able to hit air units above it. But now that I think of it this is not such a problem.

I don't know where you get the idea that your way is faster. Periodic group enum with a FirstOfGroup loop every 0.5 seconds is pretty efficient, uses no pointless regions, rects, triggers, conditions, and does not need to remove/destroy any of them, making it wicked light on RAM as well. If you are worried about the accuracy even with something as easy and infrequeent as a simple "reveal" then lower the timer a little bit.

This isn't wc3c.net where you need to use huge bulky waste of space systems to do a simple cast, you could use DummyCaster by Jesus4Lyf, for example, which fits better for TheHelper.net people.
 

Dirac

22710180
Reaction score
147
Offtopic:
Out of plain curiosity, is it FirstOfGroup really faster than common ForGroup or EnumGroup calls? are unit arrays even more faster than groups?
 

Bribe

vJass errors are legion
Reaction score
67
ForGroup and Enum filters open up new threads, and new threads are incredibly expensive operations. If you insist on using a filter or a for group or a FirstOfGroup loop, then choose one of the three. But FirstOfGroup is best because it gives you access to locals without re-declaring them, does not open up a new thread...

We do need some FPS benchmarks to show the speed difference, however.
 

Dirac

22710180
Reaction score
147
Benchmark Time (groups with 8 units inside)
JASS:
scope Tests
    // 24 - 27 fps
    private struct Main extends array
        private static method period takes nothing returns nothing
            local group g
            local unit u
            local integer i=150
            loop
                exitwhen 0==i
                set g=CreateGroup()
                call GroupEnumUnitsInRange(g,0,0,600,null)
                loop
                    set u=FirstOfGroup(g)
                    exitwhen null==u
                    call GroupRemoveUnit(g,u)
                endloop
                call DestroyGroup(g)
                set i=i-1
            endloop
            set g=null
            set u=null
        endmethod
        private static method onInit takes nothing returns nothing
            call TimerStart(CreateTimer(),0.005,true,function thistype.period)
        endmethod
    endstruct
endscope
JASS:
scope Tests
    // 5 fps - crashes
    private struct Main extends array
        private static method enum takes nothing returns boolean
            return false
        endmethod
        
        private static method period takes nothing returns nothing
            local group g
            local integer i=150
            loop
                exitwhen 0==i
                set g=CreateGroup()
                call GroupEnumUnitsInRange(g,0,0,600,Filter(function thistype.enum))
                call DestroyGroup(g)
                set i=i-1
            endloop
            set g=null
        endmethod
        private static method onInit takes nothing returns nothing
            call TimerStart(CreateTimer(),0.005,true,function thistype.period)
        endmethod
    endstruct
endscope
Proof that FirstOfGroup is actually faster
 

Bribe

vJass errors are legion
Reaction score
67
That looks pretty reasonable, logically.

I wonder what it would be like for a lower number of units? I'm sure it'd be consistently faster though.
 

tooltiperror

Super Moderator
Reaction score
231
No.

I see no reason to use this over Far Sight ability, and maybe some triggered enhancements. For your Day/Night Dilemma, you can use 2 different abilities and swap them at day and night. This library is massive overkill, and "BJ", as Dirac pointed out, is Blizzard Jass.

Graveyarded.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top