Spriter/C2 (11/22, test c3 addon) 4/5 bug fix

Discussion and feedback on Construct 2

Post » Fri Jun 30, 2017 1:08 am

sekocit wrote:Hi,

This plugin is not working on native iOS (Intel XDK Build/Cordova). Works on Preview Browser and native Android.

When debugging on iOS -> on Network Tab - > scon file is on "Pending" status. So it does not render the sprites.

I found same issue on Spriter Forum but it is not solved yet.

Environment:
Construct 2 : r239
Intel XDK: b3759
Spriter Plugin: 4/5/2017
iOS: 10.3

Best Regards.


Thanks for reporting this. Unfortunately Edgar doesn't currently own any IOS devices (we'll try to resolve that in the near future) and is currently tied up in several pressing matters.

Close to a year ago I thoroughly tested CocoonIO an [email protected] projects with Sprtier plugins worked well on Android and IOS. Come to think of it, this testing was likely done before the new sprite-sheet/draw self mode for the Sprtier objects was added. Are you using the draw-self mode?

Also, pardon my ignorance (I havent tried using the Intel XDK in a very long time), but is there a way you can get a more detailed error report when you try to run the game on the device or emulator, I thnink its possible through Xcode? A full error report might allow Edgar and Ashley to figure out the cause of the problem more quickly.

lastly, have you tried cocoonIO, just to see if it works? That might also provide useful information.

Sorry for the inconvenience. Hopefully with your help we can resolve this issue in a timely manner.

Thanks.
-Mike at BrashMonkey
B
49
S
9
G
4
Posts: 426
Reputation: 7,071

Post » Wed Jul 05, 2017 9:19 pm

nemo wrote:I noticed that C2's save and load function doesn't store Spriter object scale or animation speed.


I think this issue is also a thing with the direction of the object, as I've had objects facing the wrong direction once reloaded.

My solution was to have an instance variable on the object (and all spriter objects are conveniently in a family, so I only need to add it once), and upon loading a save, it overrides the way they are facing based on the direction value.

I imagine you could do something similar for the object scale and animation speed, the only downside being that if there is no variable you can just access and mirror, you have to manually keep track of it.

I suppose it might not be too hard to fix this issue from the source but I kinda don't want to mess with the Spriter plugin in case it's updated again later. There's also Mike's solution, which I didn't really understand when I gave it a quick read, but it probably works.

-------------

Anyway, I want to report a bug, but like with most obscure bugs, I don't know exactly what causes it to occur or else I could replicate it in my own CAPX.

In short, sound effects and event triggers in Spriter can activate multiple times in C2 when their easing curve is set to linear (the default)... but, this won't usually happen. It only seems to happen under some obscure scenario that I cannot pin down despite constant testing.

Setting the easing curve to instant seems to fix it, but I can't imagine an event or sound trigger would ever *want* functionality like this, so... yeah. As far as I can tell, the way to cause it is something vaguely like this:

- Play an animation with a sound/event trigger
- Interrupt this animation mid-way (before it is completed) with another animation, or maybe interrupt it with another animation mid-way (the latter seemed to be more consistent with the glitching), not sure
- Play the 1st animation again?
- Interrupt the animation as before, and the sound/event trigger will activate on the first frame or the millisecond after or something like that.

Again, this is just a general idea, I do not know how to actually, consistently reproduce this glitch. Should you want to fix it, you may have to try some random variations, all I could see in common was that animations were either starting mid-way or ending early and that the easing curves for the offending triggers (NOT the keyframes they belong to) were set to linear.

If I have time to play around and figure it out, I will try, but I had to spend a while just trying to figure out how to fix my sound effects seemingly randomly playing 2-4 times, so I'm kind out of time to debug the underlying cause, especially since I don't really understand how easing curves work in C2 for me to guess at why it'd affect the sound/event triggers.

EDIT: Seems I'm actually still occasionally getting the bug, but less than before. Still don't know why. :\
B
19
S
10
Posts: 51
Reputation: 1,675

Post » Sat Jul 29, 2017 1:01 am

For my previous issue where triggers were playing when they weren't supposed to (at the beginning of an animation), I came up with a hacky fix if anyone needs it until a proper fix happens (if ever)

In runtime.js on line 2737 in version 12-26-2016 where it says:

if(t>0&&t<1)
{
this.playEvent(eventline,eventline.name);
}

Add "&&this.currentAdjustedTime>20" to the condition which just doesn't allow any events to trigger in the first 25 milliseconds, basically... which could potentially be a problem, but for me it's a better alternative than having the game glitch at times.

