Individual timers, or central timers and wireless transmitters

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
Anywhere I need something on a timer, I just place a timer. I've been thinking about reducing the number of timers by having a central timing system that sends signals out on wireless transmitters. So I might have one timer set to 1 second, one set to 10 seconds, one set to 1 minute, each connected to its own wireless transmitter. Then, when I want something timed, I can just place a wireless receiver tuned to the right frequency. Does that seem like a good idea for reducing the number of timers in the world? This might be especially useful for a shared world, rather than each player placing their own timers. I've only got about 7 or 8 timers running so its borderline whether this is worthwhile for my own SSP.
 

Asphodan

New Member
Jul 29, 2019
26
0
0
When your reported goal is
Does that seem like a good idea for reducing the number of timers in the world?
, then replacing each timer with a receiver does turn out to be the best option.
However, whether or not that presents a significant performance difference would require additional testing. Whatever the difference may be, I don't think it's anything worth considering. Both are about the same so far as materials and time cost, so it's just a matter of aesthetic choice at that point.
 

egor66

New Member
Jul 29, 2019
1,235
0
0
You will end up sending more tics to server that will be more of a strain, you may know that timers are a bit of an issue the best advice at this time is to use a few as you can get away with.
 

Harvest88

New Member
Jul 29, 2019
1,365
-1
0
AE will do that for you a lot. Use alternative automation to reduce timers. Inside of 2 stacks of filters for a solar panel plant use import and export buses. Just wire up some power and there a heavily reduced timer automation.
 

Bagman817

New Member
Jul 29, 2019
832
0
0
Anywhere I need something on a timer, I just place a timer. I've been thinking about reducing the number of timers by having a central timing system that sends signals out on wireless transmitters. So I might have one timer set to 1 second, one set to 10 seconds, one set to 1 minute, each connected to its own wireless transmitter. Then, when I want something timed, I can just place a wireless receiver tuned to the right frequency. Does that seem like a good idea for reducing the number of timers in the world? This might be especially useful for a shared world, rather than each player placing their own timers. I've only got about 7 or 8 timers running so its borderline whether this is worthwhile for my own SSP.

I used to play on a server that did this, as the admins were convinced it would reduce lag. From what I've read, the performance issues associated with timers seem to be related to the block updates generated (slower timers = less updates = less lag). It seems to me, however, that the wireless receiver would produce the same updates, but I could be completely off base.
 

Redweevil

New Member
Jul 29, 2019
203
0
0
I think what the OP is wondering is what causes more lag, lots of timers or one that sends a pulse wirelessly?
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
I've started doing this now and I like it. It seems a bit less laggy when I am around a Wireless Receiver where I used to have a timer. I think that must be because it isn't doing the animation of the pointer.
 

snooder

New Member
Jul 29, 2019
363
0
0
Oh man, this is brilliant, I have no idea why I didn't think of this. I'm currently running a lot of timers to automate the frames in my alvearies and the lag is somewhat noticeable.

Even better, I could use a computer to manage the wireless signal and cut out the timer altogether.
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
Even better, I could use a computer to manage the wireless signal and cut out the timer altogether.
Oh, yes, very nice idea. Computer, bundled cable, wireless transmitters. You'd have much more control, you could stagger them so that the 5, 15, 30, 60 seconds etc. don't all go at the same time.
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
OK here it is! Forth code:
Code:
VARIABLE timer
: timerIOX
0 timer !
0
BEGIN
1
timer @ IOX!
timer @ 1 + timer !
10 TICKS
0= UNTIL
;
Cables and transmitters:
2013-05-02_23.09.31.jpg

I only placed 4 Pulse Formers for the frequencies that I am using (that I have Wireless Receivers tuned into), 4, 32, 64, and 256 seconds.
Warning: those Pulse Formers are pretty expensive on redstone, about 8 or 9 each I think. They aren't really necessary, though, so long as you're happy with your 64-second timer being on for 32 seconds and off for 32 seconds.
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
New code:
Code:
VARIABLE ontime
VARIABLE offtime
VARIABLE oldtimer
VARIABLE timer
5 ontime !
10 offtime !
: timerIOX
0 oldtimer !
0 timer !
0
BEGIN
 1
 timer @ 1 + timer !
 oldtimer @ timer @ AND
 timer @ XOR
 IOX!
 ontime @ TICKS
 0 IOX!
 offtime @ TICKS
 timer @ oldtimer !
0= UNTIL
;
New layout, no need for Pulse Formers any more:
2013-05-08_21.37.17.jpg
 

Peppe

New Member
Jul 29, 2019
836
0
1
New code:
Code:
VARIABLE ontime
VARIABLE offtime
VARIABLE oldtimer
VARIABLE timer
5 ontime !
10 offtime !
: timerIOX
0 oldtimer !
0 timer !
0
BEGIN
1
timer @ 1 + timer !
oldtimer @ timer @ AND
timer @ XOR
IOX!
ontime @ TICKS
0 IOX!
offtime @ TICKS
timer @ oldtimer !
0= UNTIL
;
New layout, no need for Pulse Formers any more:


I wrote something similar for CC. Updated to 1.5, so no wireless redstone so never got to use it much.

http://pastebin.com/GwTtcmyj
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
I wrote something similar for CC. Updated to 1.5, so no wireless redstone so never got to use it much.

http://pastebin.com/GwTtcmyj
Nice. Yours has more control over timings of individual colours, I just went with doubling frequencies because that's nice and easy with a binary counter. Keeps the code small and fast. Also I like in mine that only one timer is pulsing at any one time, so signals are spaced out.
 

snooder

New Member
Jul 29, 2019
363
0
0
Ah, I see what you guys did. You set up a specific timer interval for each frequency.

If i get ever get around to doing this, I'd probably use a program with an input variable for the time and have a different computer for each timer.
 

Petrus

New Member
Jul 29, 2019
67
0
0
I've started doing this now and I like it. It seems a bit less laggy when I am around a Wireless Receiver where I used to have a timer. I think that must be because it isn't doing the animation of the pointer.

This is consistent with my own testing, yes. The main cause of lag seems to be that the rendering engine was presumably designed for redstone to either be continually on or off, but not to pulse, which is of course what a timer does. I'm using a somewhat custom pack at the moment with several of FTB's mods installed, and I've found that using Optifine and turning all Redstone animations off helps noticeably.