update docs for steam-engine

develop
myk002 2022-07-31 13:29:28 -07:00
parent af0631cbd9
commit 479494e5a6
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 54 additions and 128 deletions

@ -1,40 +1,47 @@
steam-engine steam-engine
============ ============
The steam-engine plugin detects custom workshops with STEAM_ENGINE in Tags:
their token, and turns them into real steam engines.
The vanilla game contains only water wheels and windmills as sources of Allow modded steam engine buildings to function. The steam-engine plugin detects
power, but windmills give relatively little power, and water wheels require custom workshops with STEAM_ENGINE in their token, and turns them into real
flowing water, which must either be a real river and thus immovable and steam engines!
The plugin auto-enables itself when it detects the relevant tags in the world
raws. It does not need to be enabled with the `enable` command.
Rationale
---------
The vanilla game contains only water wheels and windmills as sources of power,
but windmills give relatively little power, and water wheels require flowing
water, which must either be a real river and thus immovable and
limited in supply, or actually flowing and thus laggy. limited in supply, or actually flowing and thus laggy.
Compared to the :wiki:`water reactor <Water_wheel#Dwarven_Water_Reactor>` Compared to the
exploit, steam engines make a lot of sense! :wiki:`dwarven water reactor <Water_wheel#Dwarven_Water_Reactor>` exploit,
steam engines make a lot of sense!
Construction Construction
------------ ------------
The workshop needs water as its input, which it takes via a The workshop needs water as its input, which it takes via a passable floor tile
passable floor tile below it, like usual magma workshops do. below it, like usual magma workshops do. The magma version also needs magma.
The magma version also needs magma.
Due to DFHack limits, the workshop will collapse over true open space. Due to DF game limits, the workshop will collapse over true open space. However,
However down stairs are passable but support machines, so you can use them. down stairs are passable but support machines, so you can use them.
After constructing the building itself, machines can be connected After constructing the building itself, machines can be connected to the edge
to the edge tiles that look like gear boxes. Their exact position tiles that look like gear boxes. Their exact position is extracted from the
is extracted from the workshop raws. workshop raws.
Like with collapse above, due to DFHack limits the workshop Like with collapse above, due to DF game limits the workshop can only
can only immediately connect to machine components built AFTER it. immediately connect to machine components built AFTER it. This also means that
This also means that engines cannot be chained without intermediate engines cannot be chained without intermediate axles built after both engines.
axles built after both engines.
Operation Operation
--------- ---------
In order to operate the engine, queue the Stoke Boiler job (optionally In order to operate the engine, queue the Stoke Boiler job (optionally on
on repeat). A furnace operator will come, possibly bringing a bar of fuel, repeat). A furnace operator will come, possibly bringing a bar of fuel, and
and perform it. As a result, a "boiling water" item will appear perform it. As a result, a "boiling water" item will appear in the :kbd:`t`
in the :kbd:`t` view of the workshop. view of the workshop.
.. note:: .. note::
@ -44,41 +51,36 @@ in the :kbd:`t` view of the workshop.
have infinite power. However, liquid consumption should be slow have infinite power. However, liquid consumption should be slow
enough that water can be supplied by a pond zone bucket chain. enough that water can be supplied by a pond zone bucket chain.
Every such item gives 100 power, up to a limit of 300 for coal, Every such item gives 100 power, up to a limit of 300 for coal, or 500 for a
and 500 for a magma engine. The building can host twice that magma engine. The building can host twice that amount of items to provide longer
amount of items to provide longer autonomous running. When the autonomous running. When the boiler gets filled to capacity, all queued jobs are
boiler gets filled to capacity, all queued jobs are suspended; suspended. Once it drops back to 3+1 or 5+1 items, they are re-enabled.
once it drops back to 3+1 or 5+1 items, they are re-enabled.
While the engine is providing power, steam is being consumed. The consumption
While the engine is providing power, steam is being consumed. speed includes a fixed 10% waste rate, and the remaining 90% is applied
The consumption speed includes a fixed 10% waste rate, and proportionally to the actual load in the machine. With the engine at nominal 300
the remaining 90% are applied proportionally to the actual power with 150 load in the system, it will consume steam for actual
load in the machine. With the engine at nominal 300 power with
150 load in the system, it will consume steam for actual
300*(10% + 90%*150/300) = 165 power. 300*(10% + 90%*150/300) = 165 power.
Masterpiece mechanism and chain will decrease the mechanical A masterpiece mechanism and chain will decrease the mechanical power drawn by
power drawn by the engine itself from 10 to 5. Masterpiece the engine itself from 10 to 5. A masterpiece barrel decreases waste rate by 4%.
barrel decreases waste rate by 4%. Masterpiece piston and pipe A masterpiece piston and pipe decrease it by further 4%, and also decrease the
decrease it by further 4%, and also decrease the whole steam whole steam use rate by 10%.
use rate by 10%.
Explosions Explosions
---------- ----------
The engine must be constructed using barrel, pipe and piston The engine must be constructed using barrel, pipe, and piston from fire-safe,
from fire-safe, or in the magma version magma-safe metals. or, in the magma version, magma-safe metals.
During operation weak parts get gradually worn out, and During operation, weak parts gradually wear out, and eventually the engine
eventually the engine explodes. It should also explode if explodes. It should also explode if toppled during operation by a building
toppled during operation by a building destroyer, or a destroyer or a tantruming dwarf.
tantruming dwarf.
Save files Save files
---------- ----------
It should be safe to load and view engine-using fortresses It should be safe to load and view engine-using fortresses from a DF version
from a DF version without DFHack installed, except that in such without DFHack installed, except that in such case the engines, of course, won't
case the engines won't work. However actually making modifications work. However actually making modifications to them or machines they connect to
to them, or machines they connect to (including by pulling levers), (including by pulling levers) can easily result in inconsistent state once this
can easily result in inconsistent state once this plugin is plugin is available again. The effects may be as weird as negative power being
available again. The effects may be as weird as negative power generated.
being generated.

@ -37,82 +37,6 @@
#include "df/workshop_type.h" #include "df/workshop_type.h"
#include "df/world.h" #include "df/world.h"
/*
* This plugin implements a steam engine workshop. It activates
* if there are any workshops in the raws with STEAM_ENGINE in
* their token, and provides the necessary behavior.
*
* Construction:
*
* The workshop needs water as its input, which it takes via a
* passable floor tile below it, like usual magma workshops do.
* The magma version also needs magma.
*
* ISSUE: Since this building is a machine, and machine collapse
* code cannot be modified, it would collapse over true open space.
* As a loophole, down stair provides support to machines, while
* being passable, so use them.
*
* After constructing the building itself, machines can be connected
* to the edge tiles that look like gear boxes. Their exact position
* is extracted from the workshop raws.
*
* ISSUE: Like with collapse above, part of the code involved in
* machine connection cannot be modified. As a result, the workshop
* can only immediately connect to machine components built AFTER it.
* This also means that engines cannot be chained without intermediate
* short axles that can be built later.
*
* Operation:
*
* In order to operate the engine, queue the Stoke Boiler job.
* A furnace operator will come, possibly bringing a bar of fuel,
* and perform it. As a result, a "boiling water" item will appear
* in the 't' view of the workshop.
*
* Note: The completion of the job will actually consume one unit
* of appropriate liquids from below the workshop.
*
* Every such item gives 100 power, up to a limit of 300 for coal,
* and 500 for a magma engine. The building can host twice that
* amount of items to provide longer autonomous running. When the
* boiler gets filled to capacity, all queued jobs are suspended;
* once it drops back to 3+1 or 5+1 items, they are re-enabled.
*
* While the engine is providing power, steam is being consumed.
* The consumption speed includes a fixed 10% waste rate, and
* the remaining 90% are applied proportionally to the actual
* load in the machine. With the engine at nominal 300 power with
* 150 load in the system, it will consume steam for actual
* 300*(10% + 90%*150/300) = 165 power.
*
* Masterpiece mechanism and chain will decrease the mechanical
* power drawn by the engine itself from 10 to 5. Masterpiece
* barrel decreases waste rate by 4%. Masterpiece piston and pipe
* decrease it by further 4%, and also decrease the whole steam
* use rate by 10%.
*
* Explosions:
*
* The engine must be constructed using barrel, pipe and piston
* from fire-safe, or in the magma version magma-safe metals.
*
* During operation weak parts get gradually worn out, and
* eventually the engine explodes. It should also explode if
* toppled during operation by a building destroyer, or a
* tantruming dwarf.
*
* Save files:
*
* It should be safe to load and view fortresses using engines
* from a DF version without DFHack installed, except that in such
* case the engines won't work. However actually making modifications
* to them, or machines they connect to (including by pulling levers),
* can easily result in inconsistent state once this plugin is
* available again. The effects may be as weird as negative power
* being generated.
*/
using std::vector; using std::vector;
using std::string; using std::string;
using std::stack; using std::stack;