Message-ID: <4F6A43B0.8070303 at ghdigital.com>
Content-Type: text/plain; charset=ISO-8859-1
I don’t think that behavior would be considered appropriate on iOS or
Android, users would complain that they just switched away to check their
email and go back and it’s back to a checkpoint much
earlier.
The saving of exact current state is an expected feature.
A good example would be a game with checkpoints while progressing
through it. In this case there is no need to save the state of the game
between checkpoints, because it was already saved at a checkpoint. When
such game is terminated and ran again the progress starts from the last
saved checkpoint.
regards,
Piotr
Message-ID: <4F6B24F1.1090302 at charter.net>
Content-Type: text/plain; charset=“ISO-8859-1”; format=flowed
Piotr wrote:
Don’t do that! If I’m playing your game, and I’m halfway to the next
checkpoint, and I get a phone call, I don’t want to get back to the game
and find out I’ve lost a couple minutes of progress! That’s the easiest
way to get a lot of 2 star reviews 
BTW, thanks for the work on the patch. Hopefully we can convince the
powers that be to put it in the repo.
[>] Brian
A good example would be a game with checkpoints while progressing
through it. In this case there is no need to save the state of the game
between checkpoints, because it was already saved at a checkpoint. When
such game is terminated and ran again the progress starts from the last
saved checkpoint.
A pure check-point system may normally be a bad idea (exception:
Minesweeper; slow-enough state change that you could justify using
each click that changes something as a checkpoint), but it could
potentially make it quicker to save your state, since you would only
need to save the changes instead of the entirety of the current level.> Date: Wed, 21 Mar 2012 14:10:08 -0700
From: Forest Hale
To: sdl at lists.libsdl.org
Subject: Re: [SDL] iOS MultiTasking and CallBacks
On 03/21/2012 11:16 AM, sdl at union.pl wrote:
Date: Thu, 22 Mar 2012 09:11:13 -0400
From: Brian Barnes
To: sdl at lists.libsdl.org
Subject: Re: [SDL] iOS MultiTasking and CallBacks
Date: Thu, 22 Mar 2012 09:22:34 -0400
From: Brian Barnes
To: sdl at lists.libsdl.org
Subject: [SDL] Bug: UIKit (iOS) version should NOT be calling Pump
Events (iOS Multitasking related)
Message-ID: <4F6B279A.1090409 at charter.net>
Content-Type: text/plain; charset=“ISO-8859-1”; format=flowed
While we are back on this subject, here’s a problem that hopefully we
can work around.
If we get in the callback mechanism, the biggest problem with it is the
callbacks can interrupt your code at bizarre times. If it’s not
predictable, it’s nearly impossible to deal with.
The only time you can get a callback is if you give up control to a OS
level API, and I think (it’s so very hard to track this and I’m not
getting any answers in the cocoa list) it only happens when you hit the
CFRunLoopRunInMode in SDL_uikitevents.m. This makes sense, but I
can’t prove it conclusively.
It’s worth noting that any OS which has preemptive multi-threading
could potentially stomp all over your callback prediction by pushing
the call to the callback directly onto the stack before giving the
processor back to your program’s registered callback location, instead
of giving it back to the location that was executing when the thread
was preempted (yes, OSes that want to CAN actually do this with modern
hardware). You’d wind up with the location of the callbacks being
essentially completely unpredictable, due to the fact that they get
issued in response to outside events, during time that your program
doesn’t experience.
Not that I’m saying that iOS currently does this (in fact, I don’t
think it’s very common at all outside of *nix signal handlers, &
low-level hardware stuff), but the ability to archive your run-state
for later restoration (app-level persistence, essentially) really is
what Apple seems to be expecting, and they could change their
implementation without warning. Also, you could probably use most of
the same code for/from game-saves, so you’ll be doing much of the same
work regardless.
Date: Thu, 22 Mar 2012 06:26:21 -0700
From: Forest Hale
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Bug: UIKit (iOS) version should NOT be calling Pump
Events (iOS Multitasking related)
Message-ID: <4F6B287D.5080805 at ghdigital.com>
Content-Type: text/plain; charset=ISO-8859-1
I think you’re on to something here - we should figure out exactly what
circumstances can cause a callback, and it may be perfectly reasonable to
handle it as an event if we can conclusively show that
only PumpEvents produces the callbacks.
Creating an event that the app can use to display some info to the
user might be a good reason to issue events for callbacks, but the OS
will probably be expecting a response from that callback, so
automatically longjumping out of the callback is a really bad idea.
Date: Thu, 22 Mar 2012 12:09:38 -0300
From: Gabriel Jacobo
To: SDL Development List
Subject: Re: [SDL] Bug: UIKit (iOS) version should NOT be calling Pump
Message-ID:
<CAKDfesmNGhA6CirKjkFtozxP64zMc5xx+WmDvnUALD44boubow at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”
2012/3/22 Brian Barnes
Assumptions I’m making:
- A SDL iOS app is fundamentally single threaded.
Not necassarily.
- By the mere fact of being single threaded, callbacks will only happen at
some point when you relinquish control to the iOS system (as it seems to be
the case from what you said)
I believe that to be the case with the current versions of iOS, but
Apple can (quite happily) change that in some future version, breaking
anything that depends on it. Look up preemptive multithreading, and
think a bit about how the preemption works, and how much access the
memory manager can allow the OS to have over a thread’s memory while
it isn’t running.
In essence, a standardized way to hook into these callbacks from SDL
really is the correct way to deal with them. It could also apply to
signals on *nix systems, though I don’t think anyone’s worried about
it there.