Spriter/C2 update 11/2 bug fix for performance mode

Discussion and feedback on Construct 2

Post » Sat May 28, 2016 5:10 pm

@BBaller1337, I'll look into everything you mentioned.

@mudmask, we were able to replicate the issue. The issue was from projects created with the previous version of the plugin. The simple fix is to save your project (to a new filename just to make sure), and then close it, and reload it. After saving and reloading, it should work fine.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat May 28, 2016 7:56 pm

@lucid Thanks for the update.

I've been doing almost nothing but trying to fix this since, here's my end:

I managed to get shadows working by adding the shadow caster object to the sprite objects, having it disabled by default, and then enabling it when an animation was active (I used a "IsVisible" check for this to keep things super simple; I'm not sure how well this would have worked in the long-run). However, I ultimately didn't like the result and opted for a very different (and less costly) implementation of shadows.

EDIT: I originally said I got the solid behavior working but I spoke too soon and was wrong about getting a solution to the solid behavior functionality. It's actually still not working. Worst-case scenario it's super glitchy and the main character goes flying around, lol. I guess the next paragraph doesn't apply as much since said solution doesn't work but.....

The downside to this solution is that A) it's time-consuming to make sure everything is set up and functioning correctly and B) it'd probably be more efficient and less prone to glitching if the SCML objects inherently used the collision or hurt boxes of the animations its loading, so if you have any suggestions or anything, I'd appreciate it.

Also, quick question: what does changing the .scml extension to .scon for the SCML object actually do? I've forgotten to do it a few times but haven't noticed anything. Thought it might be the cause of some issues but after going and back and double-checking I didn't see any differences.

As a note, I still couldn't get tags to work in C2 and gave up for a while—I did eventually look into it but couldn't find an issue in the plugin's runtime code. Then again, I didn't understand the code super well or anything, so I'll leave it to the pros... especially since the Spriter issue with the disappearing key tags isn't really work-aroundable

EDIT2: Got around to testing triggers and they work perfectly and it felt great. I just used those as a substitute for tags since they can basically do the same things, they're just maybe slightly less convenient or efficient.
B
9
S
4
Posts: 27
Reputation: 727

Post » Sat May 28, 2016 11:14 pm

Hi Bballer1337, (replies inline)

Thanks for the earlier response, I've been playing around and got a lot of things to work, and it's great so far. Unfortunately I have run into some concerns.

"f̶i̶r̶s̶t̶,̶ ̶n̶o̶t̶e̶ ̶t̶h̶a̶t̶ ̶I̶ ̶s̶e̶n̶t̶ ̶a̶n̶ ̶e̶-̶m̶a̶i̶l̶ ̶a̶b̶o̶u̶t̶ ̶t̶h̶i̶s̶ ̶t̶o̶ ̶s̶u̶p̶p̶o̶r̶t̶ ̶a̶l̶r̶e̶a̶d̶y̶,̶ ̶j̶u̶s̶t̶ ̶p̶o̶s̶t̶i̶n̶g̶ ̶a̶ ̶b̶i̶t̶ ̶i̶n̶ ̶a̶ ̶p̶u̶b̶l̶i̶c̶ ̶m̶a̶n̶n̶e̶r̶.̶ ̶T̶h̶e̶ ̶p̶l̶u̶s̶-̶s̶i̶d̶e̶ ̶i̶s̶ ̶t̶h̶i̶s̶ ̶c̶o̶u̶l̶d̶ ̶h̶e̶l̶p̶ ̶o̶t̶h̶e̶r̶s̶ ̶o̶r̶ ̶I̶ ̶c̶o̶u̶l̶d̶ ̶g̶e̶t̶ ̶o̶t̶h̶e̶r̶ ̶p̶e̶o̶p̶l̶e̶'̶s̶ ̶f̶e̶e̶d̶b̶a̶c̶k̶,̶ ̶t̶h̶e̶ ̶d̶o̶w̶n̶-̶s̶i̶d̶e̶ ̶i̶s̶ ̶t̶h̶a̶t̶ ̶i̶t̶'̶s̶ ̶a̶ ̶p̶r̶i̶v̶a̶t̶e̶ ̶p̶r̶o̶j̶e̶c̶t̶ ̶w̶i̶t̶h̶ ̶c̶o̶n̶f̶i̶d̶e̶n̶t̶i̶a̶l̶ ̶i̶n̶f̶o̶ ̶a̶n̶d̶ ̶a̶r̶t̶ ̶s̶o̶ ̶I̶ ̶c̶a̶n̶'̶t̶ ̶s̶h̶a̶r̶e̶ ̶t̶h̶e̶ ̶C̶A̶P̶X̶.̶ OK, apparently I can't get help through private channels, so I have to go off messy explanations since I cannot publicly share screenshots or the CAPX or anything."

>> You certainly can get help through private channels, but some times it takes time for us to be able to help. It would make things go as quickly as possible if you share your project files with Edgar (Spriter's programmer) so we can directly look into all aspects of the data and code related to the problems.

"Anyway, I'm trying to figure out how to set up enemies in my 2D action game. In it, you can attack with one character and hit an enemy. I figured having a family for all enemies with common instance variables and behaviors would be a good idea, so I did that. For the object, I set it to the SCML one. Probably I'll do it so that each enemy has its own scml file, for about 20 different enemy types (including bosses)."

>> Please take the time to be extra-redundant with your explanations.... this is complicated stuff, and very easy to misunderstand...especially once you start using words like "it" after having mentioned multiple things just previously. In this case, you say, "for the object".. which object? When you say you set "it" to the SCML one.. what do you set, and to which scml one?

"The issue is that the SCML objects have their own collision box and this is used by Construct 2 for:

- general collision detection, of course
- shadows (shadow light object + shadow caster behavior)
- interactions between solid objects"

>> Are you referring to collision boxes that you can manually add to Spriter animations, or some kind of C2 generated "bounding box?"

"When checking interactions between two objects with the "solid" behavior, C2 uses the collision mask of the object with the behavior. I can adjust this slightly by linking the scml to another object and changing said object, but in the end its collision mask is not going to match every frame of every animation--it's just going to be something static. So... what am I supposed to do if an enemy is say, lying down on the ground or in some other pose where their shape changes dramatically and a single rough & static collision mask won't fit the object?"

>> It depends enormously on what type of game you're making. I think you'd be amazed at how basic such collision shapes and coding was for all classic action/platformer games. You'd really have to explain in more detail what you're after... can players jump on top of enemies who are lying on the ground? What is your desired effect?

"Shadow issue is basically the same thing from what I can see, just a different application. It's using the SCML object (or in the player character's case, the sprite object that is pinned to the SCML object) and using that to draw shadows."

>> Again, we'd really need to be visual examples of your desired effect. Is this game overhead, isometric, or side scroller, for example? What's happening with these shadows and how accurate/detailed does their shapes have to be?

"I tried maaaaany different things and did hours of researching or I wouldn't bother rambling about my problem here. There were issues with putting the shadow caster behaviors on many different places (such as the sprites) and I think it's just going to be difficult to handle this when it's not integrated into the Spriter object behavior and I don't fully understand how exactly the Spriter object does what it does."

>> We really need to know exactly what desired effect you're after before we can explore possible solutions.

"I could do without shadows, but objects not having solid behaviors would just look and function oddly. As for the collisions, it's extremely confusing and I'm not sure what to do but at least I have control over the interactions, unlike the Solid behavior."

>> I'm not sure what you're after, behaviorally and visually in game, so can't offer useful advice.

"UPDATE: After a ton of thinking, research, and coding, I managed to work around the collision boxes issue by using families, containers, and some crazy code and as of right now I think I've got everything working, though it needs more testing. I still haven't fixed the issue with the solid or shadow caster behaviors though."

>> Glad you're making some progress, but we can't help without much more detailed info regarding your desired results.

"I also have some issues with Spriter I'd like report... hopefully it's just me being bad, which it usually is.

Spriter Issues

Sometimes renaming files at the top-left doesn't work, if I try to like, rename something and then rename another thing. I haven't been able to figure out what exactly causes or fixes the issue but it can be somewhat inconvenient when I keep double-clicking and it won't rename. Maybe there is some trick to it I'm missing or maybe it's a bug, I don't know."
>> WOW! I never knew you could rename sprites in the z-order palette, BUT don't understand any reason to do it,as it does not rename the file itself. I think the very ability to rename it there is a bug and not a feature. I suggest you avoid renaming images in the z-order palette. However in the Hierarchy palette I can see how renaming bones is useful.

" Meta data: when I adjust basically anything in the timeline, the existing meta data I have (just tags for now, but I want to try out variables in C2 as well, since I haven't found anything on how they work) just disappears. The key frames for them or whatever disappear and I have to re-add them, which is... well, obviously not cool."

>> Could you possible make a screen recording of this happening. it might be user error and might be a bug, and either way, footage of it happening will help us resolve it.

"I feel like I'm doing something wrong in adjusting the tags, but I can't figure out what. :
As always, thanks for any help."

>> We'll certainly do our best to help you resolve all these issues. Again, privately sending us your project is the fastest way to get concrete help.

"Update 2: Meta tags just... aren't working for me. Aside from being glitchy in Spriter, after several hours and various code tests I cannot get the different tags to function correctly in C2 either. I checked the JSON file and it seems like it's right (though I couldn't tell you confidently without a little more info about the format) but I'm just having no luck."

>> I've had both features work for me perfectly in Spriter and in C2, so we really need to see exactly what you're doing and whats happening to figure out the problem. It certainly could be a bug or bugs we just managed to accidentally avoid through different work flow etc. Hopefully we can find out together and quickly resolve it.

cheers.
-Mike at BrashMonkey
B
45
S
8
G
4
Posts: 414
Reputation: 6,805

Post » Sun May 29, 2016 12:09 am

@Getting help, Gotcha

@Explanations, I apologize. Not my strong point, I'll work on being clearer.

@3rd paragraph: C2 generated bounding box. I'm saying the SCML objects use this, of size 50x50 by default. I can change it to another sprite, but I can't naturally make it use the collisions of the Spriter animations that I set in Spriter.

@4th paragraph: Take a character standing up.

||
||
||

Let's say this is their collision box. I think you get the idea: it's tall and skinny. Now, if I pin the scml object to a sprite object, and make the sprite object have a collision box of this shape, I now have a character with this static collision box.

However, it's just that: static. If I use the spriter object to change the animation, the collision box does not change to match it. So if an animation is now the opposite, short and wide:

=======

The collision box and the animation do not match, creating an issue in the game. I could maybe hard code collision boxes for every situation, but this would be very, very time-consuming and defeat the purpose of using Spriter.

Hopefully this makes the inherent issue clear.

For the next paragraphs: not much to say since I wasn't able to get the issue across. Admittedly, I have clear visuals and you don't so that's reasonable. I did originally send a CAPX to you for that reason but I get that Edgar is the person to go to for C2 so I shall e-mail him when I get a chance.

Going to start quoting to help keep order, with quotes being in bold:

WOW! I never knew you could rename sprites in the z-order palette, BUT don't understand any reason to do it,as it does not rename the file itself. I think the very ability to rename it there is a bug and not a feature. I suggest you avoid renaming images in the z-order palette. However in the Hierarchy palette I can see how renaming bones is useful.

- Huh, really? Interesting. I actually vaguely remember being told to do this, though it may have been elsewhere. I renamed them because it's useful to me to give the objects names that mean something to me and are consistent with my general naming schemes (and thus predictable and easy to recognize). These names are used by Construct 2 as well, making them all the more important. (I'm not using bones for this project though.)

Could you possible make a screen recording of this happening. it might be user error and might be a bug, and either way, footage of it happening will help us resolve it.

Yup, no problem. Will do shortly.

"We'll certainly do our best to help you resolve all these issues. Again, privately sending us your project is the fastest way to get concrete help."

Thank you for the reassurance. As said, I shall send it again shortly.

I've had both features work for me perfectly in Spriter and in C2, so we really need to see exactly what you're doing and whats happening to figure out the problem. It certainly could be a bug or bugs we just managed to accidentally avoid through different work flow etc. Hopefully we can find out together and quickly resolve it.

Haha, I kind of figured posting nothing but text wouldn't be useful but you were the one who told me to post on forums (though you did mean the other ones, but same diff). Perhaps you didn't make the connection between the two identities though—regardless, it's all good and I'll email shortly. :)
B
9
S
4
Posts: 27
Reputation: 727

Post » Sun May 29, 2016 5:42 am

@lucid I had a feeling it had something to do with the old version. thanks again guys! btw, any good tutorials on best practices for collision boxes? Sounds like it's actually pretty confusing for a few users.
B
57
S
15
G
8
Posts: 365
Reputation: 7,884

Post » Sun May 29, 2016 1:20 pm

Awesome update! Now there should be no more unavoidable tedium in using Spriter animations together with effects. Thank you @lucid!
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun May 29, 2016 6:02 pm

PixelRebirth wrote:Awesome update! Now there should be no more unavoidable tedium in using Spriter animations together with effects. Thank you @lucid!


Is this in regards to the last update? If so, would you mind elaborating what you mean by that? Sorry for the bother, just interested since it's not clicking right now. Thanks~

EDIT: @lucid sent the e-mail :)



Another general question, but it feels like there are a lot of ways to recolor animations. I'm trying to decide which to use and feel a bit overwhelmed thinking of all the options, any thoughts from anyone?

1) Recolor the PNG files and have a separate spriter object. Probably the worst way.
2) Recolor the PNG files, copy entity, then replace old frames with the recolored frame for each frame of each animation. Works, but very time-consuming and means that if a change to one animation is made, the other has to be updated, which is an issue. Benefit is that assuming we do not use entities for anything else, we can just switch the starting entity to use our recolored version.
3) Spriter's Color Customization feature, though I found it confusing and according to the manual it is not supported yet by plug-ins and also requires indexed color mode (which makes enough sense).
4) Recolor in-game using effects that change properties (AdjustHSL or ReplaceColor for instance? there's probably a better way but I haven't really looked into it)
5) Other method I don't know or forgot?

Looking for a method where the recolor is purely visual so it should reuse all the same other data, but without me having to update changes constantly, if possible. Let me know if you have any ideas. :)

EDIT:

I remember seeing a post or something for how to preload animations (or something like it) to help the game run faster, but I can't find it. Anyone know what I'm talking about or just have some tips? I'm really struggling on optimization here.

My other question is if it's better to have a spriter object have a separate object for each animation (so in C2 an idle animation would be one sprite object and a run animation would be another one), or to have one object for all animations.

Thanks for any help you can offer.
B
9
S
4
Posts: 27
Reputation: 727

Post » Mon May 30, 2016 9:21 am

BBaller1337 wrote:
PixelRebirth wrote:Awesome update! Now there should be no more unavoidable tedium in using Spriter animations together with effects. Thank you @lucid!


Is this in regards to the last update? If so, would you mind elaborating what you mean by that? Sorry for the bother, just interested since it's not clicking right now. Thanks~


Oh, I was just referring to what mudmask initially brought up...

PixelRebirth wrote:
mudmask wrote:@lucid - thanks again for your help. I will definitely be emailing you an SCML file soon. One quick question - is there any way to apply webgl effects to spriter objects? prior to using spriter, my enemies would flash red when getting damaged using the tint effect, which was applied to all enemy families. is there a similar way to do that using spriter?


Seconded! I can't seem to think of a handy way to do this either without referring to the automatically created families of sprites for each spriter object... which could easily mean some quite redundant events.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon May 30, 2016 3:35 pm

@lucid - How do we spawn object by image point using this new plugin? Is there a new way? In the past plugin I made an image point on the separate sprites in order to spawn objects for example gun sprite on a spriter object to spawn bullets. Thanks.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
30
S
12
G
77
Posts: 964
Reputation: 51,350

Post » Mon May 30, 2016 7:16 pm

mudmask wrote:any good tutorials on best practices for collision boxes? Sounds like it's actually pretty confusing for a few users.

@BBaller1337
@mudmask - I don't think we have an in depth tutorial on collision boxes in C2 itself aside from what's in the tutorial thread linked in my signature, but it's actually pretty simple. First, the recommended method for doing something like using your entire character with platform behavior is just to pin the scml object to a dummy sprite (which is how it's usually done for regular sprites in C2 as well). If you want separate animate-able collision boxes, this works using the old method of importing. Import your project, and Construct 2 will create invisible sprite objects with the names of your collision boxes. Simply check for collisions the way you would on any sprite in C2, and since everything is in a group, it should automatically pick the correct instance of your scml object for further actions.

Unfortunately, there are no plans to add collision boxes directly into the new direct drawing mode, as it's a bit of a slippery slope, where updates to C2's collision detection methods will always necessitate changes to the plugin's as well, and I would expect it to get messy and potentially cause performance issues. For anyone curious, there is actually a hybrid way to import now, which is a bit tedious, but I will explain it in case anyone wants to use direct drawing mode with collision boxes, or even with collideable sprites. First, save your project normally, and then save a spritesheeted project. Import your non-spritesheeted project the old way. Follow the old to new style project conversion steps, but this time only delete everything except collision boxes, and other sprites you want to test for collisions. This should self draw the animation, but also animate the separate sprites and collision boxes you kept. Keep in mind, the zorder will not place sprites correctly inside the self-drawing scml object, so it's probably only useful for making invisible sprite objects for collision detection.

BBaller1337 wrote:EDIT: @lucid sent the e-mail :)

Thank you. I will look into it and respond as soon as I get a chance.

BBaller1337 wrote:Looking for a method where the recolor is purely visual so it should reuse all the same other data, but without me having to update changes constantly, if possible. Let me know if you have any ideas. :)

The best method is to recolor the individual images, and then use character maps to share the animation data and to switch colors on the fly in C2. A tutorial for character maps in C2 is in the main tutorial page linked in my signature, and more information about character maps in Spriter can be found under Help in Spriter.

BBaller1337 wrote:I remember seeing a post or something for how to preload animations (or something like it) to help the game run faster, but I can't find it. Anyone know what I'm talking about or just have some tips? I'm really struggling on optimization here.

You can try the new method of importing, which has faster performance: viewtopic.php?f=146&t=75748&p=1040600#p1040600

BBaller1337 wrote:My other question is if it's better to have a spriter object have a separate object for each animation (so in C2 an idle animation would be one sprite object and a run animation would be another one), or to have one object for all animations.

It's best to have one scml file (and one scml object in C2) for each character (or machine, or any individual animated object).

chadorireborn wrote:@lucid - How do we spawn object by image point using this new plugin? Is there a new way? In the past plugin I made an image point on the separate sprites in order to spawn objects for example gun sprite on a spriter object to spawn bullets. Thanks.

@chadorireborn, you would have to use Spriter's action point feature. which let's you place named points, and optionally attach them to bones and animate them. The main tradeoff for using the new self-drawing mode is that you don't get the advantages of having separate C2 objects.
Last edited by lucid on Mon May 30, 2016 7:46 pm, edited 1 time in total.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests