Basic BP integer logic broke. True is false, 0 > 2, War is peace...?

While trying to find out why my game mode is failing to spawn in bots I found this in debug mode:

So basically, 0+1=0, 0 > 2 and if I tried passing that “false” in the end through a NOT, it stays false.

How could this possibly happen? This survives editor restarts and it makes no sense at all.

This is on a fairly standard 4.27.2 install.

Bonus insanity:
grafik

The answer is: use a print node, don’t rely on the debugger, it lies sometimes…

OK. Printing the result of the “less than” comparison actually changes the result of that comparison. It’s not like the watched values were incorrectly displayed - the loop indeed would not start to run before adding the print node.

Is this an editor bug? How can I detect this in the future? I can’t seriously print every single evaluation result on the off chance that it might be wrong.

//edit: I was wrong, the loop does indeed execute and the “watch value” lies only during the breakpoint on the while loop. So, is that it? Some nodes handle debug breakpoints incorrectly?

2 Likes

Like I say, can’t trust the debugger :wink:

Since it’s breakpointing before it runs the node, it hasn’t yet evaluated the expression. If you step by one node, then check the values it should line up.

3 Likes

This is indeed the right answer! “pure” nodes aren’t evaluated until they are needed. This might be familiar to people who have used lazy functional languages before.

Also, “pure” nodes re re-evaluated each time they’re needed, which will then confuse all those lazy functional programmers, because that’s not the normal behavior in that world. Blueprints have managed to import special behaviors from two different worlds and merged them!

At least with Verse, we’re getting a totally new paradigm in functional logic combinatoric language evaluation. Because “it has to be easy for new programmers.” (I’m not even kidding; that’s a literal quote from SPJ and his Verse talk.)
(Personally, I’m actually excited, because I’m one of those lazy-functional people. I really hope they do get traction with that model. But it’s absolutely an uphill battle against an entrenched industry…)

1 Like

doesn’t seem weird to me, really.