Difference between revisions of "Game Box Creation - Testing"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(moved and revised the Reloading the Modified Control File to the Database section)
Line 49: Line 49:
The date is 2013-07-15 09:26:48.
The date is 2013-07-15 09:26:48.
</pre>
</pre>
===The Actual Testing===
The most common errors in a game box result from minor mis-measurements in the pixel counts of the images. So these are what we look at here.
Start a game using your new game box, Does the board display correctly? If not check the horizontal and vertical size parameters in the "board" object. Make any needed corrections and/or adjustments. Then reload the game board and test again. Be sure to check that the hexes are proportioned correctly.
Do the same for the Stock Market.
Place the first tile on the tray on the board near the top left of the map. Does it line up with the containing hex?  . . . both horizontally and vertically? If not, then adjust the relevant start values in the "board" object. Next, if the tile seems to be clipped either horizontally or vertically, then adjust the relevant start values for the tile sheet object. Finally rotate the placed tile. If the tile seems to become more and more clipped as it is rotated, then adjust the xStep value for the tile sheet object. Repeat this procedure for a tile near the bottom of the tray to test the yStep value for the tile sheet object. Use a tile with six rotations.
You will have to go through this entire process for each tray object (both tile and token sheet types).
Finally, to test the xStep and yStep values for the "board" and "market" objects, repeat the first test one more time per object. Use any relevant tray and place the object near the bottom right of the map or market sheet. Does it line up with the containing hex?  . . . both horizontally and vertically? If not, then adjust the relevant step values in the "board" or "market" object.


===Reloading the Modified Control File to the Database===
===Reloading the Modified Control File to the Database===
While testing your game box you will probably have to modify the control file repeatedly. <br>
While testing your game box you will probably have to modify the control file repeatedly. <br>
Use the following procedure to reload the JSON control file into the database without changing any other part of the table row for the game box.
Each time you do so, you will have to reload the JSON control file into the database. The following script will make doing this simple.<br>
You can use this script to reload the JSON control file into the database without changing any other part of the table row for the game box.


====Setup the Reload Procedure====
====Setup the Reload Procedure====
'''You only have to do this once for a given game box.'''
Before you start testing you should setup the reload script, called addJSONtoBox. Do these steps to accomplish this:


* Start a terminal session.
* Note down the database_name, the user_name and the password for the BOARD18 database. They are in the php/config.php file.
* Start a terminal session on the database server.
* Enter the following command on the command line:  
* Enter the following command on the command line:  
   mysql -u board18 -pboard18 board18BOARD18/
   mysql -u ''user_name'' -p''password'' ''database_name''
If you did not use board18 for your user id (-u) or your password (-p) then substitute the correct values.
Do not leave a space between -p and the password!
* Enter mysql command:
* Enter mysql command:
   select box_id, bname from box;
   select box_id, bname from box;
Line 85: Line 74:
* '''Make note of the box id for your testBox.'''
* '''Make note of the box id for your testBox.'''
* Exit mysql.
* Exit mysql.
* Start an edit session on the utility/addJSONtoBox file.
* Find the line that reads '''mysql -u board18 -pboard18 <<QUERY_INPUT'''.
* If necessary, change the user id and the password to match the values in the php/config.php file.
* Find the line that reads '''use board18'''.
* If necessary, change board18 to the database name in the php/config.php file.
* Save the changed script file.


====Do an Actual Reload====
====Do an Actual Reload====
'''Do the following each time that you wish to reload your control file to the database.'''
Every time that you make a change to the control file, you should reload the changed file to the database before retesting. To do this:


* Start a terminal session.
* Start a terminal session on the web server.
* Go to the '''utility''' directory.
* Go to the '''utility''' directory.
* Enter the following command on the command line:
* Enter the following command on the command line:
   ./addJSONtoBox box_id control/testGame.json
   ./addJSONtoBox box_id control/testGame.json
Replace '''box_id''' with the value noted above and '''testGame.json''' with the name of your control file.
Replace '''box_id''' with the value that you got from MySQL and '''testGame.json''' with the name of your control file.
* You should see the name, version and author of your game box displayed if the reload was successful.
* You should see the name, version and author of your game box displayed if the reload was successful.
===The Actual Testing===
The most common errors in a game box result from minor mis-measurements in the pixel counts of the images. So these are what we look at here.
Start a game using your new game box, Does the board display correctly? If not check the horizontal and vertical size parameters in the "board" object. Make any needed corrections and/or adjustments. Then reload the game board and test again. Be sure to check that the hexes are proportioned correctly.
Do the same for the Stock Market.
Place the first tile on the tray on the board near the top left of the map. Does it line up with the containing hex?  . . . both horizontally and vertically? If not, then adjust the relevant start values in the "board" object. Next, if the tile seems to be clipped either horizontally or vertically, then adjust the relevant start values for the tile sheet object. Finally rotate the placed tile. If the tile seems to become more and more clipped as it is rotated, then adjust the xStep value for the tile sheet object. Repeat this procedure for a tile near the bottom of the tray to test the yStep value for the tile sheet object. Use a tile with six rotations.
You will have to go through this entire process for each tray object (both tile and token sheet types).
Finally, to test the xStep and yStep values for the "board" and "market" objects, repeat the first test one more time per object. Use any relevant tray and place the object near the bottom right of the map or market sheet. Does it line up with the containing hex?  . . . both horizontally and vertically? If not, then adjust the relevant step values in the "board" or "market" object.


==Other Ways To Get It Tested==
==Other Ways To Get It Tested==

Revision as of 10:17, 26 September 2013

Once you have a finished JSON control file and the associated image files for a game box, the next step is to test it.
But first you should pass the finished JSON file through a JSON validater like JSON lint.

Game Box Creation edit

"Do It Yourself" Testing

Here are the steps necessary to test the game box on your own PC before publishing it in any form. The setup for this procedure is not easy to do and requires a PC that can run an Apache server. If you can not or are not willing to do this, then skip to the Other Ways To Get It Tested section below.

The Testing Environment

To test a board18 game box you must have a working BOARD18 server. Your local PC or any remote PC to which you have shell access should be able to be used for this.
This is especially true if you are running a Linux distribution on that PC.

Installing Apache, MySql and PHP on your PC is a bit time consuming, but it can be done by following the detailed instructions available for various operating systems.

For Ubuntu LINUX see ApacheMySQLPHP. For Windows see Apache for Windows or WampServer.
There is much more documentation out there and it covers other operating systems too.

Creating The BOARD18 Test Site

Next you must create a BOARD18 site on your Apache server.
This help file was intended for people seting up remote servers, but it has all the information that you need to create a local test server.

At this point you should have a working instance of a BOARD18 web site. Test to make sure that it works before you try to use it to test your new game box. The easiest way to do this is to create a few dummy users and start a game using one of the existing game boxes. Make sure that you can drop tokens and tiles and that everything looks as it should. If it works then you can finally start testing your new game box.

Loading Your Game Box

This step requires you to use your shell (command line) access on the web server PC.

Loading The Game Box Images and Control File

On the command line do the following:

  • cd to the images directory on your web server. This directory should contain sub directories with names like 1826-REP01 and 1870-REP01.
  • Create a new sub directory for your game box in this directory. The name of this sub directory must be unique!
  • Load all of your gamebox image files into this sub directory.
  • cd to the utility directory on your web server. This directory should contain a sub directory called control.
  • Place your control file into this directory. The name of this control file must be unique!

Moving the Game Box Control File to the Database

To load the new game box control file into the database table, do the following (but replace boxname with the name of your control file):

  • Go to the utility directory on your web server.
  • Enter on the command line:
 
php loadGameBox.php control/boxname.json
  • You should now see an output that looks something like this:
 
Successfully created game box table row 1.
The box name is 1826.
The version is REP01.
The author is Rich Price.
The date is 2013-07-15 09:26:48.

Reloading the Modified Control File to the Database

While testing your game box you will probably have to modify the control file repeatedly.
Each time you do so, you will have to reload the JSON control file into the database. The following script will make doing this simple.
You can use this script to reload the JSON control file into the database without changing any other part of the table row for the game box.

Setup the Reload Procedure

Before you start testing you should setup the reload script, called addJSONtoBox. Do these steps to accomplish this:

  • Note down the database_name, the user_name and the password for the BOARD18 database. They are in the php/config.php file.
  • Start a terminal session on the database server.
  • Enter the following command on the command line:
 mysql -u user_name -ppassword database_name

Do not leave a space between -p and the password!

  • Enter mysql command:
 select box_id, bname from box;
  • You should see output similar to the following:
    +--------+---------+
    | box_id | bname   |
    +--------+---------+
    |      1 | testBox |
    +--------+---------+
    1 row in set (0.00 sec)
  • Make note of the box id for your testBox.
  • Exit mysql.
  • Start an edit session on the utility/addJSONtoBox file.
  • Find the line that reads mysql -u board18 -pboard18 <<QUERY_INPUT.
  • If necessary, change the user id and the password to match the values in the php/config.php file.
  • Find the line that reads use board18.
  • If necessary, change board18 to the database name in the php/config.php file.
  • Save the changed script file.

Do an Actual Reload

Every time that you make a change to the control file, you should reload the changed file to the database before retesting. To do this:

  • Start a terminal session on the web server.
  • Go to the utility directory.
  • Enter the following command on the command line:
 ./addJSONtoBox box_id control/testGame.json

Replace box_id with the value that you got from MySQL and testGame.json with the name of your control file.

  • You should see the name, version and author of your game box displayed if the reload was successful.

The Actual Testing

The most common errors in a game box result from minor mis-measurements in the pixel counts of the images. So these are what we look at here.

Start a game using your new game box, Does the board display correctly? If not check the horizontal and vertical size parameters in the "board" object. Make any needed corrections and/or adjustments. Then reload the game board and test again. Be sure to check that the hexes are proportioned correctly.

Do the same for the Stock Market.

Place the first tile on the tray on the board near the top left of the map. Does it line up with the containing hex? . . . both horizontally and vertically? If not, then adjust the relevant start values in the "board" object. Next, if the tile seems to be clipped either horizontally or vertically, then adjust the relevant start values for the tile sheet object. Finally rotate the placed tile. If the tile seems to become more and more clipped as it is rotated, then adjust the xStep value for the tile sheet object. Repeat this procedure for a tile near the bottom of the tray to test the yStep value for the tile sheet object. Use a tile with six rotations.

You will have to go through this entire process for each tray object (both tile and token sheet types).

Finally, to test the xStep and yStep values for the "board" and "market" objects, repeat the first test one more time per object. Use any relevant tray and place the object near the bottom right of the map or market sheet. Does it line up with the containing hex? . . . both horizontally and vertically? If not, then adjust the relevant step values in the "board" or "market" object.


Other Ways To Get It Tested

In an ideal world there would be an application called testGameBox which would do all of the above work for you.
But I currently have no such application. So I have decided to be that application.

If you want your shiny new game box tested for you, then:

  • Create a directory structure that looks like this:
 boxes
   control
   images
     gameBoxName

where gameBoxName is the name of your game box (for example: 1870-REP01).

  • Put your control file into the control directory.
  • Put all of your image files into the gameBoxName directory.
  • Zip up this directory structure.
  • Go to the BOARD18 Developer Forum.
  • Log in to the forum. Join if you're not already a member.
  • Create a new topic in the forum stating that you have created a new game box, the game it is for and that it is an untested game box.
  • Attach the game box zip file to this topic before posting it.

I will test the game box and report the results to your forum topic.