tModLoader MechScope - Wiring visualized

DRKV

Wall of Flesh
In my opinion, there is one big issue with wiring. You can’t really SEE what is actually going on. Everything happens instantly once you flip the switch. This isn’t a big deal if you just want to build simpler door mechanisms or traps, but when you have a huge chain of logic gates, things will quickly become rather confusing… To resolve this problem, I have created MechScope, a TModLoader mod that can pause and visualize the wiring execution process.

How does it work?
There are 4 hotkeys you can use to control MechScope. They can be remapped in the vanilla controls menu.

3Q92Hv1.png

Toggle (NumPad1)
Activates or deactivates MechScope. While active, any wire trigger will be intercepted and paused. The state of the wiring system will be displayed based on the visual settings.​

Step (NumPad2)
Advances the wiring system by one step. The granularity of the steps depends the mode setting.​

Auto-step (NumPad3)
Activates or deactivates the automatic step timer. When active, a step will happen once the number of frames indicated by the auto step rate have passed.​

Settings (NumPad5)
Opens the settings menu.​

Mouse indicator
The small squares next to your cursor indicate the state of the mod.
  • Yellow square: MechScope is active
  • Red square: MechScope is active, and wiring is currently paused
  • Green square: auto-step is active.
vn4gRxc.png
5sxzH7Q.png

While the wiring system is paused, additional wire triggers will be queued up, and will only run once the current wire iteration has finished. Timers will also be paused.

OT5oiqO.png


VSU7eAA.png


Mode
The mode setting determines when the wring gets paused during the execution process.

Single
The wiring system will be paused after examining every individual block.

Wire
The wiring will pause after processing a whole run of wires. Red, blue, green and yellow wires will all appear separately.

Source
Wiring will be paused after handling all wires connected to a trigger source.

Stage
Wiring will only be paused before processing logic gates, that had their lamps toggled. This mode lets you find logic gate “delay” based issues easily.

Visuals
The source of the wire signal that is currently being processed is marked with a red border. In single mode, the tile that is currently being examined will also have a similar border. Triggered wires will be marked with a square with the same color as the wire.

Wire skip
Marks tiles, that have been explicitly flagged to skip wire activations on, with a red ‘X’. This usually happens when multi tile objects are triggered, such as statues. (There is currently a bug in the game, that causes certain objects to not skip wires, if a previous wire color has already executed.) Wire skip marks will only work in Single mode.​

Gates done
Marks gates with a white ‘X’ if they have already triggered during the current wire iteration. If triggered again, these gates won't emit a signal, they will only make a puff of smoke.​

Upcoming gates
These are the gates that had their state changed, and are currently waiting for their turn to output a signal. They are marked by a red ‘O’.​

Triggered lamps
These lamps, marked by an orange ‘?’, were triggered, but the state of their gate has not been evaluated yet. This will not display in Stage mode.​

Triggered teleporters
A white number will show next to activated teleporters, indicating which wire they were triggered by.​
  • 1 = red
  • 2 = blue
  • 3 = green
  • 4 = yellow
These numbers also tell you what order the teleportations will happen in. This only works in Source or Stage mode.​

Triggered pumps
Numbers pumps based on the order they were activated in. Red is input, green is output.​

I listed these markers in the order in which they are drawn. If a tile has two different markers on it, only the one further down the list will be shown.

Auto-step rate
This number indicates how many frames have to pass before an automatic step happens. A setting of 30 means one step will happen once every half a second.

Compatibility
This mod does not affect the way wiring actually works, so all wiring devices should function as normal, unless they rely on other game aspect, such as HOIK actors. This mod should also be compatible with other wring related mods. MechScope currently does not work in multiplayer. I don't really see many people interested in this feature, but if there's a demand for it, I can probably make it work.

Technical details
So, you might be asking, how is this even possible in TModLoader? To make this mod, I used a library know as Harmony. Harmony can apply patches to managed code at any point during runtime. It can even interoperate with other instances of itself, allowing multiple mods to patch the same methods. Harmony is commonly used to mod various games based on the Unity engine.

Download
As usual, the mod can be downloaded from the TModLoader Mod Browser or from GitHub, where you'll also find the source code.
https://github.com/DRKV333/MechScope/
 
Last edited:
This is so cool! Is this the thing you had mentioned on the Mechmod thread?
Indeed. :)
Am I the only one who has read this entire topic three times and understood nothing? :(
I'll try one more time haha, sounds interesting!
Just play around with it bit, it will make a lot more sense. I described things very technically, you'd probably need to look at the actual wiring code, to understand most of it. You can check out this guide on to T-MEC to learn more about wiring and the order in which things happen. https://forums.terraria.org/index.p...operations-smoke-and-how-to-prevent-it.44020/
 
I've fixed a few issues, and the mod is now officially available on the Mod Browse. :happy:
Also, something I should have probably mentioned in the OP:
MechScope currently does not work in multiplayer. I don't really see many people interested in this feature, but if there's a demand for it, I can probably make it work.
 
This is very interesting. When ever I'm doing wiring I always picture in my mind a pulse of energy flowing through the wires to trigger things. But this mod shows you what is happening and in the order they happen. I think this would be a good tool for teaching a lot of people who don't understand wiring how to wire.
 
Incredible work. I have some ideas that you may add to this mod.
  • Logic Lamp Rod: functions like actuator rod, but affects logic lamps. It can switch logic lamps' states without activating any wire. It would be very useful if some logic lamps have wrong states and one have to change their states with no need to replace all logic lamps stacked above it. Its upgraded version is Activating Rod, which can activate any tile that can be activated except actuator.
  • I don't know how to name this item. it works like Grand Design, but places logic gates and logic lamps instead of wires and actuators. It works when a variety of logic gates and logic lamps take too much space of the hotbar, while there are many other items to be used often.
  • A hammer that can hammer hoiks while cannot hammer background walls.
  • I wonder if you can coop with MechMod developers and bring some features from MechMod. It is a pity that MechMod is not compatible with TModLoader.
  • A sponge that can absorb all kinds of liquids.
  • Move a tile with wires connecting to it. Many restrictions on moving are needed to avoid bugs.
  • Paint Gun: functions like clentaminator, but uses paints as ammo.
 
Incredible work. I have some ideas that you may add to this mod.
  • Logic Lamp Rod: functions like actuator rod, but affects logic lamps. It can switch logic lamps' states without activating any wire. It would be very useful if some logic lamps have wrong states and one have to change their states with no need to replace all logic lamps stacked above it. Its upgraded version is Activating Rod, which can activate any tile that can be activated except actuator.
  • I don't know how to name this item. it works like Grand Design, but places logic gates and logic lamps instead of wires and actuators. It works when a variety of logic gates and logic lamps take too much space of the hotbar, while there are many other items to be used often.
  • A hammer that can hammer hoiks while cannot hammer background walls.
  • I wonder if you can coop with MechMod developers and bring some features from MechMod. It is a pity that MechMod is not compatible with TModLoader.
  • A sponge that can absorb all kinds of liquids.
  • Move a tile with wires connecting to it. Many restrictions on moving are needed to avoid bugs.
  • Paint Gun: functions like clentaminator, but uses paints as ammo.

Before 1.3.1 came out I had already made many suggestions for stuff in 1.3.1 and one was a "Chisel" which would basically do what you said about the hammer for hoiks.
But maybe right-click could effect the background walls.

SovereignVis's Many Suggestions for 1.3.1
 
Before 1.3.1 came out I had already made many suggestions for stuff in 1.3.1 and one was a "Chisel" which would basically do what you said about the hammer for hoiks.
But maybe right-click could effect the background walls.

SovereignVis's Many Suggestions for 1.3.1
That's amazing. Many suggestions have come true.
It is annoying when hammers break walls while making hoiks, because I have to replace the walls or even repaint the walls. That's why I want this hammer.
 
Incredible work. I have some ideas that you may add to this mod.
Yay, thank you! :happy: I worked quite hard on this one, but it looks like not very many people are interested. Thought I am glad at least some people care.

Logic Lamp Rod: functions like actuator rod, but affects logic lamps. It can switch logic lamps' states without activating any wire. It would be very useful if some logic lamps have wrong states and one have to change their states with no need to replace all logic lamps stacked above it. Its upgraded version is Activating Rod, which can activate any tile that can be
Yes, I was thinking about something like this too. It would be incredibly useful.

I don't know how to name this item. it works like Grand Design, but places logic gates and logic lamps instead of wires and actuators. It works when a variety of logic gates and logic lamps take too much space of the hotbar, while there are many other items to be used often.
Hmm... I guess it could work, but I would probably have to rethink the radial ui a bit. I find the grand design is a bit clunky with it's toggles.

A hammer that can hammer hoiks while cannot hammer background walls.
Vipix' toolbox has a thing like that, though is doesn't work too great with hoiks.

I wonder if you can coop with MechMod developers and bring some features from MechMod. It is a pity that MechMod is not compatible with TModLoader.
Possibly. MechMod is now open source, so they would probably be okay with that. I'd have to find a smarter way to apply different pathches to terraria's code, because right now it is kinda manual, and not very maintainable.
This might be problematic as I currently really don't have the time to work on a bigger project like this...

A sponge that can absorb all kinds of liquids.
Should be simple.

Move a tile with wires connecting to it. Many restrictions on moving are needed to avoid bugs.
Do you mean like a copy/paste thing? Cause cheat sheat has that and it works pretty well. Or do you mean like a smart wire router sort of thing? That would be interesting...

Paint Gun: functions like clentaminator, but uses paints as ammo.
Vipix' toolbox does have a paint pallet. There is also Better Paint, but I believe that one uses a custom way to tint blocks instead of the vanilla paint.
 
Last edited:
Vipix' toolbox has a thing like that, though is doesn't work too great with hoiks.
Thanks for introducing the toolbox to me!
Do you mean like a copy/paste thing? Cause cheat sheat has that and it works pretty well. Or do you mean like a smart wire router sort of thing? That would be interesting...
Yep. I hope that wires connected to the tile can be stretched to wherever the tile goes.
This might be problematic as I currently really don't have the time to work on a bigger project like this...
That does not matter. I would appreciate MechScope even if it would not be updated anymore. It helps a lot when I have to explain to others how my mechanisms work.
 
DRKV,

Thank you very much for creating MechScope. When Logic Gates came out, I was overwhelmed by a lack of understanding and tried to help myself by reading the "Logic Gates: Order of Operations, Smoke and how to prevent it" guide, but could not comprehend the concepts presented there until the visuals that MechScope aided me in my understanding.

I see a number of requests for quality of life features Terrarian engineers would like to see from MechScope in this thread.

While I like almost all of these ideas, I don't think that they should necessarily be packaged with the MechScope mod. I also have a few requests of my own, which I am apprehensive of expressing since I consider it a bit of a unfair imposition to demand of someone else their time and effort in making something you, personally, would like to see realized. But maybe they are easy to do. And perhaps, on the basis of my suggestions, other people can brain-storm better ideas.

Would it be possible to add a wire display setting of "hidden" to the Mechanical Lens and Grand Design, or replace the "faded" setting with a "hidden" option? I find overlapping wire colours in Terraria so confusing. When posting builds on T-MEC, I became accustomed making 3 copies of a build in TEdit to then be able to erase all but one colour on each copy to make isolated wire colour snapshots for threads. Instead of a "hidden" setting, perhaps an "isolated" setting that sets all other wire colours to "hidden"?

Unlimited wire and actuators for the Grand Design or an accessory that allows this >.> Cheaty, I know.

Because I am a hoiking guy, I really like the chisel idea; the hammer that does not destroy background walls. Terraria 1.4 has introduced a chisel, but all it does is increase mining speed. Perhaps the new chisel could be repurposed as a accesory that allows a hammers to reimplement their last hammered block orientation with a right click use of a hammer. This in addition to not breaking background walls. With hammers of a particular minimum tier, the chisel could be combined at the tinkerer's workshop to make hoik ready hammers. I had a look at the Vipix smarthammer, but it uses the Grand Designs clunky interface and is overkill for something I find could be done more simply.
 
Would it be possible to add a wire display setting of "hidden" to the Mechanical Lens and Grand Design, or replace the "faded" setting with a "hidden" option? I find overlapping wire colours in Terraria so confusing. When posting builds on T-MEC, I became accustomed making 3 copies of a build in TEdit to then be able to erase all but one colour on each copy to make isolated wire colour snapshots for threads. Instead of a "hidden" setting, perhaps an "isolated" setting that sets all other wire colours to "hidden"?
That should be fairly simple to do I think. I've been meaning to make a separate sort of "wiring utilities" mod. One that is just for quality of life stuff, an unlike MechScope, doesn't have anything cheaty in it. (Like being able to completely turn off all wiring traps in the game. :D)
I have some free time now, so I might start working on this. There are other mods I really need to update as well.
 
Back
Top Bottom