oceldot's Forum Posts

  • oceldot: That's a possibility indeed. But whether it's the most appropriate solution depends on the game you're making and how you did it so far.

    It's just one available tool.

    Thanks, I'll play around and see which option works best for me.

  • Indeed, the persist behavior doesn't seem to have been thought for the "reset" case.

    That's something Ashley might want to have a look on, to add a way to reset a game that uses Persist behaviors.

    In the absolute, I think the persist behavior wasn't really intended to be used in such games since its point is to remember the state of the objects, so you are expecting a persistent world, not necessary a world you would reset/start from scratch all over again.

    Global property set to "Yes" just makes that the instances don't get destroyed when moving from a layout to another. The object that is set to global also stays at the same position when changing the layout.

    So it does not sit well with the persist behavior anyway.

    A bit off topic, but are you saying I could use Global=Yes to keep a moving object start in a new layout at the same place it stopped in the previous layout, instead of using variables and set position actions?

  • I think I found it. A bit of searching has never killed someone.

  • I have an object that I want to appear at the same position in a layout as it was in the previous layout. I suppose I should be able to do this with some kind of expression, but I'm struggling. The object is starting from the top and moves slowly down, and when the player moves to the next layout, the object should appear at the same position in the new layout, and then continue its path. Any help would be appreciated.

  • Would it be possible to add functionality to delete unused resources easily? Sometimes it can get a bit messy and you need to go through every sprite etc to see if they are in use. If there was some kind of check for this which allowed you to delete this with one click that could save some time. Or am I missing something?

  • > I feel kind of stupid for wasting people's time with questions that might be trivial, but I'm about to give up and turn to you guys once again.

    >

    > I think the below looks pretty decent, but it's not currently working as expected (pausing/unpausing (is that even a word?) itself works, but not the restart action). Clicking the stop button will close the app (with the close browser action), but it will still run in the background. Is there no other option? I guess I can live with that.

    >

    > The "rewind" button is a bit more worrying. Clicking it simply gives me a black screen, this happens both during testing in the browser and when installed on my device. I don't understand why.

    >

    > (I'm using a global variable Pause to enable/disable pausing.)

    >

    >

    I can only speculate, but since you are still in pause mode when restarting the layout, maybe that is the cause of the black screen during rewind?

    Well this is awkward. Sometimes it amazes me how stupid I am. Thanks

  • Well, I don't see any improvement. My objects with Persist behaviour will still stay dead/destroyed (or whatever state they were in when layout was reset) no matter if I set Global to No or Yes, when using the Reset global variables to default action. I think actually not using Persist might be a better option in my game.

  • I feel kind of stupid for wasting people's time with questions that might be trivial, but I'm about to give up and turn to you guys once again.

    I think the below looks pretty decent, but it's not currently working as expected (pausing/unpausing (is that even a word?) itself works, but not the restart action). Clicking the stop button will close the app (with the close browser action), but it will still run in the background. Is there no other option? I guess I can live with that.

    The "rewind" button is a bit more worrying. Clicking it simply gives me a black screen, this happens both during testing in the browser and when installed on my device. I don't understand why.

    (I'm using a global variable Pause to enable/disable pausing.)

    [attachment=0:22zr81l2][/attachment:22zr81l2]

  • Thanks for you input guys, feel free to take a look.

    (I trust I won't be seeing a full version of my game on Play Store in the next couple of days )

    [attachment=0:n8er5wc3][/attachment:n8er5wc3]

  • It's a platformer. I'm destroying the few objects that I can think that should be destroyed, so not sure that's the problem. I have a few variables (a timer/clock, one for number of deaths (add 1 when outside layout), number of kills (add one every time an enemy is killed) etc). Most of them work like this: when collision between player and object, add 1.

    I don't think I have a lot of "huge" objects. My backgrond tile is something like 2*1024 I believe. Then I have some layers between the background and the main layer with tiles consisting of 524*256 images. For foreground I try to reuse some background sprites, only resized.

    But are you saying 357 is a lot of objects? What about 7350 collision checks? How can I reduce this?

    Just a very simple example from my game: I am creating my levels using mostly a single, small black square that I copy and resize to create something like the below (separate sprites indicated by red lines). Do you think it would perform better (less collision checks perhaps) if I had created it as one single, bigger sprite?

    [attachment=0:2ctv51ow][/attachment:2ctv51ow]

  • I feel like I am on the borderline of what I can put into my game now, as I experience some quite significant drops in fps from time to time. It seems to be running in a smooth 60 fps on my desktop (however it dips a bit during debugging), but a bit below this on mobile (I'm running on a Nexus 5, so on slower hardware it would be even worse).

    The thing is, I don't think I have a lot of objects, big images, physics, collision checks etc. I'm trying both with sampling set to point and linear, but with no real difference.

    [attachment=0:1c2cbroa][/attachment:1c2cbroa]

    I am using a single small black sprite as a building block (which I resize and duplicate quite a lot). Could this be a problem? Is it better to create my levels as one image instead of putting smaller images together into a bigger level?

    Any input would be helpful. Let me know if I could provide more details.

  • Ah, I found out what the problem was, if anyone for some reason wondered about something similar. User error, of course. Basically I had filled up the image all the way down to the bottom, so this somehow wrapped to the top, in lack of a better way of explaining it.

  • Actually I think you have to use "reset global variables"

    Are you saying objects with Persist behaviour will be restored to default with this action?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It sounds easy enough, but I ran into some trouble when I wanted certain object to have the Persist behaviour, so as to for example stay dead if the player have killed them when restarting layout. So in order to reset these when the player wants to restart the game from the beginning, the easiest way for me was to use "reload page" action.

  • Hey, not to but in on the tread but did you guys ever figure this thing out?

    Well, as for me, I think reloading the page is a pretty decent way of doing it. The game will restart with all variables restored to default, but it will of course restart to the splash screen, so it might not be the best way for everyone.

    I'm sure there is a better (and probably more complicated) solution, but I haven't really spent much time exploring other options yet.