System TimerCompressor Library

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
DISCLAIMER: I have not completed this yet and have not yet had a chance to compile check it, that will be done tonight when i get home from work, till then if it does not compile there isnt much i can do :(

I will update the code tonight when i compile check it and adjust it accordingly

JASS:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                             *
 *    TimerCompressor - v1.00                                                  *
 *    by G_Freak45/GFreak45                                                    *
 *                                                                             *
 *    Requires:                                                                *
 *        Jass Newgen/Jass Helper                                              *
 *                                                                             *
 *    http://www.thehelper.net/forums/showthread.php/169675-TimerCompressor    *
 *    -Library?p=1389329#post1389329 (sorry about the cut up link)             *
 *                                                                             *
 *                                                                             *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                             *
 *    Implementation:                                                          *
 *        Create a new trigger named StrategicTimer                            *
 *        Edit -> Convert to custom text                                       *
 *        Delete the inside and replace with this code                         *
 *                                                                             *
 *                                                                             *
 *    Positives:                                                               *
 *                                                                             *
 *        Replaces timer handle/timer variables with integers so no leaks      *
 *          ie: local integer t = StartTimer(5.0, null)                        *
 *                                                                             *
 *        Combines all timers into a single one by starting it with            *
 *          varying times depending on the next timer to finish                *
 *                                                                             *
 *        Replaces common.j functions with slight variations so no major       *
 *          changes to the game other than efficiency                          *
 *                                                                             *
 *        Allows you to create periodic timers that expire after X times       *
 *          of running the code                                                *
 *                                                                             *
 *                                                                             *
 *    Negatives:                                                               *
 *                                                                             *
 *        Trigger Evaluation is required to run the code                       *
 *                                                                             *
 *        Is not made for high frequency timers repeating timers (anything     *
 *          under 0.5 seconds, Timer32 is recommended for that)                *
 *                                                                             *
 *        Functions used as code MUST NOT take arguments because they are      *
 *           saved as boolexpr's seeing as code variables can not be arrays    *
 *                                                                             *
 *                                                                             *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                             *
 *    API:                                                                     *
 *                                                                             *
 *    function GetLastExpiredTimer takes nothing returns integer               *
 *        -pretty self explanatory                                             *
 *                                                                             *
 *                                                                             *
 *    function GetLastDestroyedTimer takes nothing returns integer             *
 *        -also pretty self explanatory                                        *
 *                                                                             *
 *                                                                             *
 *    function StartTimer takes real timeout, code c returns integer           *
 *        -used to start a basic timer, the integer return is the ID of the    *
 *         timer                                                               *
 *                                                                             *
 *                                                                             *
 *    function StartPeriodicTimer takes real timeout, integer periodcount,     *
 *    code c, returns integer                                                  *
 *        -used to start a periodic timer, if you want it to be a constant     *
 *         periodic (never ending) use 0 as periodcount, otherwise it will     *
 *         countdown from that number running c every time, this does not      *
 *         run on 0 so use the exact count you want                            *
 *                                                                             *
 *                                                                             *
 *    function TimerDestroy takes integer t returns nothing                    *
 *        -destroys the timer using the timer's id, there should be almost     *
 *         no need for this, thats an almost.                                  *
 *                                                                             *
 *                                                                             *
 *    function TimerPause takes integer t returns nothing                      *
 *        -pauses the timer, this replaces the PauseTimer function             *
 *                                                                             *
 *                                                                             *
 *    function TimerUnpause takes integer t returns nothing                    *
 *        -unpauses a paused timer                                             *
 *                                                                             *
 *                                                                             *
 *    function TimerPauseAll takes nothing returns nothing                     *
 *        -pauses all timers, just for completeness                            *
 *                                                                             *
 *                                                                             *
 *    function TimerChangeCode takes integer t, code c returns nothing         *
 *        -replaces the current code for the timer with a new one              *
 *                                                                             *
 *                                                                             *
 *    function FinishTimer takes integer t returns nothing                     *
 *        -completes whatever duration is left on the timer, replaces call     *
 *         TimerStart(timer, 0, false, code)                                   *
 *                                                                             *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

library TimerCompressor
    private struct TC extends array
        real totalTime
        real startTime
        real timeLeft
        boolean periodic
        boolean paused
        conditionfunc func
        integer periodcount

        integer next
        integer previous
        static integer array recycleList
        static integer lastRecycled
        private static integer listSize
        static integer lastExpiredTimer
        static integer lastDestroyedTimer
        private static trigger tcTrig = CreateTrigger()
        static timer tcTimer = CreateTimer()

        private static method allocation takes nothing return thistype
            local thistype this = .recycleList[0]
            if this == 0 then
                debug if .listSize >= 8190 then
                debug     call BJDebugMsg("TimerCompressor Error: You have attempted to create too many timers at one time.")
                debug     return 0
                debug endif
                set .listSize = .listSize + 1
                return .listSize
            endif
            set .recycleList[0] = .recycleList[this]
            set .recycleList[this] = 0
            return this
        endmethod
        
        method deallocate takes nothing returns nothing
            set thistype(this.previous).next = this.next
            set thistype(this.next).previous = this.previous
            set lastDestroyedTimer = this
            set .recycleList[.lastRecycled] = this
            set .lastRecycled = this
        endmethod

        method callCondition takes nothing returns nothing
            call TriggerClearConditions(tcTrig)
            call TriggerAddCondition(tcTrig, this.func)
            call TriggerEvaluate(tcTrig)
        endmethod
        
        method startTimer takes real timeout, boolean periodic, integer periodcount, conditionfunc c returns integer
            local thistype i = thistype(thistype(0).next).next
            local real time = TimerGetRemaining(.tcTimer)
            if thistype(0).next != 0 and timeout >= time then
                loop
                    exitwhen time + i.startTime >= timeout
                    set time = time + i.startTime
                    exitwhen i.next = 0
                    set i = i.next
                endloop
                set this.next = i.next
                set this.previous = i
                set thistype(i.next).startTime = thistype(i.next).startTime - (timeout - time)
                set this.startTime = timeout - time
                set i.next = this
                set thistype(this.next).previous = this
                set this.periodic = periodic
                set this.totalTime = timeout
                set this.func = c
            elseif thistype(0).next != 0 then
                call TimerStart(.tcTimer, timeout, false, function thistype.timerExpire)
                set i = thistype(0).next
                set i.startTime = time - timeout
                set i.previous = this
                set this.next = thistype(0).next
                set this.previous = 0
                set thistype(0).next = this
                set this.startTime = timeout
                set this.totalTime = timeout
                set this.periodic = periodic
                set this.func = c
            else
                call TimerStart(.tcTimer, timeout, false, function thistype.timerExpire)
                set this.next = 0
                set this.previous = 0
                set thistype(0).next = this
                set thistype(0).previous = this
                set this.startTime = timeout
                set this.totalTime = timeout
                set this.periodic = periodic
                set this.func = c
            endif
        endmethod
        
        static method timerExpire takes nothing returns nothing
            local thistype this = thistype(0).next
            set lastExpiredTimer = this
            call TimerStart(.tcTimer, thistype(this.next).startTime, false thistype.timerExpire)
            call this.callCondition
            set thistype(this.next).previous = this.previous
            set thistype(0).next = this.next
            if this.periodic and this.periodCount - 1 != 0 then
                if this.periodCount - 1 < 0 then
                    call this.startTimer(this.totalTime, this.periodic, 0, this.func)
                else
                    call this.startTimer(this.totalTime, this.periodic, this.periodCount - 1, this.func)
                endif
            else
                call this.deallocate()
            endif
        endmethod

        method pauseTimer takes nothing returns nothing
            local real time = TimerGetRemaining(.tcTimer)
            local thistype i = thistype(0).next
            if thistype(0).next != this then
                loop
                    exitwhen i == 0
                    set time = time + i.startTime
                    exitwhen i == this
                    set i = i.next
                endloop
                set this.timeLeft = time
                set thistype(this.next).startTime = thistype(this.next).startTime + this.startTime
                set thistype(this.next).previous = this.previous
                set thistype(this.previous).next = this.next
            else
                set this.timeLeft = time
                set thistype(0).next = 0
                set thistype(0).previous = 0
                call PauseTimer(.tcTimer)
            endif
        endmethod

    endstruct

    function GetLastExpiredTimer takes nothing returns integer
        return TC.lastExpiredTimer
    endfunction

    function GetLastDestroyedTimer takes nothing returns integer
        return TC.lastDestroyedTimer
    endfunction

    function StartTimer takes real timeout, code c returns integer
        local TC this = TC.allocation
        call this.startTimer(timeout, false, 0, Filter(c))
        return this
    endfunction

    function StartPeriodicTimer takes real timeout, integer periodcount, code c returns integer
        local TC this = TC.allocation
        call this.startTimer(timeout, true, periodcount, Filter(c))
        return this
    endfunction

    function TimerDestroy takes integer t returns nothing
        if t != TC(0).next then
            set TC(TC(t).next).startTime = TC(TC(t).next).startTime + TC(t).startTime
            call TC(t).deallocate()
        else
            call StartTimer(TC.tcTimer, TimerGetRemaining(TC.tcTimer) + TC(TC(t).next).startTime, false, function TC.timerExpire)
            call TC(t).deallocate()
        endif
    endfunction

    function TimerPause takes integer t returns nothing
        call TC(t).pauseTimer()
        set TC(t).paused = true
    endfunction

    function TimerUnpause takes integer t returns nothing
        if TC(t).paused then
            call TC(t).startTimer(TC(t).timeLeft, TC(t).periodic, TC(t).func)
            set TC(t).paused = false
        debug else
        debug    call BJDebugMsg("TimerCompressor Error: You have attempted to unpause a timer that is not paused.")
        endif
    endfunction

    function TimerPauseAll takes nothing returns nothing
        call PauseTimer(TC.tcTimer)
    endfunction

    function TimerChangeCode takes integer t, code c returns nothing
        set TC(t).func = Filter(c)
    endfunction

    function FinishTimer takes integer t returns nothing
        if TC(0).next = t
            call TimerStart(TC.tcTimer, 0, false, TC.timerExpire)
        else
            call TC(t).callCondition()
            set TC(TC(t).next).startTime = TC(TC(t).next).startTime + TC(t).startTime
            if TC(t).periodic then
                call TC(t).startTimer(TC(t).totalTime, TC(t).periodic, TC(t).func)
            else
                call TC(t).deallocate()
            endif
        endif
    endfunction

endlibrary
 

UndeadDragon

Super Moderator
Reaction score
448
Just to note: The Tutorials and Resources forum is for complete resources only. Especially if the code has not even been compiled yet.
 

Nestharus

o-o
Reaction score
84
It's already been proven that single timer systems are no good. The most efficient single timer library has already been written and it couldn't compete with plain old timers, hence why it was never submitted. There is also no way that this current library can come close to competing with that old single timer system that I called 100% garbage, so yours gets to inherit the garbage title too, congratz. I wrote that 1 timer system that I threw away after I found out that it was utterly useless during benchmarks.


Your first major problem is that your entire design is incorrect. If you aren't using a red black tree, then there is absolutely no way you will be able to compete. Also, as the red black tree expands, finding the next timers to run grows, thus slowing down the entire timer system, which is why it can't compete with plain old timers.


The best timer systems are timer systems that run off of plain old timers but maximize merging. The next timer along a string of timers that all have the same timeout can be predicted by running them all through a simple queue. Merging timers around the same size into the same node (a queue of queues) lowers the amount of expiring timers. Merging timers that have the same code lowers the amount of trigger evaluations, thus increasing speed further. This is the only way to make a timer system, and it's already been done.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
sorry about that i was just gonna compile it at home test it out, do some updates, etc, and i didnt wanna hassle with email and get some input ahead of time

damn nest you must be brothers with dirac or something, you and him have the same little kid rager asshole attitude
 

Nestharus

o-o
Reaction score
84
sorry about that i was just gonna compile it at home test it out, do some updates, etc, and i didnt wanna hassle with email and get some input ahead of time

damn nest you must be brothers with dirac or something, you and him have the same little kid rager asshole attitude

Nah, I'm as hard on others as I am on myself. Believe me, if I think something is bad, even if I spent 3-6 months working on it, I will trash it immediately and call it garbage. I give that same treatment to others, so don't take it personally.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
funny in the chatbox you spent your time sucking your dick about how good you made a map and how you used an "insane" system that makes units never die but rather get recycled... i mean its cool, i didnt expect anything better from you, but you obviously dont know what being hard on someone is and get it completely confused with being a complete ignorant asshole, its cool, be what you want idc

im in sales i deal with assholes all day, if you want a valid response from me for anything from now on say it in a way that doesnt display a less than adequate vocabulary, which i know yours is adequate

PS. Being hard on someone is either saying this simply cant become more efficient than multiple timers or saying that it was already done, OR saying how to improve
negative feedback = useless kidrage
positive feedback, even if its not what someone wants to hear = maturity
saying to scrap something and start over is different than saying this is garbage and is a useless pursuit

PPS. If your response to this, if there is one at all, is not positive i will simply close this thread :)
 

Nestharus

o-o
Reaction score
84
???

I let you know what kind of timer systems worked and why a 1 timer system can never work. Furthermore, I let you know what was wrong with your design and let you know that even if you had a perfect design, it would still be bad ;P.


I didn't simply call it crap ^)^, I called it crap and provided supporting argument as to why ; D, which is constructive criticism =). Also, a lot of the time when I get my own stuff rejected, I say around the same things =P. I don't believe in painting a pretty picture ^)^. Crap is crap after all, and it smells really bad too D:.


Anyways, if we look at an earlier 1 timer system, Bribe also attempted this. He recognized the major speed flaws in it and tried to address it as much as he could. I responded by making a 1 timer system that could handle any period like his and ran it off of an AVL Tree (for fast searches). However, this was rather problematic as after a few timers, the system became majorly bogged down and couldn't compete with standard timers. It was after that that I said a 1 timer system is impossible to do and they will pretty much always suck ; p.


Later, I believe Dirac attempted one (not sure, I know someone else did try to do one though), and I told that person the same thing I told you : ).


I'm saving you time ;p. There is a way to improve the efficiency of this, but even if you make it perfect, it's still going to be very bad and rather useless ; ). Sure, it'll be cool and you can brag about how you made a huge timer system that only runs off of 1 timer, but cool isn't always practical =).


Also, Dr Super Good piped in that the thing that slowed down timers wasn't masses of timers but rather masses of timers expiring at the same time due to syncing. The syncing lowers the FPS. This means that the problem isn't about reducing the number of timers, but rather reducing the number of timers that expire at the same time. Some methods, like ones at wc3c, space the timers out to prevent them from expiring all at once. I personally merge timers that are close together. However, timers of different periods are still problematic as the only way to merge them is to use a tree rather than a queue, which has a very hefty overhead. And really, I didn't even use a tree for the 1 timer system back then, but rather a binary heap =).


Anyways... all of this nonsense resulted in me making mass timer modules for different situations =P.


Oh yes, and during my benching, j4l's timer system was much slower than standard timers =), and I mean much much slower o-o. Oh yes, and I have tried my hand at timer systems many times and it was only the last one that could outperform standard timers in most situations =).


So there is your history lesson on timer systems : P. Now, I hope you can understand why I don't want to go over everything that's been done with timers every time someone puts up a 1 timer system that runs off of a linked list ; D. I like to cut it short and call it as I see it, utter crap ^^. I just see the linked list and go, seriously? =D



Anyways, the thread might as well be closed and graveyarded so we can stop wasting everyone's time on this old topic of 1 timer systems ; P. Ofc, you could make a 1 timer system running off of a binary heap like my old one if you wanted to, just for fun you know ; ). It could give you cool bragging rights ^)^. If you don't know what a binary heap is, google is your friend =).
 

Laiev

Hey Listen!!
Reaction score
188
Nah, I'm as hard on others as I am on myself. Believe me, if I think something is bad, even if I spent 3-6 months working on it, I will trash it immediately and call it garbage. I give that same treatment to others, so don't take it personally.

Trust me GFreak45, he is telling the truth (chatting long long time at msn with him).

PS. Being hard on someone is either saying this simply cant become more efficient than multiple timers or saying that it was already done, OR saying how to improve

No. I disagreed this. Being hard on someone is something that people should do if they want to show something to some people.
I don't know what do you mean with 'negative feedback' or 'positive feedback'. No matter if is 'kidrage', if someone feedback you, you SHOULD take your time and see, if in fact, that can be true.


GFreak if you don't want some people saying something about your work, so don't show your work to people, simple like that.

I can show you one of my thread that really made me mad :).

Search for MAC (Main Attribute Control) and watch all the thread. Kingking and Nestharus just throw lots of things to improve. While I was developing MAC, I learn lots of things like use AIDS Struct and other things. at that time I was really bored because I did not know what to do with their advice. Try to ignore advice that you dislike and try to learn what people try to teach you.

Also, if you want to accept an advice from me, ignore the fact that Nestharus seems arrogant, this really help you to learn what he teach you :D, then you'll start to like him ^_^.

PPS. If your response to this, if there is one at all, is not positive i will simply close this thread

In before closed \o/.
 

Dirac

22710180
Reaction score
147
I don't get how Nes keeps explaining the same concept to people over and over (the fact that there's no point in working in a single timer library) without getting bored, plus being very specific every damn time why it doesn't work.
Nes only provides constructive criticism, he also stands by the same idea i told you before: "there is only one good way to code something to reach an objective"
Yes, i was the one that coded the SingleTimer library before and Nes annihilated me with a much more destructive response, and i took it, why? because he was right.
I don't know if you realized it yet GFreak but you again rised your "You're an ass" shield because you did something wrong. It's time to learn from people who have experience.
damn nest you must be brothers with dirac or something, you and him have the same little kid rager asshole attitude
Do you even read your own posts? You look like a kid whining over his sand castle being step over
INB4 closed

EDIT: SingleTimer Thread
 

Bribe

vJass errors are legion
Reaction score
67
Closing the thread because someone provides constructive criticism is pretty childish. I consider advice to halt the project with the benefit of saving time constructive. Lots of people want to reinvent the wheel.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
It's already been proven that single timer systems are no good. The most efficient single timer library has already been written and it couldn't compete with plain old timers, hence why it was never submitted. There is also no way that this current library can come close to competing with that old single timer system that I called 100% garbage, so yours gets to inherit the garbage title too, congratz. I wrote that 1 timer system that I threw away after I found out that it was utterly useless during benchmarks.

Quoted because this was the entire first post before editing it last night and this is what i read, he edited it after i was already asleep, and there isnt even an inkling of constructive criticism in there, thats complete trolling

since when is this is garbage constructive? if he had explained that it just simply cant be as efficient as single timers that would be constructive

I was not going to close the thread if i got constructive criticism, if i get negative trollage like usually i was, seeing as i did some more research and agree with nes that it cant be as efficient, my issue is him being immature

I can take unsolicited positive criticism and this was solicited but being around negative people all day as a salesman means my recreational time simply will not be spent on people trolling, even if there is a nugget of constructive criticism hidden in trollspeak

Now Nest if you want to provide constructive criticism im all ears, i actually agree with you on many points, but i strongly disagree with people ignorantly stating something without any backing, your post after mine was much better and ill replace this system with one that syncs the timer

Laiev... i did look into it and i agree with him on it... but its about saying someone elses work is garbage without anything to back up it up or a reason other than... Its garbage, you cant make a system more efficient than what is already up... provide a reason, remove those "garbage statements" and walah you have constructive criticism which people will take, btw i already trashed this seeing as i do agree with nes on some points

Dirac... if you dont want to be called an ass, dont be one, simple as that, its not some "defense mechanism" i designed, its stating a fact which i am more than capable of providing proof for including quotes from others calling u the same... btw im totally sorry i didnt search the graveyard for one of your systems...

Bribe... I was not going to close the thread if i got constructive criticism, if i get negative trollage like usually i was, seeing as i did some more research and agree with nes that it cant be as efficient, my issue is him being immature. I got 0 constructive criticism at the time that i said that other than this is garbage trash it, if you consider that constructive, i never meant to reinvent the wheel and i didnt do a lot of research on the idea before i made it, all i noticed was that people use timerutils all the time (AFAIK) and it spams timer handles, i only said i would close the thread if he continued to troll because there was no point in keeping it open to feed a troll when the system was obviously going nowhere anyway
 

Dirac

22710180
Reaction score
147
Don't you find it funny that everyone is an ass but you?
I also find this incredible "Nestharus is an immature person"
this "Nestharus is making ignorant posts about my code"
Also this "there's no constructive criticism in this thread"
And "everyone is trolling me, even Bribe"

I just want to point out that all of the above describe a paranoid immature person just FYI

Nestharus isn't speaking out of the top if his head you know, he did wrote a timer system with 2000+ lines i think, that merges timers just the way he explained, no need for you to code it, neither for everyone else.

It's time for you to stay quiet and listen to those who do know better.

You think that I got mad because tooltiperror once called me arrogant? Even if you read the post on which he did i later clarified that he misunderstood my post.
Other than him i have no idea of what on earth are you talking about. And don't even bother bring Grags up
And even if, there's no such thing as "proof" that someone's an ass, i'm just not. You just can't take the fact that your code is garbage (and there's a lot of proof to that statement)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
i never said everyone was trolling me, never said bribe was trolling me, never said laiev was trolling me, all i said was that nests original post was a troll post... stop putting words in my mouth, that was a response to them and i was not listing the reasons why i thought they were trolling, and tooltiperror called you an errogant ass who doesnt think about the words he uses, exactly what i call you and i have seen it from multiple people in multiple other posts and pms discussing your actions...

I agree that this code "is garbage" but when refering to someone elses code i would NEVER call it garbage, i have recommended to start over and go in a different direction however which is exactly what i am doing

also i never said im not an ass, im totally an ass, i know it, never disputed it, but im an ass in different ways and its NEVER to criticize someone in their work, if i depend on someone to get something done and they fall through i turn into a total ass, or when people act like that to me, i also, defensively, turn into an ass... sorry im not like the usual people going from jass to gui where they just roll over and take it but i think its time someone shook things up for you... i wont take your bullshit comments and just ignore them anymore, every and any time u use one i will call you on it, simply trying to make the world a better place :)

EDIT:

If you read that entire post, when nest edited his i said i would work on something done another way based on what he had said... Im not against constructive criticism like i said and that was definately constructive, it povided a reason why it wasnt good, what could be done to make it better, and a different way to look at things
 

Nestharus

o-o
Reaction score
84
Quoted because this was the entire first post before editing it last night and this is what i read, he edited it after i was already asleep, and there isnt even an inkling of constructive criticism in there, thats complete trolling

Mate, I had it edited within like 6 minutes of posting it and within 1 minute of your first reply to it, so that's not really an excuse there ; ). It was also edited before your last post last night, so you were either lying about going to bed after the edit or you just didn't notice it =).


Anyways, the only improvement that can be made to the current timer systems is to do an abstracted trigger evaluation for all of the same periods in the core. The trigger evaluation would then run code that operates on a queue. As I mentioned, timers that have the same timeout can run very easily on a queue of queues (the first queue the different timeouts and the second queue timers on the same timeout). Furthermore, it can use my special merging algorithms to maximize merging ^)^. This is an improvement that I'm going to do at some point, but if someone beats me to it, no worries, that just means less work for me ^)^. Unlike others, I'm not a stickler as to who takes code from where and who gets the name on the resource. As long as the resource is there, it's good, and it works, all's good =). If my code from my last timer system can help you make a better one, use it ; P. If you'd rather wait for me to do it, that's an option too =).
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
oh i didnt see it until today, musta missed it, my bad
i read it within a few seconds of post time

what about this?

3 linked lists using different allocation methods
where
linked list 1 = a large time gap and is a list of the heads for linked list 2
which is the heads for smaller ones that are checked for combine time

and using an interval that is very small, it changes where on the list it begins when creating a new timer
basically making it so that you could use T32 or something similar as the base and have 0 timers for the new ones

think that might be something worth making?
 

Laiev

Hey Listen!!
Reaction score
188
Some people need to speak some truth, and I, Dirac and Nestharus are one of them.

My view is, contrary to what many do, I'd rather be considered an arrogant person, than a person who gave something done.
I prefer to teach someone to do something than to do for him.

And for me, I'd better be absolutely straight and true with someone and tell exactly what I think than just saying it may be improved.

For this reason, most people see me as arrogant, and I believe that the same goes for Dirac and Nestharus.
 

Nestharus

o-o
Reaction score
84
oh i didnt see it until today, musta missed it, my bad
i read it within a few seconds of post time

what about this?

3 linked lists using different allocation methods
where
linked list 1 = a large time gap and is a list of the heads for linked list 2
which is the heads for smaller ones that are checked for combine time

and using an interval that is very small, it changes where on the list it begins when creating a new timer
basically making it so that you could use T32 or something similar as the base and have 0 timers for the new ones

think that might be something worth making?

Not quite. Look at my last timer system on THW or TH and you'll be able to figure it out.

You'll have a hashtable of times in the core as well as one queue for each period. From there, each queue will have a trigger on it. That trigger has trigger conditions from various modules across the map that are currently running on that trigger. When the trigger is evaluated, the method for the specific modules runs through a queue of periods of that same timeout (only the first node). In that node is another queue of timers all expiring at the same point, which are inlined into the method to cut down on local declaration and function overhead. From here, the periods are also modified using a special algorithm which is in the resource I mentioned. Also, each module needs a table as well.

Now, mine doesn't really have all of that stuff in the core atm, but like I said, I'll probably get to that enhancement eventually. However, if you beat me to it, that's fine too: less work for me ^^.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
laiev you didnt read my post, i said there is a difference between saying what needs to be done negatively and positively, that does not mean that there is any difference in the meaning of what is said, only the way it is said, saying something is trash is worse than saying it would be done better another way or it is a lost cause simply because it cant be done that way and be more efficient
 

Laiev

Hey Listen!!
Reaction score
188
GFreak I read your post.

But 'positively' don't have the same impact that a 'negatively' has.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Take a communications class laiev you will learn a lot, negative feedback results in either no results, a hinderence of the process, OR an anger fueled strive to succeed, and that strive is 1 in 50, yes 2% of people get that, however positive feedback generally results in better overall self esteem and a much higher success rate, ~40% of people who recieve positive feedback truly complete the task as opposed to 2%, now this is when all feedback is considered (not just 1 person but the whole of feedback cumulatively)

negative feedback actually hinders the process
i have multiple family members with doctorates in communication and linguistics, that is just a plain, proven truth

and Nest, think about what im meaning like this:

There is a head for a linked list that constantly rotates around the list checking the current time gap that it is in
If that time gap has a qualifying timer end in it, it checks that time gap's linked list, which is another rotating head
if that head's time gap has a timer in it, it checks the next layer, which would be that exact moment's possible expiring timer
get it?
then for each "timer" you could have a saved trigger that will then evaluate any conditions attached and clear them

if you need to increase the max time of the initial list you simply add another time gap to the end, that way no timers will change when they expire, simulating a timer basically

think thats more along the lines of what would be best?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top