Skip to content

Better cables#441

Merged
jrddunbr merged 14 commits into
mainfrom
feature/better-cables
Apr 20, 2026
Merged

Better cables#441
jrddunbr merged 14 commits into
mainfrom
feature/better-cables

Conversation

@jrddunbr

@jrddunbr jrddunbr commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator

Fixes #428

  • The move from voltage and current based cables to AWG cables. These cables will be measured in AWG and/or mm^2 (the one shown based on config option). Cables will have an insulation thickness as well which will determine the voltage rating of the cable before electric shocks occur. This insulation will also have a negative multiplier towards the thermal performance of cables; bare cables will deal damage above 50V correlating to the voltage applied.
  • There will be cable material types.
  • Any reasonable cable will be able to be installed on telephone poles
  • New machine assembly lines will be introduced:
  • Wire Combiner - used to make multi-conductor wires
  • Wire Roller - used to create wire from metal rods or ingots
  • Wire Insulator - used to apply a specific amount of insulation to a wire.
  • A manual method using a forge hammer to create wires that is inefficient but at least gets you to the stage of having a wire roller and wire spooler.

Implementation todos:

  • Improve textures of cables
  • Improve textures and models of machines
  • Fix cable rendering on edge cases specifically surrounding Etent and similar cable render modes.
  • Fix molten wires never cooling down

Signal updates:

  • Signal cables will be removed. In place of this, the signal system will use low voltage low current cables that are easy to make and are held to a range of 0-5V. Signal devices will be destroyed if they source/sink too much current (depending on the device) or if the input voltage is outside the range of -0.5V to +5.5V (depending on the device)
  • Signal Bus cables will simply become Bus Cables - small AWG and insulation cables that allow for many power or signals to be sent down these wires.
  • Signal variants of relays, switches, etc will be eliminated
  • Signal devices will require nearby signal power to operate, or will allow power to be directly applied.

- Introduced `WireSnipsDescriptor` class for handling wire cutting tools with configurable cut lengths.
- Added `WireSnipsContainer` and corresponding GUI for interactive wire cutting.
- Implemented utility cable length management, including placement and cutting length constraints.
- Enhanced electrical pole and grid connection logic to support segmented utility cables.
- Added `WireScrapDescriptor` for generating wire scrap from utility cables.
- Adjusted cable width/height calculations ensuring consistent appearance across temperature ranges.
- Added support for dynamic thermal behaviors, including temperature tracking and heat-based smoke rendering.
- Introduced methods for drawing hot metal glows, flat and single conductors, and junction nodes based on connections.
- Enhanced cable material and texture management during rendering processes.
@jrddunbr jrddunbr added playtest This pull request needs to be tested before ready refactor This code needs a refactor code work Needs code implementation labels Mar 29, 2026
- Introduced `WireProcessingMachines.kt` with three machine types: Wire Roller, Wire Insulator, and Wire Combiner.
- Implemented inventory, rendering, and network serialization for each machine type.
- Added configurable options and progress tracking for wire processing operations.
- Integrated material handling for wire rolling, insulation, and combination processes.
- Introduced `/eln zonedestroy` command for removing all Eln nodes and blocks within a defined zone, with no item drops.
- Added Falstad importing functionality, including parsing, validation, and layout planning for electrical designs.
- Implemented `FalstadImporter` for processing clipboard netlists into in-game circuits.
- Enhanced `DelayedTaskManager` to use a thread-safe queue for task management.
- Refactored node logging to improve readability and debugging.
- Introduced support for parsing SPDT switches as two complementary maintained switches with forced switch states.
- Added rotated layout planning functionality, allowing clockwise rotation of circuit layouts.
- Enhanced area placement logic to account for rotated layouts and provide better feedback.
- Refactored related utility functions for area measurement and wire placement.
…rter

