- Home /
Game work slow in other devices..
Hi i am suffering from strange problem... my gaming is endless running game. my player is still and all the environment moves towards it.. everything was working perfect untill when i test my game on samsung galaxy omega 5.8 or Qmobile A12 and HTC one v. game works good in my galaxy note 10 and note1. But in other named devices it get slow, players starts moving through the obstacle, doesn't collide. i have added 2 scenes on left and 2 on right for environment. and applied the below script to repeat the scenes continuously. when i enable the scenes in inspector, game get slow and when i disable them it works perfect... ... i don't know whats get wrong with game on enabling the scenes...Kindly pleaseeeeee help me i am badly stuck... is it redering problim ? or any thing in graphics i need to adjust? or any other solution to create endless scenes like subway surfer type game
#pragma strict
function Update()
{
move();
}
function move(){
if (transform.position.z<=-229)
{
//transform.position=Vector3(-18.25419,0.3061495,182);
transform.position.z=299;
}
}
Could you explain what this script does, and what you mean by two scenes on the left and right? Is this a side scroller?
These kinds of issues are why making anything for Android is difficult. Some devices will handle certain types of graphics processing better than others, (say one device may fall apart when there are a lot of transparent materials but others handle them well), and then when you repair the problem for the failing device by changing transparent textures to 3D meshes that use non-transparent materials to achieve the same result (for example), then you find the one that was working well before doesn't work well with lots of vertices now, but the one with transparency issues works great now. It's a back and forth effort to balance the various issues. If you're using any complex shaders, you should start by simplifying them and testing on the various devices to deter$$anonymous$$e the performance differences. Then start looking at the number of draw calls and reducing those as much as you can (16 to 20 is a good goal). Then look at the amount of transparent materials. Then look at the fill rate, how often do you have large textures overlapping, the list goes on.
Basically, there's no easy answer. You just have to start dumbing down things to find the bottlenecks and correct them/redesign them one at a time until it works on your target devices. I guarantee it will still have problems on other android devices. That's just a given with Android. But you want to test on a wide variety of devices, especially the more popular ones.
Thanks for you response... i have road in the middle which is endless. it works like linklist. creates 3 roads patches.1st 2nd 3rd.. 1st road end it moves to the position of 3rd road. 2nd ends move to the position of 1st. so it works as a linklist.. player is on the road, and obstacles instantiates on the road as well and move towards player. it works perfect. player collides jump perfect. After that part, i created environment around the road. left side of the road and right side. you can say ground,buildings,plants. i created a parent empty object(left side and right side) and put all the ground and buildings in that and apply the above script and another script which moves them towards -Z direction. when left scene parent or right scene parent reaches to transform.position.z=-299; i move them back to transform.position.z=299; so it works like endless scenes around the road... like the road. i do not instantiate them again and again rather i move them like a list.. i had 2 devices note 10.1 gt n8000 and note1 gt n7000. it works fine on them but when i check on other devices low resolution i gues , player some time moves through the obstacles and do not show proper jump height...programmatically it jumps over the obstacles but visually on device show very little move not exact jump ... i hope you get my point now ... :/ ...
and i am using simple diffuse shader for every object in the scene. is it because of the resolution? should i need to write any script for resolution? when i remove or disables scenes in the inspector it again works perfect. i remove the script of scenes movement(above script) and the script which moves them in the -z direction. now scenes on the left and right are still, static and road between them are moving. but again same issue with jump and collider. when i disable scenes it works. so issue is not with the script rather it could be with the resolution or something.. :/ .... please help its almost the last part of my game and i am stuck ... :(
The devices on which you are getting issues have low processing power (CPU and GPU) compared to your Galaxy Note devices. As @supernat pointed out you have to profile your game to find out bottlenecks and optimize it for your target hardware. Try to find out the particular issues that you see and post it here. Then we may be able to help you out.
Answer by $$anonymous$$ · Apr 09, 2014 at 11:55 AM
I agree with you @HarshadK CPU is slower, thats why GTA SA android isnt same as the pc version, commands are not all like PC, radio is similar, graphics not same, animations are similar. But from my view of looking to this, i see that u said: ENDLESS. every time the road is made, is it destroyed behind u on some distance or it stays there. Because if it stays u will maybe have a large problem on slower phones and machines. I know what i mean because i bugged my S4 with a game i made last month -_- :D. Sorry if u dont understand what i mean
@$$anonymous$$RGX yes road destroys when it cross my fixed z position... and new road instantiate on the back of last road in the Que... my obstacles destroys as well after 10 seconds... but scenes on the other hand do not destroy they just changing their positions... as far i have figure out is drawcall problim.. drawcalls also slow down the speed.. as my same game works good in note1 and its resolution is 800x1280 pixels where as Galaxy mega with same CPU have 540x960 pixels.. if it could be the CPU problem then it shouldn't have work on the Note1... i am attaching the image as well on this image drawcall is 145... i tried another test.. i just enable my 1 left scene.. disable all others.. when my scene is out of the camera view it jumps perfect and does collide with the obstacles. when it again in the camera view game get little slow and jump visualization get low..
Do not use default OnGUI elements for mobile device games. Default Unity GUI is not meant for mobile devices so do not use it. It is very resource intensive. Use any other GUI assets from store or open source like UIToolkit.
ok @Harshad$$anonymous$$ i will change that but what about draw calls .. is it because of the draw calls.. ? i disable GUI but draw call are still 135-155... as now you can see in the image my rite and left scene... these are just the prototype materials .. here i will be using houses buildings etc .. but i couldn't figure out the solution yet ... i am at the end of my game .. i can't end it because of this.. as in other games turd bird,subway surfer, temple run etc they use full environment(building, bridges, houses etc )...and those games are working fine on all my devices... this is the only source i am seeking help ... :( ..
Your answer
Follow this Question
Related Questions
Graphics.DrawMesh not working 2 Answers
A node in a childnode? 1 Answer
Scene and hierarchy suddenly empty 0 Answers
Weird Scene View 'Glitching' 0 Answers
Removing scenes with set conditions 0 Answers