Increasing Performance?

For questions about using Classic.

Post » Wed Sep 28, 2011 4:27 pm

I am at the moment fooling around trying to make a top-down Minecraft 2D copy and I've recently noticed a very low FPS and laggyness, seeing that I am just a newbie at Construct I didn't know what to do...
So, what can I do to increase the performance?
FILES:
exe File: click me

cap File: click me

SCREENSHOT:
click me

CONTROLS:
WASD, mouse, rightclick: place block, leftclick: remove block, Scrollwheel: change selected block, delete: removes (almost) all blocks.helehole2011-09-29 10:37:48
B
6
G
2
Posts: 39
Reputation: 1,280

Post » Thu Sep 29, 2011 9:41 pm

You absolutely shouldn't make your background out of hundreds of sprites. This could literally be done with one single tiled background. And would save you a lot of performance.

I understand you are new to Construct and probably relied on the individual background sprites for creation and positioning of the blocks. This is entirely not necessary and can be done with a little math easily.

Basically like this: floor(MouseX(Y)/gridsize)*gridsize
And maybe add the width/height of the block divided by 2 to account for a centered hotspot.

Also your event sheet is generally very bloated. The way your are using the variable 'bc' and toggle groups is over-complicated I'm afraid. Actually reminds me a little of my first steps with Construct, so it's nothing to worry about.

As a general advice I would say try to use the function object, think about families and naming conventions for different objects of the same type. If you want to, I can give you a quick edit of your cap, with a majorly reduced event count. But still working the same, of course.

Oh, another quick hint: try to find better file hosters than megaupload and co. Because forum users generally don't like to have to click multiple times and having to wait, just to get a small file. People will be more likely to download your stuff if you put it on easily accessible services like Dropbox or Box.net.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Sep 30, 2011 9:06 pm

Oh thank you for the advice :) very constructive and helpful :) gonna remake the the project from scratch (it's easier than editing the whole system :D)
B
6
G
2
Posts: 39
Reputation: 1,280

Post » Sat Oct 01, 2011 12:54 am

Maybe learn how to use more than 1 condition in an event, and subevents! Will probably improve things for you.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sat Oct 01, 2011 10:39 am

lol that could help x)
B
6
G
2
Posts: 39
Reputation: 1,280

Post » Sat Oct 01, 2011 1:05 pm

Reached a newbie question more; as you might have noticed I used the background sprites to reach the event "spawn object" to spawn the 3D blocks, this can't be done with a "tiledbackground" because there's no such event for "tiledbackgrounds" what should I do?helehole2011-10-01 13:08:11
B
6
G
2
Posts: 39
Reputation: 1,280

Post » Sat Oct 01, 2011 1:09 pm

Just use the position of the mouse and a bit of math to spawn the blocks.

Kind of already explained it there:

[QUOTE]I understand you are new to Construct and probably relied on the individual background sprites for creation and positioning of the blocks. This is entirely not necessary and can be done with a little math easily.

Basically like this: floor(MouseX(Y)/gridsize)*gridsize
And maybe add the width/height of the block divided by 2 to account for a centered hotspot.[/QUOTE]

Can provide a quick example if needed.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Oct 01, 2011 1:45 pm

an example would indeed be very nice :) (sorry for taking your time haha)
B
6
G
2
Posts: 39
Reputation: 1,280

Post » Sat Oct 01, 2011 2:31 pm

Okay, here's the basic method:

http://dl.dropbox.com/u/2306601/placeblocks0.cap

It's just one event, you should be able to figure it out.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Oct 01, 2011 2:35 pm

Haha Thank you so much :) now I understand :) a much better method than the one I used (laughes) :)
B
6
G
2
Posts: 39
Reputation: 1,280

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests