Animation suggestions.

New releases and general discussions.

Post » Tue Mar 17, 2009 11:32 pm

Hi guys!
Since I'm getting deeper into Construct, I've started to work on sections of the software I still wasn't used to, and I guess I have a nice suggestion to the animation part.

I've been working for about 6 months with the Playground SDK, a free game SDK from Playfirst for developing casual games, and on the games I'm making, we constantly need to create simple animations without having to use too much frames (the engine currently supports animation strips of 1024x1024 max, and our sceneries and objects were quite big).
Their animation program, called "filmstrip", can read easy LUA scripts that organize frame number and delay. I really enjoyed it, and I think something similar could vastly improve how we deal with animation in Construct.

The script is simply a function with delays and frames, for example, a walking animation with 10 frames has a script sorta like this:

-Walking
delay(60)
frames{1,2,3,4,5,6,7,8,9,10}

If I wanted to make a character swing a sword, with a little antecipation on the movement, I'd say:
-Swing
delay(40)
frames{1,2,3,4} <--- draws the sword
delay(150) <---- wait for it...
frames{5}
delay(10) <---- quick slash!
frames{6,7,8,9}
delay(70)
frames{4,3,2,1} <---- returns sword more slowly.

I found myself using this for background and idle animations to... for example, if I have a dog that wags its tail, barks, and looks around, I could create, with the same frames, not only the idle animation of the dog (that involved the wagging and looking around and barks a bit) but also each separate animation, using the same frames I originally had from my strip.

I don't know how construct interprets equal frames, but I often use the same frame in the middle of my animations, so I end up having to copy them over and over. Using this "pool" of frames, We could easily create animations without having to re-import them, use size and texture resources, and so on.

What do you guys think? Have I made myself clear? I'm not a programming expert, and english's not my first language :P

Please comment on this!
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Tue Mar 17, 2009 11:38 pm

If you select a single frame in the animator bar, you can change its relative time. So 1.0 is normal time, 2.0 spends twice as long on that frame, 0.5 spends half as long on that frame, for the given animation speed.

Is that what you wanted or are you talking about a more complicated system?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Wed Mar 18, 2009 12:00 am

He' s also interested in referencing one frame of an animation in other animations, so you would save on texture space. I guess more of a library of frames that you can use to create your animations.
B
77
S
49
G
25
Posts: 346
Reputation: 17,409

Post » Wed Mar 18, 2009 1:13 am

Hey Ashley! Thanks for the information, I wasn't aware of that feature!

But yes, like Uberlou said previously, I guess the main concern here is on saving texture space. Like I said, I often find myself using frames I already used before, and as far as I could tell, Construct didn't recognize them as the same frame.

By using this method, instead of having packed animations with frames in it, we would have a library of frames in a object, and them we'd only have to call the frames and their durations over the desired animation.
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Thu Mar 19, 2009 4:22 pm

Well... No comments? :cry:

If anyone's interested in taking a look at the things I've mentioned, the Playground SDK is free do download & develop (registration is required though).
https://developer.playfirst.com
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Thu Mar 19, 2009 5:35 pm

We could make it recycle textures, but unless you manually specified the same ones, it'd have to work out on export time which ones match... which could take a long time...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Thu Mar 19, 2009 5:49 pm

Using CRC on an image wouldn't be too slow, it's something we should consider for 1.0 I think.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Fri Mar 20, 2009 3:18 am

I tried to solve this by loading all animation frames into one sprite then using the timeline object to control the frames and delay. Its kind of hacky, but it works. I couldn't figure out a way to make the animations repeat though. Im sure it could be done, maybe someone else wants to edit my cap.

Press 1,2,3 to change the animations.
[url:39o8tum3]http://www.louisferina.com/games/anims.cap[/url:39o8tum3]

For a little more explanation: In the Timeline object, each timeline is a new animation and each period is a new frame. Parameter 1 is the frame to show. Duration is how long each frame lasts. I tried to use Parameter 2 to define when the animation should end, but couldnt get that to work.
B
77
S
49
G
25
Posts: 346
Reputation: 17,409

Post » Fri Mar 20, 2009 11:17 am

Wow Uberlou! This is good! Very promising.
I'm planning to use some large animated characters on my next project, so this should come in handy! I'll put an effort on this idea too and see if we can expand it! :D
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Fri Mar 20, 2009 12:42 pm

Here, I made it loop! :D
I gotta go to work now, so this was real quick. But this sounds like a nice way of making it.

http://www.gammabeam.net/constructstuff ... onloop.cap

I simply created period with the name "loop", and at the beggining of the this period, the timeline is restarted :wink:

edit**
Using the parameter 2 we could make it flip when choosing another direction, using "set width". I'm secretly working with this at work (shhhh) and I'll upload something soon... Either way, I guess we could move this thread to another section, as this is possibly no longer a Feature Request, but rather a test thing.

edit once more**
Flipping is done... Use the link above to see it.
Messing with construct is so much cooler than my job :oops:
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests