Redstone...
#5
Recursive, or something else? It won't be too difficult to make redstone work recursively, just really annoying. I've already figured out how to make a new redstone torch update all redstone wires around it. Have to think of a way to avoid infinite loops though.

What about something else though?

All wires belong to a virtual circuit.

Example:
2 redstone wire blocks at 0, 0, 120 and 1, 0, 120 belongs to virtual wire 1211 that connects to device piston 120 and power device redstone torch 219

if power device 219 turns off and no other virtual power devices are attached to virtual wire 1211, then all redstone wire in virtual wire 1211 are set to meta value 0 (off state). and all devices attached to virtual wire 1211 are checked for other power sources, if none are found then the device is turned off.

I can find a way to make this work with MySQL and PHP, and I'm positive there's a way to make it work with c++, I'm, just not sure how yet. I read something about has tables that might do the trick.

Each "state change event" should only happen once per tick or the server will do nothing but update redstone wires. I'm pretty sure this is how the notch server works which is what causes the lag when using repeaters. The problem with the notch server is the 16 wire length because of the recursive nature of his redstone design. The virtual circuit would eliminate that problem since the circuit won't care if the blocks are 16 or 16,000 blocks away. It will only calculate changes based on the devices attached to the wire being changed, not every 32 blocks per redstone device.

I'm not sure how you would import a redstone circuit yet. I guess when an unattached redstone device was found the redstone class would need to recursively recalculate the entire circuit all at once and load it as a new virtual circuit.

Virtual redstone circuits would either need to be saved in a file, or recalculated and put into memory every time the server was started. I think the later would be the safest way to do it, but would cause lag on VERY large circuits.
Reply
Thanks given by:


Messages In This Thread
Redstone... - by rs2k - 11-02-2011, 12:22 PM
RE: Redstone... - by FakeTruth - 11-02-2011, 12:48 PM
RE: Redstone... - by rs2k - 11-02-2011, 01:15 PM
RE: Redstone... - by rs2k - 11-04-2011, 03:55 AM
RE: Redstone... - by rs2k - 11-04-2011, 05:26 AM
RE: Redstone... - by FakeTruth - 11-04-2011, 10:22 AM
RE: Redstone... - by rs2k - 11-04-2011, 03:12 PM
RE: Redstone... - by FakeTruth - 11-05-2011, 01:53 AM
RE: Redstone... - by rs2k - 11-06-2011, 04:46 AM
RE: Redstone... - by rs2k - 11-09-2011, 11:35 AM
RE: Redstone... - by NiLSPACE - 11-28-2012, 05:29 AM



Users browsing this thread: 7 Guest(s)