My game freezes whenever I die/beat a level and go to a new one.

0 favourites
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • So basically, whenever I lose all of my lives and/or beat a level and I try going to a new one or try the level again, the game freezes. However, the music still plays and the debugger even shows that I'm on the level even though the screen freezes. Why does that happen?

    Tagged:

  • You could have logic that tries to go between two different layouts constantly or keeps refreshing the layout. Or if you messed with timescale then it's stuck at 0. If it's not that I dunno, share the project.

  • You could have logic that tries to go between two different layouts constantly or keeps refreshing the layout. Or if you messed with timescale then it's stuck at 0. If it's not that I dunno, share the project.

    Well, I don't really recall messing with the timescale. Also, these are the events that determine whether the player enters a new level.

    When I go into any level (the same or different level) more than once during a preview, the timescale completely freezes. However, the music for the level still plays and the debugger shows that it's in a level. Here is an example:

    I'm not sure why this is happening. Not even the save and load feature that I've added fixed this (yeah, crazy).

  • It's probably not going to be the event shown as that's a one time trigger of a button click and you are not setting any variables either, so must be something else.

  • This is off-topic but still pretty weird...Whenever I start up the game, make a new slot, push the back button, and press the load button to load in the slot, most of the letters turn purple.

    This could also happen once the title screen layout ends and then started again:

    Who knows, maybe my game is cursed. :/

    Anyhow, I'm not exactly sure what the root of the problem is at all. I've only taken notice of this recently while testing the characters. For now, I don't really see anything that can be causing this problem. So I'm not sure what to do next. The game's progress will still continue, but maybe I'll try to fix the problem once it's published and the game's files are public.

  • If it's happening 100% of the time it should be an easy fix, just share the project if you want assistance.

  • Well, I now solved the problem..

    This means I have to make the levels unlockable again without recreating the problem once again, but I've finally fixed it!

  • I had a look and the freezing is from memory usage, it jumps from 5mb in level select to up to 900mb in the level so it's loading the assets.

    Also sorry to say but these look like mobile controls and this is never going to work on a mobile device, did you test it yet? The memory usage is so high it even freezes on a PC. Mobile should be around 100mb or less ideally and yours creeps up to 600-900mb on each level.

  • Yeah, your right, I tried it and it looks like it doesn't work. Guess I'll have to scrap the mobile controls. But is it the assets loading the reason why the game freezes?

  • Ok the memory usage is almost entirely caused by these characters you've got underneath the level that are not really part of the level. Delete them. You've used the level as a kind of object bank but this should be in a different layout. They will need to be optimised in general though as one is spawned for the player.

    Also they appear in the character select screen, consider using a different object for this - objects with one frame of the character. The tutorial is also approaching 1gb because of all the characters, they just need to be optimised I think each char adds about 200mb which is a lot when you consider that memory usage should be around 100mb max total for all graphics in the layout. This could work on mobile if you reduce those characters down.

  • Well, I tried making an object bank by placing the characters and the grass tiles onto another layout but there was one issue...

    I really don't know how object banks work.

    When I deleted the grass tiles the face of the 3D blocks with that tile became invisible. So when I deleted one of the characters under the layout, leaving him in another layout, and selected the character, this happened.

  • What are you showing us? Please explain the problem. If it's a bug of invisible character that's secondary to the performance issues at the moment, you need to chop down those character animations. You should delete the characters from that level and an object bank isn't totally necessary.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • While deleting the characters reduces the memory storage to around 60-ish, the player billboard doesn't display the characters. Keeping them in makes the memory storage go up to about 360 now. And the worst part is, it isn't even the reason why the game freezes up. While your advice lowered the storage while making more object types, it apparently isn't the reason why the game freezes.

  • There is no doubt it is why the game freezes as described above, it is preloading around 600-900mb of assets on transition. Notice how it doesn't freeze when you transition to the level select screen? If it doesn't have to load these characters then it doesn't freeze at least for me on PC because the memory usage is more reasonable.

  • Well, how would I be able to delete the characters from the particular layout but still be able to set the visible face of the player billboard to the character that I chose? It doesn't look like making a separate layout with the sprites can do the trick.

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