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 > Code Resources > Systems
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-12-2009, 06:14 PM   #16
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

I had it that way originally, honestly, but I thought people might like it more if they could change the callbacks for a given bufftype. Maybe I should revert to the old way, though, it'd save arguments on the UnitAddBuff call as well.
__________________
Rising_Dusk is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-12-2009, 06:25 PM   #17
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

Send a message via AIM to Karawasa Send a message via MSN to Karawasa
Default

Quote:
Originally Posted by Rising_Dusk
Requirements:

I strongly believe you should add support for a third indexing script, PUI. I believe it is in far more use than the two you currently support.
__________________

Element Tower Defense - Premier WC3 Custom Game
Karawasa is offline   Reply With Quote
Old 09-12-2009, 06:29 PM   #18
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

PUI doesn't share syntax with UIU/AI (Which is the only reason I can support those two, since optional code doesn't exist in vJass yet). Furthermore, PUI is slow compared to both UIU and AI because its GetUnitIndex function doesn't inline down to GetUnitUserData. The red flavor of UIU functions in a very similar manner to PUI, it just doesn't support the textmacro hacks it has. (Rightly so, personally)

I'm sorry that your map uses PUI, if you want to use it with this system, do a search and replace on "GetUnitId" to make it "GetUnitIndex". Then fix the library requirement and that should fix it right up.
__________________

Last edited by Rising_Dusk : 09-12-2009 at 06:30 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-12-2009, 06:54 PM   #19
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Or ... *cough*Table*cough*
lol, I know you are not going to do it and yes, I know there are no conflicts either xD
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 09-12-2009, 07:08 PM   #20
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Table should never be used where UnitUserData will suffice. Period.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-12-2009, 07:16 PM   #21
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

Send a message via AIM to Karawasa Send a message via MSN to Karawasa
Default

Quote:
Originally Posted by Rising_Dusk
PUI doesn't share syntax with UIU/AI (Which is the only reason I can support those two, since optional code doesn't exist in vJass yet).

Fair enough, that would certainly be a valid reason.

Quote:
Originally Posted by Rising_Dusk
Furthermore, PUI is slow compared to both UIU and AI because its GetUnitIndex function doesn't inline down to GetUnitUserData.

Is that really enough of a difference to come to that conclusion? There is more going on than just the "Get Index" function in all of these systems. I wonder what you end up with if you consider all aspects. You're welcome to PM me if you don't want to hijack the thread.

Quote:
Originally Posted by Rising_Dusk
I'm sorry that your map uses PUI, if you want to use it with this system, do a search and replace on "GetUnitId" to make it "GetUnitIndex". Then fix the library requirement and that should fix it right up.

Good to know that it's just a syntax thing that is getting in the way.
__________________

Element Tower Defense - Premier WC3 Custom Game

Last edited by Karawasa : 09-12-2009 at 07:19 PM.
Karawasa is offline   Reply With Quote
Old 09-12-2009, 07:21 PM   #22
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by Karawasa
Is that really enough of a difference to come to that conclusion? There is more going on than just the "Get Index" function in all of these systems. I wonder what you end up with if you consider all aspects. You're welcome to PM me if you don't want to hijack the thread.
Well, UIU/AI inlining their GetUnitId call makes it as fast as a single native. PUI's GetUnitIndex calls a few natives, performs several array lookups, performs several array sets, and checks at least a few if/then comparisons before returning the value. The difference is monumental, although in practical applications it may not matter. (Depends upon the frequency of your calling it, really)
__________________

Last edited by Rising_Dusk : 09-12-2009 at 07:22 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-12-2009, 07:28 PM   #23
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

Send a message via AIM to Karawasa Send a message via MSN to Karawasa
Default

Quote:
Originally Posted by Rising_Dusk
Well, UIU/AI inlining their GetUnitId call makes it as fast as a single native. PUI's GetUnitIndex calls a few natives, performs several array lookups, performs several array sets, and checks at least a few if/then comparisons before returning the value. The difference is monumental, although in practical applications it may not matter. (Depends upon the frequency of your calling it, really)

Yes, I noticed that "GetUnitIndex" is bloated compared to "GetUnitId" function. What I am still wondering about is the recycling and detection aspect of these systems. Is PUI more efficient regarding these other aspects? If so, does it make up for the performance loss described above?

I use PUI extensively and call it a lot. In fact, anytime a tower attacks or a unit is damaged (notice these are not the same) PUI gets called. If the performance difference is actually noticeable and significant (as opposed to some theoretical nanosecond stuff I don't care about) then I have a problem. However, I'd like to know about recycling and detection before changing to another system.
__________________

Element Tower Defense - Premier WC3 Custom Game

Last edited by Karawasa : 09-12-2009 at 07:36 PM.
Karawasa is offline   Reply With Quote
Old 09-12-2009, 07:33 PM   #24
Bobo_The_Kodo
oO
 
Bobo_The_Kodo's Avatar
 
Join Date: Jul 2008
Posts: 580

Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)

Default

For any possible buff(other than auras), you should have callbacks :

onRefresh
onEnd
onExpire
onPurge
onApply
onPeriodic

(Also if you're wondering why your system doublefrees)
If unit dies on last execute of onPeriodic -> doublefree

edit://

Collapse JASS:
private function BuffTimeout takes nothing returns nothing
    local timer t  = GetExpiredTimer()
    local dbuff db = dbuff(GetTimerData(t))
    
    //Different behavior for periodic buffs than one-timers
    if db.isPeriod then
        //Run the onPeriod callback no matter what
        set TempBuff = db
        call db.onPeriod.execute()
        //Check if this iteration kills the buff
        set db.elapsed = db.elapsed + db.period
        if db.elapsed >= db.duration then
            //Kill the buff completely
            call db.destroy() //Timer gets recycled in here!
        endif
    else
        //Kill the buff completely
        call db.destroy() //Timer gets recycled in here!
    endif
    
    set t = null
endfunction
I like that part, using single timer, but you need :

Collapse JASS:
private function BuffTimeout takes nothing returns nothing
    local timer t  = GetExpiredTimer()
    local dbuff db = dbuff(GetTimerData(t))
    
    //Different behavior for periodic buffs than one-timers
    if db.isPeriod then
        //Run the onPeriod callback no matter what
        set TempBuff = db
        call db.onPeriod.execute()
        //Check if this iteration kills the buff
        set db.elapsed = db.elapsed + db.period
        if db.elapsed >= db.duration then
            //Kill the buff completely
            call db.destroy() //Timer gets recycled in here!
        elseif db.elapsed + db.period > db.duration
            set db.isPeriod = false
            call TimerStart(db.tmr, db.duration-db.elapsed, false, function BuffTimeout)
        endif
    else
        //Kill the buff completely
        call db.destroy() //Timer gets recycled in here!
    endif
    
    set t = null
endfunction
-> but the duration could get changed during that timeout -> hmmm

Last edited by Bobo_The_Kodo : 09-12-2009 at 07:42 PM.
Bobo_The_Kodo is offline   Reply With Quote
Old 09-12-2009, 07:37 PM   #25
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Bobo -> you are descrbing ABuff...
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 09-12-2009, 07:41 PM   #26
Bobo_The_Kodo
oO
 
Bobo_The_Kodo's Avatar
 
Join Date: Jul 2008
Posts: 580

Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)

Default

I'm describing what any buffsystem should have. I haven't looked at ABuff (in a long long time.)

Last edited by Bobo_The_Kodo : 09-12-2009 at 07:41 PM.
Bobo_The_Kodo is offline   Reply With Quote
Old 09-12-2009, 07:50 PM   #27
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Well I don't particularly want to recreate ABuff, but at the same time I can see the applications for all of those callbacks. Furthermore, it would appear that the only way to have access to the top buff and random buffs on a unit is via a linked list approach. *Sigh* I don't mind the work, but this library just isn't worth it if ABuff already does all of this as best as can be done. (I really just hate ABuff's syntax structure)
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-12-2009, 11:05 PM   #28
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Updated to 1.01.
Quote:
Originally Posted by Change Log
v1.01:
Moved all of the callbacks and bufftype specific data from the dbuff struct to the bufftype struct. Added the GetUnitBuff function, which gives the user access to the buff data anywhere they want it. Fixed a doublefree bug that happened if a unit died on the last iteration's callback of a periodic buff. Fixed a bug where periodic buffs with uneven durations would last longer than the actual .duration value.
If you happen to test the demo map, don't mind that "CrushingWave_Notice" stuff. That fires in the onPeriodic callback function and is supposed to spam your screen like it does. (This is not a bug)
__________________

Last edited by Rising_Dusk : 09-12-2009 at 11:12 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-12-2009, 11:06 PM   #29
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

ABuff has all of this stuff ....
Though I admit I am curious to see where this is heading. Further more you would (probably) also need to link this resource to your famous IDDS so it could allow buffs that act on damage like ABuff + ADamage do.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 09-12-2009, 11:11 PM   #30
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

First of all, I don't expect the IBS to ever do something that ABuff doesn't already do. ABuff covers all angles of the buff creation and manipulation process, it just does so in a way that I, as a user, do not like. That is why I am offering my library as an alternative to ABuff; surely there are users out there who are like me in thinking that the syntax of ABuff just isn't for them.

Also, IDDS and IBS are fully compatible. Because of how easy the IDDS and IBS are to use, the IBS won't ever require the IDDS. If you want a buff that happens on damage, then rock on, you can do it already with the version that's up.
__________________
Rising_Dusk 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 10:07 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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