Help to optimize very graphics heavy game.

Get help using Construct 2

Post » Mon May 27, 2013 2:15 pm

@vee41 It's true that I don't use tiled backgrounds much, but the reasoning behind using sprites is that tiles can't be animated. If you try pressing the arrow keys you'll see that almost the entire environment reacts to it. I also didn't experience a huge performance boost even when completely erasing all art in the layout. The main performance issue lies somewhere else after all.
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Mon May 27, 2013 3:20 pm

When you say all art do you mean all the walls and platforms too? What I was getting at earlier is too many objects with the solid attribute can easily lower the framerate.

Also are you running any heavy loops or anything?Tokinsom2013-05-27 15:21:11
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Mon May 27, 2013 4:07 pm

Must say this is very impressive, well done.

first thing I noticed is you are using sprites as the background, but as you say you need them animating, but you do not need them all to have collisions enabled, only the blocks directly above and below the player need this,even the ones that need it, you could delete a point in the collision polygon to make it triangle,as you only need one straight edge,same with your animations and turrets, that are triangle anyway, add all that up and that's a lot of unnecessary collision checks by the CPU saved...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Mon May 27, 2013 4:31 pm

@Tokinsom: Yes I mean all art. I erased absolutely all art, all shaders and every layout except the test stage (In the entire project). Still couldn't get it past 40 fps. The test level consisted of only one solid box and one platform box with a "scroll to" on.

This ran on a laptop that on high performance runs the game at 60 FPS. This result is what I get when I run at low performance. I do however still get 60 FPS on low performance in a fresh project.

@Pixel perfick: Thank you, and oh snap... Didn't know about that option. Will definately check that one out. The polygon trick seems clever too.

Still weird though that I had performance issues without any objects or art assets whatsoever.


Edit: Alright I didn't mention that this test stage originally was a duplicate of one of the bigger stages, and that I removed all of the content. When I tried to make a brand new layout within the same project I managed to get 60 FPS.

I still have no clue what abominations is lurking inside the previous test stage though. I tried increasing the size to see if I could find any leftover objects, but I didn't find anything. I have a feeling whatever's slowing down this layout is the key to optimize the performance.Tinimations2013-05-27 18:34:09
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Tue May 28, 2013 10:40 am

I still haven't been able to improve the framrate, even with all the tweaks proposed by you guys.

Is it possible that duplicating layouts leave traces from the previous levels of some sort even if I erase all of the content from it? It's the only common factor I've been able to find between the levels with unnatural slow downs.

@Tokinsom: Can you please specify what you mean with heavy loops? I don't think I use heavy loops, but I do have a fair amount of "every tick" dependent events.

Tinimations2013-05-28 10:41:10
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Tue May 28, 2013 12:07 pm

Can you be more specific on where the framerate is poor? , I got the odd jitter, but for the most part it ran very well, also there is no FPS indicator, so it's difficult to compare if changes are having an effect...

Every tick events can slow a game down, if they are forcing an event that is not needed every tick, text objects are also likely candidates for frame drop, I saw them in objects, but none on screen...Pixel perfick2013-05-28 12:08:05
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Tue May 28, 2013 12:27 pm

The framerate is pretty much consistent, with an exception of the 4th stage's beginning. That's probably caused by a minor animation overload due to all of the unoptimized pillars.

What specs does your comp have? I noticed that the two test computers getting slowdowns had a poor GPU.

I monitored the framerate using fraps.

The text thing can be a thing. I use those to print out values the game uses to spawn projectiles. I can probably just print the values to a global variable instead.
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Tue May 28, 2013 12:50 pm

Regarding specs, pretty much all the work is done by the graphics card so that rings true, I'm running dual core 2.8 with 4 gig ram and Win XP, with ATI radeon 3400, 256 meg graphics card, most stuff runs very well on it despite being pretty old...

Definitely get rid of the text objects, as you say global var will cover that.

A text object to show Construct 2's FPS calculation, would be a good idea though, as fraps itself could be eating into your performance...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Tue May 28, 2013 12:59 pm

Thanks a bunch. Do you know how important a GPU's memory is to the performance, or is everything dependent on the card's number-crushing capabilities?
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Tue May 28, 2013 1:39 pm

A good rule of thumb is have double the minimum video ram,required for the application but obviously the speed of the memory and GPU speed will have a big role in performance, especially if shaders ect are used...

the system expression "ImageMemoryUsage" gives a figure of video ram usage, but does not include sound files, that your game has many of...

If all preloaded, they could take a sizable chunk,of system ram I guess...Pixel perfick2013-05-28 13:41:44
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, anty21ro, DamonZero, Radulepy and 0 guests