android
  #1  
Old 05-21-2010, 01:29 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default Several timing problems need clarifying

I could do with some help with timing please.
1. I set os.wait(10000) and expect as the API manual says, 10 seconds, it seems more like 100 seconds.

2.Apeopex uses a wait of 10ms. I changed it to 5 and the Zen locked for ever requiring a reset. Back to 10ms OK. Why is the wait needed? Why 10ms?

3. In the middle of a game, if a new screen is displayed, say with scores, is it possible to say... click the screen to dismiss it and return to the original screen continuing where it left off.

4. Timings between the real and the simulator do not match, probaly due to windows working. How do I manage both?

Thanks for any help.

Last edited by Donone; 05-21-2010 at 01:36 PM. Reason: Further question
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 05-21-2010, 01:43 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

3. No, since you always draw on top of the screen buffer there is no way of returning short of saving something which keeps track of what was on the screen and redraws it all after resetting the buffer with a fill color or something.

4. The sim is working with a much higher speed than the device itself, sloppy programming...
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #3  
Old 05-21-2010, 01:55 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default

Thank you for 3-4 Habhome.
I do not follow 4. Sloppy programming... I can see no way to control the process. I have a loop that does something presumably at its maximum speed. It does it. Presumably one programs for the device and not the simulator. My point is really that because some people might only have the simulator, I got the feeling (maybe wrongly) from reading, that one should try to cater for them also.

i.e. If I had a loop that places a sprite on the screen and then moves it, I would expect not to have to play with timing. Wrong?
I am a little confused. Any further help?
Reply With Quote

  #4  
Old 05-21-2010, 02:16 PM
Brett_val's Avatar
Brett_val Brett_val is offline
Senior Member
 
Join Date: Jan 2010
Location: The Netherlands
Posts: 636
Default

1. You are right that os.wait(10000) should result in a wait for 10 seconds, if it doesn't, then there may be something else causing another wait, or it's a typo?

2. For what I understand, the wait is needed to keep some CPU-time left for the player to do stuff in the background. Perhaps playing music, and I guess for the OS as well. I read somewhere on this forum that 30 milliseconds was advised to use, although 10 is fine also. My apps also freeze if I use less than 10, I don't know why..

3. As Habhome said, you will have to re-draw the parts that have changed. This player doesn't have a screenshot function or something. It is possible to save every pixelcolor, but when redrawing all those pixels the player freezes (got this info from the paint thread.) So yeah you will have to draw over the stuff that has changed.

4. Do you mean os.time? os.date? They give different outputs I know, but os.wait and os.sleep just work the same on the sim and player for me.
Reply With Quote

  #5  
Old 05-21-2010, 02:23 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by Donone View Post
Thank you for 3-4 Habhome.
I do not follow 4. Sloppy programming... I can see no way to control the process. I have a loop that does something presumably at its maximum speed. It does it. Presumably one programs for the device and not the simulator. My point is really that because some people might only have the simulator, I got the feeling (maybe wrongly) from reading, that one should try to cater for them also.

i.e. If I had a loop that places a sprite on the screen and then moves it, I would expect not to have to play with timing. Wrong?
I am a little confused. Any further help?
I meant sloppy programming from Creative's sim developer team. They didn't match the CPU speed of the simulator to the actual device. So for example the time to actually put your image on the screen differs from the sim and device, so you have to make two versions of a game for it to e played with sim or device in terms of that.

And well, my main goal is to create simple apps to entertain yourself with on the go and easily stop at any time. There is no use making my games for someone who has a computer, there are already so many games for that doing what we make.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #6  
Old 05-21-2010, 02:25 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default

Thanks Brett_val, I guess my wording is sloppy; timing in 4 means speed of screen refresh not time as in time. I have no wait between screens. I move something as fast as the system will permit and it is eratic but much more so on the simulator.
I am presuming from Habhome and now you, that the os.wait simply stops the thread and so will not affect the screen updates or speed of movement.
I can see no way to overcome the jerkiness.
Reply With Quote

  #7  
Old 05-21-2010, 02:28 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default

Thanks again Habhome, we crossed there. So to carry on with both conversations, my problem now is simply as just stated, I can see no way to control speed within the thread and thus make two versions.
Reply With Quote

  #8  
Old 05-21-2010, 02:32 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by Donone View Post
Thanks Brett_val, I guess my wording is sloppy; timing in 4 means speed of screen refresh not time as in time. I have no wait between screens. I move something as fast as the system will permit and it is eratic but much more so on the simulator.
I am presuming from Habhome and now you, that the os.wait simply stops the thread and so will not affect the screen updates or speed of movement.
I can see no way to overcome the jerkiness.
The wait stop the entire app, it will stay in that code line until the wait is over and then continue on to the next. To prevent erratic movements you should only redraw the parts needed and make sure to make big enough movements every time. You don't have to move it 1 pixel at a time, it will still look smooth with more than that. For example I slide my stats bar in Paradise Slots with a movement of 5 pixels at a time. And the info bar with 15 pixel at a time.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #9  
Old 05-21-2010, 02:41 PM
Brett_val's Avatar
Brett_val Brett_val is offline
Senior Member
 
Join Date: Jan 2010
Location: The Netherlands
Posts: 636
Default

Quote:
Originally Posted by Habhome View Post
my main goal is to create simple apps to entertain yourself with on the go and easily stop at any time.
Haha coming from the guy who makes the most addicting games of them all, I find this quite funny

But as for the point you are making, I agree. I don't think anyone who doesn't own the player will download these apps just to play on the simulator.

Or do you (Donone) have some really killer app in mind??

Quote:
Originally Posted by Donone View Post
I can see no way to overcome the jerkiness.
Well the trick is to minimize effort: only re-draw what's needed, and keep coding as simple as possible. The less statements, drawing, function calling, the better.

Oh and to make two version (for player and simulator), just increase the mandatory wait time on the simulator version.
Reply With Quote

  #10  
Old 05-21-2010, 02:50 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default

Thank you both. I have enough to continue experiments.
No I don't have a killer app, but I will be posting one shortly and in the first instance, although it will work, I will welcome advice from those more experienced on this device. There are a lot of limiting restrictions.
One I notice is that if text is written and then overwritten with the same coordinates, it does not write exactly in the same place. etc. etc. but I do think it is a great device.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:32 AM.