skycoin / cx-game

Game Prototype
7 stars 15 forks source link

Circuits Specifications #531

Closed ted537 closed 2 years ago

ted537 commented 2 years ago

Create markdown document in repo

ted537 commented 2 years ago

A circuit is a continuously connected segment of wire. Each circuit has a list of machine IDs attached to it. A machine is any object that generates or draws power.

When multiple circuits are connected by a switch, then they are considered part of the same group. While connected, the entire circuit group's power will be updated together (see footnote).

When there are no machines connected to a segment of wire, then labeling the segment as a circuit may not be necessary.

footnote

If two circuits in a circuit group are connected by a diode, then power can only be transmitted in one direction.

ted537 commented 2 years ago

image

ted537 commented 2 years ago

Batteries are a special case, as they draw/store a variable quantity of power. Battery power is calculated after all other power calculations. If a circuit consumes more power than it draws, then the extra power is drawn from the battery. Similarly, if a circuit produces more power than it consumes, then the extra power is stored in the battery.

ted537 commented 2 years ago

Brainstorming process for calculating power

Switches/diodes can be found via circuit groups

ted537 commented 2 years ago

Nevermind - this process is insufficient when numerous switches are involved