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

Discussion and feedback on Construct 2

Post » Thu Apr 24, 2014 1:18 am

jayderyu wrote:Pin or not the logical order of objects updates determines the reaction of SetPosition.

So let's break down what is happening.

scml.setPosition( ply.x, ply.y )
ply.setPosition(newx, newy)

so what happens here?
the first object updates the position to the current player position. Then the player is updated. This leaves the scml(or any other object) 1 tick update behind. Is this a bug? no it's an architecture design issue. The solution.

ply.setPosition(newx, newy)
scml.setPosition( ply.x, ply.y )

ok ok, but of course there is a problem. I'm aware of it too. The player is likely to be using a behaviour like Platformer. Which means we can't actually control the order of position. And as a >>>hunch<<< it goes like this.

EventSheet
Behaviours

And of course we can't actually control that order :( So instead try

wait0
scml.setPosition( ply.x, ply.y )

So is it a bug or is the result of design architecture. How can we create a fundamental change mixing plugins and ES code? The best we could get is the toggle ES/Behaviours order. But that won't fix the problems for PIN. How do we order which behaviours go last in the order structure? This is kinda the thing that just has to be. We get a massive awesome tool, but we need to accept the design architecture.

If Ashley decides to put the actions of PIN after all other updates. Then that breaks up the speed flow. As the object updates, other objects update, then goes back to PIN objects. This would reduce performance as this increases object loop update size.

Your noticing this on the SCML. I've seen it on a lot more. It really depends on some other form of object ordering. For now try the Wait 0 and see if that fixes up the problem. However it's still not an SCML issue.

And just assist you a topic made two years ago.
viewtopic.php?f=152&t=67260&p=572493&hilit=pin+delay#p572493


Ronei Alves wrote:About that lag issue on every tick, well in my project I build an way to Set Animation action ever tick below the main every tick that set the position of the player.
https://www.dropbox.com/s/8nhrxd39el5zcnv/sample.png

Here I have 2 vars: animationSet (With the name of the animation) and animationType (A number to chose from the animation possibilities)

With this, there is no lag at all.
But in case of this been actually a bug from the .scml/.scon file, I will implement the normal way of set animations anyway and let deactivate.

I hope I could help, sorry for no .capx file, just took the picture from my project.

So basic, If you set the animation every tick below the main every tick where you set the position of the .scml/.scon to the rectangle, will be no lag.


@jayderyu, @Ronei Alves thank you both for all your explanations and suggestions :) I'll test and see what happens.
B
15
S
4
G
3
Posts: 52
Reputation: 3,552

Post » Thu Apr 24, 2014 11:53 pm

PSI wrote:@Brashmonkey - @lucid - I still get these IID errors with certain spriter objects. In this case, after the error, many of the background objects disappeared.

please send me the capx at lucid@brashmonkey.com
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Apr 26, 2014 1:06 am

@lucid

Found another bug: the Spriter object shakes a bit (tested by two persons with the same results in capx from scratch) and it it way more visible if you use a complex enough object with bones etc (the scml/scon I used doesn't have bones):
Capx: https://www.dropbox.com/s/1pi2a5p0xf42f3y/shakingSpriterb7ScrollTo_C2r168Stable.capx

The situation is:
Using a PlayerBox sprite object with platform behaviour, in a runner game with scroll to X instead of using bullet behaviours for solids (and unbounded scrolling set to yes on the left layout properties)

Every tick:
- simulate control PlayerBox platform pressing right
- scroll to PlayerBox.X+200 pixels
- set spriter position to PlayerBox object

There's also a little bit of lag on the X axis this time in addition to the lag on the Y axis, it seems to be caused by the "scroll to X."
B
15
S
4
G
3
Posts: 52
Reputation: 3,552

Post » Sat Apr 26, 2014 7:55 am

I read this topic for a long time and I can't understand FOR THIS MOMENT can I create a mobile game with a Spriter plugin or not? After the first implementation I saw a critical lag which made me frustrated and all about this implementation is unpredictable and uncertain. For example I implemented the Spriter object on new layout and after I open this layout c2 is going to hung.

I'm not a programmer and a little bit embarassed with a question but what the situation with every tick depends on? The capx which was provided didn't solve the problem, so in my game when my hero is running there are glitches which make process uncomfortable.
Spriter plugin + Construct is it now still working or traditional animation is a better way to design an animation system? I am very interested in situation with plugin because there are games where smooth fighting animation is a very sufficient part of gameplay and export to png works very bad
B
7
S
1
Posts: 73
Reputation: 603

Post » Sat Apr 26, 2014 8:26 pm

Bass_X wrote:I read this topic for a long time and I can't understand FOR THIS MOMENT can I create a mobile game with a Spriter plugin or not?

Yes. CocoonJS has been working with the plugin for a while now. If you have any issues with any other export, please let me know. I don't personally own every platform C2 exports to, so I can't test every platform, but I can still fix issues on those platforms if you report them.

Bass_X wrote: After the first implementation I saw a critical lag which made me frustrated and all about this implementation is unpredictable and uncertain. For example I implemented the Spriter object on new layout and after I open this layout c2 is going to hung.

Please refer to this tutorial for the basics. If you have any issues after seeing that, please let me know what part isn't working for you.

Bass_X wrote:I'm not a programmer and a little bit embarassed with a question but what the situation with every tick depends on? The capx which was provided didn't solve the problem, so in my game when my hero is running there are glitches which make process uncomfortable.

Please send me the capx at lucid@brashmonkey.com if you're still having an issue after the tutorial.

Bass_X wrote:Spriter plugin + Construct is it now still working or traditional animation is a better way to design an animation system? I am very interested in situation with plugin because there are games where smooth fighting animation is a very sufficient part of gameplay and export to png works very bad

I don't think traditional animation is a better method, though of course I'm a bit biased. The gap will only get wider from here. Once Ashley is done with changes C2 side, you will be able to reskin characters with character maps and trigger sound effects to happen at specific points in an animation. Recently the ability to have animated control points (action points in Spriter) was added, as well as the ability to blend from one animation to another. We've kept up to date with reported bugs, and incorporated most suggestions, so if you have any more, please let me know.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Apr 27, 2014 7:52 pm

Does this plugin support hitboxes yet? Also will there be an event that handles collision with the hitbox? For example, Hitbox>Overlapping>Object>Destroy. Something like that. You could even try overlapping with a specific part, like an arm or leg part.
B
3
Posts: 4
Reputation: 283

Post » Mon Apr 28, 2014 5:42 pm

ZenithMkII wrote:Does this plugin support hitboxes yet? Also will there be an event that handles collision with the hitbox? For example, Hitbox>Overlapping>Object>Destroy. Something like that. You could even try overlapping with a specific part, like an arm or leg part.

Hello ZenithMkII. Yes, this is another one that needs some changes to the importer. I don't have an ETA yet from Ashley, but as soon as that part is done, collision boxes will work. They will be their own 1x1 sprite objects (named after the boxes), and it will animate and resize itself, and you will just be able to use normal collision events with them. Since they are in groups it will work very intuitively.

-'headCollisionBox' - on collision with 'someOtherSprite'
----'scmlObject' - play animation 'faceHurt'

that 'someOtherSprite' could of course be another scml object's collision box sprite, and you could even theoretically make a family of 'headCollisionBox' sprites, and every scml object have an animation called 'faceHurt', etc.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Apr 30, 2014 8:15 am

@lucid - I'm having an issue where when I reorder the spriter objects on a layer, their bits get all mixed up. So for example one character's arms may be infront of another character's body while they are overlapping. I remember someone else had this issue many months ago but I don't know if they found some work around.

Do you know of any way to get around this? Or are their plans to fix it in the future?
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Wed Apr 30, 2014 2:22 pm

I will do some testing Tobye to see if I can replicate the bug. Z-ordering is a little tricky since, it's actually z-ordering all of the sprites that make up the object as well. If you'd like to speed up the process, please send me a capx to lucid@brashmonkey.com and I will take a look.

Also, a heads up to everyone who was asking about an ETA for the character maps in C2. I just spoke to Ashley, and he said he plans to have it ready for the next stable release.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Apr 30, 2014 2:37 pm

@lucid - sent! I'll link to the capx here too in case anyone has some work-arounds: https://www.dropbox.com/s/mmafwljw1cs7c ... Issue.capx

Just press around the screen and you will soon witness the ordering bug.
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: 8tomo8 and 11 guests