You'll need to do the same things for sounds too or they'll have the same problem as the code is basically the same.

I still don't know why the event is being triggered in the first place, but this problem cuts it off towards the end, like a filter, rather than properly fixing the problem at the source, so I don't recommend it if you don't need it. (Also keep in mind how editing runtime.js files work, the devmode registry key, etc. when messing with this stuff)

---

To debug this, I looked through the foreign code for a while, and eventually tried commenting out a line, found it solved the problem but introduced other bugs, and then used a log message (log("[Construct 2] Event call at time " + this.currentAdjustedTime + ".", "warn");) to see when events were being called, confirmed they were happening when they weren't supposed to (usually in the first 10 milliseconds, so the chosen 20 just gives it some padding), and used the most straightforward solution to fix it.

I think the real issue has to do with not clearing the state of the timeline or something like that when an animation is changed mid-way (i.e. doesn't complete itself), but I couldn't figure out the code myself so I still don't actually know... but since the duplicate trigger always happens right after the animation starts (probably the first tick after?) idk what else it could be but some false trigger from a previous animation or something.
B
19
S
10
Posts: 51
Reputation: 1,675

Post » Tue Aug 22, 2017 7:04 am

[suggestion]
in my game
i have 17 scon files - 7.8MB
picture folder (With tiny png compression) - 6.80MB
audio - 7.88MB

i dont see any reason spriter logic needs to take that much space
the problam is that the scon files are in json format, and there are many duplicate strings like:
"abs_x","abs_y","name"....

this is a ton of work, because the plugin code need a complete rewrite
but maybe... if it not too late for C3
B
41
S
16
G
7
Posts: 55
Reputation: 6,498

Post » Thu Aug 24, 2017 3:51 pm

Hi Brashmonkey @lucid,

I just encountered a bug in the plugin release 6/26/2017:
An error message popped up in runtime, when activating the animation of a flipped Spriter object.

The game developer with whom I work pinpointed the issue to line 1,523 in "runtime.js":
"this.this.currentAnimation", where "this.this" is undefined.

Hope this helps.
B
2
Posts: 4
Reputation: 158

Post » Fri Sep 01, 2017 12:41 pm

Brashmonkey wrote:
sekocit wrote:Hi,

This plugin is not working on native iOS (Intel XDK Build/Cordova). Works on Preview Browser and native Android.

When debugging on iOS -> on Network Tab - > scon file is on "Pending" status. So it does not render the sprites.

I found same issue on Spriter Forum but it is not solved yet.

Environment:
Construct 2 : r239
Intel XDK: b3759
Spriter Plugin: 4/5/2017
iOS: 10.3

Best Regards.


Thanks for reporting this. Unfortunately Edgar doesn't currently own any IOS devices (we'll try to resolve that in the near future) and is currently tied up in several pressing matters.

Close to a year ago I thoroughly tested CocoonIO an [email protected] projects with Sprtier plugins worked well on Android and IOS. Come to think of it, this testing was likely done before the new sprite-sheet/draw self mode for the Sprtier objects was added. Are you using the draw-self mode?

Also, pardon my ignorance (I havent tried using the Intel XDK in a very long time), but is there a way you can get a more detailed error report when you try to run the game on the device or emulator, I thnink its possible through Xcode? A full error report might allow Edgar and Ashley to figure out the cause of the problem more quickly.

lastly, have you tried cocoonIO, just to see if it works? That might also provide useful information.

Sorry for the inconvenience. Hopefully with your help we can resolve this issue in a timely manner.

Thanks.
-Mike at BrashMonkey

IM using cocoon.io to guild a infinite scroller game but on ios the char does not apear.
B
27
S
8
G
2
Posts: 80
Reputation: 2,756

Post » Sun Oct 15, 2017 12:11 pm

Hi @lucid,
i have visual glitches, on spriter objects only when webGL is set to OFF
it looks like you fixed something in "instanceProto.drawGL" and forgot to upadte "instanceProto.draw"
B
41
S
16
G
7
Posts: 55
Reputation: 6,498

Post » Wed Nov 22, 2017 1:31 pm

Hi everyone. Sorry for the lack of replies as of late. I will look into this stuff soon.

In the meantime. Here is a C3 version to test. I got it playing an animation, but haven't tested much beyond that. At the moment it (and for the near future) it only works with self-drawing mode.
https://www.dropbox.com/s/6fef4yt5q6jr9 ... addon?dl=0
Spriter Dev
B
101
S
22
G
12
Posts: 3,270
Reputation: 17,066

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests