Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet Vita    [LBPV] Help!
#1

Analogue Signals .. ARG!!

Archive: 10 posts


Someone posted a way to compare two signals to see if they are equal. In using their method, I'm taking both signals and feeding them into a direction combiner, then outputting into a positional sequencer (with a battery filling the timeline), then outputting the battery to a not gate I believe, and then finally out to a tag.

Strange thing happened though. When I added a 10% signal to an 11% signal, and used that output to compare it to a battery set to 21%, it gave me a false on my little sequencer comparison thing. So as a work-around at that time, I just took the 21% and saved it in a node to use for comparison instead of the battery.

But now, ...ahhhhhh... I can't do that anymore. I actually need it to add multiple signals together and compare it to another set of added signals. I'm assuming this method isn't working because of fraction of a difference between the numbers. But I'm not sure what to do about it.

So, question is.... does anyone want to finish this blackjack game for me? lol. JOKING .. just kidding..ARGG

Is there a better way to compare two signals? If not, is there a way to allow for this tiny decimal of a percentage, that I'm assuming it is off by?


-Thanks for the help,
Sweet
2013-02-07 07:02:00

Author:
Bitter Sweet
Posts: 95


i set it up with 3 numbers added to get 21 and combined it with a 21% battery and ended up with a 0.00000149% signal remaining, so there is error in there somewhere.

if you subtract a tiny signal from the combiners output it will fix it, but if you are using a sequencer you would need to dump the negative with a spliter after.

i'd recommend using a speed scale timer set to 0.0 , it does the same thing as a positional sequencer with a battery filling it, exept it doesnt have the 1 frame delay and it ignores negative signals

if you wire a 1% battery to 2 ports of an AND gate set to multiply it will give you a 0.01 signal which is big enough to fix the error yet low enough to not affect the result. just subtract that from the output of your combiner then wire that straight into the timer
2013-02-07 11:12:00

Author:
evret
Posts: 612


Erm, forgive me if I'm miss understanding this, but you want a simple way to compare to values? Why not a note set to display values and set to 1000%? Sounds too obvious, so I'm guessing I've got the wrong end of the stick here ???2013-02-08 13:28:00

Author:
Shade_seeker
Posts: 328


Erm, forgive me if I'm miss understanding this, but you want a simple way to compare to values? Why not a note set to display values and set to 1000%? Sounds too obvious, so I'm guessing I've got the wrong end of the stick here ???


This isn't what I'm looking for.

Nor is the timer suggestion by Evret. With Evret's suggestion, I would have to know which number is the greater of the two 21%(and plug the greater into the positive of the combiner), else if reversed it returns a false.

I just slapped a tag on a timeline at 21% to get through this. But I'm worried that when my chips compare the player hand to dealer hand and both are equal, lets say both player and dealer ended up with a 20. And player got there with a 5,6,3,4, and a 2. But the dealer got there with two 10's, that it may not display the result as a push. If the signal is off by a little the dealer may end up cheating the player.

Anyway thats my concern since that part of the chip is also calculated and compared the same way as my comparison to 21 chip. If only I could get more accurate percentages, life would be easier.



I thought about replacing all the signals (i.e. 1% for an Ace, 2% for a two of clubs, etc) with a number of tags and have it count how many tags there are instead. Knowing now about the odd behavior of these signals I would have eliminated the use of signals from the start. Too late for that now. And thanks again for your suggestions.
2013-02-08 15:23:00

Author:
Bitter Sweet
Posts: 95


Nor is the timer suggestion by Evret. With Evret's suggestion, I would have to know which number is the greater of the two 21%(and plug the greater into the positive of the combiner), else if reversed it returns a false.


please at least try things b4 dismissing them, the fact you wire the output of the first combiner to the positive input of the second combiner to do the tiny subtraction makes it work no matter which signal is higher.......
2013-02-08 19:33:00

Author:
evret
Posts: 612


Wow..

I did in fact try your method before dismissing it!

I didn't try the sticky note suggestion, but I suppose I can go try that one now that you pointed out every method should be tried.

..maybe I can program a sackbot to watch the sticky note and flip a button if he likes what he sees.

I must have misunderstood what you were telling me to do, because when I hooked everything up I got a false, I swiched the inputs around and got a true. Which is excatly why I said that if the inputs were plugged in wrong it would not work. That was the result of my testing of your suggestion. So ... Not sure what I did wrong then. I'll give it another go later when I cool down.


Thank you for yelling at me today, that was very helpfull!
2013-02-08 21:40:00

Author:
Bitter Sweet
Posts: 95


Re-tried and tested again... Here is the result and setup:

I have a battery at 10% and another battery at 1%.
I then have an OR gate with '3' ports set to add values.
The 10% battery is plugged into 2 of the ports on the OR gate and the 1% battery is plugged into the third port.

The OR gate has an output of 21.000001563%

I then have a battery set to 21%. It is plugged into the positive input of a direction combiner. The OR gate output of 21.000001563% is plugged into the negative input of the direction combiner.

The direction combiner is now outputting a signal of -0.00000149%.

Next, I have that signal of -0.00000149% plugged into the positive input of another direction combiner and a signal of 0.01% plugged into the negative input. This combiner's output is going into a timer set to 'speed scale' with a target time of 0.0.

As I explained earlier. The result is a false. By false, I mean than the timer has an output of ZERO.


Is there something here that I am missing?
2013-02-08 22:45:00

Author:
Bitter Sweet
Posts: 95


The OR gate has an output of 21.000001563%

I then have a battery set to 21%. It is plugged into the positive input of a direction combiner. The OR gate output of 21.000001563% is plugged into the negative input of the direction combiner.

The direction combiner is now outputting a signal of -0.00000149%.

Next, I have that signal of -0.00000149% plugged into the positive input of another direction combiner

The negative is discarded at this point, since the top combiner input will take the absolute value of the incoming signal.


and a signal of 0.01% plugged into the negative input.

This signal is now being subtracted from the absolute value of the above signal. Since the signal in the negative input exceeds that in the positive input, the resultant will be negative. Slightly negative, but negative nonetheless.


This combiner's output is going into a timer set to 'speed scale' with a target time of 0.0.

You should note that a timer with these settings will only activate by a positive signal. If the incoming signal is zero or less than zero, it will not activate.


As I explained earlier. The result is a false. By false, I mean than the timer has an output of ZERO.

It's not false, it is behaving exactly as it has been set up to behave. Since the incoming signal is less than zero, the timer will stay inactive.


Is there something here that I am missing?

This is just a correction factor, and the only way you'll get a positive signal here is if the resultant from the subtraction exceeds .01%, which won't happen if they are effectively equal.

The result you came up with actually solves the problem. You just created a system that activates if there is a difference between the signals. Since there was effectively no difference, the timer remains inactive. Toss a NOT gate onto the end of that (or invert the timer), and it will activate when the values are effectively equal.
2013-02-08 23:48:00

Author:
comphermc
Posts: 5338


Re-tried and tested again... Here is the result and setup:

I have a battery at 10% and another battery at 1%.
I then have an OR gate with '3' ports set to add values.
The 10% battery is plugged into 2 of the ports on the OR gate and the 1% battery is plugged into the third port.

The OR gate has an output of 21.000001563%

I then have a battery set to 21%. It is plugged into the positive input of a direction combiner. The OR gate output of 21.000001563% is plugged into the negative input of the direction combiner.

The direction combiner is now outputting a signal of -0.00000149%.

Next, I have that signal of -0.00000149% plugged into the positive input of another direction combiner and a signal of 0.01% plugged into the negative input. This combiner's output is going into a timer set to 'speed scale' with a target time of 0.0.

As I explained earlier. The result is a false. By false, I mean than the timer has an output of ZERO.


Is there something here that I am missing?

Yes, I didn't mention it,
but you would still need to invert the timer output or run it through a NOT gate like your positional sequencer method.
2013-02-08 23:58:00

Author:
evret
Posts: 612


Ah!! Got it. That not gate solves the problem! Thanks a bunch guys. Now I almost understand how this whole thing works. The timer set to speed scale at 0 sec., That's the part I don't understand. But works none the less.


Sorry for being grouchey the other day. I just started using these logic gates in Janurary of this year so I'm still trying to understand how it all works.

I really do appreciate all your help. And thanks to Evret, for once again solving my problem!

Im nearly done with this level now. Just some simple animations to put together and a scoregiver to work out.

So, Thanks again!
-Sweet!
2013-02-10 20:19:00

Author:
Bitter Sweet
Posts: 95


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.