How to troubleshoot performance issues in Unity 3D - android

We have created a game in Unity and are currently testing on various devices.
Some devices as you'd expect perform better than others, but we are surprised by our testing on iPad 3 and iPhone 4, which we'd have thought would cope better. (simple movements of objects appear quite jittery)
With regards to troubleshooting we have placed a frame rate readout on the screen and we can see that this is very erratic (a target of 60fps can flick anywhere between 24 and 60 seemingly randomly), but I was wondering what other performance diagnostics can be done. Are there plugins that can give readouts/log performance as the game plays that could point to specific events or graphics that cause it all to struggle?
Any other ideas would be much appreciated.
Thanks in advance

Profile
Unity has some excellent tools to enable you to profile your code while it is running, both in the editor and on devices.
This generally involves:
Connecting your device to the same wifi network as your development machine, or plugging it in via USB cable
Selecting "Dev Build" and "Autoconnect Profiler" when you build your project
Opening the profiling window in Unity.
I would suggest that before you try profiling your application on your tablets, you try profiling it in the editor. This will give you an idea of how to best use the profiler, and you may realise what parts of code you can optimise before even running it on your device.
Profiler: http://docs.unity3d.com/Manual/Profiler.html
Read up on optimisation
Not so much an answer to your question, but read up on various performance gotchas. You don't want to prematurely optimise, but there are certain practices you need to be aware of when developing for mobile devices, keeping your shaders simple, reducing draw-calls, dynamic batching etc.
Various notes on optimisations:
http://answers.unity3d.com/questions/37293/general-ways-to-optimize-frame-rate.html
http://www.paladinstudios.com/2012/07/30/4-ways-to-increase-performance-of-your-unity-game/

Related

Android application performance monitoring tool

I have developed an Android game app, and now I am looking for a tool that would monitor my apps real user performance (like CPU, memory, GPU, network, latency, etc.).
I know about NewRelic's mobile APN monitoring, but it is too expensive for me.
What would be other options?
Thank you in advance.
If you are simply looking to understand the consumption of each of the device vitals by your application, then there are several tools on the Google Play which will help you with the same. Some of them may include CPU Monitor, 3C Toolbox, Elixir 2 etc.
Not to mention Android Studio's inbuilt monitoring capability.
Reference link : https://developer.android.com/studio/profile/index.html
However, if you are looking to monitor on the production and understand the real user experience, then you will have to invest some cash. But there are free tools such as Fabric which would provide device vitals during crashes in the production. Along with the device vitals there are several other details such as stack trace, time of crash, geography etc. that would be available on Fabric.
You could also try Apteligent, yet another mobile front end performance monitoring solution, to monitor your application in the production. This is similar to Fabric but provides more in depth information about crashes (in addition to device vitals) and slow transactions. However, this is a commercial tool but comes with free trial (limited features). Though I am not sure of the pricing and licensing models provided by them, they are as efficient as New Relic, Appdynamics, Dynatrace and such from a mobile front end perspective.
You can also refer to this post that I came across if that helps : https://sqa.stackexchange.com/questions/13936/measure-resource-intensive-actions-in-a-mobile-application/18880#18880

Simultaneous Localisation and Mapping for android

I recently started exploring the world of visual recognition and was particularly interested in SLAM. I have tried and tested different SLAM implementations on a laptop from openslam.org
I'm still new to the field and still learning about it. I want to implement SLAM on an android device. Can anyone point me to any such implementation. Or can you suggest which implementation of SLAM would work best on an android device. I have access to top of the line android devices such as the Galaxy S6 or the Nexus 5.
Before starting to work on my idea I just wanted to know which implementation would work best in terms of efficiency and accuracy on an android device.
Thankyou
Those guys are quite good, the source is available under GPLv3 license (in user friendly form) and a friend of mine was able to run it on android in real-time (It was developed for MAVs and they state that it should reach 50FPS on current embedded computers).
https://github.com/uzh-rpg/rpg_svo
(Check out the video on the homepage as well)
orbslam is a open source slam system basing on sparsity method.
on pc orbslam can reach about 35 FPS,on smartphone it can‘t perform like on pc, so you can't move the phone too fast. That is because the feature extraction process of orbslam take so much time.
svo is a good choice as for speed, however, svo is only a visual odometry, it dosen't have a loop closing module, therefore when run for a long time, the drift may be large.
therefore, i recommend orbslam.
many people have migrate the code to android, you can search on github:https://github.com/search?q=orb-slam+android&ref=opensearch

Android Tablet or iPad for Kiosk Device

