Search Unity

"Failsafe mode" is actually a bad feature.

Discussion in 'Unity Everyplay' started by N, Sep 10, 2015.

  1. N

    N

    Joined:
    Oct 30, 2009
    Posts:
    31
    Hey guys,

    Devices tested: MyTab11, Asus Nexus 7 2013

    If I'm initializing the Everyplay this way,

    Code (CSharp):
    1. void Start(){
    2.      Everyplay.ReadyForRecording += OnReadyForRecording;
    3. }
    4. public void OnReadyForRecording(bool enabled){
    5.      if(enabled) Everyplay.StartRecording();
    6. }
    it fails to initialize and eventually leads to "failsafe mode".

    Which totally kills the possibility of running the recording again, even thought
    the device (Nexus 7) is absolutely supported.

    Solution is simple - initialize it straight

    Code (CSharp):
    1. void Start(){
    2.      Everyplay.StartRecording();
    3. }
    All works like a charm, a lot of records were made.
    But I'm losing on delegates this way. If I understand correctly
    the ReadyForRecording event will always return false on Android?
    Anyway that's not the main question.

    What I'm interesting is - can we have the method of clearing Everyplay's cache?
    Or putting it on its defaults.

    Deleting the game and installing it again every time the failsafe doesn't like something
    isn't a solution at all.

    Thanks.
     
  2. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    108
    Hello @N,

    Thanks for reaching out!

    What you are actually doing is not Initializing, but instead controlling the recording.
    If you are using Unity, our Early Initializer functionality takes care of Initializing Everyplay (calling Everyplay.Initialize).

    Failsafe mode should only be triggered if your application crashes during Everyplay initialization. This is so that the application can function on the device even if the device is not completely compatible with Everyplay.

    ReadyForRecording event can return either false or true, depending on the device and the state of the application.
    In some cases it can also be fired even before you can attach the listener to it.
    This is why you should instead rely on Everyplay.IsRecordingSupported() boolean to get the state of recording capability on runtime.

    Unfortunately at the moment there is no way to clear the Everyplay cache manually. The failsafe file is stored in area that is only available to the application itself.

    Hope this answers your questions.

    Cheers,
    Simo
     
  3. N

    N

    Joined:
    Oct 30, 2009
    Posts:
    31
    Hey ullatussimo,

    Thanks for reaching me back.
    Yeah sorry, I of course meant recording control.
    But, I believe there is a bug with Failsafe then. The thing is, if I'm starting recording the way I mention,
    literally nothing happens. Game doesn't crash, either recording doesn't start. So I'm restarting
    the game and bam, that's it - we get a forever failsafe, which obviously doesn't allow to record
    anymore, ever. And that behavior was seeing on both devices.

    Alright, I'll be using IsRecordingSupported() from now on, thanks for the advice.

    And yeah I figured out that the cache is pretty much bind to app, and I really hope
    that you guys will add the possibility to clean it manually. Thought as of now
    it works like something that starts with "goo" and ends with "gle" in some cases,
    banning you without explanation why and without possibility to appeal.
     
  4. N

    N

    Joined:
    Oct 30, 2009
    Posts:
    31
    Hey Simo,

    Is it possible to initialize Everyplay manually in Unity?
    I'm trying to initialize it only if user pressed on the button to do so.
    To exclude the situations when the game crashes on startup and
    no matter if EP caused that or was it another reason - we can't
    use recording anymore.

    On Cocos manual initialization works, but when I try it in Unity
    Everyplay.Initialize() gives me:
    Well, obviously it's disabled in Editor, why else I would try to initialize it.

    I also tried to define EVERYPLAY_ANDROID in "Scripting Define Symbols",
    but on any change in editor, symbols just poof. Any hints?

    Also one word about Everyplay.IsRecordingSupported(). It returns true even though
    failsafe is flagged.

    Cheers.
     
  5. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    108
    Hello @N,

    We will be likely revising how the failsafe mechanism works in the future.

    If you wish to control the Everyplay Initialization manually on Unity projects, you should leave the platform enabled in Unity settings and instead head down to /Assets/Plugins/Everyplay/Scripts/EveryplayEarlyInitializer.cs and disable the Everyplay initialization call from there.

    The early initialization system was put in place to easen up the integration to Unity projects, but disabling it provides you with the additional control you may need.

    Hope this helps!

    Cheers,
    Simo
     
  6. N

    N

    Joined:
    Oct 30, 2009
    Posts:
    31
    Hey Simo,

    Just what I was looking for. And I'm sure you guys will come up
    with a solid solution for the failsafe, some day.

    Thank you!
    Cheers.