playMaker

Author Topic: Android - Debug Log not reporting  (Read 457 times)

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Android - Debug Log not reporting
« on: March 23, 2019, 06:04:31 PM »
Playmaker 1.9.0.p12
tested on Unity 2017 4.1, 4.3, 4.5

When using the Debug Log action with it set to Send to Unity log checked, it appears it is not on Android builds.  I have used several mobile console (android) log addons:

-Lunar Mobile Console
-SRDebugger
-Mobile Console
-Log Viewer

None of them are seeing it.  So I made my own debug log script and called it via a FSM and it shows up in the mobile console viewers. 
« Last Edit: March 23, 2019, 06:08:52 PM by PlaymakerNOOB »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Android - Debug Log not reporting
« Reply #1 on: March 23, 2019, 09:19:02 PM »
For performance reasons, internal FSM logging is disabled in builds, unfortunately, this was also blocking the debug actions. I've attached a fix.

Please backup the file PlayMaker/Actions/ActionHelpers.cs then import the attached package. This should fix debug actions logging in builds.

Let me know if it works for you and I'll include the fix in the next update.


PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: Android - Debug Log not reporting
« Reply #2 on: March 25, 2019, 04:59:40 AM »
That did it.. thanks!

I needed the action to help troubleshoot why playerprefs are not saving/loading properly in my build, but work fine in the editor.  Im still not closer to understanding it so im wondering if you have an android device available and I can condense the project down to the offending section for you to look at?
--edit--
ignore the request, added debuglog but forgot to check send to unity. I can see why I have an issue.  Thanks!!
« Last Edit: March 25, 2019, 05:38:50 AM by PlaymakerNOOB »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4522
    • View Profile
    • jinxtergames
Re: Android - Debug Log not reporting
« Reply #3 on: March 26, 2019, 02:19:07 AM »
Hi.
Off Topic.

@ PlaymakerNOOB

I would not recommend to save sensitive variables with playerprefs tho, as the are very easy to hack.

Easy save is until now still one of the best solutions and worth the purchase.
I have it a few years now and i use it in almost all my projects.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: Android - Debug Log not reporting
« Reply #4 on: March 26, 2019, 06:30:43 AM »
Yeah, I actually got ES3 to save encrypted PlayerPrefs.  But I had 4 bugs show up all at once which really caused me a headache.

1) ES3 wouldnt save/load without a cryptography error
2) When I fixed the above, then ES3 would crash unity upon building (took many hours before the Unity error log actually showed an error related to ES3 so I could ask the dev for help)
3) PlayerPrefs not saving
4) Using Playmakers Debuglog action didnt work on builds, so I couldnt troubleshoot properly why PlayerPrefs were not saving on mobile as I couldnt figure out where things were failing. 

So I removed ES3 and that cleared up #1 and #2, worked with ES3 creator to figure out why.. we did, it works, but just to be safe I removed ES3 again to make sure that its not related to issue #3 or #4.  Then I went to debugging and that figured out why #3 wasnt triggering after Alex gave me the updated file.  I just havent got around to putting ES3 back yet.

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Android - Debug Log not reporting
« Reply #5 on: September 23, 2019, 07:03:35 AM »
This is an old thread but I'm curious about PLnnob's chocie regarding Easy Save.
Have you gone back to using Easy Save 2? It's included in the package after all and actions are still available.

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: Android - Debug Log not reporting
« Reply #6 on: September 27, 2019, 11:41:57 AM »
At that time, I was pretty frustrated with ES3 in general and had no interest in dealing with ES2 if ES3 was giving me that much trouble.  Its been awhile but I eventually worked through the issues since I had to just put debug logs on everything to figure out where it was failing in device builds.  Also used SRDDebugger to provide a console log on device.  I dont remember now where the problem was.

Since then, i've had no issues and its worked great.

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Android - Debug Log not reporting
« Reply #7 on: September 30, 2019, 03:11:23 AM »
Thx.
SRDDebugger looks mighty nice. Especially the pin option.
It's really something that by default, in a WYSIWYG engine, there's no solution to save values tweaked at runtime.
However, I wonder how easy it would be to expose variables to make them accessible in-game through the plugin's panels, when using Playmaker. Have you done that through code only or did you manage to pull some simple actions?
Or was it with Script Control actions?

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: Android - Debug Log not reporting
« Reply #8 on: September 30, 2019, 06:02:24 AM »
SRD has limited playmaker options.  I've included a screenshot.  I thought they would have actions to expose those variables in the panel when I bought it, so I could change things, but no such luck.  Adding playmaker support to SRD looks rather straightforward I think.

