Page 1 of 2

[Mod] Circuits - Mesecons alternative [circuits]

Posted: 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/ ... 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
Spoiler
The MIT License (MIT)

Copyright (c) 2015 qwertymine3

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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

Posted: 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]

Posted: Wed Mar 01, 2017 11:15
by cx384

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]

Posted: 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]

Posted: 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]

Posted: Wed Mar 01, 2017 15:41
by qwertymine3
cx384 wrote:

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]

Posted: 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]

Posted: 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]

Posted: 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]

Posted: Tue Mar 28, 2017 15:52
by bigfoot
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]

Posted: 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]

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

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

Posted: Wed Mar 29, 2017 13:37
by Desour
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]

Posted: 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).

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

Posted: Mon Apr 03, 2017 12:51
by qwertymine3
texmex wrote:Is there anything us players can do to help with further development of this mod?
Do my coursework for me ;).
I've been quite busy recently - and in what spare time I've had, I've been taking a break from minetest modding.

That said, over easter I will have a lot of free time, so I should be able to get a good amount of work done on this mod.
texmex wrote:I'm not sure what the author see as the next step (if there is a next step).
The next step for this mod is world interaction - namely pistons (but I'm also considering other interaction nodes).

I have a reasonable plan for how to impliment them - however I do not know what the precise behaviour should be.
Here are a few questions that you could help me with:
1. What nodes should a piston be able to push? Is it worth trying to restict the nodes that can be pushed as some mods have issues if nodes are pushed?
2. What should happen if a door is pushed with a node at each face? The naive approach would have the node on the top of the door not move - and to fix this I would need to override some mtg nodes?
3. What should happen to entities (both on the pushed nodes and infront)?
4. What should happen to wall mounted nodes on pushed nodes? The naive approach would not move the wallmounted node - but checking for them would make the code much more expensive?
5. What should happen to pushed pistons? Extended and retracted? Sticky and non-sticky?
6. What should happen to pushed nodes which will power something in the next tick? Should their update be moved to their new position - or should it be invalidated? What would be more useful?
7. Should I try to define the update order of pistons - currently they would update in order of distance from the power source, but this is not guarenteed?

I'm also thinking about more wire primatives - levers and some form of wire which can go through walls.
I am not sure how to design the lever node box/mesh, and would happly accept pr's for this - if you have any non-lever ideas for a toggleable input - I would also be happy to look at them.

I am not sure how the 'through wire' work - but unless someone has a fantastic idea on how to do them - I'll leave discussing this until a later date.


You can also help by finding bugs and play-testing it.
IDK what happens if a wire is triggered which goes over into un-loaded areas. I'm pretty certain that it just updates the loaded wire - but it may also crash.
Also I have put a 50 node restriction on the size of a network (wires and all things attached to it), is this a good idea - or should I remove it?

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

Posted: Mon Apr 03, 2017 12:53
by qwertymine3
texmex wrote: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).
Also if you are willing to be dissapointed - I may be willing to privately share some more exotic and unlikely future ideas with you - but this should really wait for the main mod to be finished.

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

Posted: Mon Apr 03, 2017 12:59
by qwertymine3
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 ;).
Thanks for offering your help - I don't think that this mod is quite ready for PRs yet though.

The internal API is not stable, and will be refactored as I continue to work on this.
That said - if you could look at the code and suggest what would make the internal APIs easier to work with (mainly for adding nodes).
Also I have some ideas on how I want to re-design the internal API, which it owuld be nice to discuss with someone.

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

Posted: Mon Apr 03, 2017 13:03
by qwertymine3
Fixerol wrote:More alternatives - the better. I hope t does not lag that much, hope...
I will have to dissapoint you - the visual lag caused by both this and mesecons is due how the minetest engine handles mesh updates.
In terms of server lag, mesecons has had years to optimise their code - while I haven't - so this mod would be the one found wanting.

That said - if the re-coloured node variants in 0.4.16 dev allow for the mesh update to be skipped - I may be able to fix the lag, if you know please tell me.

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

Posted: Wed Apr 05, 2017 19:39
by Fixer
Visual lag can be mitigated by "mesh_generation_interval" in minetest.conf for 0.4.15-dev+

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

Posted: Thu Dec 28, 2017 18:53
by TechNolaByte
octacian wrote:
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.
you might not know this but you can actually nestle mod packs in side of other mod packs which is what I'm doing for my skyfactory mod pack/subgame which is basically a mod pack of modded mod packs inside other modded mod packs which allows for billions of items and about 400 mb in total storage

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

Posted: Thu Dec 28, 2017 18:57
by TechNolaByte
cx384 wrote:– 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 ))
this actually is possible as the mesecons node breaker can left click any item to use its left click function not just break the block and the deployer will right click any item or block.
I know the point of this mod is to provide an alternative to mesecons I'm just pointing out that it is in theory possible to have a block that could right click or left click any item placed into it like Minecraft's autonomous activator mod

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

Posted: Tue Jan 02, 2018 18:58
by Sires
I would like to see "animated piston heads" just like the ones in minecr***, even if it's an optional thing because it may lag in lots of blocks(maybe ya could put some limits as 10 or 15 blocks). I would help if you plan adding this

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

Posted: Tue Jan 02, 2018 19:15
by Sires
Here comes my "world interaction nodes suggestions":
->Mover, it's a non-solid node that just moves one block forward to where it's pointing any entities inside it when powered
->Thrower, it's like the mover but when powered by different wire colors it throws the entities in different amount of blocks, example: Green wire throws the entities in 5 blocks, Blue/Purple throws in 7, Light Blue/Light Purple throws in 6 etc..

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

Posted: Tue Jan 02, 2018 19:19
by TechNolaByte
Sires wrote:minecr***
why does every body bleep out part of the name Minecraft?

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

Posted: Tue Jan 02, 2018 20:06
by Sires
RSLRedstonier wrote:
Sires wrote:minecr***
why does every body bleep out part of the name Minecraft?
Because:
Shhhh! It's a badword!! No swearing plz

:P