We want to place a device in a store that operates as sort of a kiosk device. As in customers walk up to it and start interacting with our custom app. The app could be developed for Android or the iPad, so I'm trying to decide which one to use and would like comments on the following ideas:
Is it possible for Android or iOS to access services over the USB port? This would enable us to disable the network.
Is one particularly better for 24 hour always on?
I like the iPad as I think its supply will be more constant as we move forward and need to replace devices due to ones gone bad. Also, our app will probably work on future generations of the iPad. With Android, I'm not sure there will be that sort of consistency from the tablet vendors.
Kiosk mode? I think with the iPad by putting it in a kiosk case that removes access to the home button and turning on the restrictions we'll get what we want. What about Android? I'd rather not have to get into rooting devices and replacing their firmware.
Remote control? Any way to remotely control iOS or Android in a standard means? Our app will be a client to a master server which will obviously be able to control the app somewhat (when used purely as a display device to a customer, controlled from behind the counter).
My feeling is that neither Android tablets or the iPad is best suited for this. Are there other options?
I will try to answer your points, but know that I am probably biased towards Android, because that is where my experience lies.
With Android 3.1+, at least with the Xoom, you have full USB host capabilities. Things like USB flash/hard drives, keyboards, mice, even digital cameras, all work. If you need custom interop with a USB device, you could go as far as to write a driver for it.
24 hour always on is not good for any device with a battery, but neither is better in this situation.
While android apps are forward-compatible, bad programming practices and/or deviations from "vanilla" Android software and hardware CAN break forward compatibility. That being said, if you grab a Google Experience device like the Xoom, you won't meet as many surprises.
In Android 3.0, the navigation bar is built-in at a low level, and it is not possible for apps to remove it. Therefore, it is trivial for anyone to break a "software nanny."
I know that it is possible to control android devices remotely, but without knowing your specific needs, I can't really offer more information than that.
Good luck!
iPad NOOO believe me I am a convert to Apple for my home and business but when we went to launch kiosk the iPad FAILED Big Time.. Here are a couple of little (Big) issues we ran into.
If the device reboots you cannot auto launch you iPad app since Apple does not allow that.
There is a serious memory leak in the iPads browser. We were running javascript / CSS3 and it cratered intermittently. I literally spent 2 hours "today" on the phone with Apple getting the MAJOR run around. I finally said let me speak to an Enterprise Sales Manager as my project could mean thousands of iPads and I got NO WHERE. One Apple employee even told me they don't have enterprise sales managers.
If those weren't enough even though we are just in the proof of concept phase, we are already getting request for other options. These other options are going to require access to the OS which Apple yea right. We are moving to Android immediately.
Sorry Apple I love you but you loose here.
If your using an Ipad you should consider if it can support the power for the USB thing. Watch this Using Powered USB Port
Your idea about putting the tablet behind another piece of glass/plastic is neat. To then deal with remote controlling, you might consider doing some Bluetooth programming.
My mobile development has been primarily with iOS, so I am biased toward that SDK. I will mention that the data/sync/charge port for iOS has (I believe) never changed. Your Gen 1 iPhone sync cord works on your iPhone 4... and your iPad or iPad 2. So, in terms of third party hardware, you may see more consistency with Apple.
I haven't found a good answer regarding whether it is easier to do Bluetooth programming for iOS or Android, but I think to stay cost-effective, you might see which one is more open to third-party devices. Here is an SO post/answer about iOS and third-party Bluetooth devices; I've not found anything on Android regarding third-party Bluetooth remotes, but considering a lot of hardware running Android is third-party, your chances from a naive perspective seem pretty good. Here's the Android Bluetooth API.
Buying an iOS or Android handheld to remote control an iOS or Android tablet does seem a bit steep, but then again, maybe not. Cost also depends on your ratio of remotes to tablets. 1:1? 1:N? N:1? N:M?
The lowest end iPod goes for $229 as of May 20, 2011. Android does have more variety in terms of hardware. You may be able to get a cheap Android phone with no service plan to act as a Bluetooth remote for an Android tab.
I have provided a solution for the kiosk mode using iPad here Lock-down iPhone/iPod/iPad so it can only run one app
I am afraid that I don't really know for Android if the same thing is possible.
To address the issue of crashing applications you can use an exception trampoline (see discussion here https://blog.compeople.eu/apps/?p=275) to catch the crash and reboot your app.
If the entire device is restarted however then other apps that are on the device can be started and will subsequently be locked in.
To answer your other points:
You can use a configuration profile to control network access. Force it to use a VPN or Proxy that only allows your custom app with embedded credentials to use. That way other network access can be prevented.
Your concern over future compatibility is spot on. The Android marketplace is so fragmented then maintaining a fleet is difficult.
If you have an app that is behaving as a server and is locked in then remote control is possible.
We manufacture tablet kiosks that support both android and iPad devices. In fact we are the only iPad kiosk that has achieved apple approval.
Generally speaking i think you will have an easier time with an iPad as the software and hardware will remain more consistent over time. Which is important if you have to change out a fault unit or deploy more kiosks 6 months or year from now when the original device is no longer manufactured.

How do I output to monitor from android device

I am trying to do a demo on a android device, but the screen is too small so is kinda hard to do a demo let say in a meeting room with 12 people. Although I can pass the device around the table or just simple borrow or get more devices for the demo purposes.
I understand there are devies where you can buy special USB converter to do TV-out like in iPhone, and some specific devices on Android (e.g. Motorola Incredible?) But I have to demo on a specific device where it runs standard Android build.
I understand I can do it on Android emulator but the screen refresh rate is too slow, as it will send the wrong message to the audience that the app is slow. (Or there is a way to increase the screen refresh rate for emulator?) Furthermore the emulator doesn't support multitouch. (Or am I wrong?)
Not sure if anyone
You do not have many options.
You can use Droid#Screen, but the refresh rate on it is maybe 6fps. I am not aware of any other software projector that is faster.
You failed to mention the "specific device" that you are using, so I cannot comment on whether it has TV-out capability. The HTC DROID Incredible and the Samsung Galaxy S series support composite output -- I use the DROID Incredible for this purpose a fair bit. Most of the devices that have HDMI output only support it for certain built-in apps, such as the video player.
You can rent or purchase a device projector, like an ELMO. These are fairly expensive pieces of equipment purchased new, though I see a handful of used ones on eBay at interesting prices (though watch out -- many seem to lack the AC adapter).
If you can delay the demo several months, you may be able to use a Google TV.
And that's about it, AFAIK.
Or there is a way to increase the screen refresh rate for emulator?
Get a faster computer.
Furthermore the emulator doesn't support multitouch. (Or am I wrong?)
I am not aware of a way to simulate multitouch with an emulator, though I have not gone looking for a solution there.
If you have an Galaxy S3 Android mobile phone, you can use Mobizen. It's free and the screen refresh rate is relatively good. You can control you mobile phone from you computer using your mouse and your keyboard. It's working using USB, 3G or Wifi connection.
I have used this Android screencast tool: http://code.google.com/p/androidscreencast/ in past demos, but again the downside is the relatively slow refresh rate.
If you have a rooted device, you could try Droid VNC Server (it's on the market). The refresh rate isn't too bad, but I certainly wouldn't want to demo full motion video or an arcade game on it.
You could also get a webcam, rig it up with a tripod. Something like this. Downside is your hands will be in the way, maybe issues with lighting and/or focus. Upside is a decent refresh rate.

Cheap Wi-Fi enabled Android or other programmable device

Does anyone know of a cheap Android or programmable device that has wifi?
I need it for a project for a company that needs a Wi-Fi handheld device for the shop floor.
I'm not too fussed about the language the device uses though I'm not really interested in the iTouch as there's no intention to release the app in the app store and I don`t really want to jail break everybody's iTouch.
Ideally it would be small, iTouch size for example and relatively cheap $100 or less. Nothing fancy, just ability to write a simple UI and have Wi-Fi. Voice is not needed.
Not too fussed about touch or qwerty keyboard either.
How cheap is cheap? On the weekend I searched eBay for "android slate" and found a bunch at US $99. I bought one immediately. It may not have the world's fastest CPU or a heap o' RAM, but at that price, how can I complain?
Like you, I want to develop apps for use in an industrial situation. I'll list voice as a feature if I use handphones, but don't really need it.
Would you please publish your final purchase decision here and I will likewise if I find a "better" option.
Bear in mind that it's not all about the cheapness of the device and consider the development effort.
Android has at least 2 good things going for it.
1) Generally programmed in Java (although you can use C & C++ if you jump through a few hoops). I may be wrong but it seems that new grads these days only know java (no offence intended to anyone reading this) and even "old hands" with C++ can quickly pick it up.
2) Android was designed from the start for developers and has an excellent development environment and good tools.
I bought a bunch of Android books and really liked Unlocking Android: A Developer's Guide, but you might want to check Amazon for readers 5 star votes.
And I have just noticed Android Wireless Application Development which I will have to buy; I think that you might benefit from it too.
Oh, and if you want to outsource any development at competitive rates ... ;-)
There were some cheap Android devices at http://dealextreme.com

Categories

Resources