Increasing Performance?

This forum is currently in read-only mode.
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • 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.

  • 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. <img src="smileys/smiley2.gif" border="0" align="middle" />

    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.

  • 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)

  • Maybe learn how to use more than 1 condition in an event, and subevents! Will probably improve things for you.

  • lol that could help x)

  • 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" <img src="smileys/smiley5.gif" border="0" align="middle" /> what should I do?

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

    Kind of already explained it there:

    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.

    Can provide a quick example if needed.

  • an example would indeed be very nice :) (sorry for taking your time haha)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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. <img src="smileys/smiley2.gif" border="0" align="middle">

  • Haha Thank you so much :) now I understand :) a much better method than the one I used (laughes) :)

  • Yet another question (yep, I am really new <img src="smileys/smiley36.gif" border="0" align="middle" /> )

    in the formel (or script, whatever it is called) it says 'grid' and when I am trying to replicate the line it tells me to define 'grid', what should I type? haha

    floor(MouseY/global('grid'))*global('grid')+global('grid')/2

  • Yet another question (yep, I am really new <img src="smileys/smiley36.gif" border="0" align="middle" /> )

    in the formel (or script, whatever it is called) it says 'grid' and when I am trying to replicate the line it tells me to define 'grid', what should I type? haha

    floor(MouseY/global('grid'))*global('grid')+global('grid')/2

    global('[text]') means the global variable [text]. In this case, it's trying to make a new global variable named grid as it does not exist yet in your project. Global variables stay at their set value between all layouts/levels so they are basically named values. However, you can use events to change the value if you need to.

    In this case, you can replace the whole global('grid') section with a number size that you want for your grid size, or go ahead and define it.

    Hope that helps!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)