System Timer Ticker

Jesus4Lyf

Good Idea™
Reaction score
397
>Stop with the name calling.

Sowwy.

Lol yeah, it is slightly faster. But if you want speed and don't mind sacrificing the user interface, you need to look up Rapid Timers. It's what TT would look like if noone cared what "nice user interfaces" are.

I'm still hoping to find a way to implement the method in KT2 without sacrificing the UI.

PS. Linked lists are nice because they don't add any overhead to the main body. But you're right, they probably add an insignificant amount to adding/removing instances. :)
 

Builder Bob

Live free or don't
Reaction score
249
Lol yeah, it is slightly faster. But if you want speed and don't mind sacrificing the user interface, you need to look up Rapid Timers. It's what TT would look like if noone cared what "nice user interfaces" are.

Looks interesting, and not that much harder to use than TT.
Seeing as you made GTrigger, I'd think you'd approve of Rapid Timers. Too many spell casting triggers never wore down a map on it's own, but you bothered making it faster anyway. I think it's a good thing. Every little bit helps.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Yes and no. I don't approve of Rapid Timers because it doesn't allow period specification, and because KT1 is faster, probably. Rapid Timers is 15% faster than KT2 and TT at about 36,800 executions per second (over about 32,000, these numbers are off memory, btw), but KT1 is way faster at about 60,000 executions per second (eh, see KT2 thead. Just released more detailed test results yesterday...). RT is only that much faster at 100 executions, it has a large overhead, and may be slower than both TT and KT2 at a smaller number of instances anyway (pending bench tests). KT2 is still faster (as admitted by the author of Rapid Timers) for multiple periods, because of the overhead.

GTrigger was not released for the sake of extra efficiency, although it acomplishes this very well. It was written because:
  • I hated the idea of spawning 12-16 events for each spell I made where the was an alternative.
  • I liked the idea of a substitute event system that reduces code, and it makes code much nicer.
  • It's faster to code with.
  • You can declare a trigger in one line without storing it in a variable.
  • It is minimalistic in every way (except internal implementation).
Note that in-game efficiency doesn't even come into it! Rapid Timers does not acomplish these kinds of things, but TT/KT2 do. :) And the speed difference is not useful. If it was, you'd use KT1 or a struct/stack loop.

See, either TT or KT2 is a much nicer interface than attaching to timers directly. Rapid Timers is not.

However, Rapid Timers is definitely nice for those who are obsessive about efficiency, like seemingly, yourself. Which is fine! I used to be too. I just wouldn't wish that kind of interface on every JASSer. Cohadar is very right in saying that maps don't suffer for efficiency as much as suckyness.

I dare say you would never notice the speed bonus from switching from TT to Rapid Timers, and KT2 is faster at what it does anyway. :)

I'm investigating a way of implementing Rapid Timers style internal implementation without losing the clean interface.

Edit:
Nearly there, I think.
 
Reaction score
91
I dare say you would never notice the speed bonus from switching to any system
Fixed.

I have no idea why everybody is so crazy with all those systems and "which is faster by 296969%". Like, you're going to notice something that would happen a microsecond later? When the hell are you going to execute something 30k times to understand it is "slow"? It's efficiency and ease of use that matters - the system must work at all cost and never break down. That's why I prefer cohadar's resources - created exactly for the user and really efficient.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Precisely.

However, I must insist that there are exceptions to your rule. If you have 50 special effects all moving around, you can definitely experience lag. My point was you then wouldn't jump to Rapid Timers, you'd jump to a struct/stack loop manually coded, or KT1 which is the very same. :D

>I have no idea why everybody is so crazy with all those systems and "which is faster by 296969%".

Please understand that my bench tests are for the curious. I would not say a system should be used simply because it is fastest, hence why I wouldn't go the way of Rapid Timers. :)

You've summed it up very nicely there. And I agree that Cohadar has the right idea, and I've adopted that idea that the interface (and a reasonably high efficiency, and brilliant stability) is what actually matters.
 
Reaction score
91
> If you have 50 special effects all moving around... you'd jump to a struct/stack loop manually coded, or KT1 which is the very same.
The effects would cause the lag, not the 50 timers... I'd reduce the eyecandy by a lot. But yes, I'll maybe use a single timer to run all this.

> Please understand that my bench tests are for the curious.
Agree. I was curious as well, good job for taking your time and testing these systems.
 

Jesus4Lyf

Good Idea™
Reaction score
397
>Agree. I was curious as well, good job for taking your time and testing these systems.

Hey, thanks. I appreciate your appreciation. :)

>The effects would cause the lag

You know, you'd be suprised, and that's an all-to-common misconception. Originally Sharl and Sandman were written with a nasty old version of KT2, and they lagged. Now they don't. The effects were not the problem, even though they had hundreds of dummy units with attached effects on the screen (well Sharl did, but Sandman only had 40 per instance). Only the efficiency of the timer system changed. :)

By the way, I would actually encourage spell makers to add simple eyecandy like the sparks in Sharl (and spam it), because TT and KT2 handle these amazingly efficiently. Adding those things now brings close to no efficiency penalty! Especially because these systems extend their executions per second with the number of instances on a single period! ;)
 
Reaction score
91
> Now they don't. The effects were not the problem,
Really? And why does my computer go from 64 (should be 60) to 35 fps with a PC bought before 2 months? Still, it is more efficient to handle it on one timer than tens/hundreds.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Well my 3 year old laptop used to go from ~35 fps down to 10. :p
I suppose my point is they're now actually usable in a map. :D

Oh, and just for kicks:
Designing for People Who Have Better Things To Do With Their Lives (lol don't go read the whole doc, just the first few lines...)

Edit:
Anyone using Rapid Timers as a result of the discussion in this thread should switch to KT2 immediately (as they'd only have switched for efficiency), which is now faster and has nearly the same interface as TT.

Cohadar, as for upgrading TT, I don't know if you will or not, due to incompatability issues. My bet, I suppose, would be that you won't, or you'll try really hard to find some way to keep compatability...

Screws and nails...
(Do we need more snails? XD)
 

Vexorian

Why no custom sig?
Reaction score
187
Eww Cohadar, was there really a good reason at all to add that StartEx function? It sounds like you just implanted a hash in there but instead of the usual, fast method you used TriggerEvaluate for loading the index (plus there's "timer indexing" on it, yiuck)

Was the reason just so you could say that TT supports flexible expiration times?
 

Cohadar

master of fugue
Reaction score
209
Was the reason just so you could say that TT supports flexible expiration times?

Of course not.
The reason was me wanting to use same TT_GetData() function no matter what kind of timers it runs on in the background.

Interface awesomness was always my primary goal.
What happens in the background is irrelevant.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
a few questions:
is it possible to make the function Start or StartEx return boolean or any other type to let know when it's finished?

is it possible to use it in a loop? (also explain me why not cause im not sure i relized how it works)

is it possible to change periodic from the UserFunc?

i know those questions are will probably be answered with "no" but i wonder as well if it's possibly avilable with a few adjustments

also i wanted to ask - how come your start function takes integer as data instead of struct? just curious to know
 

wraithseeker

Tired.
Reaction score
122
Actions that you run must return boolean with this to be with.

It is possible to use in a loop.

No, you have to start it over again with a new Timer.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
>Actions that you run must return boolean with this to be with.
im not talking about the UserFunc im talking about the start function
for example:
JASS:
boolean b = TT_StartEx(UserFunc,struct,period)

and thanks for the rest
 

Flare

Stops copies me!
Reaction score
662
also i wanted to ask - how come your start function takes integer as data instead of struct? just curious to know
A struct instance is just an integer that is used for an array index
JASS:
local StructName data = ...
set data.member = value

would be equivalent to
JASS:
local integer data = ...
set struct_StructName_member[data] = value

If it took a struct type, then it would be specific to that struct e.g. you wouldn't be able to pass a struct of type StructB if the parameter required a struct of type StructA (I believe you'd get "<variable> is not of type StructA" error)

im not talking about the UserFunc im talking about the start function
You want it to return a boolean when userFunc has stopped being executed, or return true if TT_Start(Ex) finished successfully? If it's the first, why would you need that? You'd already know when userFunc finished executing (since you'd have a function that is used by TT and returns true at some point) and you could do what you want with it from there
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
>You want it to return a boolean when userFunc has stopped being executed, or return true if TT_Start(Ex) finished successfully?

i want it to return true when it's finished successfully

thanks for the explanation about the struct as integer
 

wraithseeker

Tired.
Reaction score
122
If what I think is correct for example

JASS:
function test takes nothing returns boolean // this is the callback function and must return boolean
// your attaching stuffs and actions
if return == true then
return true // this would mean that the action is done and it is successful and the timer has stopped running.
else
return false // continue on..
endfunction


Handwritten and expect errors.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
^ im not sure i understand where should i put it

and also im pretty sure this is not possible:
JASS:
if return == true then
 

wraithseeker

Tired.
Reaction score
122
this is just a test variable.

it should be a
JASS:
local boolean test


Well, since it's a test, it doesn't matter right :p

Put the return false at the end of the condition and use a boolean to check whether the function has met your requirements aka conditions and then type return true.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
^ im not sure if i understood your idea but if i did i think using a global would be better to let me know if it's finished....
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top