Not logged inOpenClonk Forum
Up Topic [Project] Mechnisms and Mechanization

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to MimmoO

Mechnisms and Mechanization



Hello all,
I am currently working on an object pack that lets players connect objects ingame. The core elements of this pack will be the Library_Mechanizable and the Mechanism object, which can be crafted in the Workshop.
Objects that include this library can define any number of inputs and outputs. A Door might have the inputs "open" and "close", while a Button only has one output "pressed".
The mechanism object allows you to connect any output to any input, so pressing a button could be wired to open a door. Each output can only be connected to one input and vice versa.
The mechanized object can define a trigger(int output_index) and a triggered(int input_index) function to interact with each other. So far the Mechanism and the Library_Mechanizable have been implemented.

The other part of this pack will be a collection of constructable contraptions, like sensors, logic gates and actors. Those are a few ideas:

Sensors


All sensors simply check a specific criteria periodically. Once the criteria is met, they trigger.
  * Living Sensor: Triggers when any object living object is near
  * Enemy Sensor: Triggers when enemies are near (also glows blue)
  * Motion Sensor: Triggers when any object over a speed threshold is near
  * Pressure Plate: Triggers once enough weight is on top. Might have multiple outputs for multiple thresholds.
  * Liquid Sensor: Triggers once the sensor is submerged in water/lava/acid
  * Energy Sensor: Triggers when powered / power threshold is reached. Might have multiple outputs for multiple thresholds.
  * Fire Sensor: Triggers when burning / burning object near
  * Wind Sensor: triggers once wind reaches a threshold. Might have multiple outputs for multiple thresholds
  * Damage Sensor: Triggers when damaged, looks like a practice target
  * Switch/Spinwheel: Like the existing Spinwheel, triggers when switched. Has two outputs, one for left and one for right.
  * Button: A wall mounted button which triggers once pressed.
  * and so on..
 

Gates


These gates have no use other than to propagate a trigger-signal in different ways.
  * AND OR, XOR, NOT, ONE, NOR, etc.
  * Delay: Once triggered, waits for some time and then triggers. Might have multiple outputs for multiple delays.
  * Charge: Needs to be triggered for a certain amount of time until is triggers itself (think capacitator).
  * FlipFlop: Constantly triggers (ON), but once triggered, it does nothing (OFF) and stays like this until triggered again.
  * Frequencer: As long as it is triggered, sends a trigger signal itself periodically.
  * Splitter: One input, multiple outputs. Triggers all output once triggered.
  * And so on...
   

Actors


These are the parts that interact with the clonk world. These can also be traps that damage clonks.
  * Floor Trap: Looks like a bridge segment, but opens once triggered. Might have two inputs, one for opening and one for closing
  * Directional Trap: Can be placed and given a direction to face (from 360°). Then you can put a bow+arrow / musket+bullets / airbag / other directional item in, and it will use it once triggered (with cooldown depending on item. Might require energy?)
  * Spear Trap: Like Spring Plate, but extrudes spears once triggered, damaging whats in front of it
  * Incinerator Trap: Can be filled with dynamite / powder kegs. Incinerates and spills contents once triggered
  * Separator: Can collect stuff like a lorry (hitting from above). Once triggered, releases items. Might have two inputs to release one or all items.
  * Spring Plate: Can be placed on a flat surface (ground/wall/tunnel). Once triggered, flings objects on it in the air/away. Might have two inputs for fling and reset. Might also have to be reset manually.
  * Valve: Can also be connected to a pipe/pump, will let fluids through only when triggered.
  * Electrical Gate: Like Valve but for power.
 

Existing Objects


These already existing objects could be modified to work with this pack.
  * Gate: This gate has two inputs to open and close the gate. Could also have outputs that trigger once the door is closed or opened completely.
  * Catapult/Ballista/Cannon: Fire once triggered. Maybe the vehicle needs to be secured (unmovable) to be connected to something. Might also have multiple inputs to aim the vehicle.
  * Elevator: Can go up/down. Could also have outputs like the Gate, also an output that triggers as long as the lift moves.
  * Dynamite Box Handle: Once triggered, ignites fuse.
  * Torch: Shines when triggered.
 

Additional Notes


  * There are a lot of sensors and gates. To avoid having a huge number of objects, I thought about merging all gates into one single object. Once this object is placed, the player can decide which function the gate should have.
  * The same might work for a subset of sensors. Really, only the Switch, Button, Pressure plate and Damage sensor would have to be single objects.
  * The current framework is vulnerable to circular wiring and might result in a deadlock. Also, objects can be triggered twice in the same frame.. I thought about having an effect which represents a signal, which then traverses from sensor to actor or something.
  * Should multiple outputs be allowed to connect to the same input? This would make the OR-Gate not needed anymore, but might lead to confusion.
 

What to build


  * Combine a sensor which can distinguish between mutliple raw materials (gold, ore, rock etc), and build a autmated sorting machine.
  * Flood your crops if they start to burn.
  * Reinforce the entrance to your base by setting up some nasty traps.
  * Build an airlock for your underwater base.
  * Be notified when a volcano erupts.
  * Catch Wipfs in selfmade traps.

Thank you for your attention. Feel free to comment or share ideas :). I will attach what I already have to this post later.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill