[SOLVED]Complex, multi part sprite animation

For questions about using Classic.

Post » Mon Jun 13, 2011 7:11 pm

Hey guys me again :)
This time i need an adive/tutorial/hints about complex sprite animating.
Animated sprites are made by frames. Each frame consist of a whole picture with changing elements. But sometimes not the whole sprite changes from frame to frame.

Imagine a police car sprite from topdown view. The only thing that actualy changes is the light on top.

So what i need to figure out is a to have a sprite + microsprites. So they are being aminated independently from each other. So for example if i want i can turn animation of the lights, or flame from wheelr or laserz - or whatever.

Now howcan i manage this?

The only way i know as for now is to create a seperate sprite and via events set its X/Y to image point and run on "always". But now i think about 100 of such sprites and so much X/Y being conctantly adjucted would propably tire the CPU and would trash the event sheet.

Any idea of more elegent solution? to link that sprite animation?
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Mon Jun 13, 2011 7:20 pm

I'm not sure if the bone behaviour does rotation properly, but it is worth a try. Setting the X and Y of each object will probably run faster than 100 objects linked up by the bone behaviour though :?

You could try creating families of similar sprites and then put them in containers, they will then link up to their correct main body and it will reduce the amount of events you need to write. The end result will still be those sprites being processed in large amounts, but Construct can probably handle it without dropping (m)any FPS.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Mon Jun 13, 2011 7:34 pm

oh really? hmm. thought Beh's are executed faster then events. what a shame :(

Some nice tut on this method with fammilies would be greatly aprreciated.
Oh and it bother me - its quite plain to link sprites via X/Y event if they are pre-made.
But what about the one that are spawned, created?

Think: monster spawner. each monster is made out of 3 individualy animated sprites that creates the whole. But they are being spawned from sprite X - the spawner.
Making the spawner create new monsters sounds very easy. But to make him spawn them in couples of 3, when each should be attached in a precise manner to each other... thats beyond my knowledge. and then, if i would use X/Y event tracing - how i am supposed to make it trace each new psanwed mosnters and their elements?

i mean okey:
if always -> set Mob Tail X, Y on image point "tail start" of Mob Main body

but then if i spawn lets say 10 of them each will get glued to one mobs, em i right?

UPDATE:
ive managed to get a grip of the fammilies linking method but for some reason i simply cant set the angle of the sub-sprite which is odd.
When i try to
if always -> set angle Family_sub.angle to Family_main.angle
it just doesnt work. I mean, the second family is not even there to pick or click. and if i type the expresion by hand it says that there no such expresion.

http://dl.dropbox.com/u/15566547/turnleftright.cap

UPDATE2:
oh okey now it works. instead of using family angle i just used sprites angle
http://dl.dropbox.com/u/15566547/turnleftright%202.cap

Works like a charm. Thank you Jay :D
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Mon Jun 13, 2011 8:39 pm

Heh, no problem, I'm just happy it works! :P

Thanks for sharing your solution though, hopefully other people who have the same problem can learn from the cap :)

Families can sometimes have bugs though, so keep backups incase you stumble onto something that breaks your cap!
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Tue Jun 14, 2011 5:27 am

[quote:1sv71nl7]Families can sometimes have bugs though, so keep backups incase you stumble onto something that breaks your cap![/quote:1sv71nl7]
now you scared me
._.
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Tue Jun 14, 2011 10:04 am

yeah, be carful with families. Few days ago I deleted one object (who belong to a family) and few hours later I got an error massage trying to save my cap...
Just always remember to save before you add, remove or do something with families.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Jun 14, 2011 5:57 pm

Events with families work pretty fine though, it's just whenever you change private variables, behaviours, or actual objects. That's when you need to be careful.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Tue Jun 14, 2011 6:39 pm

[quote="Jayjay":ghtb1th3]Events with families work pretty fine though, it's just whenever you change private variables, behaviours, or actual objects. That's when you need to be careful.[/quote:ghtb1th3]
hmm. this is troubling.
PV - you mean PV's of the whole family or just its members?
Beh's - do you mean like turning beh's off or like for example: changing 8dir beh speed?
Object - whta sort of changes can be classified as this? i mean is frame/animation changes safe?

on example:
I have lots of enemy mobs. Many mobs are made out of couple of sprites linked togather. All of them have also PV's for their ammo, HP, alertness and many others. They also are all animated and have some custome animations displayed under precise circumstances like death, running away, agressive, shooting etc.
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Tue Jun 14, 2011 6:46 pm

[quote="The_Funny_Guy":1z89n91g][quote="Jayjay":1z89n91g]Events with families work pretty fine though, it's just whenever you change private variables, behaviours, or actual objects. That's when you need to be careful.[/quote:1z89n91g]
hmm. this is troubling.
PV - you mean PV's of the whole family or just its members?
Beh's - do you mean like turning beh's off or like for example: changing 8dir beh speed?
Object - whta sort of changes can be classified as this? i mean is frame/animation changes safe?

on example:
I have lots of enemy mobs. Many mobs are made out of couple of sprites linked togather. All of them have also PV's for their ammo, HP, alertness and many others. They also are all animated and have some custome animations displayed under precise circumstances like death, running away, agressive, shooting etc.[/quote:1z89n91g]

By change, I mean (sometimes) adding or (mostly) removing them. Changing their values, graphics, animations, and settings is fine. Just plan ahead so that you don't need to add/remove things to the families too often, as it doesn't go smoothly every time.

Sorry for the confusion :oops:
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Tue Jun 14, 2011 7:01 pm

oooh. Okey so removing/adding family members is dangerous. em i correct?
thats so sad :(
i wonder when(IF!) itll get fixed. Sounds like a major kick in the balls if you dont backup your caps that offten.
Hell! i am scared that i might one day forget to do backup and ill loss days of hard work :(
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests