[System] Smooth Timers

Zwiebelchen

You can change this now in User CP.
Reaction score
60
Okay first of: This patch tool is awesome and works.

Second: I tested waits now on Bnet (with only me as a player, though ... couldnt make other people to join >_>), and they worked the same as in single player.

I tested it via the following trigger:
Code:
Nahkampfinitialisierung
    Ereignisse
        TriggerAddEventMapInit()
    Lokale Variablen
        t = (TimerCreate()) <timer>
        i = 0 <int>
    Bedingungen
    Aktionen
        TimerStart(t,9.0,false,c_timeGame)
        While()
            Conditions
                Comparison(i,<=,256)
            Actions
                Wait(0.0,c_timeGame)
                IncrementInteger(i,+,1)
        TriggerDebugOutput(1,"This should show 1:",true)
        TriggerDebugOutput(1,(FixedToText((TimerGetRemaining(t)),c_fixedPrecisionAny)),true)
It returned "1" in both singleplayer and singleplayer-bnet games.

However, something is really odd about that: When I changed the code to this, it returned "0" for some reason: Any idea why?
Code:
Nahkampfinitialisierung
    Ereignisse
        TriggerAddEventMapInit()
    Lokale Variablen
        t = (TimerCreate()) <timer>
        i = 0 <int>
    Bedingungen
    Aktionen
        TimerStart(t,9.0,false,c_timeGame)
        While()
            Conditions
                Comparison(i,<=,256)
            Actions
                Wait(0.0312,c_timeGame)
                IncrementInteger(i,+,1)
        TriggerDebugOutput(1,"This should show 1:",true)
        TriggerDebugOutput(1,(FixedToText((TimerGetRemaining(t)),c_fixedPrecisionAny)),true)

PS: Sorry for this gui trigger stuff, but I didnt find out how to convert triggers to galaxy yet.
 

Saldu

New Member
Reaction score
1
My only guess would be that since you can't have 0.03125 as a real entered there since the real input is limited to 4 digits after comma, it can't display 7.9872 as a result for some reason, but I'm at a loss for that reason too.
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
The reason for that problem was already found; I posted everything I found out about waits in the other thread. But thanks for your comment.
 

Marsunpaisti

New Member
Reaction score
0
Im having problems getting this to work. I tried to experiment around with these timers, and I'm not really sure if I used them properly. First of all I tried to copy the example you had in the original post but when im saving the map, galaxy editor tells me there is a syntax error on the line where there is the "newsmoothtimer(test,5)" thing.
 

Steel

Software Engineer
Reaction score
109
Steel said:
I was going to try this but got side tracked with my latest tutorial so someone in their spare time can try running this. The minimum time you can wait is 0.03125s, this is tested and proven, we know this. But that is just a minimum, the fastest. This means you can have something wait 0.03126s. So you could potentially have triggers running at the intervals of:

  • 0.03125
  • 0.03126
  • 0.03127
  • 0.03128
    ....

With careful coding and tweaking some numbers you could have several triggers running in parallel to execute code at a much faster rate.

If you have one trigger starting at the fastest delay possible 0.03125s and the next starting at 0.04678s (rounded up) you effectively double the number of waits you get to execute with your data¹. If you create another split you can end up with these figures: 0.03125, 0.03907, 0.04689, 0.05471¹. This now breaks the limitation of 1/32 executions per second and effectively increases it to 1/128 executions per second.

Now remember I'm just speculating here. I don't know if parallel time triggers will work or what their effect on the game they would have. The thing people seem to be focused on is interval clicks. Like everything executes in batches of 0.03125, I don't know if that is true or not. If you can actually have a wait time between 0.03125 and 0.0625, the next minimum wait time, you can execute more than this mysterious minimum value.

[Note: If the numbers get cut off to rounding, then round all of the minimum waits to a linear progression so they all are going in unison.]

¹ With proper rounding lets say we run two triggers in parallel starting at 0.03126, 0.04689. The interval difference here is 0.01563s. The starting point for our thread can be 0 seconds since we can execute a command upon initialization since these would be two actively running triggers. If you're going to nitpick and say what if this is at map initialization? The first instance of thread 2 would not execute, everything else though would be the same.

Thread 1 - 0.00000
Thread 2 - 0.01563
Thread 1 - 0.03126
Thread 2 - 0.04689
Thread 1 - 0.06252
Thread 2 - 0.07815
Thread 1 - 0.09378
Thread 2 - 0.10941
Thread 1 - 0.12504
Thread 2 - 0.14067
Thread 1 - 0.15630
Thread 2 - 0.17193
Thread 1 - 0.18756
Thread 2 - 0.20319
Thread 1 - 0.21882
Thread 2 - 0.23445
Thread 1 - 0.25008
Thread 2 - 0.26571
Thread 1 - 0.28134
Thread 2 - 0.29697
Thread 1 - 0.31260
Thread 2 - 0.32823
Thread 1 - 0.34386
Thread 2 - 0.35949
Thread 1 - 0.37512
Thread 2 - 0.39075
Thread 1 - 0.40638
Thread 2 - 0.42201
Thread 1 - 0.43764
Thread 2 - 0.45327
Thread 1 - 0.46890
Thread 2 - 0.48453 (32 executions here)
Thread 1 - 0.50016

33 executions in 0.050016 seconds

Originally posted on TDG's forum.

Have fun.
 

Marsunpaisti

New Member
Reaction score
0
Here is the map I was trying to import the smooth timer into.
 

Attachments

  • Galaxy racing 0.1a.zip
    73.9 KB · Views: 251

Builder Bob

Live free or don't
Reaction score
249
Does this system actually work as intended? I'm trying to create a smooth sliding motion for a unit, but it appears just as choppy with this system as with a .0625 timer.

Adding a line to display the game time every time the smooth timer starts a new tick shows it constantly expires twice with the same game time.

Example:
0
0
0.0625
0.0625
0.125
0.125
0.1875
0.1875
etc.

Can anyone confirm this system works and that I'm just doing something wrong? If not, can you point me in the right direction on how to achieve smooth sliding?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +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