tunepunk's Forum Posts

  • 99Instances2Go System > Z order only set's a global value.

    When the global value is 1. I'm running the new action Sort Z order by : variable and then setting global value to 0 again, so I'm only sorting 1 tick.

    The main thing is actually the the lower part of the event chain, detecting if something with a High Y has lower Z order or oppisite. That tells me that it's not sorted correctly. And will set the global value to 1, to initate the sort. But running only that little check is so heavy on performance that i have to filter it this way first with the whole event chain first :p that's where BBox comes in, If the BBoxCheck is false, it's not even gonna go ahead with the Y vs Z check.

    I'm trying to limit the ammounts of Y vs Z checks to only check objects that are actually overlapping any moving objects. If i checked the Y vs Z for everything on screen I'm using way too much resources to be useful. I only need to check the Y vs Z for any moving objects that are overlapping any other object in the Zorder family.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Artpunk I downloaded "Last of the survivors" "Mortar Melons" from the windows store on my phone. They have the same issue. But if I lock and unlock the screen they work well.

  • Did you try this test? does it fail as well?

    http://www.tunepunk.com/touchtest

  • Artpunk thanks for the info. It seems like it's a Windows Phone bug. As blackhornet also reported touch becomes unresponsive at around 50% ,but if you lock the screen - unlock and it's back to normal. Very weird. I've sent a bug report to MS, so hope they will fix it. It's the same behaviour on other C2 made games in the windows store as well.

  • This is our officially recommended workaround to needing multiple collision polygons, and uses the existing collision engine which is well-optimised, so I think you may as well do that.

    I havn't tested this yet, but I will try it out, to see if I get any improvements I don't know if it would be a mobile friendly approach.

    [quote:3all9cg9]

    Have you tried the new "Sort Z order" action in the latest beta? That should be significantly faster than previous approaches.

    Yep that's what I'm working against to beat. Even the new improved zOrdering it's still my 3rd biggest resource hog on Mobile, after Draw Calls and engine, so I'm trying to optimize it further. I would approximate it's using around 15-20% of the entire game logic. (Not counting draw calls and engine)

    Turning off Z-ordering completely gives me around that much less CPU usage for the event sheet, so for me 20% just for sorting is still unacceptable. I would be a happy man if I could get it down to let's say <5-10%.

    My game is still running extremely well, on midrange phones at almost constant 60fps, but I'm not done yet and still have some things to add, because I'm working on the limit of what a midrange phone can handle, I would be happy to cut the cost of the zOrdering even further.

  • is it possible that you can use this kind of approach? maybe with arrays?

    http://w-shadow.com/blog/2009/09/29/fal ... imulation/

  • Ashley Sometimes you have a collision polygon set at a certain shape for some reason, and want to detect a sprite overlap, but they don't detect because the collision polygons are not completely square at the Sprite edges. An ugly workaround - Create another sprite on top with a Square collision box pin it to the object, and wholla! you've doubled the spritecount, and icreased collision checks. I find BBox very useful also, since you can't really get X &Y positions of idividual collision polygon points.

    Index based multiple collision boxes per object could also work. That may be even better.

    sprite1.colBox(0) is overlapping sprite2.colBox(2)

    EDIT: To explain further one of the main uses could be for z-Ordering. Instead of having Zorder to run every tick it would seem smart if you could have it trigger once only on any BBox overlap. For me et least on developing for mobile Zordering is one of my main resource hogs at the moment, so I would like to bring it down further to allow for other good stuff instead.

    For now this chunk of events was the most resource friendly way I could do it, and it's just slightly better than running the zOrder every tick. What it does: If there's any moving objects on screen, first picks within radius (Line of sight is supercheap distance picking), then Checks BBox overlap, and then if any BBox overlap is off in Zorder (higher Y but lower Z or opposite) then trigger the Zorder Once.

    I sort on average once every 2-5 seconds (if there is any overlap/zorder that needs fixing), but the whole event chain there is just slightly cheaper than running Zorder every tick.

  • 5. Is not because C2 is easier to use that you don't need game logic and a deep understanding, easier to use but easier to mess up things as well

    I completely agree. I've done so many stupid things so many times that i should probably start working on a massive tuturial on "How not to do things in C2". Well sometimes things work, but they dont work well. It's like eating icecream with a snow shovel. You can probably do it but it's not very precice or effective. Then people go on the forums and rant about bad performance. The problem is that C2 let you do things, so you tap yourself thinking, "IT WORKED, I'm an awesome coder" but in reality you're not. Happens to me all the time. :p

  • I use BBox quite regularly and It would be nice to see a plugin that handles BBox instead of only XY and collision boxes. I'd gladly donate or pay for some neat BBox tools.

    Practical uses.

    Detecting overlap of objects.

    Sometimes you don't want use the regular collision boxes to detect overlap. BBox can come very handy then. I use it all the time, but current the event sheet way is not very friendly way of do it, as it involves a very heavy piece of code, and I'm pretty sure a plugin/behaviour would handle that much better. Currently I'm doing this:

    Pick by evaluate: Sprite1.BboxLeft < Sprite2.BboxRight & Sprite1.BboxRight > Sprite2.BBoxLeft & Sprite1.BboxTop < Sprite2.BboxBottom & Sprite1.BboxBottom > Sprite2.BBoxTop.

    It would be nice to be able to both pick any overlapping sprites, or just detect any overlap and return true without picking.

    I don't know if it's possible, but it would be good if you could even detect overlap on sprites within a family, only checking against other sprites within the family, as I havn't figured out a way to do that using events. You can't check family1 against family1 as it's always true, checking against itself.

    I found this piece of code but don't know is useful: I wouldn't even know where to start to make a behaviour myself. Otherwize i would do it.

    var overlap = !(rect1.right < rect2.left ||

    rect1.left > rect2.right ||

    rect1.bottom < rect2.top ||

    rect1.top > rect2.bottom)

    Any help appreciated and would have gladly pay for it, if you give me a reasonable price for the request.

    spy84 If your game is running at 25-30fps at best (I don't know what phone you got those reuslts on) you probably have a lot of optimization to do. Anything below full 60fps, on a mid range device is unacceptable if you are developing for mobile. I'm getting almost constant full 60fps (with a few dips) on a lower end mid range phone (2 year old - Lumia 830). using 1280x720 window size, linear sampling, 3000x3000 layoutsize, isometric with z ordering, approximately 800 objects in layout, with 4 player multiplayer using photon. Yeah... I've spent a year grinding and trying out stuff, and learning and optimizing so now the game I even running on a 50€ low end phone at around 15-30fps, and get around same results which ever wrapper I use.

    Agree with Ashley there. Too many people complaining about mobile performance when they clearly don't know the limitations of mobile development. Just because you can make something in C2 and can export for mobile doesn't mean that it will play well on mobile. I've learnt the hard way. Investigated what's going on under the hood, what features to use and what not to use.

    X - Don't use webGl effects - They are neat but usually heavy & not useful for mobile.

    X - Don't use Force own texture on layers.

    X - Don't use constantly updating Text object if you can do the same with Spritefont.

    X - Don't use particles, unless it's very simple and low amount of particles.

    X - Don't expect heavy amount of physics to run well.

    X - Don't update things every tick unless you have to. Use 'Every X Seconds'

    X - Don't use big images with large areas of overlap.

    * - Always limit your Top level events. The less events the the engine has to go through each tick the better.

    * - Group event's and only activate groups when needed, close when not needed.

    * - Use smart and cheap ways of picking objects & Structure your conditions accordingly.

    * - Disable collisions for objects that don't need it. (Personally I think this should be disabled by default)

    * - Keep an eye on memory, cpu, fps, draw calls, ammount of sprites, etc

    * - Study and try different approaches of doing the same thing in a smarter/cheaper ways.

    If your game is not performing well, it's probably not because C2, it's probably because you don't know what the hell you're doing, and have no clue what the mobile limitations are.

  • I absolutely love those pure & clean graphics and animations.

    It works like this.

    everything is sorted by Y right? So anything with lower y will be behind and higher y will be in front. For the character on top to appear in front of the sprite you cant sort by only y. His y is lower so will look like he is behind and not on top. but if you sort by y + elevation. his new sorting point will actually have a higher value than the tower so he will appear infront (on top) instead.

  • Confirmed. Bizarre. Lumia 550. When first started, after 6 clicks on +, I can move in circles, lift my finger, and watch the dot follow my path in slow motion. Press the power button, press again to get back to the app, and responsiveness is immediate, even hitting + X times.

    Ahhhh. Thank you! I thought I was going crazy! I've spent countless hours/weeks optimizing the game to keep as low CPU level as possible to reduce the lag. And woooops..., close screen open, and the lag is gone. I don't think It's a Construct 2 issue though. I did the same test on some of the Intel XDK demos that comes with the app preview. (I doubt they are done in C2 but don't know for sure) and notice the same behaviour. This seems to be a Microsoft issue from what I'm guessing but so far I can't confirm

    So Lumia 830 and Lumia 550 is confirmed to have this issue.

    I hope more people can do the test as I had a report that som older Android devices had a similar issue, but i havn't tried myself.

    **Edit: Another funny thing is that this behaviour is apparent even if you build with XDK or even Visual Studio.

  • Ashley It seems like on startup touch seems to fail to initialize correctly or something, or maybe stuck in some loop?

    I just noticed that the Touch Lag/unresponsiveness goes away if i lock the screen in game, and then unlock it again on Windows Phone.

    This also helped on other C2 games for windows phone like (Mortar Melon and Last of the Surviors)

    I still need to confirm if All windows phones have this problem or if it's just my device. So calling out for anyone with a windows phone.

  • tunepunk Is there somewhere I can see your game in action?

    http://www.tunepunk.com/arrowheads

    It's based on touch so you need to try on a mobile phone or tablet.

    The arrows are using the "elevation" variable, so that they will sort correctly when they stick on walls etc, and can fly over certain things correctly.