Wire Repeaters vs Trigger Loops

Trigger loops, they are simple, memory efficient, only require two triggers, AND COST 500 MEMORY PER BLOCK IN EACH TRIGGER?!
There’s got to be another way…


1 block of code, The Trigger Loop:


A common Trigger Loop would usually require 1 Lifecycle, two wires, two triggers, and two sets of identical block code, one in each trigger. That would be:

50(Lifecycle)+80(Two triggers) +1000(Block code(1 in each trigger))+20(Two wires)

1150 Memory!
Hint: Don’t you think how the block code was used is inefficient…

Now, let’s take a look at a Wire Repeater Loop

A Wire Repeater Loop is similar to a Trigger Loop, it looks like this:

Your wire repeaters will “trigger” each other and the trigger with any set delay.
Here’s what the memory would look like

50(Lifecycle)+10(Two wire repeaters) +500(Block code)+50(5 wires)

Wow, that’s only 610 memory…we saved 540 memory!

Here’s an explanation on how that works given by @VALUEX :arrow_down_small:

Read me!

Each trigger on usual costs 40 memory, however, if we add block code, it costs 40 + 500, which is 540 memory. Now in a trigger loop we can either use recursion and just use one trigger (not memory efficient as it would require 540 memory), or we can use two triggers and have 80 memory (40x, x=2, 40 * 2 = 80). Now that all is great, but we can not only simplify our lives, but also decrease memory consumption by 50%. You all will most definitely be asking, “HOWWW???”, well the answer is simple. Wire repeater loops. If you connect one wire repeater to another and have them interact with something, you would get:
10x + 5x = m
10x = 30, meaning x = 3, meaning 3 wires consuming 10g’s(a g, or a gim, is equal to 0.001% of memory, so 10 g’s are 0.01% of memory) of memory
5x = 10, meaning x = 2, meaning 2 wire repeaters consuming 10g’s of memory
30 + 10 = 40g’s of memory being consumed with this system(half of the trigger loop).
Incredible, right? Yes, it is, and though this system doesn’t allow channels or block code, we can add that using a trigger.
We can add two wire repeaters that form the loop, and a trigger that is triggered by the wire repeaters. We would then have block code or channels in that trigger in order to make the system more versatile.
For nerds:
10x + 5x + 40x + 500x = m
10x = 20g’s
5x = 5g’s
40x = 40g’s
500x = 500g’s
20 + 5 + 40 + 500 = 565g’s
Though that would mean that the trigger + wire repeater system consumes 15g’s less of of memory as the trigger loop system(when block code is applied to both), it works.

Key:
As a standard way to measure memory- g’s or gims- compared to bits, and 1000 gims = 1 kit, and 100 kits = 1 gimkit, 1 gimkit = 100,000 gims, or 100% of memory

Whenever you need a loop without consuming extra memory and that only needs wires, use the wire repeater system and save 50% (approximately, or possibly more) of memory!

But wait, you thought I was done there, HAH no. @Bardy_2913 reminded me of the single trigger loop. So, let’s check that out real quick.

Put a lifecycle down, when the game starts transmit on “game-start-trigger”. Now in the settings of the trigger you will put: When triggered transmit on “game-start-trigger”, and Trigger when receiving on “game-start-trigger” Make sure to put in a delay (ex, 1.0), and the trigger will trigger itself. The memory?

P.S No wires were used for this

50(Lifecycle)+40(Trigger)+500(block code)

590 Memory! Only 20 less than the Wire Repeater method.

If you remember our hint from earlier, you should now see how the first trigger version was inefficient


In the end, it may not seem like much, but every bit of memory counts
Credits: @ShadowDragon44 & @VALUEX & @Bardy_2913

Fun fact, with the setting below, there is no need for a counter to stop your trigger loop!


The Leaderboard


1 Block of code. Triggers vs Wire Repeater

A close race but the Trigger takes the dub


2 Blocks of code. Triggers vs Wire Repeater

IN PROGRESS


Guides on Wire Repeaters and Triggers

Wire Repeater Tutorial (and their useless brother, the repeater)!

On the Nature of a Trigger: A Deeper Study on its Biology and Role in Gimnature [WIP]

10 Likes

Nice guide, very necessary.

first reply before tons of replies :P

1 Like

nice guide (second reply)

1 Like

Nuh-uh

It’s 1 trigger. Broadcast on triggerLoop, receive on triggerLoop and with a delay of x, you get a trigger loop!


Wire repeaters are good… If the thing you need has to run throughout the whole game. If you wanted to stop it, you would need… well, a trigger. And at that point, you might as well just use a trigger loop.

5 Likes

…and you can add code to triggers

2 Likes

Also, did you make the memory-efficiency tag? I’ve never heard of it.

I understand the simplicity of the single-trigger approach, but the wire repeater system still offers significant memory savings, which is why I made this guide in the first place. In large projects, these savings can add up quickly. However you are right, it depends on what type of system you use

Anywho, I forgot about that technique… I was mainly using the two-trigger system as a better illustration as that version is more commonly known.

In reality there will always be a constant battle against many devices to find newer ways of memory-efficiency.

BUT if you would like to present your idea @Bardy_2913 let me know what you would like to say and I can add it in, as what was said in the guide


I never excluded the trigger


Against my will… cough cough you know who you are cough, the tag can actually be applied to many guides

2 Likes

Hey uh, I think you made a mistake. you see, you a trigger loop is actually only 90 memory if you dont use block code. that is because a trigger loop just does this
Trigger when recieving on X, Brodcast on X when Triggered. X is the channel to start the loop so you don’t need wires. just something to activate the loop, and 1 trigger. you could even remove the lifecycle if you make the players spawn on the trigger loop, and then teleport them away. so a trigger loop can theroetically be only 40 memory. (Dang, what is it with me and sounding like a nerd)

1 Like

I posted this as a discussion topic for ways to increase memory efficiency on a trigger loop/wire repeater loop containing block code.

A teleporter is an added 50 memory, so you would be right back at 90 memory, and it would interfere with smooth gameplay contributing to lag, and bad cuts loading in at the beginning of the game.

Nice thought though!


I plan on adding more and seeing how far you can go (trigger and wire repeater) to achieve the ultimate memory efficiency

Why can’t you only put the block code in one of the triggers(in the trigger loop)? I don’t think there’s a reason to put the block code in both triggers unless they have different code, in which case the wire repeater wouldn’t be more efficient.

You can, as I just said

And when I’m done finding all possible ways (with selected devices), I’ll rank them; But so far:

This :arrow_up: appears to be the best way

Wha- where did you get needing block code in any triggers, let alone each?
Trigger loops are slightly less efficient than wire repeaters, but you literally do not need block code for 99% of use cases, so the difference is near-negligible.
I’m so confused.