Mechnisms and Mechanization
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:
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..
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...
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.
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.
* 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.
However, this will be as successful at it will be practical. It should be extremely easy to build mechanisms that immediately become useful. I think for simplicity's sake, you should pass on the gates altogether for the first versions as well as most sensors. I think the best approach would be to first think of applications ("What to build") and only then decide if you need more sensors or more specialized actors for that.
> * Combine a sensor which can distinguish between mutliple raw materials (gold, ore, rock etc), and build a autmated sorting machine.
Useful in theory, but after all, most raw material goes into the foundry anyway. Plus, somehow your raw material has to get to the sorting machine. Whether you carry them there or to their proper destination does not really make a difference since the place where you mine always changes. It is not worth it to build up a stationary infrastructure to transport the material from your mine to the nearest production building. (Why build a sorting machine when you can simply build another foundry in your new mine?)
> * Flood your crops if they start to burn.
Not useful. You could simply have your crops always slightly in water. But in reality, who cares for that?
> * Reinforce the entrance to your base by setting up some nasty traps.
Not useful in a clonk melee. Your enemy will just dig around it and perhaps even steal the weapon that was intended for the trap.
> * Build an airlock for your underwater base.
> * Be notified when a volcano erupts.
Not really useful, the volcano can erupt anywhere
> * Catch Wipfs in selfmade traps.
Not really useful as just catching them will be faster.
The other idea I had about this was to give scenario designers some kind of easy interface to design traps and contraptions in scenarios, like the SpinWheel and StoneDoor already have.
> 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.
Also, in theory useful to transport materials from your mine to your base. Preset the angle/strength, connect a Frequencer to continuously shoot whatever is entered. But:
* Someone still has to operate the catapult to put the stuff into it
* If you are so far away from your base / the terrain is so inaccessible that a catapult is the easiest method to transport your materials, how did you get the catapult to this place then?
* Mining a vein of material usually does not take that long. Is it even worthwhile to set up the mechanism and get a catapult?
* Conveyor belts
* Windbags with a fixed direction
* A display panel with various shapes (possibly with multiple inputs for different colors)
* A single-layer perceptron that can be trained
> * Conveyor belts
Yay! I think something like this already existed in CR. Could be remade with nice 3D graphics and stuff.
> * Windbags with a fixed direction
This was actually my first idea. But I thought having a universal "directional-use-item-actor" would be more versatile. But maybe it would just complicate things.
> * Pumps
Are there no Pumps yet in OC? Anayway, yay pumps!
> * A display panel with various shapes (possibly with multiple inputs for different colors)
Nice idea. Could also be really useful for debugging.
> * A single-layer perceptron that can be trained
I see someone played with neural nets.
> This was actually my first idea. But I thought having a universal "directional-use-item-actor" would be more versatile. But maybe it would just complicate things.
The idea would be that you can build automated transportation routes. I'm not sure if the regular windbag is versatile enough; you may need something that allows you to adjust strength, etc.
Also, hydraulics would be cool. I.e. SolidMask-objects that can push around things.
Additional actor: Cable car starts moving!
I'm really growing fond of those "developer blogs". Plenty of stuff going on right now :)
Just to give you an idea how it could work. Like Input == A Certain Object and so on.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill