Commit Graph

13269 Commits

Author SHA1 Message Date
teknomunk
e91a288782 Remove extra build_netlist() that always is run on block update (expensive) 2025-01-11 09:15:18 -06:00
teknomunk
9605ae4a5e Make sure reverse mapping in netlist_map always includes entries all wires and sinks when there are no sources (fixes netlists not depowering when no power sources present) 2025-01-11 09:15:18 -06:00
teknomunk
46bc8daac9 Connect up circuits thru weakly powered blocks while disallowing passthru to wire 2025-01-11 09:15:18 -06:00
teknomunk
0907f4f941 Start strong/weak block powering logic 2025-01-11 09:15:18 -06:00
teknomunk
4cfcef9efd Make power source nodes (redstone torches, redstone blocks, etc) power nets 2025-01-11 09:15:18 -06:00
teknomunk
d28eecaff0 Clear netlist information from caches, update caches when new netlists are created 2025-01-11 09:15:18 -06:00
teknomunk
2d6b1e66e8 Stop crashes in recomputing netlist map (will need to be looked at again, shouldn't crash), background wire power update, update netlist members when updated (not working entirely correctly) 2025-01-11 09:15:18 -06:00
teknomunk
7d3090b3e1 Fix multi-source power level recalculation 2025-01-11 09:15:18 -06:00
teknomunk
d882bc7c9f Rename source_map to netlist_map, rework netlist map to forward/reverse for each of sinks and wires 2025-01-11 09:15:18 -06:00
teknomunk
53f5e5acb8 Stop pistons from crashing due to calling commented out mesecons functions, make pistons breaking redstone trails unset the old netlist positions, add todo for recomputing power levels of the new netlist 2025-01-11 09:15:18 -06:00
teknomunk
a1c56c3bfd Add file 2025-01-11 09:15:18 -06:00
teknomunk
81bafef7de Turn off a bunch of debug logging, adjust power length and power recalc 2025-01-11 09:15:18 -06:00
teknomunk
b5f5d8550c Connect up circuit-based redstone enough to turn on lamps (length limited), disable mesecons services for dig/place node to prevent it messing up wire power levels 2025-01-11 09:15:17 -06:00
teknomunk
05df3024da Make sure mesecons is loaded before vl_restone so that we can reliably override mesecon.receptor_*() functions 2025-01-11 09:14:52 -06:00
teknomunk
f4130bf508 Implement netlist tracing, start of mesecon.receptor_*() override 2025-01-11 09:14:51 -06:00
teknomunk
193f0889b5 Start building netlist 2025-01-11 09:14:51 -06:00
teknomunk
ef0ac17804 Initial redstone circuit implementation of wires 2025-01-11 09:14:50 -06:00
teknomunk
f661fcc613 Compute mesecons rules from wire connectivity rules 2025-01-11 09:06:56 -06:00
teknomunk
92317502c5 Correct node data update condition 2025-01-11 09:06:56 -06:00
teknomunk
8cd982be0b Move wire connection test out to separate function, add back dust-mesecon device connection logic 2025-01-11 09:06:56 -06:00
teknomunk
653321dd20 Stop crash when placing redstone dust next to unknown nodes 2025-01-11 09:06:56 -06:00
teknomunk
540a419b7e Add non-debug palette, remove dead code 2025-01-11 09:06:56 -06:00
teknomunk
3ced98c2df Make mesecons turn on/off new wire correctly 2025-01-11 09:06:56 -06:00
teknomunk
9b321fe490 minetest. -> core., fix typo that prevent wires from breaking/joining on block updates 2025-01-11 09:06:56 -06:00
teknomunk
32cd0152cb Remove circuits from this branch 2025-01-11 09:06:56 -06:00
teknomunk
829bc4d829 Fill out all 256 possible wire connection patterns 2025-01-11 09:06:56 -06:00
teknomunk
9d2e4ba8e6 Initial redstone circuit implementation of wires 2025-01-11 09:06:55 -06:00
teknomunk
2740ad5e1b Rework codegen and vl_block_update, add lookaside cache for core.get_node(), make observers get alternating on/off pulses when starting up a world 2025-01-11 09:05:38 -06:00
teknomunk
c58ab89885 Add type annotations, fix typo in mesecons_mvps, drop using custom mvps handler for existing mechanism, rewrite observer node registration to no longer use mesecon.register_node() 2025-01-11 15:48:51 +01:00
teknomunk
10f1f2ec4e Add faster bypass when no block updates have occurred 2025-01-11 15:48:51 +01:00
teknomunk
34525462ab Resolve more luacheck findings 2025-01-11 15:48:51 +01:00
teknomunk
ab1013fdb0 Rework codegen and vl_block_update, add lookaside cache for core.get_node(), make observers get alternating on/off pulses when starting up a world 2025-01-11 15:48:51 +01:00
teknomunk
e87e1b7521 Get observer clocks starting reliably across reloads 2025-01-11 15:48:51 +01:00
teknomunk
6d0addf4f1 Replace vector.add(pos, {}) with vector.offset 2025-01-11 15:48:51 +01:00
teknomunk
c4f39c8340 Use codegen when core.hash_node_position() returns a number 2025-01-11 15:48:51 +01:00
teknomunk
a0e28f95c3 Fix crash when piston moves observers very fast 2025-01-11 15:48:51 +01:00
teknomunk
a3d193f12b Make moving observers with a piston forcibly activate them 2025-01-11 15:48:51 +01:00
teknomunk
9c4ec7df23 Add mesecon to list of globals exposed by meseconds mod (should resolve a lot of luacheck issues) 2025-01-11 15:48:51 +01:00
teknomunk
cdd8f8fcd5 Resolve some luacheck issues, change piston node name check for node definition callback _onmove(pos,node,def) 2025-01-11 15:48:51 +01:00
teknomunk
38d1267c54 Rework observers to use core.after and an _onload() startup (fixes observers using block updates except on some restarts) 2025-01-11 15:48:51 +01:00
teknomunk
7b75149de6 Implement block updates, rewrite observer to use block update-triggered scanning, make observer ignore 'ignore' nodes 2025-01-11 15:48:51 +01:00
teknomunk
7eafdfbf62 Convert minetest->core, add type annotations, make sure all task callbacks have a dtime passed in (0 for async) 2025-01-11 15:15:44 +01:00
teknomunk
98078cee8e Add code to support cancelling jobs 2025-01-11 15:15:44 +01:00
teknomunk
2da59d93cf Fix crash when tasks are scheduled for the next timestep into priority 2 from inside a function dispatched from priority 2 2025-01-11 15:15:44 +01:00
teknomunk
2257beca7c Add vl_scheduler.after() that acts like after() except it takes a priority as param 2, add tests for background tests, fix appending to existing list for next timestep 2025-01-11 15:15:44 +01:00
teknomunk
88ddb8a17c Implementation scheduler with next-timestep/soon/later queues and 4 priority levels (async-now, main_thread-now, async-background and main_thread-background) that throttles background tasks to keep under a timestep budget (1/20 second) 2025-01-11 15:15:44 +01:00
teknomunk
6cc0e22818 Fix regex error 2025-01-11 07:35:22 -06:00
teknomunk
60329a1720 Fix call 2025-01-11 07:35:22 -06:00
teknomunk
beb93e124c Address review comments 2025-01-11 07:35:22 -06:00
teknomunk
45ded56e45 Detect lua version 2025-01-11 07:35:22 -06:00