-
[Bug]
Eh, forgot to add title... It should be:
[Bug] Scaling and overlapping in a loop
Is this where general bug reports goes nowadays?
The game lags, while in a loop, setting an object's y-scale to a dynamic value like for instance loopindex("currentLoop") or y-scale of object +1, and at the same time testing for object overlap for that object and another one.
Running the same app in the android runtime makes the app crash instantly. Removing the overlap condition or the scale action makes the app run well in both standard and android.
-
Overlap is the heaviest condition of all and slows game heavily. Do as low amount of overlaps as physically possible. Compare positions, values, but not overlaps/collisions :<
-
In other words what I wanted to point out is tht doing overlap check (heaviest one) in a loop (fastest and usually not well coded) will cause heavy delays always on less powerful machines. Check your code on any netbook I bet you will have similar results in performance.
It's how MMF is done, it's not a bug but normal behaviour which you find now because you are not using from your CPU.
-
What Fano is saying (badly) is that for overlap, all the instances of all the objects' current animation images' single pixels must be checked to see if they overlap and aren't transparent. That's a lotta loops.
-
I get your point, but if the object is not scaled, or always scaled to a static value, the loop runs fine...
-
That's probably becasue the scaling is per-object and so the image has to be scaled up for the is-overlapping check, before a scan of each pixel.
-
Which means - bigger object, more pixels, more overlap checks. And outside of loop is done only once per frame loop.
-
So, in the following example, where the y-scale is dynamically set, it scales the object on every loop...
* On loop "resize Object1"
+ Object1 is overlapping Object2
- Object1: Set y-scale to LoopIndex("resize Object1")
...while in this example it only scale the object when the loop starts? Is that what you two are saying?
* On loop "resize Object1"
+ Object1 is overlapping Object2
- Object1: Set y-scale to 150
Then can you please explain why the following events don't work either?
* On loop "resize Object1"
- Object1: Set y-scale to LoopIndex("resize Object1")
* On loop "resize Object1"
+ [Negate] Object1 is overlapping Object2
- Stop loop("resize Object1")
I guess I understand why it is slow, I just don't get why it works fine when the value is a static one.
-
I assume fine detection is turned on for your object? Try turning it off, so you get box collisions - these are much faster.
(of course, you probably WANT fine detection, but just a thought - I'd be intrigued to know if you still get the bug)
-
You are right, it works fine with finedetection off, but yeah, not getting the desired effect.