How to optimize a game that loads images into folders by MS?

For questions about using Classic.

Post » Tue Mar 15, 2011 7:16 am

Any ideas ?
B
2
G
2
Posts: 31
Reputation: 712

Post » Tue Mar 15, 2011 11:02 am

Oh, that's a bit too much for me, sorry :P Like I said, I don't do much animations, I'm just familiar with certain game design paradigms.

Why don't you create a new .cap and experiment there? Might find a solution that works for you.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Mar 15, 2011 3:41 pm

I'll see about setting up a demo later, but in the meantime I'd suggest naming your files, and animations numerically, and using folders to make things easier.

>Start of layout
>-for "folders" = 1 to 4
>--for "frames" = 1 to 10
>---sprite set animation to loopindex("folders")
>----sprite set frame to loopindex("frames")
>-----sprite load frame from appath &"\"& loopindex("folders")& loopindex("frames")&".png"

It shouldn't be necessary to set animation speed as this is happening at start of layout, and all within a loop.
Although that does mean that if you plan on loading an animation later on you will have to change the speed.

Edit:
[url:2g7db7pk]http://dl.dropbox.com/u/666516/skelanim.zip[/url:2g7db7pk]
Not my sprite
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Wed Mar 16, 2011 10:15 am

I think the best way is to make new action in plugin "Sprite".
Says you just need to specify folder where from to load sequences and prefix for frame count and file extension. Action look for subfolders and creates new animations for each one. Then for every subfolder it loads amount of frames equal to amount of files. I think it will be very usable for everybody if someone make this.
For me it's very needed feature because artists always improves animations and you need every time to reload it manually.
B
1
G
1
Posts: 8
Reputation: 441

Post » Wed Mar 16, 2011 1:26 pm

Not sure if your aware of this, but there's already an action under sprite called "load frame from file", so you don't have to use the image manipulator.(see download above)
Also you can do all you suggested via events, and the file object.
The only thing you can't do is add frames during runtime.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Fri Jan 27, 2012 12:03 pm

I'm just trying to understand the advantage of animations loading at the start of layout...
For example, I have next animations and associated RAM use:
1. Hero (100 mb of RAM)
2. Enemy1 (20 mb)
3. Enemy2 (20 mb)
4. Enemy3 (20 mb)
On total - 160 mb

At the first layout I'm using Hero and Enemy1, so - 120 mb of RAM are used.
At the second layout I'm using Hero, Enemy1, Enemy2 and Enemy3 - all 160 mb are used.
If I understood correctly, comparing usage of unique .exe, I have an advantage of free 40 mb of RAM only at first layout (and at the meny layout of cours).

The question is: if at each layout I have to render all my animations, is it usefull to use "Load frame" ?
Rainman2012-01-27 12:05:34
B
7
S
1
G
1
Posts: 9
Reputation: 1,076

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests