[Solved] Performance Impact on Code/Event Sheets

0 favourites
  • 8 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hello.

    I hope this kind of question is in the correct place.

    Is there any benefit in using event sheets like the scripts in other program languages?

    Does it save performance if I link the content of huge if statements to event sheets?

    Thank you.

  • An event sheet is directly tied to a specific layout. All of that layout's specific code is place on the event sheet.

    So if you have a button on the Layout, you can tell the program what to do when a user presses that button on the Event Sheet tied to that Layout.

  • Thank you for the answer but you misunderstood me. Maybe I explained myself badly.

    I mean:

    Does it has advantages if I create new event sheets for big blocks of code like the AI? In programming languages you can call a Script. In construct 2 there is an option to use event sheets like scripts. But I'm not sure if this is of advantage in construct 2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I understand now.

    Sure it is, you can have many layouts that access the same code so you won't have to copy that code to every layout.

  • Okay this makes sense, thank you.

    And if I only have one layout? Does it safe performance if I avoid giant blocks of code?

    For example if there is an "if statement" (if x=1) with 1000 lines of code in it. Does it take processing power to skip this huge "if statement" if x is not 1? Because if this is true, than using event sheets instead, whould also make sense.

  • I'm actually curious about this, as well. I've been adding enemies to my game, and checking the debugger, even when the enemies aren't in the layout, the code still seems to grab a 0.1% or 0.2% of my CPU usage.

  • I've got 20 different events sheets to more easily manage different parts of my code. There shouldn't be a huge performance impact if you make sure any code that isn't relevant to what's currently going on in the game isn't being checked. Even if you don't worry about that tiny little bit of optimization (like turning groups on/off to turn sections of code on/off), it doesn't seem to noticeably impact performance.

    Keep in mind you can also include different sets of events sheets with other layout-associated event sheets, so if for example there are no enemies on a specific layout, just don't have the event sheet with the enemy behaviors as one of those included with that layout.

  • So does this mean using multiple event sheets (as "scripts") does safe performance?

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