[Behavior] moveto

  • I'm having some performance problems with moveto. I use cocoon.io and it works smooth as hell with the launcher app. When I compile it to iOS the objects running with moveto behaviour don't run smooth at all. It lags quite a bit and i'm on an iPhone 7 Plus. Are there any performance tips?

    Hi

    I'm using this behavior as well. But I never had any performance issues with it while using Cocoon.

    I test my games on an Iphone 6s.

    Regards

    Andy

  • > I'm having some performance problems with moveto. I use cocoon.io and it works smooth as hell with the launcher app. When I compile it to iOS the objects running with moveto behaviour don't run smooth at all. It lags quite a bit and i'm on an iPhone 7 Plus. Are there any performance tips?

    >

    Hi

    I'm using this behavior as well. But I never had any performance issues with it while using Cocoon.

    I test my games on an Iphone 6s.

    Regards

    Andy

    Okay thats quite odd. Because i made an iOS puzzle game which is 1.5MB large and uses about 11mb ram. So the performance should be much better. But it's only smooth with the launcher app. Not after compiling and testing on the device.

    I'm using scale outer mode to let my game scale to every iphone and ipad and it works great. But I'm asking myself it this can be a factor for the bad performance in addition with behaviours.

  • Kraudi I see no performance issues with moveto on mobile either, not even a problem on my oldest testing devices. Sure it is the moveto behaviour?

    Are you using effects of any kind? Even the simplest effects can make a game unplayable on mobile.

  • Kraudi I see no performance issues with moveto on mobile either, not even a problem on my oldest testing devices. Sure it is the moveto behaviour?

    Are you using effects of any kind? Even the simplest effects can make a game unplayable on mobile.

    I think it is moveTo. I compiled a version where I move X coordinate of the sprites every tick and it is much more smooth then with moveTo. The only real "effect" I'm using in my game is the Inverted color effect because I implented a dark mode.

  • Ok weird. If you use the move to in a trigger and let it move it shouldn't be performance heavy at all. As long as you only set the moveto position once and not every tick or something like that. Just set where it should go in a trigger and let it go there.

    I tried again now in a simplistic test and I see no difference whatsoever in performance if I move with the moveto behaviour or manually with set position each tick.

    Have you tried a super simple test on your phone?

  • rexrainbow

    Hey rex! I've been using your push out solid plugin and it works great, but it's kinda wonky depending on the direction. I've made an example capx:

    1drv.ms/u/s!AuQM7MihYyx4jf5uOiFeT8ty1jbbWg

    As you can see, if you try moving downards into the wall, it works correctly. But in any other direction, it moves the sprite in a different angle (if you try the left wall the sprite moves up, if you try the upper wall the sprite moves left, if you try the right wall the sprite moves downwards).

    Am I doing something wrong?

    Thanks!

  • Remove Pushoutdolid and set background solid behaviour and see if that works.

  • Remove Pushoutdolid and set background solid behaviour and see if that works.

    It would be pointless for me, the reason I'm using this is because I'm having a weird bug with the default solid behavior if the objects also have the 8-direction movement behavior..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Rex is not going to solve this, it will no longer invert its time in code C2 or C3.

    Maybe someone could look into the code of this behavior and solve that problem?

  • Rex is not going to solve this, it will no longer invert its time in code C2 or C3.

    Maybe someone could look into the code of this behavior and solve that problem?

    Oh, I had no idea. :(

    I tried looking into the code and messing around with it a bit and I think I know why this is happening, but I'm not savvy enough to fix it. I *think* the way this plugin works is that it tries finding the first avaiable free position to push the object in that direction using what rex calls a "8-direction spiral scan", so depending on where you're colliding with the object, it pushes you to the first available free direction.

    // 8-direction spiral scan
    		while (dist <= max_dist)
    		{
    			switch (dir) {
    			case 0:		dx = 0; dy = -1; dist++; break;
    			case 1:		dx = 1; dy = -1; break;
    			case 2:		dx = 1; dy = 0; break;
    			case 3:		dx = 1; dy = 1; break;
    			case 4:		dx = 0; dy = 1; break;
    			case 5:		dx = -1; dy = 1; break;
    			case 6:		dx = -1; dy = 0; break;
    			case 7:		dx = -1; dy = -1; break;
    			}
    			
    			dir = (dir + 1) % 8;
    			
    			inst.x = cr.floor(oldx + (dx * dist));
    			inst.y = cr.floor(oldy + (dy * dist));
    			inst.set_bbox_changed();
    			
     overlap_inst = this.get_first_overlap_inst(candidates, overlap_inst);
    	 if (!overlap_inst)
    		 return true;
    		}

    I'm going to try messing with it a bit more to see if I can just stop the player altogether instead of pushing him to different directions.

  • Anyone else having this issue?

  • rex_moveto is a behaviour, not a plugin. You've installed it in the wrong place.

  • Thank you very much! I figured it was small issue I was overlooking. :D Another set of eyes is always invaluable.

  • hello I need help because I can not put the behavior in my construct 3 it appears in the menu of complements but not in the menu of behaviors I can not use it you can help me

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)