- Introduced parsing and placement for Falstad NAND gates, signal inputs, and signal outputs, with proper substitutions and validation.
- Added support for rotated layouts and improved wire/node mapping for logic components.
- Enhanced connectivity calculations and placement logic for Falstad components.
- Updated `FalstadImporter` and relevant descriptors to handle signal cables dynamically.
- Extended unit tests to cover new components and logic state parsing.
- Introduced parsing and placement for AND, OR, NOR, XOR, and NOT gates in the Falstad importer.
- Refactored gate placement logic to handle two-input gates generically and added specialized support for NOT gates.
- Updated `FalstadNetlist`, `FalstadImporter`, and descriptors to integrate new gate types and substitutions.
- Enhanced tests with scenarios for half-adder, full-adder, and digital comparator logic symbols.
@jrddunbr jrddunbr marked this pull request as ready for review April 19, 2026 01:19
@jrddunbr

Copy link
Copy Markdown
Collaborator Author

Other items on the to-do list will be in a separate PR

- reworked motor behavior into an integrated drive model with soft-start, current limiting, voltage-scaled speed targets, low-speed startup limiting, stall handling, and low-pass filtering on both sensed supply voltage and commanded output voltage
- reworked generator behavior into an integrated regulator model with voltage ramping, current limiting, droop, and low-pass filtering on output voltage to reduce generator-motor feedback loops
- fixed motor idle and undervoltage behavior so the machine no longer behaves like a near-short or falsely dumps shaft energy when supply voltage is low
- fixed generator shaft and thermal power accounting so drag and conversion losses are handled as power terms instead of mixing in step-sized energy incorrectly
- moved generator heating to the actual internal machine resistor instead of heating from a terminal load using cable-style resistance
- increased modeled generator cooling to ambient without raising the acceptable temperature limit
- improved breaker audio by raising the trip sound volume and keeping open/close behavior unchanged
- fixed breaker GUI interaction so the toggle button now activates on mouse release instead of mouse-down, preventing duplicate breaker sounds and actions when exiting the GUI quickly
- improved middle-click pick-block behavior for six-node items so wires prefer the nearest matching hotbar stack instead of producing a fresh stack, which is especially important for utility cables with per-stack NBT
- added targeted logging for six-node deletion paths to distinguish breakBlock, neighbor-driven deletion, and self-destroy cases during load and rejoin debugging
- traced the disappearing utility cable issue to the host SixNodeBlock being broken during load, not to cable melt or destruction
- hardened NodeBlockEntity load-time node lookup so transient null and type-mismatch states during the first update window no longer immediately queue delayed block removal
- added extra diagnostics around node lookup preservation during load to continue narrowing the remaining six-node rejoin instability
- kept all changes save-compatible by avoiding item and block id/subId remaps
…icons

- Deleted `InsulationCompoundDescriptor` and its references.
- Replaced outdated default icons for various cables, fuses, and machines.
- Adjusted electrical cable resistance and voltage constant calculations.
- Added proper overlays for `ElectricalBreakerDescriptor` and enhanced its UI rendering.
- Upgraded matrix inversion logic in `SubSystem` to use `commons-numbers-core`.
- Introduced `docs/mna-double-double-benchmarks.md` to summarize benchmarking results for the `DD` solver path using `commons-numbers-core`.
- Included performance comparisons with previous `double`-based methods and analysis of numerical stability under varying conditions.
- Added charts and tables for build times, solve times, scaling behavior, and error trends.
- Highlighted limitations of the current `DD` implementation for large, dense matrices and outlined recommendations for future improvements.
- Committed related benchmark assets, such as performance graphs and error visualizations.
@jrddunbr jrddunbr merged commit 33608fc into main Apr 20, 2026
1 check passed
@jrddunbr jrddunbr deleted the feature/better-cables branch April 20, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code work Needs code implementation playtest This pull request needs to be tested before ready refactor This code needs a refactor

Development

Successfully merging this pull request may close these issues.

The Cable Update

1 participant