[SOLVED] Draw calls can skyrocket when zooming, crashing...

Discussion and feedback on Construct 2

Post » Wed Aug 05, 2015 12:08 pm

Hey all,

I've been running into some really weird behaviour in Airscape recently. One of the visual effects involves zooming in very rapidly. I've noticed that on occasion, this rapid zooming can cause *incredible* lag spikes and recently I've heard reports of the entire game crashing during these zooming sections!

I've recently been doing some testing, and it's a very weird issue. Here are some of the things I've noticed:
- it happens very infrequently, and repeating the zooming process under the same conditions can either reproduce the problem, or work perfectly fine.
-When it does happen, the profile measurement for CPU 'draw calls' skyrockets, eventually reading as >100% of the CPU just used in draw calls.
-I've checked and double checked, and I'm not doing anything dumb like accidentally spawning hundreds of objects while zooming. It's definitely the zoom that causes it.
-It only seems to happen when zooming *quickly*. Slow zooms won't cause the issue.
-It only happens on a certain layout of the game (the map screen). Rapid zooming in other levels has never caused a problem.
-I can't find a reliable repro, no matter what I do. I do know it seems to happen more often when the GPU is already struggling.

Basically, I'm asking if anyone has any idea what could be causing something like this? It's driving me up the wall and it's a high-priority issue as it's crashing the game for a lot of users. What on earth could cause the draw calls to skyrocket all of a sudden like this, and so unreliably?
Last edited by sqiddster on Thu Aug 06, 2015 10:20 am, edited 1 time in total.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Wed Aug 05, 2015 6:51 pm

I wonder what's different about *that* layout? Captain Zero relies heavily on zooming with many layers going on, so I'd be interested to know as well. Keep us posted if you figure out anything else!
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
62
S
17
G
5
Posts: 171
Reputation: 8,329

Post » Wed Aug 05, 2015 7:43 pm

i cant help but im curious, is there a tilemap involved?
i had similiar failures but always thought of bad hardware or drivers, but most "weird & non good to reproduce" failures i had with tilemaps involved.
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Wed Aug 05, 2015 10:21 pm

@sinister99 afaik there's nothing too special about the layout. I've tried enabing/disabling layers but since it's so infrequent to reproduce it wasn't very helpful.

@fldr no tilemaps.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Wed Aug 05, 2015 11:27 pm

@sqiddster

My guess:

Every time the game zooms, in or out, the engine is checking each object to see if it's on screen or not so it knows to whether to draw said object.

If you have lots of objects, this can be an issue. Zooming in/out really fast is calling drawing checks on top of each other(guesswork).

You could try snapping to a certain scale? So the engine doing the on-screen check once?

*notes, i could be completely wrong about all of this XD.
B
10
S
2
G
1
Posts: 92
Reputation: 926

Post » Wed Aug 05, 2015 11:42 pm

It's surprising and a little disconcerting if layout zooms can make games crash on some machines (I am using a few as well....). Have you the ability to count how many objects are on screen at the approx times of the crashes and if that number changes greatly? My total guess would be a GPU instantaneous bottle neck as the number of objects to render goes up (zoom out) - although there could be something to @tommsstudio 's guess, I -er- guess! I find it hard to imagine a CPU bottleneck... so I'm guessing that the users who experienced this were celeron or i3 users with weak GPUs that could not cope with running a single thread nw.js and all of that scaling maths.

Does the map layout use any unique to that layout 3rd party plugins or webgl effects?
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Thu Aug 06, 2015 12:08 am

@tomsstudio not a bad guess. But why does this only happen when zooming quickly? Shouldn't scrolling present the same problem? (it doesn't).

@colludium - the crash happens when zooming *in* so the number of objects on screen can only be getting *smaller*!
I've managed to recreate the problem multiple times on my super powerful gaming PC (only when using the integrated GPU though)
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Thu Aug 06, 2015 12:12 am

How many times a second does a scale need to be called?
Image ImageImage
B
169
S
50
G
169
Posts: 8,286
Reputation: 108,216

Post » Thu Aug 06, 2015 12:17 am

Does it matter which browser is used?
B
43
S
19
G
65
Posts: 1,105
Reputation: 37,949

Post » Thu Aug 06, 2015 1:46 am

@newt 60, for a smooth zoom. And does 'calling a zoom' have some kind of performance implication that I'm unaware of?
@Prominent haven't checked but the game is only designed to run in Chrome.
Last edited by sqiddster on Thu Aug 06, 2015 2:04 am, edited 1 time in total.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests