Testability of games

Game development with Board Game Arena Studio
Post Reply
demiurgo84
Posts: 2
Joined: 14 January 2017, 19:49

Testability of games

Post by demiurgo84 »

Hi all,

I'm working on a game, and I'm a bit confused about the flow people here use when they develop theirs games.

I discovered the GitHub project "bga-workbench" and it seems it can be useful to test the php part of the game, but I want to understand if anyone here uses any different test method.

What's the best way to have a E2E test environment for our game? I'm not asking to put a full featured build system behind BGA, but I want to be sure that my game will work now and if I do any change I don't want to retest it in all the variants.

Anyone tried any solution other that "bga-workbench"?

Thanks,
Carlo
vincentt
Posts: 247
Joined: 01 September 2017, 17:25

Re: Testability of games

Post by vincentt »

Hi,

I am not sure what you are wishing for. I do not see how GitHub is helping you validate your PHP.
What I do is :
_ use of a GUI that is directly connected to the SFTP folder
_ GUI that has validation of syntax (at least)
_ For the JS, I load the game and try the action
_ For the PHP, I load the page to see if I do not have any syntax error, and I try my action. You can also test the PHP function through the chat where you can directly call the PHP functions

I begged Souris to provide a VM or something to work on it offline, but he said no :p

Cheers
User avatar
RicardoRix
Posts: 2117
Joined: 29 April 2012, 23:43

Re: Testability of games

Post by RicardoRix »

As vincentt suggests, auto SFTP with WinSCP and start a game in BGA studio, then a lot of F5's and reading the error messages to get info with line numbers. It seems like a strange setup because I am used to compiled languages, but it actually works very well and the turn around time is minimal, it's only when you get an error with not much info to help.
but this page has helped: http://en.doc.boardgamearena.com/Troubleshooting

In my states and game.php code I have made minor changes to temporarily set the state to go straight to the state I'm developing.

For PHP, you may need to use the die("ok") to stop the function from completing and going on to the next stage (like writing to the DB) until you're happy.

For JS add the line 'debugger;' and then open the F12 chrome console.

Contrary to the debugging wiki help, I find JS debugging easier due to the break-point and step through code and seeing all the variables, whereas PHP is all manual var_dumps or logs to see how things are going. For a long time once I thought that my php code was doing wild things like jumping backwards and it wasn't until I realised I was inside a large loop did the penny drop - stepping through code at that point would have been much, much better.
vincentt
Posts: 247
Joined: 01 September 2017, 17:25

Re: Testability of games

Post by vincentt »

Hum nice one Ricardo :)
For debugging PHP, I do not use a lot of var_dump but more feException. It has the good thing that it will reject everything and I have the result directly in the studio as a notification. Like that I can directly update, try again. I know that this is not the most efficient way, but I am used to it now :)

Vincent
demiurgo84
Posts: 2
Joined: 14 January 2017, 19:49

Re: Testability of games

Post by demiurgo84 »

Sorry, maybe I didn't explain well my point :(

I know how to test / debug php or javascript, and I can test every change I do by myself.

My question is about the automatic tests of your game (https://en.wikipedia.org/wiki/Test_automation); now I'm trying to use webdriver.io with a headless chrome to launch a new game, and test multiple path inside my game. Am I the first one wanting to have an automated test system in place?

Thanks,
Carlo
vincentt
Posts: 247
Joined: 01 September 2017, 17:25

Re: Testability of games

Post by vincentt »

Hum that's the rolls royce!
If you manage to do something I am interested.
Maybe Een has an idea

Vincent
User avatar
Een
Posts: 3854
Joined: 16 June 2010, 19:52

Re: Testability of games

Post by Een »

demiurgo84 wrote: 14 April 2019, 22:02 My question is about the automatic tests of your game (https://en.wikipedia.org/wiki/Test_automation); now I'm trying to use webdriver.io with a headless chrome to launch a new game, and test multiple path inside my game. Am I the first one wanting to have an automated test system in place?
Hi!
Some developers wrote tests for the php side, but I don't know of a studio project where there has been extensive automatic testing.
Your feedback on experimenting this is welcome :)
User avatar
Sydnique
Posts: 9
Joined: 26 July 2020, 21:38

Re: Testability of games

Post by Sydnique »

I would also like to use automated tests during development, and I am a php and js noob.

However, I found a bga project which seems to do exactly that:

https://github.com/Lucas-C/tablut
Post Reply

Return to “Developers”