How do I better optimize my map scrolling?

0 favourites
  • 3 posts
From the Asset Store
Classic style beat'em up template. Punch & Kick foes across the screen.
  • I have set up a system that loads data from one array to another, but it checks for each part of the far larger array every tick, which massively decreases my performance. Is there a way for my game to only use array data when I need it?

    Capx file:

    dropbox.com/s/j5web7lhfo4jjoz/roguetest.capx

  • I see you got yourself some event sheet there. Great work, but now, let's see where can we improve this:

    To be honest, you are generating a world, and that might take some time, no doubt about that. But to be frank, 88 events are quite big, and skimming through this is a little rough for me, if possible, could you just tell us your main procedure?

    On the other hand, skimming through your event sheet, I see that you got quite a number of iteration there with arrays especially on Blockload event group. I see you got Array instance with size of 220 x 220 x 1. And you are iterating these arrays in every tick call.

    While array allows you to store things neatly up to 3D. Accessing/Manipulating arrays in many dimensions is real performance eater. This holds true, not only in C2, but in every other programming language, game engine, etc.

    I also see from event sheet 1, event number 60-64, I see identical actions in those events. I believe you could combine those into just 1 event for that. Why did you do that for? You could use "Is between values" condition right in the General section above "Global & Local variables" section instead, so:

    1 = TextStack = 5

    Also, no need for "every tick" after those conditions in event 60-64. Remember, events are always called every tick already. You will want to use "every tick" only when there are no conditions to check.

    Furthermore, in event 15-39, I believe your intention is that you want these to run only once? Right now, I see that they will run in every tick, as they are not sub-events under "on start layout" event. Because of this, all those events will run every tick, not to mention, you are also iterating your array in there every tick.

    Sorry for bad response, but could you elaborate more on what exactly are you doing in several key parts? Or else, what we can suggest you may not help you at all.

    In fact, I see that you are having an event sheet logic design problem. Focus on each part separately as of now, and ask the community accordingly for better event sheet design.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see you got yourself some event sheet there. Great work, but now, let's see where can we improve this:

    Sorry about that, I found the largest performance hog is the process which sends the mapdata in my overall array over to my array used for generating what's on screen (event 79). I'll work on getting the rest of the events less sloppy later on, but right now I just need to pin down this one thing:

    dropbox.com/s/trzydwaanmq8qr2/Untitled-1.png

    I've tried making it only add to the screenspace array for the elements that would be on the screen, but it only adds a minor performance boost.

    dropbox.com/s/k2ar2gne9o50bak/Untitled-2.png

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