[Feature suggestion] Analogue Features
JazzaHat opened this issue ยท 9 comments
Hi :)
I have a potential idea.
To enable things like Carry Cancel Adders, and other components that rely on signal strength to benefit from extended wire distances, would it be possible to make a custom comparator which interacts with the Infiniwire and can evaluate the distance of two power sources? It would output True or False / 1 Or 0.
Perhaps using a formula like: Distance from Power source = (Comp.x - Power.x)^2 + (Comp.y - Power.y)^2 + (Comp.z - Power.z)^2
Thanks!
EDIT: Upon Debugging my CCA Adder it appears to work perfect with Infiniwire as it is. :) I didn't understand the logic properly. However, it seems like torches block update the wire into being incorrectly un-powered when used on transparent block.
Which version of the mod are you using?
Also, can you explain more about your custom comparator idea? I don't think I understand it very well.
I have now published a new version of the mod (morewires-1.16.5-3.1.0.0-forge) that should fix the bug you're experiencing. Please try it out and let me know if it works.
I was on 3.0.0.0 :) That does appear to have solved it thank you!
If you wished to incorporate "comparator" like features to check the difference in (traditional) "signal strengths" of some Infiniwire, I imagine calculating a "real" redstone strength over Infiniwire would take a relatively large amount of time.
Instead of iterating over the whole path to find the real distance and updating this for every wire segment, a distance metric based on (idk the technical words) the sum of the squares of the 3D coordinate differences could be used.
Here is a diagram where the comparators would be set to evaluate Back>Side.
This probably isn't ideal for implementation, but it might be a good primer for some other peoples ideas :)
Actually, the way infiniwire is currently implemented, calculating the length of the wire from the power source probably has a similar cost to calculating the absolute distance from the power source. The comparator idea is definitely feasible.
Before I work on implementing it, however, could you explain more on the uses of such a block?
In Vanilla, the standard comparator function is used for high frequency and/or low latency adders and subtractors. the standard 15 power level limit, limits the size of such adders to around ~ 8 bits. Comparators that can compare strengths greater than 15 would extend the limit to infinite* size :)
I am not sure what other circuits could benefit. The above point alone is probably not worth the effort.
PS. I been enjoying this mod a lot, Currently working on ~1KB of analogue memory where the cells have footprints of 2x4x5, a significant reduction of standard vanilla designs! Is there a more general chat, perhaps a Discord or something. I am sure there would be a reasonable amount of people interested in this mod :)
Edit: I have two slight bugs" but I don't want to unnecessarily add issues to your github. And Also they are World Edit (worldedit-mod-7.2.5-dist.jar) related.
- World edit commands drop Infiniwire randomly, this makes copy/paste difficult. Pasting twice fixes any missing wire. I remember when this problem occurred with Vanilla Redstone, likely cause the paste order of World Edit causes the to be placed on air blocks? This doesn't happen to vanilla components anymore, so maybe they included a quick way to tag a block as "Place last" or something?
2a. Pasted Wires sometimes do not connect properly. Manually replacing them fixes this issue.
2b. Sometimes pasted wires refuse to take power at all. Even replacing wires and they still do not function. Solved by restarting the game.
2c. Some wires do not connect properly and restarting the game does not solve this, HOWEVER, manually replacing or updating the wire does solve it.
Is it possible to add a hotkey to reset the wires which effectively acts as a reboot of the game? I'm sure once I have a bit more game time I will be able to assist in narrowing down the cause a little more.
Do the issues with world edit also occur when using the vanilla structures / structure blocks to copy wires?
From my inexperienced test, it does seem to copy successfully when using structure blocks :) So it seems like its only a problem with world edit.