Does it slowdown performance?

Get help using Construct 2

Post » Sat Jan 07, 2012 6:08 pm

I don't feel good creating a topic for those noob questions, but lets go.

I'm creating a game in which each level is on a separate layer.
Level 1 - Layer 1.
Level 2 - Layer 2 .. and so on.

All layers are invisible, except the one the player is playing.

If I have like 100 levels, and level 88 is full of objects movind and shooting and jumping etc... Does it affect the performance when the player isn't on this level ?

1-Do I get better performance, If after each level, I completely delete everything on the past layer (level) ? Or just setting invisible does the thing ?
2-If my level 88 is full of objects but I just start playing their actions when its actually level 88, is it better than let they playing since level 1 startup?
3-Should I create all the instances while on editor, or is it better to do - "Spawn object over point(x,y)" when each level starts ? And for that way I need to save the position for each object I want to create...

I'm just afraid of lagging my game, by using many layers. The Final question would be: Does invisible layers waste processing or only when it's visible(drawing) ?

Thats it, thx.
B
5
S
1
G
2
Posts: 44
Reputation: 1,470

Post » Sat Jan 07, 2012 6:16 pm

My question is: why can't your break things up into different layouts?

For performance it depends on many factors.Yann2012-01-07 18:18:04
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Jan 07, 2012 6:24 pm

hmmm interesting, Its dependant on every game i guess.

But with ym experience in construct it shouldn't affect performance too much.

Just a little lag in the beginning where its loading the objects.
     --> But you could allways do something like this:
        - On start of layout
             -> Set loading sprite visible(true)
        - If(FPS <= 20)
             -> Set loading sprite visible(false)

That way users wont see the lag in the beginning.
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sat Jan 07, 2012 6:25 pm

Oh and, I'm using Firefox 9.0.1 and When on preview mode, it has a lag issue.
Every 5 seconds it lags..
It's seems to be a browser problem, dont know.
B
5
S
1
G
2
Posts: 44
Reputation: 1,470

Post » Sat Jan 07, 2012 6:25 pm

But you should really consider separate layouts for each level, but use the same event sheet. It will not lag, and its easier to edit.

Why are you doing it the layers way?
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sat Jan 07, 2012 6:34 pm

[QUOTE=Yann] My question is: why can't your break things up into different layouts?

For performance it depends on many factors.[/QUOTE]



Layouts..... I didn't know I could create more of them
Lol

I just bought Construct 2 because of Layer limitations...
So I could have done this with Layouts...

Layers isn't lagging at all.. I'm just wondering, that it might lag on future.
Anyway, using layouts would be less recursive. I'm doing : End of Level, Go to Layer Level+1.

I'm finishing level 10 right now. Maybe I could use a Layout for each 10 Levels, that wouldn't be that bad :p
But still didn't get it. When going to another Layout does the other Layout unload ? Layouts are just loaded when we go to them ?
And with layouts I can't find the action "Go to Layout Level". I would have to create a individual "Go to Layout N" for each level.SplashHunt2012-01-07 18:38:49
B
5
S
1
G
2
Posts: 44
Reputation: 1,470

Post » Sat Jan 07, 2012 6:40 pm

Ask this to developpers
i think that it would be easy to change this
...
But for now continue like that
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Sat Jan 07, 2012 6:43 pm

@SplashHunt: you should check out the manual, read about C2's interface and check out the system epressions very useful with how events work.

[quote]I'm just wondering, that it might lag on future.[/quote]
Performances should be fine, as long as you don't spawn 10 000 sprites on the screen.
For the chopyness in FF, make sure in your C2 project's settings that webGL is turned to on and that your graphic card drivers are up to date.

FF 9 as been the fluidest of all the versions so far to me. And FF 10 arrives by the end of january.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sat Jan 07, 2012 6:46 pm

If you have a separate event sheet called vars and make a global variable called Level(Note, you can have the variable on any event sheet, Its just tidy to have some variables on a separate one, As there global any event sheet can access them)

Then on the Event sheet for the level/game, for example level1:

Depending on your set up for leveling do something like this:

Player.OnCollision with (EndFlag)
     -> System.addTo(Level, 1) // Adding one to the level count
     -> System.GotoLayoutByName("Level"&Level) // Here were refencing the level variable, So if the level is 7 were basically saying "Level"&Level(7)

Do you understand? or do you need me to knockup a example?

If you share your capx, or PM it to me, I'll add it to your game for you, Or i can make a example to show you.
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sat Jan 07, 2012 7:12 pm

[QUOTE=smitchell] If you have a separate event sheet called vars and make a global variable called Level(Note, you can have the variable on any event sheet, Its just tidy to have some variables on a separate one, As there global any event sheet can access them)

Then on the Event sheet for the level/game, for example level1:

Depending on your set up for leveling do something like this:

Player.OnCollision with (EndFlag)
     -> System.addTo(Level, 1) // Adding one to the level count
     -> System.GotoLayoutByName("Level"&Level) // Here were refencing the level variable, So if the level is 7 were basically saying "Level"&Level(7)

Do you understand? or do you need me to knockup a example?

If you share your capx, or PM it to me, I'll add it to your game for you, Or i can make a example to show you.
[/QUOTE]

Yeah I got it, just haven't seem that option.
Bah. So I didn't had to buy C2 for now. As my project has only 35 events, and it's very simple. I could do 100 Levels and it would be less than 100 events.
Now I don't know what to do. Keep doing on layers or transfering everything to separate layouts. Layout would be better to use layers for things that I'm using ZOrder.

The game is quite simple, take a look:
http://goo.gl/Rq13L
B
5
S
1
G
2
Posts: 44
Reputation: 1,470

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 23 guests