Several questions about performance

Get help using Construct 2

Post » Fri Mar 06, 2015 6:55 pm

1: I use about 30 event sheets in my game. For example : character controler, disable /enable colision , Disable animations , Music , sounds , etc
Is it better to use separate event sheets for each of theese , or 1 huge event sheet? Will plenty of eventSheets decrease Performance?

2: Will invissible objects icrease performance? Example: Is on screen set visible, is not on screen set invisible.

3: Will big music files decrease performance? 5 minute tracks per level? Or 1 minute loop is better

4: Is pin behaviour the same as every tick set position to object?

5: is it better to use every tick or every 0.01 seconds?

6: Why CoconJS is much faster on mobile devices than IntelXdk. What can i do to Xdk settings to get the same performance as CoconJs?

7: Why i cannot use more than 1 else in my eventSheet?

8: I was making a big game level, but i hit the 10000 margin limit, any way to increase it?

This is all what i am interested right now, , thank you for advice guys.
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Fri Mar 06, 2015 7:20 pm

1. It's for organization purposes and probably has no impact on performance at all.
2. Less things to draw would speed up rendering.
3. Whether the music is one minute long or on hour has no impact on performance, only loading time of the webpage.
4. Basically. The pin behavior has more features than just that, such as setting angle. And there are cases where doing it with events is more useful.
5. Any value below 0.0166 (1/60) with every n seconds will be the same as "every tick". Other than that just use the one that makes sense for what you're doing.
6. As I understand it CocoonJS takes some shortcuts to make rendering faster at the expense of unsupported edge cases, whereas IntelXdk supports everything C2 supports. Making it faster is unknown to me, I do not use it.
7. Don't know. I'm guessing it's where you're placing them. Else can't be used after a trigger is one reason that comes to mind.
8. Why not just increase the layout size? Margins are just extra space around the layout for editing purposes.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Fri Mar 06, 2015 7:28 pm

Thank you , helped.
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Fri Mar 06, 2015 7:29 pm

I will add that for 2, off screen object are not rendered, to check if rendering is needed, the first thing it checks is if the object is invisible, then if it is off screen, then the size, it might be possible that just checking if it is on screen or not to change the visibily manually will be slower than just letting it be.
Last edited by Aphrodite on Fri Mar 06, 2015 7:33 pm, edited 1 time in total.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Fri Mar 06, 2015 7:29 pm

2 - No this will not increase performance. All this will do is force the system to test each object each tick to see if it is on screen which would in fact hurt your performance. If you have a really big game with a large number of static objects, you may want to look into enabling Render Cells.

4 - The pin behavior can have the same result as the set position to object but also has the added benefit of getting rotation from the object pinned to. Also, it is optimized so would cut down on performance issues.

5 - In almost all cases, using time is better than every tick. Every tick can cause issues because different systems will register a different number of ticks per second.

7 - You can use more than one else. However, it is only valid immediately following a single easily defined event trigger. Else just means if the last event didn't fire, trigger this event. You can combine an else statement with another condition to create an "Else If" event and have any number of these in sequence followed by i final "Else." See the else section of the tutorial at the following link for more information:
https://www.scirra.com/tutorials/292/gu ... t-features
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Fri Mar 06, 2015 7:42 pm

Thank you guys for suggestions. Here is last one i want to ask. You sayin that what is not on screen is not going to be rendered yes? I have about 30 torches in the level , each torch has 12 frames. So if the torch is not on screen it will not be rendered , but the animations will still be played for all of them? or should i stop animation while not on screen?
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Fri Mar 06, 2015 8:00 pm

Animations for off screen items should not significantly affect performance. You could disable the animation if you would like but, it probably won't have too great an effect. In fact, the very act of testing if the torch is on/off screen could completely negate any benefit you would have seen. Take a look at this tutorial about Render Cells for a better explanation:
https://www.scirra.com/blog/ashley/14/h ... cells-work
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Fri Mar 06, 2015 8:03 pm

ok thank you , gonna read that.
B
11
S
3
G
1
Posts: 419
Reputation: 1,782


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests