Hey guys, been trying out the Mapbox SDK for unity which is available after signing up here:
And it seems to have some problems (it is beta, so yeah… gonna happen I suppose).
EDIT: See below post for possible resolution…
I started using it when it was beta 0.2 and it had an example of a slippy map where you could scroll around with your mouse (or mobile touchscreen) and view a map. Pretty decent little demo, but it had problems. It seems that after you go into playmode and use the slippy map example for a minute or two, then leave playmode, the editor continues to eat up CPU usage pretty bad, seems to get worse the more you use the demo.
I thought it must have been something I was doing wrong, and I tried for a while to locate any issues with the side of things I had created, but could not get to the bottom of it.
I downloaded the new version today (0.4) and tried it out, and it includes a new slippy map demo. Turns out though, lots of the functionality of the old demo was lost! Now the demo doesn’t do things it used to do, like keeping the map centered on the world origin to avoid floating point precision issues if you were to go far from the origin while scrolling. Also it doesn’t seem to delete the distant tiles, and keeps them around, making it very memory consuming. It does look nicer! They seem to have improved the quality of the terrain graphics and height mapping.
I noticed though, this new demo, it is even worse than the old one perhaps as far as performance goes, it has the same CPU eating problem also! The only way to make this go away, is to completely exit unity, and restart fresh, then after only playing a single time and exiting, it seems to start eating CPU for me. This gets progressively worse until it takes upwards of 99 percent of the processor, and unity becomes sluggish as can be.
So anybody else experience this issue with the SDK? Anybody figure out why/what causes this leak/problem? I haven’t dug in deep enough to find out, but before I do - maybe someone knows where to start?
I decided to port the old (better in my opinion) slippy map into the new SDK, it was pretty easy, and it still works like it used to, but again, still seems to have the CPU usage leak in the editor. I imagine this wouldn’t be a problem on real apps, where the app is closed and restarted rather than exiting and re-entering playmode and keeping “orphaned” variables/methods or whatever is going on, I’m guessing here… I really have no idea, and would love it if somebody has already had a chance to address this problem, or at least knows more about it, before I pull all my hair out trying to find out ![]()
PS, already brought this up to mapbox team through email, haven’t heard back…