wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > - Submit a resource -
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-16-2011, 11:26 AM   #16
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by Anitarf
You need proof that a function which inlines to a GetUnitUserData call is faster than a non-inlineable function which contains a GetUnitUserData call in addition to an if statement? Now you're just trolling.
No, I just need proof that Autoindex is faster than PUI,
I already explained why you can't just compare the speed of those two functions (post #9)

Maybe a bit of statistics will help:
Autoindex size (without header comments) : 520
PUI size (without header comments): 93

Pretty big difference for two things doing the same job.

EDIT:
Just to be clear, I am not trying to put Autoindex down.
But I also won't let anyone put PUI down, because PUI is not just some random new library.
it was the first indexing sytem, it was tested and tried in real games and it still does the job it was supposed to do.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-16-2011 at 01:23 PM.
cohadar is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-16-2011, 01:07 PM   #17
Bribe
User
 
Bribe's Avatar
 
Join Date: Mar 2010
Posts: 233

Submissions (1)

Bribe will become famous soon enough (30)Bribe will become famous soon enough (30)

Send a message via AIM to Bribe
Default

If your system supported unit index locks then it wouldn't be such a problem, because then you don't need the "on deindex" events. I also think the GetIndexUnit function should be able to inline to a direct array lookup because if the unit user data is invalid it returns null anyway.

Using the periodic recycler with a doubly-linked index is more viable because then you don't have to loop 1-1024, you just then loop over however many you have.
Bribe is offline   Reply With Quote
Old 12-16-2011, 01:21 PM   #18
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by Bribe
If your system supported unit index locks then it wouldn't be such a problem, because then you don't need the "on deindex" events. I also think the GetIndexUnit function should be able to inline to a direct array lookup because if the unit user data is invalid it returns null anyway.
Try reading the thread more carefully please, I am sick of explaining stuff over and over.

Quote:
Originally Posted by Bribe
Using the periodic recycler with a doubly-linked index is more viable because then you don't have to loop 1-1024, you just then loop over however many you have.
Nope, using lists is bad idea.
Here are some hints for you:
  • timer period is a fixed constant.
  • recycler attempts only one recycling operation per timer tick.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-16-2011 at 01:27 PM.
cohadar is offline   Reply With Quote
Old 12-16-2011, 01:35 PM   #19
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

The truly perfect unit indexer is really simple in essence but requires a full control of unit creating/removing by triggers. (unit creation -> index, unit removing -> deindex)
In a highly triggered custom map that can be done, but it's a too big requirement for a public resource.

Btw i don't get what are you not just using a timer for your period recycler.

And to compare PUI against AutoIndex, i would say that in heavy usage of the unit user data, AutoIndex will obviously win, and anyway the extra stuff on an unit creation should be negligible against the unit creation by itself.
But it's not the same story when you remove an unit, mostly because of the hook.
I wouldn't say that is negligible.

PS : A library with a such name leads to trolling anyway.
__________________
Cool != Useful

Last edited by Troll-Brain : 12-16-2011 at 01:49 PM.
Troll-Brain is offline   Reply With Quote
Old 12-16-2011, 01:57 PM   #20
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by Troll-Brain
The truly perfect unit indexer is really simple in essence but requires a full control of unit creating/removing by triggers. (unit creation -> index, unit removing -> deindex)
In a highly triggered custom map that can be done, but it's a too big requirement for a public resource.
No, the perfect unit indexing is when you index only those units that actually ask for an index, and that is what PUI does.
PUI = Perfect Unit Indexing :P

Quote:
Originally Posted by Troll-Brain
Btw i don't get what are you not just using a timer for your period recycler.
Because it does not matter?

Quote:
Originally Posted by Troll-Brain
And to compare PUI against AutoIndex, i would say that in heavy usage of the unit user data, AutoIndex will obviously win, and anyway the extra stuff on an unit creation should be negligible against the unit creation by itself.
But it's not the same story when you remove an unit, mostly because of the hook.
I wouldn't say that is negligible.
No, sorry, imaginary benchmarks do not count.
Because what is obvious is that earth is a flat surface, and sun revolves around it.

