Alright so I used a tutorial for this at first but then kind of went off on my own. Now when collision happens on a tablet then it pauses. I am testing it on a Motorola Xoom tablet. Would it be the Tegra chip since it works on my friends phone fine and the simulator? If you need the collision code then just ask me. [import]uid: 180414 topic_id: 33876 reply_id: 333876[/import]
Looks like the Zoom has plenty of memory and a pretty snappy processor. I’m not a physics expert, but a look into your code will be needed by any one looking to help.
[import]uid: 199310 topic_id: 33876 reply_id: 134696[/import]
Most likely the pausing in your game is not due to physics, but perhaps due to something you do when the collision occurs.
Biggest sources of pauses in my experience are:
- Loading images
- Running a very large amount of lua commands in a row
- Changing the position, rotation, scale, or other properties of a lot of display objects at the same time.
- Making a lot of database queries in a row.
Also, Android devices seem to be a little bit slower when you do things that interact with the filesystem than iOS devices, and they vary from one device to the other. That might be why you see the pause on some devices and not others.
Edit: And here are the solutions for each case mentioned above:
- Pauses due to loading images
Solution: Load images when your game starts or when you load the current scene instead of loading them during gameplay. You can make them invisible to start. Then during gameplay just show/hide them as necessary.
- Running a very large amount of lua commands in a row
Solution: Keep an eye out for collisions events that occur repeatedly (Only process the first one and ignore the others), event listeners that get added multiple times, and other cases where you might end up executing more code than necessary.
- Changing the position, rotation, scale, or other properties of a lot of display objects at the same time.
Solution: Avoid changing the properties of more display objects than necessary, or change them less frequently.
- Making a lot of database queries in a row.
Solution: Group multiple queries into one query (by using UNION, for example). You might also defer updating the database until the user finishes the current level. [import]uid: 135827 topic_id: 33876 reply_id: 134711[/import]
george 18, great informative feed back.
[import]uid: 108129 topic_id: 33876 reply_id: 134784[/import]
Looks like the Zoom has plenty of memory and a pretty snappy processor. I’m not a physics expert, but a look into your code will be needed by any one looking to help.
[import]uid: 199310 topic_id: 33876 reply_id: 134696[/import]
Most likely the pausing in your game is not due to physics, but perhaps due to something you do when the collision occurs.
Biggest sources of pauses in my experience are:
- Loading images
- Running a very large amount of lua commands in a row
- Changing the position, rotation, scale, or other properties of a lot of display objects at the same time.
- Making a lot of database queries in a row.
Also, Android devices seem to be a little bit slower when you do things that interact with the filesystem than iOS devices, and they vary from one device to the other. That might be why you see the pause on some devices and not others.
Edit: And here are the solutions for each case mentioned above:
- Pauses due to loading images
Solution: Load images when your game starts or when you load the current scene instead of loading them during gameplay. You can make them invisible to start. Then during gameplay just show/hide them as necessary.
- Running a very large amount of lua commands in a row
Solution: Keep an eye out for collisions events that occur repeatedly (Only process the first one and ignore the others), event listeners that get added multiple times, and other cases where you might end up executing more code than necessary.
- Changing the position, rotation, scale, or other properties of a lot of display objects at the same time.
Solution: Avoid changing the properties of more display objects than necessary, or change them less frequently.
- Making a lot of database queries in a row.
Solution: Group multiple queries into one query (by using UNION, for example). You might also defer updating the database until the user finishes the current level. [import]uid: 135827 topic_id: 33876 reply_id: 134711[/import]
george 18, great informative feed back.
[import]uid: 108129 topic_id: 33876 reply_id: 134784[/import]
Thank you. I will look into these things. [import]uid: 180414 topic_id: 33876 reply_id: 135335[/import]
Thank you. I will look into these things. [import]uid: 180414 topic_id: 33876 reply_id: 135335[/import]