Jump to content
Stray Fawn Community

Logic: Updates Needed


Devin923

Recommended Posts

So far I am rather impressed with the fact that things actually work relatively well.

 

I had issues creating the logic for:

 

IF A && !B THEN C

 

To solve this I had to make intermediate output keys and use an AND, OR and XOR to do this.  Figuring out what keys are assigned to what gets confusing when choosing a key for physical things, and keys for temporary variables.

 

If Logic could be connected, or have logic gates be able to reference the out put of each other this could be avoided.

The other solution is to have the inverse of Logic Gates, so a checkbox for if something that for example could be:

 

ex. AND Gate  True and True

  or

      AND Gate False and False

 

So the two additions to the game i would recommend would be:

[*]a checkbox to invert the state of the variable either true or false.

[*]a dropdown list to select the logic gate and use it's output as the input, this or be able to connect the logic gates together to achieve this

 

Addition 1, would add more options for making logic.

Addition 2, would prevent complicated setups with a crazy amount of key assignments.

 

Side Note:  When using OR, AND , XOR logic gates to press intermediate keys, ie A -> B -> C... The intermediate button can remain true, if A is no longer being pressed.  Will try to create GIF to explain this, but this is a bug currently.

 

Link to comment
Share on other sites

Attached is a Drone I have been working on with this logic issue solved.

 

The problem was, if the mouse cursor is under the drone, and the ground sensors detect the planet.  I need to stop movement downwards and turn on the boosters upwards to prevent impact with the ground.

 

Issues with using just an OR gate would result in one or more boosters being activated that were not to be activated at that time.

 

Now that it is fixed the drone will stop at the planets surface before smashing into the ground.

 

For those who download, the keybindings are:

 

TAB - Shields

1 - Mining Lasers / Attack

2 - Currently Disabled ( Assign weapon to F2 )

3 - Currently Disabled ( Assign weapon to F3 )

Hold Left Mouse - Accelerate in the direction you are moving

 

Cursor in the middle of the drone will allow it to stall, if you need to hover.

T-1000.nimbatusdrone

Link to comment
Share on other sites

For if A and not B, (!B is 'not B,' right?) I usually have a NOT gate output C, if B is not pressed, and an AND gate for A and C.  It took me a minute to organize that in my head, but once I did, it became easy. (It does require extra keypresses though, which sucks for complex craft.)

 

So, in logical terms,

IF !B

  {

    Output C

  }

IF A && C

{

    Output S (In this case, if using default controls)

}

 

Link to comment
Share on other sites

For if A and not B, (!B is 'not B,' right?) I usually have a NOT gate output C, if B is not pressed, and an AND gate for A and C.  It took me a minute to organize that in my head, but once I did, it became easy. (It does require extra keypresses though, which sucks for complex craft.)

 

So, in logical terms,

IF !B

  {

    Output C

  }

IF A && C

{

    Output S (In this case, if using default controls)

}

 

Yes these solutions work, but the main issue is having to assign the additional output every time you do this, so for one function this is okay.  But to do this for say 4 or more, mapping outputs starts to become very cumbersome.

 

This example takes up 4 output bindings, and when you have a limited number of keys on the keyboard in addition to hard coded key mappings for other functions, you start to run out of keys quickly.

 

Wondering if the addition of more attributes on gates could alleviate this issue.

Link to comment
Share on other sites

So an IMPLY gate and a NOT gate should get you what you want.

 

Yes, an imply gate would solve the issue perfectly for this example.

 

I would like to put it to the developers to see if they choose another option, based on the the confusion of non programmers understanding all the variations of logic gates.

 

Given that we are also missing NOR and XNOR, I am personally okay with either solution, but do have some concern about regular users understanding too many gate options.

 

Thank you for describing this properly.  The Imply gate would be great.

Link to comment
Share on other sites

That's my concern, as well, non-programmers being able to handle unusual gates.

 

My thoughts on the matter is to make the gates themselves more capable.  If you include an option for any gate criteria to be NOT, that combines the IF and NOT gates, makes the AND gate also a NOR gate and the gate you require, and makes a lot of drone programming a lot easier to handle for those unused to coding.

Link to comment
Share on other sites

That is also my belief, if you allow the option inputs to be NOT and TRUE, we could eliminate the NOT gate and XOR gates, an in return have more flexibility to make all the gate combinations.

 

If done this way, 90% of users will use strictly True conditions, and if this is the default people will not be confused.

 

When a novice user then needs to use a NOT statement and realize they can invert the input, doors will open for them to understand the rest of the gates and using NOT in those as well.

 

Of course that is a theory anyways, but i would love to see this in an update to validate the functionality.

 

I might start a new thread for typical logic structures and use cases, so it can be a start for a wiki of ship components or something like that.

Link to comment
Share on other sites

XOR and NAND are weird.  You can't really specify which should be true and which should be false - you'd lose the usefulness they're supposed to have. Because they don't care which input is triggered, they can do things that would otherwise take several simpler gates to replicate - such as changing the way thrusters fire if the ship detects walls closing in left and right, but not if there's only a wall to one side, or no walls detected.

 

For the rest, you're right.  The OR gate and the NOT gate could have their functions folded into other, more capable and simpler logic blocks.

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...