Page 1 of 1

[Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Tue Feb 28, 2017 21:49
by qwertymine3
An alternative circuitry mod to mesecons.

I am looking for constructive feedback on what should be added to or changed in this mod.
Please keep in mind the style of this mod - I am not looking to re-make mesecons with lua-controllers and logic gates as basic nodes - logic should be build from primative nodes. Also please check planned features before suggesting something that I'm planning.
Image
Planned addtions/changes
* Move some nodes out of this mod into seperate sub-mods
* Some kind of node for precision in tick timing?
* Add pistons (please suggest other world interaction nodes)
* Force-load circuits?

Basic info for use
There are 12 ticks per second.
Inverters invert the incoming signal with a 1 tick delay (like minecraft redstone torches).
Coloured wire only connects to wire of the same colour - the mese coloured wire connects to all colours.
Buttons are powered for 1 second - the number of ticks is not guarenteed.

Additional use instructions
Nodes are only availiable in creative mode.
The wrench must be used to rotate nodes, as the screwdriver doesn't update the nodes.
DO NOT use the wrench on chests - all items will be lost.
Circuits are not forceloaded - make sure no circuits are running when you leave an area.
Wire networks are limited to 50 nodes (including things connected to the wire).

Downloads
https://github.com/Qwertymine/circuits/archive/master.zip
Github Page
https://github.com/Qwertymine/circuits

Depends
Must be added to the 'trusted mods list' in settings - as this mod requires bitops.
Default (textures)
Luajit (Bitops)

License
This is licensed under the MIT license
+ License

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 01, 2017 06:35
by octacian
This honestly looks pretty cool! Will likely also help with the development of my mod, MicroExpansion, as XtremeHacker and I are currently at loss as to how to implement the technic-like power cables. And wow, it takes a long time to read enough to figure it out; neither one of us are done yet xD

One suggestion: please don't divide this mod into a modpack. If you want to allow for enabling or disabling certain portions, at least do something like I did for MicroExpansion and digicompute with a module system built right into the mod.

Why: using a modpack clutters /mods and everything else related and also prevents this mod from being included in another modpack.

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 01, 2017 11:15
by cx384
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2017-03-01 12:08:10: ACTION[Server]: singleplayer places node circuits:button_on at (346,20,-3)
2017-03-01 12:08:14: ACTION[Server]: singleplayer digs circuits:button_on at (346,20,-3)
2017-03-01 12:08:14: WARNING[Server]: Undeclared global variable "bit" accessed at /.../.minetest/mods/circuits/connection.lua:249
2017-03-01 12:08:14: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'circuits' in callback node_on_dig(): Runtime error from mod 'circuits' in callback node_on_destruct(): /.../.minetest/mods/circuits/connection.lua:249: attempt to index global 'bi
2017-03-01 12:08:14: ERROR[Main]: ' (a nil value)
2017-03-01 12:08:14: ERROR[Main]: stack traceback:
2017-03-01 12:08:14: ERROR[Main]:    /.../mods/circuits/connection.lua:249: in function 'get_connected_in_dir'
2017-03-01 12:08:14: ERROR[Main]:    /.../.minetest/mods/circuits/connection.lua:295: in function 'get_all_connected'
2017-03-01 12:08:14: ERROR[Main]:    /.../.minetest/mods/circuits/connection.lua:216: in function 'disconnect_all'
2017-03-01 12:08:14: ERROR[Main]:    /.../.minetest/mods/circuits/util.lua:92: in function </.../.minetest/mods/circuits/util.lua:90>

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 01, 2017 15:19
by rubenwardy
Please do use separate mods for nonessential items such as lua controllers, as it makes dependencies nicer, and means the user can enable and disable without using settings. The ui problem of /mods is a ui problem of /mods, and shouldn't get in the way of making dependencies cleaner and modular

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 01, 2017 15:29
by Naj
octacian wrote:This honestly looks pretty cool! Will likely also help with the development of my mod, MicroExpansion, as XtremeHacker and I are currently at loss as to how to implement the technic-like power cables. And wow, it takes a long time to read enough to figure it out; neither one of us are done yet xD


I began to work on a network API. It is tested but not yet in use in any mod. You can find the code here : https://github.com/pyrollo/factory_modpack

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 01, 2017 15:33
by octacian
rubenwardy wrote:Please do use separate mods for nonessential items such as lua controllers, as it makes dependencies nicer, and means the user can enable and disable without using settings. The ui problem of /mods is a ui problem of /mods, and shouldn't get in the way of making dependencies cleaner and modular


Yes, but again, what if someone wanted to put this in a modpack? Well, not happening. It's already a modpack. I've had to fight with mesecons over that before. At one point I remember actually going and moving it to one mod for something I was doing. And wow, I really don't wanna do it again.

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 01, 2017 15:41
by qwertymine3
cx384 wrote:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2017-03-01 12:08:10: ACTION[Server]: singleplayer places node circuits:button_on at (346,20,-3)
2017-03-01 12:08:14: ACTION[Server]: singleplayer digs circuits:button_on at (346,20,-3)
2017-03-01 12:08:14: WARNING[Server]: Undeclared global variable "bit" accessed at /.../.minetest/mods/circuits/connection.lua:249
2017-03-01 12:08:14: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'circuits' in callback node_on_dig(): Runtime error from mod 'circuits' in callback node_on_destruct(): /.../.minetest/mods/circuits/connection.lua:249: attempt to index global 'bi
2017-03-01 12:08:14: ERROR[Main]: ' (a nil value)
2017-03-01 12:08:14: ERROR[Main]: stack traceback:
2017-03-01 12:08:14: ERROR[Main]:    /.../mods/circuits/connection.lua:249: in function 'get_connected_in_dir'
2017-03-01 12:08:14: ERROR[Main]:    /.../.minetest/mods/circuits/connection.lua:295: in function 'get_all_connected'
2017-03-01 12:08:14: ERROR[Main]:    /.../.minetest/mods/circuits/connection.lua:216: in function 'disconnect_all'
2017-03-01 12:08:14: ERROR[Main]:    /.../.minetest/mods/circuits/util.lua:92: in function </.../.minetest/mods/circuits/util.lua:90>

Thank you for actually trying the mod.
This mod requires bitops (Luajit) (Which is not in the secure environment for some reason).
I had turned off mod security a while ago, as it was breaking some old mods - and forgot to turn it back on.

I updated this now to correctly load this in the secure environment - but this mod needs to be added to the 'trusted mods' list in settings to work.

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 01, 2017 16:56
by cx384
qwertymine3 wrote:Thank you for actually trying the mod.
This mod requires bitops (Luajit) (Which is not in the secure environment for some reason).
I had turned off mod security a while ago, as it was breaking some old mods - and forgot to turn it back on.

I updated this now to correctly load this in the secure environment - but this mod needs to be added to the 'trusted mods' list in settings to work.


Thank you for the information.
Nice mod, I have already build my first clock with 7 cables and one inverter.(but it was laggy like mesecons)
I think this mod will be a great addition/alternative for mesecons.
qwertymine3 wrote:please suggest other world interaction nodes

– node breaker/digger,placer
– node detector ( should also detect meta data, light level, rotation... )
– object scanner
– mesecon signal detector
– sound player ( which can play any existing sound in minetest )
– right,left clicker ( which can click any craftitem/node/tool on a target for a specific time ( I don't know if this is possible ))

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Mon Mar 06, 2017 13:58
by texmex
Hey qwerty! I've tried this mod out but lightly since I'm not that good with logic functions. But it works quite well with what is is right now. The usecase for my players would be block manipulation (pistons, crafters, diggers etc) and lights (solar panels etc). Door and trapdoor triggers would also be great.

Some thoughts:
  • I like that the wire is thick, thus that it not looks strange standing on its own in mid air.
  • I like that all components are made up of existing textures. Though I guess it's the result of rapid development I think you should keep them like that. They look good and they immediately feel at home in the MT universe.
  • The buttons could be developed further. In creative they're hard to toggle without also digging them. It'd be useful if their placement was similar to the pressure plate, so that you could place another block in between the button and the wire. Doing so would enable embedding buttons in walls and such.
  • Personally I'd like for the power in the circuits to not come from the supposed infinite powers of mese but from a finite power source such as a steam engine or similar. One could imagine an opt-in option called "circuites_require_powersource".

I really want this to be something different from mesecons, a fresh start. Please don't delve into code-like formspecs but keep it simple with basic in-world components. :)

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Tue Mar 28, 2017 13:02
by texmex
Is there anything us players can do to help with further development of this mod?

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Tue Mar 28, 2017 15:52
by bigfoot547
texmex wrote:Is there anything us players can do to help with further development of this mod?

Make a PR? I'd help ;).

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Tue Mar 28, 2017 17:01
by texmex
bigfoot547 wrote:
texmex wrote:Is there anything us players can do to help with further development of this mod?

Make a PR? I'd help ;).

Players aren't usually skilled in coding, if you hadn't noticed. xD

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Tue Mar 28, 2017 23:40
by Fixerol
More alternatives - the better. I hope t does not lag that much, hope...

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Wed Mar 29, 2017 13:37
by DS-minetest
texmex wrote:
bigfoot547 wrote:
texmex wrote:Is there anything us players can do to help with further development of this mod?

Make a PR? I'd help ;).

Players aren't usually skilled in coding, if you hadn't noticed. xD

You can not only make PRs for code but also for styling things like textures, nodeboxes, models, sounds, documentation and co.

Re: [Mod] Circuits - Mesecons alternative [circuits]

PostPosted: Thu Mar 30, 2017 08:11
by texmex
That's true. I do those kind of PRs already, but with this project I'm not sure what the author see as the next step (if there is a next step).