Populate - OUT NOW!

Jon

  • *
  • Posts: 17524
Aasimar says that b54 is "fast" and b55 is much slower. Given the 1 day lapse between the two and the short changelist, I think it could be pinned down.

- Game crashes when unloading atlases on device (happened to Balloons, Paper Physics)
- String setting can lead to crashing (Please check that your games don't crash in general or from string setting)
- Shut off pausing when scene doesn't transition
- Take out tween debugging messages

I strongly think #2 is the cause since (1) and (4) were just debug messages, and 3 doesn't apply to your game, nor would it affect regular gameplay, only on transitions.

Jon

  • *
  • Posts: 17524
The slowdown is more complex than originally thought. Aasimar now says that b54 slows down, but after a much longer time, but b55 exhibits the problem much faster.

Jon

  • *
  • Posts: 17524
The slowdown in his game turns out to be unrelated to whatever slowdown was seen here. In this game, I think it's just the memory usage got out of hand due to whatever I'm wrangling with.

In his game, it appears that although it's also memory related, it's due to completely different problem with on-screen buttons.

Jon

  • *
  • Posts: 17524
I haven't fixed all the memory issues yet, but I think this build might help you quite a bit.
http://community.stencyl.com/index.php/topic,2479.0.html

At this point, what I have fixed is these cases

- Backgrounds
- Actors
- Actors with animations set to diff atlas than main actor
- Actors with animations set, coincidentally to same as main actor (but not the "same as" setting, just happens to be the same)
- Recycled Actors

Fonts and Tilesets appear to be OK.

There's still some leaking of 1 atlas happening when swapping back and forth between the main menu and the editor. I haven't determined what and why yet.

But the game now runs fine on the touch without dying due to memory. No real FPS issues versus before. The ferris wheel is 35 FPS but it would probably be higher if there weren't some bug that makes the tracks play on top of each other. I hear at least 2, possibly 3 instances of the track playing simultaneously at a slight offset.

Loading times between scenes where there are atlas swaps is better than before. For some reason, the screen flashes black between levels (bug?)

« Last Edit: October 23, 2011, 02:56:23 pm by Jon »

Rhys

  • Posts: 1046
That's great, thanks for looking into this.

The screen doesn't flash black between levels with b55. Is it happening on the ipad or on the iPhone? (or both?)

I've never noticed the overlapping tracks, probably because I've never played the sound through earphones.

Jon

  • *
  • Posts: 17524
iPod touch w/ retina - i can't test on my iPad because my SDK is still 4, and your game doesn't build on the server (I'm thinking it has to do with the size).

On the bright side, the white flashes seem to be gone or much less than before.

I played the sound through the internal speaker on the touch.

Jon

  • *
  • Posts: 17524
For the flashing, there's a remote possibility that it might be caused by the new transitions. For some reason, all the existing scene switchers now use Blinds Out/In which is a no-op on iOS.

Rhys

  • Posts: 1046
That's probably it. The no transition work around works by making both start and finish fade in, as the transition will only last 1 frame at 0 seconds and it always starts at 0% opacity.

I haven't downloaded a version with the new transitions yet, should I hold off until the old dropdown value is honored?

By overlapping tracks do you mean overlapping music or popping sounds? I've been trying to listen for overlapping music.

Jon

  • *
  • Posts: 17524
Overlapping music. Happens during the main game and also in the level share where I'll hear the main menu music and the main game music at the same time.

Don't wait for the dropdown value being honored. It might take a couple days to come.

Jon

  • *
  • Posts: 17524
The level editor leak is subtle and I haven't fully understood it yet.

It's caused by the +/- button and the play button. Those are used in the behavior level editor code. It could be held on to because they're passed in as attributes, or because you use them to draw in the drawing method of that behavior. But that's the general cause of that. I'm surprised that it isn't happening in other places.

Edit: Noticed that those 2 actors don't get cleaned out after the scene exits, but the rest do.

« Last Edit: October 23, 2011, 05:20:51 pm by Jon »

Jon

  • *
  • Posts: 17524
Fixed that leak. Editor no longer leaks that atlas and when switching between the two, memory usage no longer jumps a bunch, only a tiny bit (20-30 KB?). Though I'd like figure out why there's still a small disparity (on smaller games, the jump between scenes if 0-10 KB, it's nothing to hold back a release anymore.

There are a couple other cases that might cause atlases to retain (particularly if you're dumping actors into lists), but we'll tackle as we see them. You'll need to watch Instruments > Allocations to actually detect this, both the total memory and filtering to SPSubTexture to see if that number jumps between the SAME scene.

I'll update b56 tonight and urge anybody who's submitted to the store and uses the atlas load/unload to test and resubmit. The gains from this are substantial.

(Off topic but nice job on the level share error handling - really nicely done overall now that I've put this more through its paces)

Rhys

  • Posts: 1046
Great detective work. :)
Quote from: Jon
- Plugged a bunch of memory leaks, most notably a leak that happened with every touch.
The Main Menu buttons don't respond, it might be because of this fix. Ice's buttons work fine. (landscape) Non button touches work fine, so I can work around this to get ingame.

Jon

  • *
  • Posts: 17524
Save the game once before you run it - I forgot to mention it.

Rhys

  • Posts: 1046
The performance is still severely degrading on iPhone 4 after 33 or so levels. 33% of the CPU being used on a static scene with just music playing doesn't seem too great either.

Allocations seems to worsen the problem, it uses a lot more memory in allocations rather than out. And the performance is worse, too bad to test.

So I've been using the system monitor tool to determine memory usage, and the game peaks at 80 in the difficulty selector. There are no performance issues in the difficulty selector, but at 75 there are ingame (it slowly works it's way up every scene change). But then when I go back to the menu, the 75MB usage stays but the menu runs at full 60 fps. When I go back into the arcade, the game runs at 60 fps until the same set of intensive levels where it breaks. The absolute breaking point is the fading background, which was trivial before these problems started happening

This all broke with either iOS5 or the first "scene switch time is accounted for in frame skipping" attempt where fps under ten was limited to 10. Are there any remnants of this in builds afterwards that might be making frame skipping go funny?

(haven't tested on non retina recently)

EDIT: I tried b52 but it didn't compile, something about not being able to delete the folder under games-ios?

EDIT 2: If I pop most of the balloons and leave the game without doing anything the fps recovers, which wouldn't happen if it were a memory problem. Nearly all of the leaks are gone anyway so that wouldn't make much sense.

« Last Edit: October 28, 2011, 01:35:39 pm by Rhys »

Jon-iPad

  • *
  • Posts: 166
Which levels are those? I played the game on my iPad and iPod touch v4 well beyond level 33 with no issues.