Help on pre-loading images

For questions about using Classic.

Post » Mon Sep 26, 2011 10:53 pm

Hi all! Im making a space shooter game and I pre-load the background and split it up into many 256x256 canvases to save video memory. But I get a black screen when I put any layout before the layout that loads the images. I cant figure out why this happens.

The .cap file might be a bit messy, but I have the load command under "Arena" layout and under the group "initialize".

http://dl.dropbox.com/u/18307664/SCII.zip

Any help would be very appreciated :)
/Segoi
B
7
G
1
Posts: 14
Reputation: 710

Post » Mon Sep 26, 2011 11:16 pm

Keep in mind using 4 256x256 canvases will not use any less video memory than using 1 512x512. It only helps if there is a large area of unused transparent space that enables you to use, for example, 3 256x256 textures instead.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Mon Sep 26, 2011 11:38 pm

Arima: Ok tnx, but I thought 256 worked better since I wanted to update the collision mask each tick, for some reason this was very slow if I didn't split the background.
B
7
G
1
Posts: 14
Reputation: 710

Post » Mon Sep 26, 2011 11:59 pm

A funny and simple bugfinding trick is to start deleting large parts of the events and check if the error is still there. If it's eliminated, delete smaller parts and check again, until you pinned down the event that causes the unwanted behavior.

In this case I do blame linkman! :D
Well, the "Setup following" action of the Magicam object apparently doesn't like it when you load stuff on start of layout, IF you set a lag. 0 lag will be fine.

Apart from simply setting lag to 0, which you probably don't want, you can just push the "Setup following" action back. For example make it an action of event 9 where the condition is "Timer is equal to 4000" and place it right after you set the position for the player ship. Then it will work correctly.

Why it does work when the layout is the first in line, might have to do with things going down differently on software startup.

Other than that let me advice you to point out any custom effects and plugins you're using (or delete them from the project before you upload), because users interested in helping you might not bother to search the forum for the needed items.

Good luck with that game (and please do discover the function object *hint*)!PixelRebirth2011-09-27 00:05:47
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,440

Post » Tue Sep 27, 2011 11:27 am

Solved! :) Thanks alot PixelRebirth! You guided me to the problem. It was the paste into canvas that was the main problem. I solved it by giving it more time using the timer condition.

Im a gfx artist and programming is something I forced myself to learn to make games :) But I'll look into this function object. Thanks for the tip.

And sorry about the plugins, I totally forgot about that. hehe.

/Segoi Segoi2011-09-27 11:28:51
B
7
G
1
Posts: 14
Reputation: 710


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests