Jump to content
Stray Fawn Community

Logic Gate Tricks


corona_wind

Recommended Posts

I have a few tricks that make it into most of my drones.

Latch

A switch that, once pushed, stays on forever.  Built from a buffer with its output on the same key as its input.  You can also build it from an "or" gate or a time-delay gate.

latch.png

Boot Signal

A latch plus an inverter(the one with the circle) to make a signal which starts "on", waits a moment, then turns off.  You can control the on-time by changing the time on the time-delay.  This is useful for drones which need a kick to get moving, either logically or physically.

boot.png

Turn Memory

You can use sensors to avoid obstacles in races, etc, by having the right sensor turn off the left engine and vice versa.  This pushes your drone away from hazards.  But what happens if both sensors get blocked?  Can't turn off both engines!

You can use a pair of NAND gates, wired like this, to remember which sensor turned on first.  S and R are sensor inputs, Q and Q' are engine outputs.

nand-gate.png

It's always 1 1 when no sensors are triggered, but if both sensors get triggered, it remembers which sensor got triggered first and continues to turn that way.

There's a rare glitch if both sensors go from 0 to 1 the exact same instant.  Then it will flicker until one of the sensors turns off.  This is not a bug, the real-life part does the same thing.

What tricks do you use for nimbatus logic?

  • Like 1
Link to comment
Share on other sites

I had found that a NOT gate could save me the time it takes to charge jump thrusters. Said thrusters need approximately a fourth of a second to completely unload, so add a buffer to that because I rarely manage timings well and I rather let the computer.

Thus: jump thruster(s) with input key "charge"; NOT gate with input key "jump", input tag "jump 2", output key "charge"; buffer gate with input key "jump", output tag "jump 2".

Jump thrusters will be charging on their own, and stay loaded until you press "jump"; at which point they will kindly take the time to pull you out of a cave filled with lava, then charge up again in case you were thinking of going back.

---

An old trick: distance and proximity sensors can act as buttons for half the space. Set one to "Own drone" and target something that should not move around too much.

  • Like 3
Link to comment
Share on other sites

  • 3 months later...

Hi everyone. I miss a compact logic computer in the game. I am playing logic drones with a lot of gates.

I miss a compact logic computer in the game.

Do you maybe know PAL or GAL chips? They are for State programming of automatics. I like those. They are hard to understand unless being in trade. Young players might not like it.

Or another two:

a compact logic module alternative where we would have a Truth table to tick instead of gates to describe logic function.

 I think that is much less process intense for the game as there is no extra variables between gates. And young players would love that as It is very simple to understand.

Memory compact module would also be nice  to round all logic needs. 8 inputs bits (keys) by 8 outputs bits (keys). I think this will make game more stable as well.

Something like that is awesome.

  • Like 1
Link to comment
Share on other sites

Thank you for the suggestion @Skynova! I'm not familiar with the term PAL or GAL. But if it's something similar to Truth tables then I think some players already requested it :) I think they would not that hard to implement, but we have to check when we have resources for adding new logic parts.

I hope you like the game so far. Thank you for posting here :) 

Link to comment
Share on other sites

There is a block a processor (For compact logic) is mentioned in Poll of new features, that will be it. I think It will be a block where we will be able to write a logic Function. Idk.

The following are compact logic electronic chips Manufactured in real life and advantage of those chips over microprocessors are speed and the way of execution.

PAL  stands for Programmable Array Logic and were later replaced by PALCE. 

PLA Programmable Logic Array: Programmable AND array feeding a fixed OR array
GAL Generic Array Logic
MACH high density PLD
PLD Programmable Logic Device
CPLD Complex PLD
FPLA Field-Programmable Logic Array

I think there will be hard to implement above technologies in a game as they are not CPU friendly because of the way of execution.

Did you know? All Logic functions can be made by NAND or by NOR gates. There are logic functions that requires more NAND gates than NOR and versa.

The best way to implement Logic Functions is to convert them to memory topology instead of CPU topology. That enable stability and speed.

It all depends what we wish to achieve. Sometimes It is better to use CPU resources over Memory or GPU and versa. It all depends what It is friendlier.

When we wish to make multi-variable Logic functions it is the best to use Memory resources than Arithmetic Logic resources. The execution time is the same for any Logic functions in that case. And that will be more alike a Truth table or Look up table.

Did you know? GPU implements GAL cell for every pixel.

 

  • Like 1
Link to comment
Share on other sites

I know about FPGA, so I guess PAL, GAL is just an earlier version/variant of it? We discussed once that we could have a block which would allow you to write scripts (for example in LUA) and then execute those. Maybe your have 8 inputs, some LUA code and 8 outputs. This would somehow work like the FPGA you mentioned?

But I'm not certain if we go that deep with programming. A truth table would be interesting for a wide array of problems, but not sure how much deeper we should go :) Maybe we will rework the logic in the future, adding something akin to node-based programming. But nothing is decided on that end yet :) 

Link to comment
Share on other sites

Nimbatus is exiting game as such. I like SUMO part of It a lot. Present Nimbatus game is for players of all ages and that is nice.

If Logic Blocks would not count as a drone size that would be awesome. But If someone would implement 100+ Logic block in order to make some kind of AI brain, I don't know how Game would perform.

Nesting gates is a problem as they make issues with delays at each gate output. By nesting I describe  using two 2 input variable gates to make 3 input variable gate with one variable output.  I really wonder, I will test it now.

Let's say we would need  8 input NAND gate with one exit for drone project for example. It takes too many intermediate variables just to make a gate of the kind in present version of the game.

LUA or any other scripting plugin would just be an expense for your developing house. I would keep game simple so that 5 year old child can play and enjoy.

On the other hand game has educational value as Logic gates are implemented.

Truth table block Is what we would like to have indeed. It is easy to implement from programming point of view. And game would not become buggy.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

@Skynova - You don't need intermediates for an 8-input NAND gate.  NAND gates are special that way.  Pile up four NAND gates, all with the same output key, and it will work.

This works because NAND(A,B) or NAND(C,D) or NAND(E,F) or NAND(G,H) is logically equivalent to NAND(A,B,C,D,E,F,G,H).  And when you put several different gates on the same output key, they are effectively "or"-ed together.

Link to comment
Share on other sites

My water scorpion has a speed limiter:

3XK9vDB.gif

This prevents it from overspeeding on straightaways and getting a faceful of death zone...  But it can still use its engines to full advantage in tight cornering.  And sometimes lets it power straight through decelerators without losing ramjet.

You can use NOR gates as "disable" gates.  With one element off, they just invert the other signal;  with that same element on, they're always-off.

Speed sensor is set to 140m/s and outputs X.  Direction indicator outputs Q/E.  Left engine logic is Q NOR X, right engine logic is E NOR X.

 

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

I had been building magnet systems with a switch, to turn on and off, but have found that can be replaced by a distance sensor, set to detect collectible items, pointing straight through the magnet.

I put this in "logic" though the only logic is mechanical - it stays on since the magnet holds it to the sensor.

Link to comment
Share on other sites

  • 5 months later...

Something I would really like to see is a way to implement complex logic functions without taking up a ridiculous amount of physical space, which I always found silly in games that allow logic operations, from Minecraft to Oxygen Not Included.

What I imagine is a 1x2 or maybe 2x2 "logic board" tile that could contain a large amount of logic gates.

You could edit these blocks, which would present you with a relatively spacious grid (about 10x10 maybe?) that you could populate only with logic components. The signals/keystrokes defined inside the box would be only local, except for a limited number of inputs and outputs (maybe 2 of each for a 1x2 block and 4 of each for a 2x2?) that would be handled just like the I/Os of a basic logic gate.

  • Like 1
Link to comment
Share on other sites

Direction indicator trick:  Lock-on signal.

locked-dir.png

The inverter is set with "!LOCKED" as input, and "LOCKED" as output.

locked-dir.gif

Now the direction indicator can tell you when its dead-on.

Bonus:  Using a NOR gate instead of an inverter, gives you a free logic input which will disable the "LOCKED" signal whenever you want.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...