tunepunk's Forum Posts

  • Another solution is to use for each and place all the things that you need to sort in a Family.

    For each Family1 order by family.Y ascending > Move to top of layer.

    This is a shortcut but can get very heavy since it will sort all objects every tick.

  • He could design like this... to use any area outside the 4:3 aspect to just repeat graphics. They won't be missed if you play on a 4:3 ratio screen.

  • Anonnymitet It all depends what kind of game you're making though... For a sidescroller it would work fine. If you're doing a game with a fixed Level size, like the gif gillenew posted. (Does not look like a sidescroller) .If The level is fixed in a 4:3 area, I don't think he would want to crop out stuff that's either over/under or on the sides. He should do a vertical fill, and design some elements that could be outside the Game level, or maybe just use a fancy backround there instead of black.

  • Anyone here any good at math?

    I need to calculate the distance between an object and a point in a diagonal line between 2 other objects.

    A bit hard to explain but i will try.

    The point at the top (DTC) is an object. I need to calculate the Y distance between this object and a point straight below in the diagonal line.

    The diagonal line would be calculated based on 2 points. the lower left point and the upper right point. Anyone comprehend what I'm trying to do?

    The DTC object can move in both X and Y axis so the distance value can be variable.

    Any help appriciated.

  • So it's actually a screen aspect ratio problem than a resize problem? I think there should be some ways around that... I havn't looked in that that much yet, since I'm not that far in to the production yet, but yes that's an issue i have to deal with as well at some point. If you're making a game in 16:9 format and displaying on a 4:3 screen there will be black borders under and over, but I don't really see it as a huge problem since most smart phones today are in 16:9 format...

    Iphone 4, and iphone 5 differs in ratio for example, but if you really want to optimize your game for phones with aspect ratios other that 16:9 i don't think it would be too much trouble, just have to be taken in to account when designing the game, especially the UI. But i wouldn't worry about it too much since most smartphones use a 16:9 ratio. If you want to please a few% that has other screen ratio then i think it can be done properly without too much hassle.

    Scaling a 16:9 game to fill a 4:3 screen vertically without black borders might crop out stuff that are to the left or right, (Probably mostly UI Stuff) but that can probably be adjusted for with events.

    https://www.scirra.com/tutorials/73/supporting-multiple-screen-sizes

    UI elements can be placed using these system expressions instead... if you want something to stick to a certain point, like the lower right corner you could probably use set position to: WindowWidth - 30 windowHeight - 30, that would probably work for any screen ratio.

  • I'm developing for mobile too, but I'm not using pixel art so i can't give you any advice there, but from what I've noticed, scaling is pretty good. Most of the time I'm downscaling instead of upscaling. My project is done in 720p and downscales well, it also upscales quite well but will be a little blurry or choppy depending on if i use point or linear sampling. Doing a low res pixel-art game and upscaling to 1080p shouldn't be a problem (I think) as long as you sample by point instead of linear. Play around with the project settings to see which gives the best rusluts.

  • Much like imagepoints where you can add more, it would be great to have more collision polygons per Sprite. Current workaround is to create a dummy sprite which is not very handy. You can either have these dummy sprites within a container of an object or you can create a the dummy sprites with actions. Either way this is kind of a pain to work with.

    It would be nice if these could be used through expressions using index based collision polygons

    Sprite1.CollisionPolygonAt(0) Is overlapping Sprite2.CollisionPolygonAt(3) - or something in terms of that.

    Another thing that would be nice is enabling collisions for BBox boundaries as well.

    Sprite1.BBox is overlapping Sprite2.BBox

  • Strange - when I make a new project i don't get the same effect. Have to investigate further. In my project there is a group with events which keeps hovering around 1 to 1.5% CPU usage (mostly this group contains set position every tick on several sprites) even when all the events in the group is disabled - the group still uses around around 0.6% cpu... When i replicate in a blank project the same kind of events only take 0.4% CPU... and 0.1% CPU when disabled.

  • Another question. I would imagine that the structure of the events would play some role as well. For example... If you have an event, which is false, will any further sub-events be skipped by the system and not checked, or are they still run through and checked?

    I would imagine that using sub-events well could limit a lot of checks that way. If the first event is false & placing many related events within that one, instead of creating a new event under, with the same conditions would save on some quite a lot of checks?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Throughout my project i have lots objects where their position is set every tick to the position to another object. Doing a little bit of testing turning off these particular event saves me a lot of CPU budget, but then again objects wont follow. It's not really the draw calls that make up for these CPU usage, but rather the setting of all the numbers every tick.

    I've read all the optimization guides but want to go more in depth on how to optimize the events as I'm aiming to make a quite complex game for Mobile so every tiny bit of CPU usuage i can save on seems like a very good idea. I've identified the "on every tick" event as a major resource hog. So....

    Will (Pin Behaviour) Pinning an object to another one instead of using On every tick > set position to > sprite.X sprite.Y or is there any other way that I've missed that might be better.

    I know we're talking minimal tiny ammounts of CPU per object, but everything adds up quite fast.

  • The thing i would try is to change the keybidings probably. Moving with wasd feels more natural for me and then aiming up down with up & down arrow maybe? That's just my preference or what I'm used to, so maybe you can add an options menu with "reversed" keybindings? I would suggest trying some different setups with people to see which feels more natural. otherwise... nice game.

    Best suggestion would probably be to make the draw gun a "toggle switch" instead of having to hold it... for less fingertwisting.

    Reversed Control suggestions:

    WASD movement (A&S) Can alternatevly be used as aiming as well as up down arrow.

    Make draw gun a toggle switch using (F) for less fingertwisting. or use (LEFT SHIFT)

    Fire - (Enter)

    Reload (R)

    Medpack (C or R Shift)

    Roll (R Ctrl)

    (Space) when you hear a ding and ! appears in the top right to inspect/use.

  • Nice game, but the controls take's a bit getting used to, once i got the hang of it it played quite well.

  • Charming game! Great job!

  • Finally!!!!!!

    I this is all i needed. Now my z ordering only uses 0.6% CPU even with LOTS of objects on the screen.

    Sharing if anyone else might need to optimize.

  • Trigger once while true will only trigger once while true..

    Hence it only triggers once..

    I would do the z-sorting on collision with player..

    That will only trigger once if the player collides, but depending on how you've set things up, it could cause issues if you want the player to be able to walk through..

    Yeah, i had some issues with that too. I tried soooooo many ways to optimize now im going nuts. Haha. Even dummy objects to use a second collision box. Any way, i want to limit the CPU usage in any way in can, and right now Z Ordering is my biggest resource hog, so i have to keep trying to find ways to optimize it.

    Im gonna try using the oldValue idea there...