Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: [NEEDS_POWER] and [GENERATES_POWER:x]  (Read 2309 times)

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #15 on: April 20, 2011, 04:43:32 pm »

A magma powered, aquifer fueled and cooled steam engine?

Now THAT'S Dwarfy. Very Dwarfy.

You make a good point about fuel efficiency.   Possibly the tags should be constructed differently, like declaring the product of a reaction as a quantity of power units that can be generated for a specific amount of time.

[GENERATES_POWER:10000:100] would generate 10k Urists of power over 100 Urists of time, for a total of 100 UPU (Urists per Urist).

[NEEDS_POWER:100:100] woudl take 100 Urists of power to run for 100 Urists of time, or 1 UPU.

OR maybe they could be defined better as [PRODUCT]s and [REAGENT]s
Logged
I like fortresses because they are still underground.

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #16 on: April 20, 2011, 05:43:56 pm »


100 UPU (Urists per Urist).


This still makes more sense than the English system.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #17 on: April 20, 2011, 05:55:25 pm »

Doesn't it, tho?

We should have a symbol for the Urist measurement.

I propose: Urist (†).  Urist is the Dwarven word for "Dagger", hence the dagger character.

So the above measurement would be 100 †/†, or 100 ‡
Logged
I like fortresses because they are still underground.

noodle0117

  • Bay Watcher
  • I wonder what would happen if I pull it.
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #18 on: April 20, 2011, 10:40:58 pm »

If all the new power generator ideas are implemented, then I think the current power generators (namely the waterwheel and its infamous perpetual motion abilities) might have to be weakened slightly.
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #19 on: April 20, 2011, 11:39:25 pm »

Why? I mean while he's in there at that section of code, there are likely tweaks that could be made... but why at this point? Just use them as a base range.
Logged
I like fortresses because they are still underground.

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #20 on: April 21, 2011, 12:14:13 pm »

If all the new power generator ideas are implemented, then I think the current power generators (namely the waterwheel and its infamous perpetual motion abilities) might have to be weakened slightly.

Perpetual motion is always going to be possible as long as mechanical components use/generate fixed amounts of power.  Making one waterwheel generate less power is just going to make people use more waterwheels - which, given the current "flow" system, is extraordinarily easy.  The entire flow system would need to be reworked in order to give diminishing returns based on flow speed, amount of fluid, etc (this is hell on system performance, by the way).

Frankly, as "unrealistic" as the current system is, I'd rather Toady spend his time developing something else.
« Last Edit: April 21, 2011, 12:20:00 pm by narhiril »
Logged

Deepblade

  • Bay Watcher
  • Tholtarmid
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #21 on: June 05, 2013, 11:45:40 am »

I was just thinking about this very thing. I had the idea that the tags could also define what type of power it made. So, a custom made waterwheel with the proper fittings to generate electricity would have [GENERATES_POWER:ELECTRICITY:X]. And the power transfer device would need to be capable of being defined if we want use something other than axles and gearboxes. And, lastly that custom made light bulb would have [NEEDS_POWER:ELECTRICITY:X].
Logged
Deepblade's Standardized Creature Parts, for when you're pissed about all the different types of animal products there are.

King Mir

  • Bay Watcher
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #22 on: June 05, 2013, 02:54:36 pm »

If that's done, you may as well put levers and controls under the same system. So a pressure plate would generate "CONTROL" type power, and would need some kind of axel-like wire (rope maybe) to connect it to a device. Controls are normally binary, but that's easy to model on top of a gradient. That's been suggested anyway, but if it's under the same system, it allows more extensibility, and fewer places for bugs.

Gargomaxthalus

  • Bay Watcher
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #23 on: June 06, 2013, 11:51:50 am »

I kindof hate the idea of having uranium reactors. WTH!? Anyway...  :P

I support the idea(because everybody does) and I have a few tags that I want to suggest myself.

[REQUIRES CAGED BENING]-It would require an animal that is caged and/or tame/good to run the device. This allowws to make treadmills and mule axels(those things with the donkey running around.)
[REQUIRES CAGED SMART] It would require an INTELEGENT caged creature to opperate it. This means that we can finally have slaves elves help you with your chores.
However, you would also have to take care of the caged creatures.

[GENERATES FLOW] As what Quitust said, this would make the machine GENERATE a flow

This would require some extra monkeying around since Dwarfs are anti-slavery. However, the general idea feels like an absolute must.
Logged
Well lets see... at least half of what I say is complete bullshit. Hell the other half tends to be pretty sketchy...

OOOOHHHH,JUST SHUT UP AND LISTEN TO WHAT I HAVE TO SAY AND MAYBE I'LL GO AWAY!!!!!!!!!!

javascript:void(0)
javascript:void(0)

Waparius

  • Bay Watcher
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #24 on: June 06, 2013, 09:37:57 pm »

This is a great idea for when Toady gets round to fixing mechanics and traps. It also take springs into account, since they're planned as an essential trap component.

So as well as [NEEDS_POWER] and [GENERATES_POWER] you probably also want some variant of [STORES_POWER].

Which leaves things open for modders to put in stuff like counterweights (if Toady doesn't do it, though I'd prefer it if he did), flywheels, storage batteries et al.

It would be good as something that released a given amount of power when triggered, but could only store so much until it needed a recharge.

I'm sure a lot of people have said it before but it would be great to give bridges the [NEEDS_POWER] attribute, scaling based on the size of the thing.
Logged

Deepblade

  • Bay Watcher
  • Tholtarmid
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #25 on: June 07, 2013, 07:11:42 am »

That's a pretty good idea. I never thought about traps needing power, but it makes perfect sense.
Logged
Deepblade's Standardized Creature Parts, for when you're pissed about all the different types of animal products there are.

UberFuber

  • Bay Watcher
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #26 on: June 07, 2013, 12:08:42 pm »

In order to support steam engine or a large variety of power source, we will need a way to store power.
At the very generic level, we can have a token that indicates a "store stuff" action, and have a massless/dimensionless item called "power" (or "steam") for steam engine. Although for sanity purposes, let's just have [POWER] related tag.
You can define it in a reaction raw.
[REACTION:ADD_FUEL]
     [NAME:Add fuel]
     [BUILDING:STEAM_ENGINE:a]
     [REAGENT:A:150:BAR:NONE:COAL:NONE]
     [REAGENT:water:1:LIQUID_MISC:NONE:WATER:NONE][PRODUCT_DIMENSION:150]  need a new ability to trigger dwarf to get a bucket of water.
     [REAGENT:bucket:1:NONE:NONE:NONE:NONE]
          [CONTAINS:water]
          [NOT_IMPROVED]
          [PRESERVE_REAGENT]
     [PRODUCT:100:0:NONE:NONE:NONE:NONE][ADD_POWER:100000] - amount of power to add the building within which this reaction occurs. Doesn't do anything if the building in question don't have capacity for any power.
     [SKILL:SMELT] furnace operator skill
     [AUTOMATIC_POWER] the building will automatically queue up this task when the building's stored power is less than POWER_CAPACITY minus this reaction's ADD_POWER amount AND all reagents are available. Basically, this reaction is eligible to be automatically added if it can add power to the building without overfilling it.


