"Not Responding" windows reaction to intense calculations

New releases and general discussions.

Post » Sat Jun 11, 2011 7:11 pm

For nested loops just break up the top level loop across multiple ticks. That still cuts up the entire job in to smaller pieces.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Jun 11, 2011 7:47 pm

[quote="Ashley":11twnj7b]For nested loops just break up the top level loop across multiple ticks. That still cuts up the entire job in to smaller pieces.[/quote:11twnj7b]
oh yeah, that's way easier than my suggestion, but I already made it, so here ya go:
http://dl.dropbox.com/u/1013446/splitsplits.cap

splits em up into chunks of 10,000 regardless of nested loop position
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Jun 11, 2011 8:28 pm

[quote="tulamide":2sfgvj4y]Also, Python may be an alternative. The standard library, starting with v2.6, supports threading/multiprocessing:

http://docs.python.org/release/2.6.7/li ... ading.html
http://docs.python.org/release/2.6.7/li ... ssing.html[/quote:2sfgvj4y]

I wasn't able to get either threading or multiprocessing to fully work with Python. For some reason, I can't seem to populate the entire Construct array inside the thread (only the first element). It is like it runs the loop once then just stops.... also can't set globalvars from inside the thread, etc... For multiprocessing I get an error "AttributeError: 'module' object has no attribute 'argv'...perhaps related to running the program via the Construct IDE and not commandline.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Jun 11, 2011 9:18 pm

Ok, plenty of food for thought.

While I try some of the suggestions, here's the most basic way I could find of making the "Not Responding" message happen using 2 nested loops, with minimum reading and writing to an array.

http://www.smileydesign.co.uk/FreezeMe.cap

How would you go about stopping that from freezing?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sat Jun 11, 2011 10:25 pm

[quote="KrushBrother":1enwetts]Ok, plenty of food for thought.

While I try some of the suggestions, here's the most basic way I could find of making the "Not Responding" message happen using 2 nested loops, with minimum reading and writing to an array.

http://www.smileydesign.co.uk/FreezeMe.cap

How would you go about stopping that from freezing?

Krush.[/quote:1enwetts]

The simplest way would be to split the x over 100 ticks, like this:
http://dl.dropbox.com/u/326175/freezemeunfreezed.cap
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Post » Sat Jun 11, 2011 10:47 pm

[quote="Daiz":1sw5ahk3]The simplest way would be to split the x over 100 ticks, like this:
http://dl.dropbox.com/u/326175/freezemeunfreezed.cap[/quote:1sw5ahk3]
That doesn't seem to work.
The outer loop isn't a loop, if you know what I mean.

But I can see what you guys meant now by splitting it over many ticks.

But is this going to restrict my use of Functions?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sun Jun 12, 2011 12:41 am

Ok, I think I'm onto something now. :)

I'm using a disabled group so I can enable it when I need the data worked on, and I'm using a variable to keep tabs on the x loops (1-500), and each x loop contains a real "Y For Loop" that runs 1-10000, with the group disabling itself when x has reached 501.

I've only done this in a test cap, and it runs fine without any "Not Responding" messages, enabling me to move the window about and everything.

The real test will be when I add it to the project tomorrow, but I'm optimistic.
I'll let you know how it goes.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sun Jun 12, 2011 12:53 pm

[quote="scidave":16morb2x]
I wasn't able to get either threading or multiprocessing to fully work with Python. For some reason, I can't seem to populate the entire Construct array inside the thread (only the first element). It is like it runs the loop once then just stops.... also can't set globalvars from inside the thread, etc... For multiprocessing I get an error "AttributeError: 'module' object has no attribute 'argv'...perhaps related to running the program via the Construct IDE and not commandline.[/quote:16morb2x]
That's really too bad. I assume that Construct's objects are only updated per tick and threads are running outside the scope. Threading might only be usable with a Python array/list/dict etc.

AttributeError: 'module' object has no attribute... most often indicates that there is no correct path to the module. Maybe a 'sys.path.append' with the working or temp directory in the script before calling any other functions could help? Also, try saving the script to Construct's python directory and import it.

A few weeks left until I can really test things out instead of just proposing them and hoping for the best ^.^
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Jun 12, 2011 2:06 pm

Right, I've just set aside a couple of hours to sort this out, and I'm looking forward to it, but something did occur to me.

I'm going to have to replace the Perlin Noise plugin by Arsonide because it causes this "Not Responding" state when generating the noise.
That's not a problem, as I had most of that written before Arsonide released his plugin (several Seeded number generators and interpolation, easy), but I did wonder if there was anything that plugin authors could do to avoid the "Not Responding" state when writing their plugins.
I haven't looked at the plugin SDK, so I don't know how much control you allow plugins to have, but could they use multiple threads in their plugins?

Anyway, I'm going to have a couple of hours of fun coding, with Chris Moyles on the iPlayer acting as white noise to the outside world. :)

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sun Jun 12, 2011 2:17 pm

[quote:26njzfjd]I'm going to have to replace the Perlin Noise plugin by Arsonide because it causes this "Not Responding" state when generating the noise.[/quote:26njzfjd]

Perlin shouldn't slow down anything, it's just data. :?:
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 5 guests