https://www.stompyrobot.uk/tools/srdebugger/documentation/#options_tab

In its current state, I am using it for the console logger and bug reporter for my mobile game.

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Android - Debug Log not reporting
« Reply #9 on: October 02, 2019, 02:23:27 AM »
Ok thx, I see.
I try to guess what the things does but since you obviously cannot access Unity's Inspector panel inside your game, on your device, something special has to be done for the tweakable parameters to be saved at runtime.
If in your code you had a float set to 2 at init and you decide it would be better to be set at 2.1, essentially it's modifying the code that's on the device and then send back the new code into Unity; or it directly applies the change into Unity—all of this logically meaning that your test device is attached to your computer at all time anyway—and to me this almost sounds like the code would have to be prepared ahead, so these variables actually appear in the SRD's panel (https://assetstorev1-prd-cdn.unity3d.com/package-screenshot/dd3ac9fb-c25f-46ae-8f20-4160bb5b1a0b_scaled.jpg).

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Android - Debug Log not reporting
« Reply #10 on: October 02, 2019, 02:27:37 AM »
I just finished reading some parts of the documentation.

I see that you need to inject the SROptions code bit into the lines involving the variables you seek to modify on the run. My understanding of all of this is rudimentary and it's possible Playmaker does not reach that far into the code.
However, it would be fantastic if it were a feature of Playmaker. :)
Imagine, all you'd have to do to expose the variable into the in-game PM's Option tab would be to tick a box next to the var in the Playmaker Editor: Variables tab.
A Wizard might be necessary to parse the code just before building, for all references in order to add the, say, "PMOptions." part just before the variables you wish to expose and tweak in-game.
Most of the FsmVars are managed (edit: I mean the relatively same types, aside from the fact that FsmVars are only slightly different so as to work within the Playmaker environment):

Quote
Properties of the following types are supported: Boolean, Enum, int, uint, short, ushort, byte, sbyte, float, double, and string.

They also have option that's more dynamic and it might be the solution here,

Code: [Select]
// Simplified example - it is a good idea to handle cases where MyComponent is not found.
public float MyCustomProperty {
get { return GameObject.FindObjectOfType<MyComponent>().SomeField; }
set { GameObject.FindObjectOfType<MyComponent>().SomeField = value; }
}

because they say:

Quote
#2 is useful when you wish to affect code that you do not control, for example a library contained in a .dll file.

Maybe PM staff could get in touch with the publisher of SRDebug and see if something can be done here?
« Last Edit: October 03, 2019, 01:23:41 AM by Broken Stylus »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14483
  • Official Playmaker Support
    • View Profile
Re: Android - Debug Log not reporting
« Reply #11 on: October 02, 2019, 11:46:35 PM »
hi,

 it seems they already support PlayMaker: "Control SRDebugger from Playmaker state machines."

Have you contacted the author and asked if they would be willing to provide support for fsmvariables?

Bye,

 Jean

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Android - Debug Log not reporting
« Reply #12 on: October 03, 2019, 01:37:16 AM »
I think they only mean you can open the Debug panel, based on the screenshot taken by pnoob. It's different form the Options tab, which is the juicy part of the plugin unfortunately not reachable via Playmaker.

https://www.stompyrobot.uk/tools/srdebugger/updates/#updates

Quote
1.4.0 (21/Sep/15)

(EXPERIMENTAL) Added PlayMaker actions package (Open bug report sheet, Open/Close debug panel, Dock/Undock Console/Profiler, Enable/Disable trigger, etc).

Their last update was Oct 23, 2018.
However, they may still be active as they had a game in WIP state, called Nova.

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: Android - Debug Log not reporting
« Reply #13 on: October 10, 2019, 08:46:35 AM »
@Jean and @Stylus

Yeah, I purchased because I thought I could control variables directly from their options menu, but you cannot. 

I'd email them about it, but just wanting to know first if somebody like Jean or DJ will be willing to help them out if they have trouble so I can include the offer of help in the first message.

They can also be reached at hte bottom of this link:
 https://stompyrobot.uk/tools/srdebugger/documentation/#support

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14483
  • Official Playmaker Support
    • View Profile
Re: Android - Debug Log not reporting
« Reply #14 on: October 10, 2019, 11:24:56 PM »
hi,

 yes, I'll be willing to help out on this. Cc me when you reach them out, ( my email is available if you pm me and then choose to send via mail)

Bye,

 Jean