Basically, this adds an reaction to a STEAM_ENGINE requiring one bar of coal and one bucket of water. Once reacted, it created a non-existent product (or you can have it create something that cause minor/major syndromes, so you can have somethings that, say, sacrifice the operator's life and/or skill level and/or attribute to fuel it, like a soul-powered generator). It also add 100000 units of power to the building within which the reaction occurs.
Alternatively, a reaction can be something like this.
[REACTION:ADD_FUEL]
     [NAME:Add fuel]
     [BUILDING:STEAM_ENGINE:a]
     [FUEL][CONSUME] the consume tag indicate that in the case of magma, it will consume 1/7 unit of magma from the tile beneath
     [WATER][CONSUME] The water tag indicate that it require either a bucket of water OR at minimum 4/7 tile of water beneath. Consume tag indicate that in this reaction a 1/7 unit of water will be consumed.
     [PRODUCT:100:0:NONE:NONE:NONE:NONE][ADD_POWER:100000]
     [SKILL:SMELT] furnace operator skill
     [AUTOMATIC_POWER]

The consume tag can be omitted for the current "infinite power" engine that's placed on 1 water and 1 magma tile. The consume tag is just my thought on how to balance magma related furnaces/engines (instead of current "get 1 4/7 magma tile under smetler, use it forever).
Or you can have a sort of "dwarven based" power source.
[REACTION:WIND_UP]
     [NAME:Crank]
     [BUILDING:CRANK_ENGINE:c]
     [PRODUCT:100:0:NONE:NONE:NONE:NONE][ADD_POWER:10000]
     [SKILL:OPERATE_PUMP]
     no automatic power needed, just set this on repeat since it doesn't consume anything (other than a dwarf's time)

A steam engine building/workshop would look something like this (I'm leaving out building size/shape definition to shorten it).
[BUILDING_ENGINE:STEAM_ENGINE] an engine building, indicating that it can produce power (perhaps existing BUILDING_WORKSHOP/BUILDING_FURNACE is sufficient)
    [POWER_CAPACITY:200000] the maximum units of power the building can store.
    [POWER_OUTPUT:100] the amount of power this building can produce per tick. Also the units of power this unit will "consume" from its internal store per tick. In this case, the STEAM_ENGINE filled to max capacity can generate 100 power for 2000 ticks (1 day).
    [POWER_EDGE:SIDE:TOP] which edge of the building can be connected for send/receive power. Can be SIDE (for four sides on the same Z-level), TOP (z-level above building), BOTTOM  (z-level below building), or ALL (all sides). Argument can be combined as the example here, which defines the steam engine as having a valid power connection on its sides and top. Omitting this tag defaults to all-side of engine capable of connecting to power connections.

Okay, so how about creature power. The way I see it, creature type/size/power should belong to building definition, with the reaction definition associated with said building define how much power the building generate.
[BUILDING_ENGINE:TREAD_MILL]
    [POWER_CAPACITY:100000]
    [POWER_OUTPUT:40]
    [WORK_CREATURE] Indicate that this building can have a creature. Essentially the building can act as a sort of chain (chain that allows no movement) to let dwarf "chain" any creature in it. Building with this tag will provide an interface for player to select which animal to "chain" to the engine after the building is built. The work creature tag can be followed by one or more [WC_*] tag to indicate certain constraints on what kind of creatures. The idea is that almost any creature definition tokens can be checked. All building can have at most 1 creature "chained" to it. But multiple WORK_CREATURE tag can be defined, the workshop will accept creature that fits at least one of the WORK_CREATURE definition. Vermin will also work. Removing the creature from a building with this tag disables the building (no power output despite still having power stored). Some examples.
        [WC_CDI_REQ:<interaction token>] creature must be capable of performing the interaction listed (for example, a dragon-fire based steam engine).
        [WC_CAN_LEARN][WC_CAN_SPEAK] creature must be capable of learning/speaking (for example... I don't know, magic engine that provides power by being talked to?).
        [WC_CREATURE_ALLOWED:creature:caste] require a specific creature and/or caste (so you can say only use the ANT by omitting the caste, or ANT of WORKER caste by defining the require caste as worker). Can have multiple. If defined, the building will ONLY allow creature that's defined in WC_CREATURE_ALLOWED and WC_CREATURE_CLASS_ALLOWED and nothing else.
        [WC_CREATURE_FORBIDDEN:creature:caste] similar as above, but specifically forbid certain creature. Note that is WC_CREATURE_ALLOWED is defined, this tag have no meaning (because any creature not part of WC_CREATURE_ALLOWED is considered forbidden).
        [WC_CREATURE_CLASS_ALLOWED:class] same as WC_CREATURE_ALLOWED, but based on CREATURE_CLASS tag (again, multiple definition is possible). If defined along with WC_CREATURE_ALLOWED. The building will allow creatures that fulfills either WC_CREATURE_CLASS_ALLOWED or WC_CREATURE_ALLOWED.
        [WC_CREATURE_CLASS_FORBIDDEN:class] same as WC_CREATURE_FORBIDDEN. Again have no meaning if the "ALLOWED" counterpart is defined.
        [WC_BODYSIZE_RANGE:min:max] creature must have a body size that's within the given range (omitting max indicates no upper limit. to "omit" min, set it to 0). An upper limit would make sense for, say, you make a power generator that runs off guinea pigs or rats (can't stuff a dragon in there).
        [WC_REQ_BP_*] * can be one of several body tokens (LIMB, GRASP, STANCE, FLIER, THOUGHT). Creature must have a body part with the given tag to be available (so a CRANK_ENGINE would require a creature with GRASP tag. A treadmill requires STANCE. A Matrix battery requires THOUGHT). Multiple definition means that creature must have all those body tokens available to be eligible.

I think the above should be sufficient. Worst come to worst, you have to manually mod valid creature to have an additional CREATURE_CLASS called "Generator" or something.

So, for power generation reactions, you get something like this.
[REACTION:WALK_TREAD]
     [NAME:Drive creature]
     [BUILDING:TREAD_MILL:a]
     [NEED_WORK_CREATURE] tag indicate that this reaction needs a creature chained to the building.
          --- optional restriction tag --- additional [WC_*] that define some required properties for the creature chained to the building. Basically if a building don't have a creature passing these requirement chained to the building, this reaction will be unavailable. Omitting the optional tag means that this reaction only cares that a creature is chained.
     [PRODUCT:100:0:NONE:NONE:NONE:NONE][ADD_POWER:50000]
     [SKILL:ANIMAL_TRAINER] well, you still need someone to give that creature some incentives to move.
     [AUTOMATIC_POWER]

Basically, this combination should give you several options for power sources.
1. Power output based on creature size
Define different building with different power output, each with a different minimum body sized requirement.
2. Dwarf powered engine
Define a reaction with no reagent but still ADD_POWER.
3. Dragonfire based steam engine
Have to modify dragon to change its CAN_DO_INTERACTION:MATERIAL_EMISSION to something more clear like
CAN_DO_INTERACTION:DRAGON_BREATH. Require building/reaction to require creature the "WC_CDI_REQ:DRAGON_BREATH". Any creature with "DRAGON_BREATH" interaction can be used.
4. Matrix-style battery:
Two possible way. An additional feature to dwarf fortress can allow a reaction to "target" the worker/creature chained to workshop. Or using the already defined system, have a PRODUCT that creatures a syndrome based boulder (or bar, or glob) that vaporizes at room temperature (say, boiling point of 1000 urist (water freezes at 10000 urists)). So you can have a generator that produce a lot of power from a dwarf, but renders him unconscious. Or if you want a sacrificial altar, kills the dwarf.
5. Steam engines
Well... duh.

Finally, on power consumption.
All workshop, furnace, engine buildings can have a [USE_POWER:power] tag, where power is the amount of power required to keep it "active". If an engine building have a [USE_POWER:power] tag, you can have an engine that requires a certain amount of power to start up. So you can have building that have this.
[BUILDING_ENGINE:TESSERACT]
    [POWER_CAPACITY:10000000]
    [POWER_OUTPUT:2000]
    [NEED_POWER:1000]
    [POWER_EDGE:ALL]
with one reaction
[REACTION:ALIGN_CRYSTAL]
     [NAME:Realign power crystals]
     [BUILDING:TESSERACT:a]
     [PRODUCT:100:0:NONE:NONE:NONE:NONE][ADD_POWER:5000000]
     [PRODUCT:5:0:BOULDER:NONE:INORGANIC:TESSERACT_SHARD]
     [AUTOMATIC_POWER]
with material
[INORGANIC:TESSERACT_SHARD]
[USE_MATERIAL_TEMPLATE:STONE_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:tesseract shard]
[MELTING_POINT:1000]
[BOILING_POINT:1001]
[SOLID_DENSITY:100]
[USE_MATERIAL_TEMPLATE:POD_JUICE:CREATURE_EXTRACT_TEMPLATE]
       [STATE_NAME:ALL_SOLID:tesseract shard]
       [STATE_ADJ:ALL_SOLID:tesseract shard]
       [STATE_NAME:LIQUID:tesseract fluid]
       [STATE_ADJ:LIQUID:tesseract fluid]
       [STATE_NAME:GAS:tesseract vapor]
       [STATE_ADJ:GAS:tesseract vapor]
       [PREFIX:NONE]
       [SYNDROME]
           [SYN_NAME:tesseract syndrome]
           [SYN_AFFECTED_CLASS:GENERAL_POISON]
           [SYN_CONTACT]
           [CE_FEVER:SEV:50:PROB:100:RESISTABLE:START:50:PEAK:500:END:3000]
           [CE_NAUSEA:SEV:35:PROB:100:RESISTABLE:START:50:PEAK:100:END:1000]
           [CE_DROWSINESS:SEV:75:PROB:100:RESISTABLE:START:1000:PEAK:2000:END:10000]
           [CE_DIZZINESS:SEV:75:PROB:100:RESISTABLE:START:1000:PEAK:2000:END:10000]

Basically, it's an engine that, once supply with an initial 1000 units of power, will provide a net output of 1000 units of power that just require a dwarf to "maintain" it once in a while. But has a 5% chance of causing a crystal shard to break off and vaporize, which cause cave-floater like syndrome over a long period of time.
« Last Edit: June 07, 2013, 12:44:56 pm by UberFuber »
Logged

UberFuber

  • Bay Watcher
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #27 on: June 07, 2013, 12:55:28 pm »

Okay, the above is getting a bit long so I'm going to post in a separate post. Here's an example of a rat wheel based generator (again, various tag omitted so it won't be too long) based on my above suggestion.
[BUILDING_ENGINE:CRITTER_WHEEL]
        [NAME:Critter wheel engine]
        [DIM:1:1] small size, allow you to "chain" a bunch of them together.
        [WORK_LOCATION:1:1]
        [POWER_CAPACITY:1000000]
        [POWER_OUTPUT:10] it's a very, very weak generator. Combined with above, it can run with very little maintenance.
        [POWER_EDGE:SIDE] can transmit power to/from the same z-level only.
        [WORK_CREATURE]
                [WC_BODYSIZE_RANGE:150:800] only small animals, like squirrel, rats, cavy (guinea pigs) etc
                [WC_REQ_BP_STANCE] must be able to stand. Basically, must be able to run.

[REACTION:MOTIVATE]
     [NAME:Motivate] um... can't think of a better way to describe getting the critter to start running.
     [BUILDING:CRITTER_WHEEL:a]
     [PRODUCT:100:0:NONE:NONE:NONE:NONE][ADD_POWER:500000] given the power output of 10, each "critter wheel" needs this task every 50000 ticks.
     [SKILL:ANIMAL_TRAINER]
     [AUTOMATIC_POWER]

Note that since power units are such a big number, perhaps the ADD_POWER and POWER_CAPACITY can be in units of thousand of power-ticks, instead of 1 power-ticks.
Note: 1 power-tick = 1 power for 1 tick.
Logged

Matoro

  • Bay Watcher
  • if you drive alone you drive with hitler
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #28 on: June 07, 2013, 03:33:55 pm »

I think this is a good idea, if the idea is for pushing windmills and watermills to raws, and allowing players to define their own power sources and power-based workshops.

It wouldn't take long until someone would make furnace that uses elf blood as a fuel.
Logged

Deepblade

  • Bay Watcher
  • Tholtarmid
    • View Profile
Re: [NEEDS_POWER] and [GENERATES_POWER:x]
« Reply #29 on: June 07, 2013, 09:49:34 pm »

That'd be amazing. It'd also explain why everyone loves to make elves bleed.
Logged
Deepblade's Standardized Creature Parts, for when you're pissed about all the different types of animal products there are.
Pages: 1 [2] 3