Is There Any Way To Clean This Up?

I am coding a timer with some separate stages with music, but the wiring is becoming confusing. Any suggestions on how to clean it up?

If you split everything into bundles that do separate things then attach them it can make it way simpler.

I can help clean it up if you need. If you send a game link I’ll show how I would fix it and my thought process.

Also this is a guide I made for some stuff to keep in mind to keep things organized

Thank You! Here is the link. I also noticed that sometimes both timers show, and I have no idea why.

There are behaviors in the code that do nothing or are redundant, so those are the main things I’ll be removing.


It can likely be cleaned up further, but I don’t know exactly what you’re trying to do, so I just did a basic bundling/reordering.
I noticed that the system mainly seemed like 2 distinct parts, so I bundled part of it, then straightened some of the behaviors so there was less backward/overlapping wires.

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":1,"outputCount":0,"name":"Pizza Mode","behaviorType":"logic.NodeGroup","x":0,"y":32,"group":"","id":"a4c2fcaa43e6e048","isMenuItem":true},{"delay":1,"count":0,"version":2,"inputCount":3,"outputCount":1,"name":"Timer","behaviorType":"logic.triggers.Timer","x":-90,"y":0,"group":"a4c2fcaa43e6e048","id":"a4c1f61e2856734f"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":270,"y":96,"group":"a4c2fcaa43e6e048","id":"a4c24ce3f464e142","startVal":2290,"tag":"","roundMode":1},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-90,"y":-96,"group":"a4c2fcaa43e6e048","id":"a4c27b56ee69b14d"},{"inputCount":4,"outputCount":4,"name":"Label","behaviorType":"logic.hud.Label2","x":630,"y":0,"group":"a4c2fcaa43e6e048","id":"a4c2bf636c749949","text":"","textColor":0,"fontName":"oduda","scale":10,"textAlign":"left","maxWidth":0,"xO":0,"yO":0,"pin":false,"alpha":100,"kerning":0},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":90,"y":0,"group":"a4c2fcaa43e6e048","id":"a4c39c06f6ca644b","startVal":-1,"tag":"","roundMode":1},{"expression":"A/10","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":2,"tag":"","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":450,"y":96,"group":"a4c2fcaa43e6e048","id":"a4c4d7c4f5821a40"},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":90,"y":-96,"group":"a4c2fcaa43e6e048","id":"a4c9cc0b72cc5c47","tag":"Practice Enabled:Number","version":2,"dataType":2},{"gateVal":0,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter2","x":270,"y":-96,"group":"a4c2fcaa43e6e048","id":"a4c9e22ab1c10c4e"},{"inputCount":5,"outputCount":2,"name":"Text","behaviorType":"logic.data.TextBlock","x":450,"y":-96,"group":"a4c2fcaa43e6e048","id":"a4d49222e99e5445","startVal":""},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":630,"y":96,"group":"a4c2fcaa43e6e048","id":"afcfd23dc415744e","startVal":0,"tag":"","roundMode":1},{"inputCount":1,"outputCount":1,"name":"RestartGame","behaviorType":"logic.gameflow.RestartGame","x":630,"y":192,"group":"a4c2fcaa43e6e048","id":"afd03a704d9cdd4e"},{"gateVal":0,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter2","x":450,"y":192,"group":"a4c2fcaa43e6e048","id":"afd1489db4bd3843"},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":0,"group":"a4c2fcaa43e6e048","id":"afd680d9fdace140","portId":"a4c2fcaa43e6e048i0","tag":"input","dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":-270,"y":0,"group":"a4c2fcaa43e6e048","id":"bdf6766bde9f4a43","_startVal":0,"dataType":2},{"inputCount":3,"outputCount":4,"name":"SoundEffect","behaviorType":"logic.components.SoundEffect","x":90,"y":336,"group":"cb04b1a13a61ca41","id":"c8c4ba5003410d4d","sound":null,"loop":true,"volume":20,"url":null,"soundName":"chase","soundURL":"/music/loops/chase.ogg.mp3"},{"inputCount":3,"outputCount":4,"name":"SoundEffect","behaviorType":"logic.components.SoundEffect","x":-270,"y":208,"group":"cb04b1a13a61ca41","id":"c8c5b27796089f4f","sound":null,"loop":true,"volume":20,"url":null,"soundName":"level-3","soundURL":"/music/chiptunes/action/level-3.wav.mp3"},{"inputCount":0,"outputCount":1,"name":"Mailbox","behaviorType":"logic.components.Mailbox","x":-450,"y":448,"group":"cb04b1a13a61ca41","id":"c8c7870a623e9b47","msg":"Win"},{"inputCount":2,"outputCount":2,"name":"LoadLevel","behaviorType":"logic.gameflow.NextLevel","x":90,"y":208,"group":"cb04b1a13a61ca41","id":"c8c845a8b1f36e4c","levelId":4088973},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":90,"y":112,"group":"cb04b1a13a61ca41","id":"c8c8921c14528f48","startVal":1750,"tag":"","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":-90,"y":208,"group":"cb04b1a13a61ca41","id":"c8c9ca6e3f163a47","_startVal":0,"dataType":2},{"inputCount":3,"outputCount":4,"name":"SoundEffect","behaviorType":"logic.components.SoundEffect","x":270,"y":336,"group":"cb04b1a13a61ca41","id":"c8dc684783315b46","sound":null,"loop":false,"volume":20,"url":null,"soundName":"success sound effect 10","soundURL":"/effects/success/Transistion_Retro_GameStart_02.wav.mp3"},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":-90,"y":336,"group":"cb04b1a13a61ca41","id":"c8e34ff664729444","_startVal":0,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":-270,"y":336,"group":"cb04b1a13a61ca41","id":"c8e3f854ca4c3d48","_startVal":0,"dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":90,"y":464,"group":"cb04b1a13a61ca41","id":"cb04e6ec72853f43","portId":"cb04b1a13a61ca41o0","tag":"Reset","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":208,"group":"cb04b1a13a61ca41","id":"cb04e7f2fd47e14c","portId":"cb04b1a13a61ca41i0","tag":"input","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":288,"group":"cb04b1a13a61ca41","id":"cb055be4d5efe04b","portId":"cb04b1a13a61ca41i1","tag":"Start","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":270,"y":112,"group":"cb04b1a13a61ca41","id":"cb0668d52255c940","portId":"cb04b1a13a61ca41o1","tag":"Set","dataType":2},{"inputCount":2,"outputCount":2,"name":"Custom","behaviorType":"logic.NodeGroup","x":-270,"y":96,"group":"a4c2fcaa43e6e048","id":"cb04b1a13a61ca41","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Mailbox","behaviorType":"logic.components.Mailbox","x":-450,"y":96,"group":"a4c2fcaa43e6e048","id":"cb04b813e1344845","msg":"Start"}],"links":[{"input_id":"a4c39c06f6ca644bi1","output_id":"a4c1f61e2856734fo0"},{"input_id":"a4c4d7c4f5821a40i0","output_id":"a4c24ce3f464e142o0"},{"input_id":"a4c4d7c4f5821a40i1","output_id":"a4c24ce3f464e142o0"},{"input_id":"afd1489db4bd3843i1","output_id":"a4c24ce3f464e142o0"},{"input_id":"a4c9cc0b72cc5c47i1","output_id":"a4c27b56ee69b14do0"},{"input_id":"a4c24ce3f464e142i2","output_id":"a4c39c06f6ca644bo0"},{"input_id":"a4c2bf636c749949i0","output_id":"a4c4d7c4f5821a40o0"},{"input_id":"a4c9e22ab1c10c4ei1","output_id":"a4c9cc0b72cc5c47o0"},{"input_id":"a4d49222e99e5445i1","output_id":"a4c9e22ab1c10c4eo1"},{"input_id":"a4c2bf636c749949i0","output_id":"a4d49222e99e5445o0"},{"input_id":"a4c24ce3f464e142i0","output_id":"afcfd23dc415744eo0"},{"input_id":"afcfd23dc415744ei1","output_id":"afd1489db4bd3843o0"},{"input_id":"afd03a704d9cdd4ei0","output_id":"afd1489db4bd3843o0"},{"input_id":"bdf6766bde9f4a43i1","output_id":"afd680d9fdace140o0"},{"input_id":"cb04b1a13a61ca41i0","output_id":"afd680d9fdace140o0"},{"input_id":"a4c1f61e2856734fi0","output_id":"bdf6766bde9f4a43o0"},{"input_id":"c8dc684783315b46i0","output_id":"c8c4ba5003410d4do1"},{"input_id":"c8c9ca6e3f163a47i1","output_id":"c8c5b27796089f4fo0"},{"input_id":"c8c9ca6e3f163a47i2","output_id":"c8c5b27796089f4fo1"},{"input_id":"c8c5b27796089f4fi1","output_id":"c8c7870a623e9b47o0"},{"input_id":"c8e3f854ca4c3d48i1","output_id":"c8c7870a623e9b47o0"},{"input_id":"c8e34ff664729444i2","output_id":"c8c7870a623e9b47o0"},{"input_id":"cb0668d52255c940i0","output_id":"c8c8921c14528f48o0"},{"input_id":"c8c8921c14528f48i1","output_id":"c8c9ca6e3f163a47o0"},{"input_id":"c8c9ca6e3f163a47i0","output_id":"c8c9ca6e3f163a47o0"},{"input_id":"c8c845a8b1f36e4ci0","output_id":"c8c9ca6e3f163a47o0"},{"input_id":"c8c4ba5003410d4di0","output_id":"c8c9ca6e3f163a47o0"},{"input_id":"c8c4ba5003410d4di1","output_id":"c8e34ff664729444o0"},{"input_id":"cb04e6ec72853f43i0","output_id":"c8e34ff664729444o0"},{"input_id":"c8e34ff664729444i1","output_id":"c8e3f854ca4c3d48o0"},{"input_id":"c8c5b27796089f4fi0","output_id":"cb04e7f2fd47e14co0"},{"input_id":"c8e3f854ca4c3d48i2","output_id":"cb055be4d5efe04bo0"},{"input_id":"a4c1f61e2856734fi1","output_id":"cb04b1a13a61ca41o0"},{"input_id":"a4c24ce3f464e142i0","output_id":"cb04b1a13a61ca41o1"},{"input_id":"bdf6766bde9f4a43i2","output_id":"cb04b813e1344845o0"},{"input_id":"cb04b1a13a61ca41i1","output_id":"cb04b813e1344845o0"}]}}}
1 Like

I found the source of the bug, there was a copy of the block on top of it. So I saved the bundle of everything because you are forced to delete all of its kind. But the bundle actually only saved one part of the code so I am set back several days

But don’t feel bad, I remade it along with importing your cleaned code.