Aphrodite's Forum Posts

  • I have array who store object's UID's in cells. And i want make somethink like:

    int a = array [uid].variable

    How I can make that?

    I think the easiest way it to use(I use on start of layout and sprite as an exemple):

    Conditions;

    On start of layout; Sprite:Pick by unique ID: Array.At(x)

    Actions;

    Set global variable A to Sprite.variable

    The pick by uid will take the variable of that particular instance

  • If you want to stay with non 3rd Party plugin with construct 2, you can have a look to the system action "Set Layout Scale".

    To have it smooth, instead of setting it to a constant, you can set it to :

    When zooming In:clamp(LayoutScale+Scale_Speed, 0, Final_Scale) ; Scale_Speed being the speed of the zoom, and Final_Scale the value you want to have

    When zooming Out:clamp(LayoutScale-Scale_Speed, Final_Scale,LayoutScale) ; Scale_Speed being the speed of the zoom, and Final_Scale the value you want to have

    Just a suggestion thought

  • hi,

    i want to know how can i do pause game with very tick

    explain :

    iam using every tick ---- set x of background to background.X-5

    but when i when to make pause (by set time scale to 0) the game is pause but the background stil move

    thanks

    if instead of doing set x of background to background.X-5, you do set x of background to background.X-5*60*dt, not only the pause will work, but also if the framerate takes a hit during gameplay, the speed of the background in pixels/sec will not be affected.

  • I would guess it is because it is much simpler to do, like you can visually set the size and angle, also the values of each variables, it also forces you to set it, since it takes this instance you create as a reference (even in the editor itself, have only one instance of a sprite, change it's size, then add another one in the layout view: it is the same).

    Also I would guess the object type define more the reference of the identity, more than the actual settings of it.

    Anyway, I think it would be more trouble to have to set it without a visual representation anyway.

  • The thing is mostly I think you should preload them not all at once, only the needed ones firt, then the others

  • [quote:4nl0ykj4]As for memory management. Not all objects need loaded at the same time. store object data in arrays and create those objects as needed and destroy them as needed. Think of this like minecraft "chunks" You only need to load so many "chunks" at a time.

    Texture wise, they are still in memory, so it can be a pain.

    [quote:4nl0ykj4]An amazing feature construct should do instead of tiled backgrounds or sprites etc. Is procedurally/dynamically/viewpoint loaded objects. When the viewport is near where objects should be, load them and create them. Otherwise, they dont need to be loaded or known about until later.

    This looks like more something the user should have to do himself, that could break so many projects otherwise

  • You could also use the function object, have a function that return a value, then call it via function.call(functionname)

  • tgeorgemihai : method one is what we were using before the tilemap, method two is not a great idea memory wise, unless I did not understood it well

  • [quote:2ojkbp3k]Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little),

    What do you mean with that they are normally checked if outside layout, its standard that they are excluded if outside layout, or do you mean something else?

    I meant that even if they are outside the layout, they still exist, and C2 still register collisions with them from my experience. Which is normal, not every game can satisfy itself with a predefined layout size.(however, most likely the collision cells will filter that out).

  • > Have you tried setting the parameters when using the "On Created" event?

    >

    > That should work like a "Constructor" and apply to only the freshly created object.

    >

    > If you're using some system objects or functions and not re-picking though, I could see that potentially causing some issues.

    >

    Hmm. I missed that one! Thanks for pointing that out. >.>

    you can also add the events just under the creation itself, it should work

  • thanks aphrodite ... you are really like aphrodite in mythology (saverrrr)

    yes this why i was thinking to destroy object when its outside layout maybe will reduce the collisions calculations ... so as i understand i will help (just little but better than nothing ...)

    and for reduce polygons collisions on object (as you sad i have object with some parts that not need to be checked for example only their X and not ther Y so ... that will help ??? yes ?

    finally i just not understand something ...

    when you say "Some collisions maybe could be check only each other ticks."

    that mean that i have to add another condition to "when object 1 is on collisions with another object B" for example every tick or every seconde ?

    thanks a lot for all

    i just finish my game and publish it on appstore ... but i see that its slower on iphone 4

    so i would like to improve performance at maximum for iphone 4

    For the collisions, C2 already checks only the bounding box first, then if the bounding box are indeed colliding(very fast to calculate), it checks the true collisions, this can be slower depending on the complexity of the collision polygon, also C2 arranges everything in different cells (areas) if it is possible to reduce the collision checks, but other than that, I do not know much about how it is done.

    As for not checking every tick, I would say for exemple a large (relatively speaking, testing will tell if it works or not) projectile can checks if it is colliding with the player only one tick out of two for exemple, to achieve that, you can add the system condition "Compare two values: tickcount%2 equal to 0", that may help (it could also cause problems in some cases, but I consider that this kind of projectile will be destroyed right after colliding)

    I do not know much about your game so I cannot help a lot, the debugger feature of C2 may help you see what parts are cpu consumming.

    Also, it may be possible that graphics are what kneel you game down, but not sure about that

  • You do not have permission to view this post

  • Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little), reducing collison polygon of object could help during intense phases.

    If your ennemies have an AI that doesn't need to be active when not on screen, you could do something for that too.

    Some collisions maybe could be check only each other ticks.

    At the end, the goal is to keep the amount of calculations as low as possible, while preserving the game.

  • I would like tilemap to look like the tilebackgrounds actually looks like, right now seams makes it pretty useless for a lot of people

    Other than that, not much I can think of other than modularity

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If your rock is a sprite, use the rock action: create object

    If not, add a system: for each rock loop just after the collision check