Dianne,
I don't know why but I found that my games were jittery using
SystemClock.uptimeMillis(). It's as if there was a little
inconsistency and when doing time-interpolated movements, it shows.
I've never run a test comparing the output of nanoclock vs uptime so I
have no empirical evidence, bu
Fwiw, we generally use SystemClock.uptimeMillis() in the platform. This is
monotonic and should not jump. It does not increment when the CPU is not
running, but typically this is actually fine or even good behavior. (For
example, it is used to time messages in handlers; if you post a delayed
mes
just a little followup.. thanks again Robert for encouraging me to use
nanoclock. I eventually got around to the conversion (I had been
invoking System.currentMillis in a thousand individual locations, of
course :-)
Anyway clock sync is better than ever, whether I am on Wifi/3gs or
lagging my poot
I admit I have pretty much given up on all the android string
formatting, as just being too painfully slow to use during the game
itself. I'm actually not using many views any more either, though
that's probably just an overreaction on my part. I basically have one
view (once the game starts) and
Have you checked all entried in logcat to see if you can see anything
odd? I had e.g. a loop where each iteration did something like:
Log.i(TAG, "Forecast expires at " +
aJavaDateInstanceRepresentingExpirationDateTime);
Each execution of that log statement took about 1-2 seconds since
date.toStri
FYI - Good that you're doing it that way. I have to recommend
switching to nanoTime, though. I've witnessed multi-second time
updates (from the system, not from me) while playing my games and it's
not pretty. I've switched everything to nanoTime / 100 since then
(which gives milliseconds) an
Thanks, Robert!
yes, don't worry, I wasn't doing that. :-)
Basically the server has the master time, each client has a dynamic
ping value to the server, which is also shared with the other clients
for suitable adjustments. at key moments a client notes the local
currentMillis() value matching a
Samsyn,
For multiplayer synchronization, you absolutely can not count on the
current time of either device. Here's one way to handle it:
Both host and client use System.nanoTime() / 100; That gives you
a fairly accurate counter to use.
Host sends snapshots with their current time. Client a
at the risk of answering my own question (with the to-be-expected
accuracy level associated with that), it appears that if I
* shut down eclipse
* open two CMD windows
* launch the emulators from command line
that I get much better peformance (5x better?), less 'time-slice-
theft' (top window sti
9 matches
Mail list logo