How do I preload next layout?

Get help using Construct 2

Post » Sun Aug 30, 2015 12:56 pm

When the layout starts, for a second there is a drop on the frame rate and after that runs perfect. If i enter in the previous zone(layout) and go to the layout again not happens, i guess the layout was loaded in the memory and after that always access fast without framerate drops. (I'm using NW.js)

So, is there anyway to load the next layouts to avoid this framerates drops when the player access to a new zone/layout for the first time?.
B
25
S
10
G
3
Posts: 577
Reputation: 4,556

Post » Sun Aug 30, 2015 1:53 pm

i don't understand ur question, can u please simplify?
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Sun Aug 30, 2015 7:08 pm

PreLoad a layout when you are in other. So when you go to the big layout he is already in memory and avoid frame drops when starts.
B
25
S
10
G
3
Posts: 577
Reputation: 4,556

Post » Sun Aug 30, 2015 7:11 pm

ooh let me see, i will replay when i get any result :D
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Sun Aug 30, 2015 7:16 pm

oh yea ...... i remembered this... i got the same problem on my game too, i fixed it by making the layout bigger and make the layout 2 in layout 1
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Sun Aug 30, 2015 9:12 pm

Thanks but this not work for me, i will have a lots of maps in the rpg and i will have various layouts that will have diferent layers and things, i can't do it all in the same layout.

-

One of my ideas is put a black sprite at top of each layer in the layout and when the app starts run all the layouts, i mean "When layout loading is complete= Next Layout" and in the last layout set "Loading=1" and go to first layout. Then if loading is 1 the black layer will off and will deactivate the group "loading" that skip the layouts when are loaded.

With that all the layouts will load to memory and next time when the player plays will load fast without framerate drops "theorically!" :P . I test one of the big layouts wth 300 objects and the RAM charged was 500-600KB, so i guess this may work.

Is there any other solution already that C2 can do?
B
25
S
10
G
3
Posts: 577
Reputation: 4,556

Post » Sun Aug 30, 2015 9:26 pm

There isn't a way to preload it like you're asking, but I have a fade in/out to black to hide and smooth out the transition.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Sun Aug 30, 2015 9:58 pm

I'm just curious, but what if you make everything in the big layout invisible, just to test if it loads quicker. Does it have any effect?
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Mon Aug 31, 2015 7:56 am

u can make a loading screen that shows up when going from layout to another, i think this is the only way, or maybe u can save all the object in the layout to the local storage or webstorage, example: So when the layout go to (layout2) then returns to layout 1 the object will be saved and ready for loading quickly :D
C2 Intermediate Developer
Feel free to contact me
B
7
S
2
Posts: 111
Reputation: 908

Post » Mon Aug 31, 2015 8:24 am

@Prominent I will have a lots of big layouts for the maps of each zone, do all in one layout.... i guess will be a chaos with all layers, tilesets and events,etc... to say what ones are visible and what others no and also will have indoor/outdoor maps when you enter on a house, cave or something.

So then the unique way seems will be create the main map, (outdoor) all in one layout like this:
http://www.zeldaelements.net/images/gam ... rldmap.png

And create new layouts only for indoor zones(houses, caves...) like this:
http://www.zeldaelements.net/games/c/li ... ening/maps

Also i'm using the C2 tilemap editor actually, and for big things maybe will be better use the Tiled one and use the plugin of .TMX to parse it all.
B
25
S
10
G
3
Posts: 577
Reputation: 4,556

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 6 guests