Memory issues on Windows Phone 8.1

I have been getting numerous reports that the game crashes frequently on Windows Phone 8.1 devices.

Almost all the crash reports come from devices with 512MB of memory, which led me to conclusion that the game is running out of it.

After investigating, this indeed seems to be the case. While the game was happy to run on 512MB WP7 devices, WP8.1 has, for some reason, much more stringent memory requirements.

As it turns out, WP7 app on a 512MB device can allocate up to 276MB of memory before running out and crashing. On WP8.1 this limit has been reduced to 185MB!

I could hardly believe my eyes when I saw that today. This is just above a third of the device memory available. I think it’s a real mistake by Microsoft, and not the first one either. What is the remaining 2/3 of the memory being wasted on? If an user is running a foreground app, why the system can only allocate 1/3 of the memory to it? It should be more like 4/5, with the system trimming down as much as possible and killing background apps.

Anyway, I can wail and whine, but in the end we have to do something about it.

If you are experiencing crashes and have a 512MB device (Lumia 520/620/720 etc.), the only thing you can do is to reduce visibility range. Go down to 96 or even 64 blocks.

I will try to scrape some memory here and there, but 185MB is a pathetic amount in 2015. Especially that of these 185MB I am only directly allocating less than 100MB (with 128 blocks visibility range), and the game still crashes from time to time. The rest is apparently taken away by some runtime stuff that I have no control over.

All still in review

Both iOS and Windows Phone 8.1 builds are still in review.

I am aware that there are still issues with Android audio, due to Android bugs. I have a certain idea how to fix them once and for all, but I am not sure yet whether it will work. I’ll let you know soon.

Windows 8.1 build is ready for submission as well, but I am waiting to see how Windows Phone 8.1 will fare first.

Windows Phone 8.1 Submitted

I have just submitted 1.27 build for Windows Phone 8.1.

This is a new platform as well, although it was previously supported via Windows Phone 7 build.

I am no longer maintaining Windows Phone 7 – the new engine cannot support it as it is XNA only. In the unlikely case you are still using Windows Phone 7, you will be able to keep playing 1.26, but to get 1.27 you need to upgrade your phone to Windows Phone 8.1.

iOS submitted

Yesterday I submitted iOS build of 1.27 to Apple. They usually take 4-7 days to review it.

It’s so refreshing to have no audio or graphics bugs to workaround and no million devices to test on, every one misbehaving differently. Somehow everything just works as expected :-)

Amazon Out

Amazon have approved 1.27 in their store, so Kindle owners should now be able to upgrade.

http://www.amazon.com/gp/mas/dl/android?p=com.candyrufusgames.survivalcraft

Before publishing there I fixed a last minute glitch on 1st gen Kindle Fire that caused the sky to go black. This was due to another Android shader bug that I had to workaround.

I am sad to mention that, but the quality of Android software is poor, even with reputable manufacturers like Amazon. They are trying to replicate PC market of the 90s and 00s where all hardware combinations were allowed. The difference is that one could replace a single part in their PCs, or upgrade drivers just for that part. Android does not have that. If you get a device with a single dodgy bit you’re out of luck. You must rely on the OEM to issue an upgrade for the entire firmware, which never happens. They prefer to sell you next year’s model instead. Rant ends.

New platforms

All the hustle and bustle around the 1.27 release, but I haven’t told you the most important news about it yet.

With the new engine, there is support for new platforms! Namely Windows Phone 8.1 and Windows Store. I will be submitting 1.27 there soon.

download

Windows Store submission means that for the first time you will be able to play Survivalcraft on your powerful PCs, using mouse and keyboard. Provided you have Windows 8.1 of course. I spent a lot of time updating mouse/keyboard support so that they are production ready and not just some development hack like in 1.26.

The Windows Store version has been running smoothly for some time now, so I have high hopes for the submission success. However, as this is a completely new platform, our mileage may vary. We will see.

1.27 is the biggest release for a long time.

1.27.4 out

Another bugfix release is out.

Here’s the changelist:

  • Fixed animals spinning aimlessly
  • New compatibility setting to disable AudioTrack caching. Should only be used on Kitkat and above (4.4+), just in case someone finds a problem with the caching
  • Worked around clouds rendering bug in Samsung Galaxy Tab 4 7.0 (and other devices using Vivante GT GPU)
  • Reduced wolf loot
  • Fixed health regeneration in Challenging
  • Optimized clothes drawing, it’s 2x faster now, should run smoother when inventory page full of clothes is displayed
  • Added swoosh sound when attacking
  • Melee attacks can now miss, with probability depending on weapon used
  • Made axe powerful, but with large chance to miss
  • Made clothes and carpets colors more saturated
  • Reduced opacity of water sides
  • Increased maximum creative flying height

Please download and test.

For electrically inclined, check this enlightening video: http://youtu.be/IN3Bs3ySLZ0

Huge visibility range

The new engine has one great advantage over the old one. It can run in a 64 bit process. It is not bound by 2GB memory limit that each 32 bit process has.

Lack of virtual address space was the factor limiting visibility range in previous versions. In the new one, I can enable truly monstrous visibility ranges.

This is not for the phones of course, which run 32 bit hardware anyway. Plus their GPUs would totally choke even if they had the memory to run it. It’s just for my test desktop version.

1024visrange

1024 blocks visibility range in Survivalcraft (click to enlarge)

I am quite proud of what Survivalcraft engine can do. At 1024 blocks I am still frame locked at 60 FPS! Although this is on nVidia 970 GTX, which is a poweful GPU.

There is an insane amount of geometry out there. 512,000,000 blocks in total, although most of them underground or behind, and thus invisible.

To compare, the biggest visibility range setting Minecraft has is 32 chunks (each chunk is 16 blocks), so 512 blocks. And it is completely unplayable, even on my powerful PC. Although Minecraft was never optimized for the phones, so it can be forgiven that it is slow.

If you look closely you can just spot the ship, miles away on the right :-)

I think with the default visibility range (128) you would not see a single block from this high vantage point of view (150 blocks)

Two more screenshots:

1024vis2

 1024vis3

New combat mechanic

I have decided to quickly add a new combat mechanic to Survivalcraft – the melee weapons now have a probability to miss.

I think this should add more risk to attacking animals, because if you miss there is no pushback effect, and the animal will get you. Currently it’s too easy to use hit-and-run strategy.

This is an eleventh-hour change that I should not really be making at this point, but let’s be it :-)

MeleeHitProbability

Using this new value, I made axe an interesting weapon. It causes massive damage, bigger even than the machete, but has an abysmal hit ratio. Only one in four swings hits the target.

1.27 faster than 1.26

While fixing the sky I was running Survivalcraft 1.26 on the Samsung Tab 4 7.0, and took the opportunity to compare framerates against 1.27.

1.27 wins, 55fps vs 49fps.

It is on a flat, empty terrain though, with no animals, so it’s not a very realistic benchmark. Maybe some day I will find time to compare them properly.

Follow

Get every new post delivered to your Inbox.

Join 44,367 other followers