Friday, March 14, 2014


Research Computer

 The research computer serves one simple purpose.  It allows you to view the technology tree as you understand it.  You start with a few technologies, such as knowledge of the new metals, basic understanding of the makeup of materials, and basic circuity.  The computer gives you insight into how the technologies you know may be combined together, with a hint towards what you're working towards.  Thus you can always see what is available for you to head towards next.


 Technologies are the individual milestones in the research tech tree.  Technologies are either hidden, discovered, or researched.  When all prerequisite technologies are researched, a technology becomes discovered, and visible in the tech tree.  Clicking on the technology at this point will give you a name, a crafting grid, and a small descriptor of what the possibility of this technology is.  Putting the listed materials into a Research Console allows you to create a data card with the information corresponding to this technology, which can be used to unlock it for a player.  Only players who have the technology discovered can use the data card.

Once a technology is discovered, it will give recipe patterns for all of the items associated with this particular technology.  It may also give additional information about the technology as a whole.

Research Console

This is where the research actually happens.  Placing the materials from a discovered Technology into the console, you can begin the process of analyzing these materials.  This takes time, but nothing else.  It will continue even if you walk away from the console.  Once this process is done, you receive a data card that can be used to change the corresponding Technology from discovered to research.

Additionally, certain technologies may generate items as part of the discovery process.  This is often the case when the technology research items correspond to a recipe, or portion of one.  By creating this object, you discover additional uses, and thus, technologies.

Tuesday, March 4, 2014


Suction Pipes

Suction pipes are liquid transportation pipes.  When attached to a non-pipe Liquid Tank, they automatically attempt to output liquid into said tank.  Pipes can be configured to pull liquid from said tanks, instead.  Pipes are always on - they either pull, or push, liquid.  Suction Pipes use a system similar to the power algorithm.

Pipes maintain a pressure value.  Pipes that are pulling from tanks have higher pressure, the greater the amount of liquid in said tank.  Pipes that are pushing into tanks have a negative pressure, where there is more negative pressure the more empty room in the tank this is.  As such, when a pipe distributes its liquid, it divides its storage among all neighboring pipes with lesser pressure.  This ensures that liquid flows from areas of high pressure to low pressure, with more liquid going to locations that have more room for it.

This continues the trend of being server friendly, for the same reasons as the power system.

Vacuum Tubes

Vacuum tubes are all-purpose item transportation devices.  These are one-directional tube systems whose sole purpose is simply to move items from one place to another.  A vacuum tube only has one input, and one output.  Pipes have 4 slots, with an emergency fifth overflow slot.  Every tick, vacuum tubes with their inputs attached to inventories pull an item stack from the inventory, and propagate forward all items already in the tube, 1 slot forward.  If a vacuum tube cannot move items out of it, such as if the inventory at its output is completely full, and no item stacks can be combined, then the pipe begins to overflow.  This is signified by the slot marker turning red.  This can cause backups down the pipe system as each next pipe fills up and begins to overflow.

 If vacuum tubes have empty space as their input, they attempt to suck in all items in a 1 block area of the end, pulling them into the system.  This behavior is disabled if the tube is overflowing.  Tubes with no output inventory, when moving the 4th slot, will eject the item into the world.  This keeps the flow of items moving, and can be used for trash disposal, etc.  Tubes, once placed, can be manipulated to change direction or attach to different tube systems.

Power System


Tiers of Power


Femtocraft is all about tiers and encapsulation.  Each tier, once researched, exposes another layer underneath it.  This theme propogates into the power system as well.  Each tier of decomposition has an accompanying tier of power - Micro, Nano, and Femto.

Each power storage is a wrapper around the previous tier.  The picture shown above is the Nano-Cube, which is the Nano-tier power storage device.  At the core of this multi-block is the Micro-Cube.  When the Femto-Cube is built, it is a wrapper around the Nano-Cube.  In this way, the latest tiers of Femtocraft still require infrastructure and items from the previous tiers.



The power system of Femtocraft is not coded using an energy net, nor does it require any pathfinding algorithm of any kind.  Each Femtocraft power block simply pushes power to neighboring blocks with less power.  In layman's terms, power flows from where it is generated to where it is needed.

In programming terms, each power block is a node in a greedy distribution system, where every tick a portion of the node's power is distributed among neighboring nodes with less power.

What this means is that there are no computational bottlenecks.  Power can't get lost in the system because there is no path-finding algorithm to confuse.  Power producers don't need to determine a path to every potential consumer, which could potentially require traversing hundreds of blocks.  Instead, they simply push their power out to the wire, which then pushes it out to the next wire, etc.  Each block only ever needs to perform a certain amount of computation every tick, and the amount of computation is capped to the number of neighbors it has.

This does mean that power does not propagate instantly when a new machine is connected to the system.  I feel that this fits the theme of Femtocraft better, and isn't much of a problem in usability.

Liquid Distribution


The liquid distribution system uses a near-identical algorithm.  This will be covered more in the following posts about utility transportation implementations.