PUI was used in element TD without any problems,
it is still used in Tropical Tower Wars,
and I can't imagine any map type that has bigger production of units that tower defense maps, so all this talk about PUI being slow is just hogwash.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 12-16-2011, 02:08 PM   #21
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

Quote:
Originally Posted by cohadar
No, the perfect unit indexing is when you index only those units that actually ask for an index, and that is what PUI does.
PUI = Perfect Unit Indexing :P

Well, anyway the perfection is just a matter of point of view.
But i hate when there is unecessary stuff in the background (if it's reasonable to avoid them).
Also, i think you've missed an important part of my PUI.
You don't want to index an unit ? Right, simply use CreateUnit and you're done.

Quote:
Because it does not matter?

It also really doesn't make sense, hell, your code will be even shorter ...

Quote:
No, sorry, imaginary benchmarks do not count.

That's not a secret that an unit creation is the most expensive thing in jass.
Same for TriggerEvaluate, i mean it opens a new thread, and it's not the lightest thing in jass.

Quote:
Because what is obvious is that earth is a flat surface, and sun revolves around it.

Great, i started to believe that i was the only one who got the truth.

Quote:
PUI was used in element TD without any problems,
it is still used in Tropical Tower Wars,
and I can't imagine any map type that has bigger production of units that tower defense maps, so all this talk about PUI being slow is just hogwash.

I'm not saying PUI is unusable, neither that is slow, we are just comparing two scripts here.
__________________
Cool != Useful

Last edited by Troll-Brain : 12-16-2011 at 02:11 PM.
Troll-Brain is offline   Reply With Quote
Old 12-16-2011, 02:17 PM   #22
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by Troll-Brain
Same for TriggerEvaluate, i mean it opens a new thread, and it's not the lightest thing in jass.
It does? You sure about that? (I really don't know)
Link for this?

Wait, you are claiming that timers don't open new thread?

Ah, the depths of jass.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-16-2011 at 02:19 PM.
cohadar is offline   Reply With Quote
Old 12-16-2011, 02:38 PM   #23
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

Quote:
Originally Posted by cohadar
It does? You sure about that? (I really don't know)
Link for this?

100 % sure, you can test it yourself easily, it resets the limit op, same for each trigger conditions, or any other boolexpr.

Quote:
Wait, you are claiming that timers don't open new thread?

No i'm not.

Collapse JASS:
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterTimerEvent(trig, PERIOD, true)
    call TriggerAddCondition(trig, Condition(function UnitIndex.Recycler))
endfunction

instead of that :

Collapse JASS:
private function Init takes nothing returns nothing
    call TimerStart(CreateTimer(),PERIOD,true,function UnitIndex.Recycler)
endfunction

I don't know what to choice, hmm, it's pretty hard, right ?

Not to mention that it also doesnt make sense that the UnitIndex.Recycler returns a boolean.

Also vJass hooks -> TriggerEvaluate
AutoIndex -> hook RemoveUnit ...

Quote:
Ah, the depths of jass.

Agreed, but i think you've also missed some vJass depth.
The typecast code -> boolexpr is meant to be implicit in vJass, even if i remember correctly it doesn't always work, sometimes (can't remember when and how) it has to be explicit.
You could fix that btw.
__________________
Cool != Useful

Last edited by Troll-Brain : 12-16-2011 at 03:00 PM.
Troll-Brain is offline   Reply With Quote
Old 12-16-2011, 03:16 PM   #24
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by Troll-Brain
Also vJass hooks -> TriggerEvaluate
AutoIndex -> hook RemoveUnit ...

Riiiiiiiiiiight, lets check that.

Collapse PUI initialization:
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterTimerEvent(trig, PERIOD, true)
    call TriggerAddCondition(trig, Condition(function UnitIndex.Recycler))
endfunction

Collapse Autoindex initialization:
    private static method onInit takes nothing returns nothing
        local region maparea = CreateRegion()
        local rect bounds = GetWorldBounds()
        local group g = CreateGroup()
        local integer i = 15
            static if not UseUnitUserData then
                set ht = InitHashtable() //Only create a hashtable if it will be used.
            endif
            loop
                exitwhen i < 0
                call SetPlayerAbilityAvailable(Player(i), LeaveDetectAbilityID, false)
                //Make the LeaveDetect ability unavailable so that it doesn't show up on the command card of every unit.
                call TriggerRegisterPlayerUnitEvent(order, Player(i), EVENT_PLAYER_UNIT_ISSUED_ORDER, null)
                //Register the "EVENT_PLAYER_UNIT_ISSUED_ORDER" event for each player.
                call GroupEnumUnitsOfPlayer(g, Player(i), function AutoIndex.initEnteringUnit)
                //Enum every non-filtered unit on the map during initialization and assign it a unique
                //index. By using GroupEnumUnitsOfPlayer, even units with Locust can be detected.
                set i = i - 1
            endloop
            call TriggerAddCondition(order, And(function AutoIndex.onIssuedOrder, function AutoIndex.detectStatus))
            //The detectStatus method will fire every time a non-filtered unit recieves an undefend order.
            //And() is used here to avoid using a trigger action, which starts a new thread and is slower.
            call TriggerRegisterPlayerUnitEvent(creepdeath, Player(12), EVENT_PLAYER_UNIT_DEATH, null)
            call TriggerAddCondition(creepdeath, function AutoIndex.detectStatus)
            //The detectStatus method must also fire when a neutral hostile creep dies, in case it was
            //sleeping. Sleeping creeps don't fire undefend orders on non-damaging deaths.
            call RegionAddRect(maparea, bounds) //GetWorldBounds() includes the shaded boundry areas.
            call TriggerRegisterEnterRegion(enter, maparea, function AutoIndex.initEnteringUnit)
            //The filter function of an EnterRegion trigger runs instantly when a unit is created.
            call TimerStart(CreateTimer(), 0., false, function AutoIndex.afterInit)
            //After any time elapses, perform after-initialization actions.
        call GroupClear(g)
        call DestroyGroup(g)
        call RemoveRect(bounds)
        set g = null
        set bounds = null
    endmethod

Hummm, yeah I will refrain from commenting any further.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 12-16-2011, 03:24 PM   #25
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

How this is related to the quote ?!

You're the one which is trolling here.

For me, AutoIndex is cumbersome, but the custom events are nice.
Sure your PUI is light, but i don't have the use of it, i prefer my own way.

Actually P should stands for personal.
__________________
Cool != Useful
Troll-Brain is offline   Reply With Quote
Old 12-16-2011, 05:08 PM   #26
Bribe
User
 
Bribe's Avatar
 
Join Date: Mar 2010
Posts: 233

Submissions (1)

Bribe will become famous soon enough (30)Bribe will become famous soon enough (30)

Send a message via AIM to Bribe
Default

Quote:
Originally Posted by cohadar
Try reading the thread more carefully please, I am sick of explaining stuff over and over.

I did, and you have been arguing the GetUnitIndex thing. If you read more carefully I said GetIndexUnit, which no one has brought up.
Bribe is offline   Reply With Quote
Old 12-16-2011, 06:39 PM   #27
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

@Troll-Brain
Communication breakdown I guess, we were not talking about the same thing.
Just chill out.

@Bribe
Oh, sorry, my bad. Those are easy to confuse.
And to answer your question:
It would not work because the time in between unit removal and index recycling is not zero in PUI.

================
Heh, after 4 years PUI is still useful for starting a fanatical debate.
Perfect Unit Insanity.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 01-12-2012, 04:24 PM   #28
Deaod
User
 
Join Date: Jan 2007
Posts: 542

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Default

PUI was used in EleTD. And it was ditched to reallocate performance to something more interesting than a background implementation detail. And because AutoIndex' modules are awesome.
__________________
Deaod is offline   Reply With Quote
Old 01-12-2012, 05:29 PM   #29
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Relax, I no longer push for this to get approved.
Find some better reason for posting on wc3c.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 11:02 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services