Hi I am developing a game that will be some what graphically and physically intense with lots of bullet objects, and some explosions. I have been using the network feature for Gideros player to test on device and hadn't used the desktop player for several days. When I did go back to the desktop player I noticed that as my game progressed the desktop player was no longer at 60 fps, but more at like 25 or 30, even if I put it on "unlimited" fps. The player zips at a blazing 60 fps on android, and building an apk also produces a stable 60 fps. My machine has 6gb ram and a 3rd gen i7 so it cannot possibly be my comp. Are there any known desktop simulator issues that I should be aware of ?
Comments
There were some similar issues on some specific types of machines (maybe combination of specific hardware), but since it was not possible for Gideros team to reproduce it is really hard to find and fix such things.
Maybe if this happens for this project only, then we could isolate the exact part that is causing it.
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
---
Just did some testing. I think the problem is completely different. My game has a spaceship which I currently limited to only being able to shoot 6 bullets/second. I turned on the Gideros Dekstop player and shot continuously for 30 seconds and got out 161 bullets which is roughly ~ 5.4 bullets/second. There is obviously a performance issue but it is not major. However, I then turned on the Gideros Android player and got a wopping 277 bullets off which is ~ 9.2 bullets/sec! I did not change ANY code and I even made sure I put my finger in the same spot in my control UI. My friend tested on a Galaxy S Blaze and got performance similar to the desktop simulator while I get the 277 bullets/sec performance on my Optimus 2X P990. This occurs both with APK's and Gideros Player. I also checked my code for memory leaks and there are none. Lua memory starts at about 500kb, grows to 620kb and stops there. I assume that means there are no leaks because objects get collected properly?
---
Also on enterFrame on the Optimus 2x doing a print(1/e.deltaTime) within an enterframe results in values ranging from 50 to 400 fps... I really don't think this is a bug in my code as the simulator stays between 50 and 60 fps. I also have 60 fps set in the project properties. Do I need to modify anything once I export the project to eclipse?
---
This only seems to happen when I set the project properties to 30 fps. At 30 fps the device successfully throttles itself to stay at 30 fps but setting it 60 breaks throttling for some reason.
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
How do you actually shoot? Do you use onEnterFrame to start and move bullets?
You can check this example project for lots of good practices in creating shooting game.
http://www.giderosmobile.com/forum/discussion/comment/17263#Comment_17263
Starting from handling bullets, to pooling them for reusage.
One version was with bitmap bullets other with meshes which is even more optimized.
So does the same issue happens with these projects?
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
We have Samsung Galaxy Mini 2 device, and we test it with gideros, the fps cap goes higher than 60. on all of our iOS device we got solid 60fps however. I suggest to use deltaTime instead of frames to update your game logic since some android device cant lock to 60fps.
http://www.nightspade.com
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
I suggest you use event.deltaTime from enterframe event.
Some case: you want to move a car 120px a second.
If you know you would get solid 60fps then every enter frame you will move it 120/60 = 2px
However, in real world when a player play your game, he/she got sms, notification or just the hardware is underpowered or overpowered, which will make your fps go down or up. That way on one second, you are not getting 60fps.
By using event.deltaTime you could calculate it to move every enter frame at 120px * event.deltaTime to handle the case above
Here is a nice article about game loop http://www.koonsolo.com/news/dewitters-gameloop/
Let's ask @atilim if we could lock fps to 60 in Android too for another solution
http://www.nightspade.com
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
Likes: anneMurielle
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
I wonder what's printed on your device when you take the average FPS:
And currently your device is Optimus 2x with Cyanogenmod, right?
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
you have a sprite within a sprite within a sprite, multiple hierarchies and each with rotations, not just a single parent. You might want to iterate through all of the parents till you reach the parent which is the stage.
Likes: hgvyas123
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
While fixing this problem, I've realized that the fix can be done by simply changing your Activity.java file. You just need to replace current GiderosRenderer class with:
Also if you need an Eclipse version of Gideros Android Player (to apply this modification and deploy to your device), you can create an empty project (like with name GiderosAndroidPlayer), export as an Android application and delete assets/assets folder.
Likes: fxone, hgvyas123
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
http://www.nightspade.com