How to debug a game in Alpha?

Game development with Board Game Arena Studio
Post Reply
User avatar
GoDodyGo
Posts: 42
Joined: 14 August 2020, 07:30

How to debug a game in Alpha?

Post by GoDodyGo »

PHP: How can I see the server-side PHP log?
JS: Is it OK to add console.log back to the code so I can see what's going on?

If I cannot get these things, how to do debugging? The Alpha release works a little differently in Studio release (for some functions).
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: How to debug a game in Alpha?

Post by Tisaac »

GoDodyGo wrote: 22 November 2020, 03:43 The Alpha release works a little differently in Studio release (for some functions).
For which functions ? That's not supposed to be the case in general, the only difference being the js file is minified, which you can test on the studio in the control panel.
User avatar
GoDodyGo
Posts: 42
Joined: 14 August 2020, 07:30

Re: How to debug a game in Alpha?

Post by GoDodyGo »

Specifically there seems to be some issue with Safari browser. At one specific game operation, the PHP side checks for valid combinations of cards being submitted by the player. One failure I saw shows the PHP side rejecting the submission from the Safari player as invalid (it sends a message via notify), however the cards which were chosen are not invalid. The player reports the computer becomes briefly unresponsive, as if the script is pegging the CPU.

Other browsers have never shown this issue, in hundreds/thousands of this specific operation. Safari has not been tested as heavily as others. I need some time to get a better device to test more.

Summary: During a specific operation, the PHP side produced some message to the player which should never had occurred. The player's action was OK but PHP saw it as invalid.

So, I want to see my PHP logs to see what the PHP code is seeing and why it produced that message to that Player.

And I want to see console.log from the Safari browser, but I've had to remove it all, but I will now try to put it back in.

On Studio we had 1 Safari tester and didn't see this particular issue yet even going through this operation (but not tested many many times yet - I will do more).
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: How to debug a game in Alpha?

Post by Tisaac »

Why not using browserstack on studio to test Safari then ?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: How to debug a game in Alpha?

Post by Een »

On the JS side, you can use console.error if you want to display some specific traces in the console in prod. Only console.log are removed.

On the PHP side, you should use self::warn or self::error if you want to see the matching logs in production.
User avatar
GoDodyGo
Posts: 42
Joined: 14 August 2020, 07:30

Re: How to debug a game in Alpha?

Post by GoDodyGo »

Thanks for the reference to browserstack. I didn't know about them and will take a look.

When self::warn and self::error are used, where do the messages go? I don't see a way to see a log.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: How to debug a game in Alpha?

Post by Een »

You have a "see errors in production" block on your manage page (nb: needs to enable popups)
User avatar
GoDodyGo
Posts: 42
Joined: 14 August 2020, 07:30

Re: How to debug a game in Alpha?

Post by GoDodyGo »

OK I see that "see errors in production" button, thanks.

And Tisaac I was able to get a free 1 year open-source account from browserstack! So I should be able to debug the Safari issues directly. It took me a bit to get the proper license file put in so they'd grant me it, but got it done.

Thanks for the guidance?
Post Reply

Return to “Developers”