construct 2 is not so fast after all

Discussion and feedback on Construct 2

Post » Fri May 20, 2016 5:22 pm

@lennaert Yes, the second event is not firing because with wait(0) x sets to 2 after the event, great example.

For everyone, who get confused over the skipped actions, no matter the framerate, actions can't be skipped, i made a .capx demonstrating this. The heavy and laggy function is called and increase "var2" variable by one for 8797899 times (to hang the game for 5-10 seconds), then another function is called and set "var3" variable to "var2", and both values are always equal to 8797899, no action is skipped, no bad values written, when a function is called, the game hangs and the following actions are not even happening before it finishes (If you not using actions that don't give a result immediately, like destroying object, but even if using, this action will not be skipped, it will fire, but the system can destroy objects only in the end of tick, that's why you need to use Wait(0) after them to fire the following actions after destroy.).

.capx
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Fri May 20, 2016 5:31 pm

@lennaert Your examples are poor. There is no reason a Wait 0 is needed in your function example, and the reason Wait 0 doesn't work in this example is because the Trigger once, which is an abuse of Trigger once, will prevent x=2 from being evaluated. The X=2 condition would nee to be a subevent of x=1 to work with Wait.

Wait 0 is rarely required.
ImageImageImage
B
71
S
22
G
258
Posts: 3,792
Reputation: 143,200

Post » Fri May 20, 2016 5:35 pm

@Sisyphus
Yep, i am guessing the whole missed actions is a bit of a myth which finds it's origin in incorrect expectations.


blackhornet wrote:@lennaert Your examples are poor. There is no reason a Wait 0 is needed in your function example, and the reason Wait 0 doesn't work in this example is because the Trigger once, which is an abuse of Trigger once, will prevent x=2 from being evaluated. The X=2 condition would nee to be a subevent of x=1 to work with Wait.

Wait 0 is rarely required.


That depends on whats in the function meh, blackhornet.

But you are right, the examples might seem poor to a more advanced developer as they would not need it nor require it.
But there are quite a few here which do not understand the use and mis-use it....

The trigger once execution was actually a very good example in demonstrating the working of wait(0) .... whether it is useful or not was not really the point.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Fri May 20, 2016 5:42 pm

@blackhornet He just wanted to show, how not to use Wait 0 :)
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Fri May 20, 2016 5:43 pm

@lennaert
@newt
well as i said in the above post its not happening everytime depends on how cluttered the project is and depends on the hardware that runs on.

for example i had run some projects on mobile that was basically unusable because the system was skipping or reading the events sheet with delays.

@Sisyphus
here is a example capx with multiple empty events filtered trough functions.

you will notice a 0.1 -0.2 cpu utilization fluctuation depending on your system, instruction can be found in template

Code: Select all
Edited: And that example is only using 50 objects moving 1 px and thats it... imagine having 100 or 300 moving jumping or adding effects on it... the cpu wold "explode" or app wold crash on most of mobiles/browsers


when you start the test leave it 1-2 seconds to get a stable point
Last edited by gamecorpstudio on Fri May 20, 2016 6:06 pm, edited 1 time in total.
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027

Post » Fri May 20, 2016 6:03 pm

@gamecorpstudio Well, you can use any other condition not just empty, and there'll be even more lags. But it doesn't matter how laggy the project is, the actions never can be skipped, if you are having your actions skipped then you should report this as a bug for sure. You can check my .capx above with a heavy and laggy function, it frozes the game for 5-10 seconds, but no following actions are skipped and no wrong values.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Fri May 20, 2016 6:13 pm

Sisyphus wrote:@gamecorpstudio Well, you can use any other condition not just empty, and there'll be even more lags. But it doesn't matter how laggy the project is, the actions never can be skipped, if you are having your actions skipped then you should report this as a bug for sure. You can check my .capx above with a heavy and laggy function, it frozes the game for 5-10 seconds, but no following actions are skipped and no wrong values.


well yes but your capx that repeats "8797899" its not a actual "laggy example" caused by the function filtering but mostly cause you used repeating that action to many times. which of course wold freeze or delay the system until the "8797899" repeats are finished and then the right value wold be written.

but on my capx you dont have no repeats and cpu increases ... on higher amount of objects (bigger projects) that type of unoptimization wold cause a freeze or cpu spikes that wold make the game/app act like skipping and you will start seeing objects going haywire or objects passing trough walls, or objects just not doing nothing or reacting to late. by "skipping" i meant not responding in the same order it should no matter the browser fps or delay of system.

and of course im not using that type of event hierarchy i just said most people do use them and its a bad example of usage that may lead to freezes that visually look as a action or event is "skipped".

maybe "skipping" is not the best term to use here.

let me create a type of example infinity run like where i encountered the "skip of a action"..(edited: but i dont think you wold face any skippings nor i at the moment on my current rig) this types of so called skipping where happening on a older rig i had a few months back. now even if i manage to replicate it i wont notice it since my current rig its just awesome lol... i have some projects i could share and you could run as a test on mobiles or ur pc but requires premium plugins so... need to basically replicate those in a free way.

anyway im not complaining about it cause by this time i learnt to work around those issues. but you asked :P
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027

Post » Fri May 27, 2016 11:00 pm

You can set a time to be 0.001 I believe.
B
31
S
13
G
1
Posts: 41
Reputation: 2,958

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests