“Quiz Goose” Documentation by “Officine Pixel” v2.0


Title

Created: 02 June 2015
By: Lamberto Tedaldi (Officine Pixel)
Email: games@officinepixel.com

Thank you for purchasing our game. If you have any questions that are beyond the scope of this help file, please feel free to email via our user page contact form here. Thanks so much!


Table of Contents

  1. How to customize the game
  2. How to translate the game
  3. How to deploy the game on your site
  4. How to add/modify questions
  5. How to reskin the game
  6. How to Change sounds

“Customizing the Game”

There are many aspect of the game you can customize by editing the prefs.json file.
Open data/quizDB/prefs.json file in your favorite text editor.
Each text blok reppresents a feature of the game you can customize. Each text blocks have:
An internal reference that is the the all capital name.
the "value" string that is the only portion of text may change.
the "type" string telling the kind of value you are editing, it may be a text, a numer, a color, etc...
property block containing the desription of the feature and eventualli the range it may assume.

{
	"TITLE":{
		"value":"Quiz Goose Science",
		"type":"text",
		"properties":{
			"label":"Loading Screen Title",
			"description":"Text shown in loading screen",
			"group":"preferences"
		}
	},
	
	"CPU_SMARTNESS":{
		"value":"50",
		"type":"range",
		"properties":{
			"label":"CPU Smartness",
			"description":"This value is for setting the cpu player smartness. A value of 0 the cpu player never answers correctly to questions while with a value 0f 100 always it answers correctly. With a value of 50, it has 50% of chances answer correctly",
			"min":0,
			"max":100,
			"group":"preferences"
		}
	},
	
	"TIMER":{
		"value":10,
		"type":"number",
		"properties":{
			"label":"Answer timer (seconds)",
			"description":"The time for answer expressed in seconds. 0 = unlimited timer",
			"min":0,
			"max":9999,
			"group":"preferences"
		}
	},
	
	"OUT_OF_TIME":{
		"value":-2,
		"type":"number",
		"properties":{
			"label":"Out of time penality",
			"description":"This is the number of positions the player loses if he can't answer before the end of the answer timer.",
			"min":-99,
			"max":0,
			"group":"preferences"
		}
	},
	
	
	"WEBFONTS":{
		"value":"true",
		"type":"bool",
		"properties":{
			"label":"Enable Web Fonts",
			"description":"This enables the loading of desired font from Google. If disabled, the game will use system fonts.",
			"group":"fonts"
		}
	},

	"FONTFACE":{
		"value":"Modak::latin",
		"type":"webfont",
		"properties":{
			"label":"Font Face",
			"description":"This is the Google font family. Write here font name and charset. Visit https://www.google.com/fonts for choosing the font. Otherwise write here system font you wish to use.",
			"group":"fonts"
		}
	},
	
	"BOLD_FONT":{
		"value":"false",
		"type":"bool",
		"properties":{
			"label":"Font strong",
			"description":"This sets the font to bold.",
			"group":"fonts"
		}
	},
	
	"FONTSIZE":{
		"value":40,
		"type":"range",
		"properties":{
			"label":"Base Font Size",
			"description":"This is the average font size, adjust this value according the font you use. Each button will scale down font size in order of fitting text lenght.",
			"min":20,
			"max":75,
			"group":"fonts"
		}
	},
	
	
	"FONT_BORDER_TYPE":{
		"value":"stroke",
		"type":"select",
		"properties":{
			"label":"Font Border Type",
			"description":"Set the type of border effect around the text font.",
			"values":["stroke","shadow"],
			"group":"fonts"
		}
	},
	
	"FONT_BORDER_SIZE":{
		"value":5,
		"type":"range",
		"properties":{
			"label":"Font Border Size",
			"description":"This is the trickness of the font border.",
			"min":0,
			"max":10,
			"step":0.1,
			"group":"fonts"
		}
	},
	
	"FONT_COLOR":{
		"value":"#fff6d5",
		"type":"color",
		"properties":{
			"label":"Font Color",
			"description":"Color of text font",
			"group":"fonts"
		}
	},
	
	"FONT_BORDER_COLOR":{
		"value":"#000000",
		"type":"color",
		"properties":{
			"label":"Font Border Color",
			"description":"Color of text font border",
			"group":"fonts"
		}
	},
	
	
	"LEADERBOARD":{
		"value":"true",
		"type":"bool",
		"properties":{
			"label":"Leaderboard",
			"description":"Enables or disables leaderboard",
			"group":"preferences"
		}
	},
	
	"LEADERBOARD_URL":{
		"value":"http://www.ffx.it/games/quizGooseScience/leaderboard.php",
		"type":"url",
		"properties":{
			"label":"Leaderboard URL",
			"description":"the URL where is located the leaderboard php script",
			"group":"preferences"
		}
	},
	
	"MOREGAMESLINK":{
		"value":"http://www.ffx.it/",
		"type":"url",
		"properties":{
			"label":"More Games",
			"description":"Url for 'More Games' button",
			"group":"preferences"
		}
	},
	
	"AUTHOR_LINK":{
		"value":"true",
		"type":"bool",
		"properties":{
			"label":"Author credits",
			"description":"Enables or disables author credits in the How to Play page. You are allowed to turn it Off, but, you will receive a big thank you from us if you leave this option On.",
			"group":"sys"
		}
	},
	
	
	
	"P1_TXT_COLOR":{
		"value":"#a3e9ff",
		"type":"color",
		"properties":{
			"label":"Player 1 text color",
			"description":"Color of text for player 1 log",
			"group":"preferences"
		}
	},
	
	"P2_TXT_COLOR":{
		"value":"#a3ffa7",
		"type":"color",
		"properties":{
			"label":"Player 2 text color",
			"description":"color of text for player 2 log",
			"group":"preferences"
		}
	},
	
	"P3_TXT_COLOR":{
		"value":"#ffd4fa",
		"type":"color",
		"properties":{
			"label":"Player 3 text color",
			"description":"color of text for player 3 log",
			"group":"preferences"
		}
	},
	
	"P4_TXT_COLOR":{
		"value":"#fffda3",
		"type":"color",
		"properties":{
			"label":"Player 4 text color",
			"description":"color of text for player 4 log",
			"group":"preferences"
		}
	},
	
	"QUESTIONS_SOURCE":{
		"value":"JSON",
		"type":"select",
		"properties":{
			"label":"Questions source",
			"description":"it may be JSON or MYSQL questions source",
			"values":["JSON","MYSQL"],
			"group":"sys"
		}
	},
	
	"AUDIOSYSTEMS":{
		"value":"mp3,ogg",
		"type":"text",
		"properties":{
			"label":"Audiosystems",
			"description":"typically mp3,ogg for playing in every browser/device but if you plan distribute the game as executable wrapping it with NWjs only ogg is allowed",
			"group":"sys"
		}
	}
}

Go To Table of Contents

“Translating the Game”

You can change all the text of the game by editing the locale.json file.
Open data/quizDB/locale.json file in your favorite text editor.
Each text blok reppresents a text can customize inside the game you. Each text blocks have:
An internal reference that is the the all capital name.
the "value" string that is the only portion of text may change.
the "label" string that usually tell you the original meaning of text.
the "description" string helping you finding the placement of current text into the game screens.

{
	"SUBTITLE":{
		"value":"MAKER",
		"label":"Home Screen Subtitle",
		"description":"This is the sub-title shown in home screen under the game logo"
	},
	
	"PLAY":{
		"value":"Play",
		"label":"Play",
		"description":"Play button on Home Screen"
	},
	
	"MORE_GAMES":{
		"value":"More Games",
		"label":"More Games",
		"description":"More Games button on Home Screen"
	},
	
	"HOW_TO_PLAY":{
		"value":"How to Play",
		"label":"How to Play",
		"description":"How to Play button on Home Screen"
	},
	
	"LEADERBOARD":{
		"value":"Leaderboard",
		"label":"Leaderboard",
		"description":"Leaderboard button on Home Screen"
	},
	
	"HOME":{
		"value":"Home",
		"label":"Home",
		"description":"Home button shared on various Screens for back the user to the home screen"
	},
	
	"CONTINUE":{
		"value":"Continue",
		"label":"Continue",
		"description":"Continue button shared on various Screens"
	},
	
	"YES":{
		"value":"Yes",
		"label":"Yes",
		"description":"Yes button used in alerts"
	},
	
	"NO":{
		"value":"No",
		"label":"No",
		"description":"No button used in alerts"
	},
	
	"ALERT_RESUME":{
		"value":"Do you want to resume last play?",
		"label":"Do you want to resume last play?",
		"description":"Alert text asking player if continue playing interupded game."
	},
	
	"OK":{
		"value":"Ok",
		"label":"Ok",
		"description":"Ok button used in alerts"
	},
	
	"ALERT_INSERT":{
		"value":"Insert your name first",
		"label":"Insert your name first",
		"description":"Alert text asking player for insert its name before select avatar."
	},
	
	"HOWMANYPLAYERS_TEXT1":{
		"value":"Define how many players, including computer's players",
		"label":"Define how many players, including computer's players",
		"description":"How many players page text."
	},
	
	"HOWMANYPLAYERS_TEXT2":{
		"value":"Total number of players",
		"label":"Total number of players",
		"description":"How many players page text."
	},
	
	"HOWMANYPLAYERS_TEXT3":{
		"value":"How many of those are humans?",
		"label":"How many of those are humans?",
		"description":"How many players page text."
	},
	
	"INFO_TITLE":{
		"value":"HOW TO PLAY",
		"label":"HOW TO PLAY",
		"description":"How to Play page title."
	},
	
	"INFO_TEXT":{
		"value":"Choose how many players and insert name(s).\n\nYou can play against other humans or against computer.\n\nClick for rolling the dice when your turn, avatar will go forward the same steps the dice result.\n\nAnswer the question if your avatar stops in special cells.\n\nTry to arrive first to the end of the journey.",
		"label":"How to Play text",
		"description":"How to Play text"
	},
	
	"LEADERBOARD_TITLE":{
		"value":"Leaderboard",
		"label":"Leaderboard",
		"description":"Leaderboard page title."
	},
	
	"LEADERBOARD_TEXT":{
		"value":"$1 won in $2 turns",
		"label":"$1 won in $2 turns",
		"description":"This is the text written on each line on leaderboard screen. $1 will be replaced with player's name and $2 with number of turns, so, don't change them."
	},

	"LEADERBOARD_NORECORD":{
		"value":"No records yet",
		"label":"No records yet",
		"description":"This is what is written when thare aren't any record on leaderboard yet."
	},
	
	"INPUT_TITLE":{
		"value":"Insert your name...",
		"label":"insert your name...",
		"description":"Input name screen title."
	},
	
	"INPUT_TEXT":{
		"value":"...and select your avatar!",
		"label":"...and select your avatar",
		"description":"Input name screen, select character text."
	},

	"INPUT_PLAYER":{
		"value":"Player",
		"label":"Player",
		"description":"The word player shown in Input name screen, at the left of input field."
	},
	
	"VICTORY_TITLE":{
		"value":"... and the winner is:",
		"label":"... and the winner is:",
		"description":"Title for the victroy screen."
	},
	
	"STORAGE_ALERT":{
		"value":"May be you are in private browsing I can't save game progress",
		"label":"May be you are in private browsing I can't save game progress",
		"description":"Alert shown when the game detects local sorage isn't available."
	},
	
	"QUIT_ALERT":{
		"value":"Do you really want to quit?",
		"label":"Do you really want to quit?",
		"description":"Alert shown when the player clicks on quit button. Quit button is not present by default: you must edit home tmx file and home image for using it. Quit button may be usefull if you wrap the game as desktop executable."
	},
	
	"QUIT":{
		"value":"Quit",
		"label":"Quit",
		"description":"Text on quit button. Quit button is not present by default: you must edit home tmx file and home image for using it. Quit button may be usefull if you wrap the game as desktop executable."
	},
	
	"CLICK_TO_ROLL":{
		"value":"Click to roll",
		"label":"Click to roll",
		"description":"Text shown on dice when waits for user input."
	},
	
	"LOG_MOVES_SINGULAR":{
		"value":"Round $1 : $2 position for $3",
		"label":"Round $1 : $2 position for $3",
		"description":"Text log for singular position (-1, +1). $1 is the round number, $2 is the position player moves, S3 is the player name."
	},

	"LOG_MOVES_PLURAL":{
		"value":"Round $1 : $2 positions for $3",
		"label":"Round $1 : $2 positions for $3",
		"description":"Text log for plurals position. $1 is the round number, $2 is the positions player moves, S3 is the player name."
	},
	
	"LOG_FREEZE":{
		"value":"Round $1 : $2 miss a turn",
		"label":"Round $1 : $2 miss a turn",
		"description":"Text log when player miss a turn because frozen. $1 is the round number, $2 is the player name."
	},
	
	"LOG_UP_TO":{
		"value":"Round $1 : It's up to $2",
		"label":"Round $1 : $2 miss a turn",
		"description":"Text log when player begins turn. $1 is the round number, $2 is the player name."
	},
	
	"LOG_MOVES_BY_SINGULAR":{
		"value":"Round $1 : $2 moves by $3 position",
		"label":"Round $1 : $2 moves by $3 position",
		"description":"Text log when player moves one position. $1 is the round number, $2 is the player name, $3 in position number."
	},
	
	"LOG_MOVES_BY_PLURAL":{
		"value":"Round $1 : $2 moves by $3 positions",
		"label":"Round $1 : $2 moves by $3 positions",
		"description":"Text log when player moves more than one position. $1 is the round number, $2 is the player name, $3 in positions number."
	},
	
	"LOG_BOX_ADVANCES_BY_2":{
		"value":"Round $1 : $2 advances by 2 positions",
		"label":"Round $1 : $2 advances by 2 positions",
		"description":"Text log when player advances by 2 positions the because special box. $1 is the round number, $2 is the player name."
	},
	
	"LOG_BOX_ADVANCES_BY_1":{
		"value":"Round $1 : $2 advances by 1 positions",
		"label":"Round $1 : $2 advances by 1 positions",
		"description":"Text log when player advances by 1 position the because special box. $1 is the round number, $2 is the player name."
	},
	
	"LOG_BOX_BACKS_BY_1":{
		"value":"Round $1 : $2 backs by 1 positions",
		"label":"Round $1 : $2 backs by 1 positions",
		"description":"Text log when player backs by 1 position the because special box. $1 is the round number, $2 is the player name."
	},
	
	"LOG_BOX_BACKS_BY_2":{
		"value":"Round $1 : $2 backs by 2 positions",
		"label":"Round $1 : $2 backs by 2 positions",
		"description":"Text log when player backs by 2 position the because special box. $1 is the round number, $2 is the player name."
	},
	
	"LOG_BOX_FREEZE":{
		"value":"Round $1 : $2 freeze one turn",
		"label":"Round $1 : $2 freeze one turn",
		"description":"Text log when player freeze because the special box. $1 is the round number, $2 is the player name."
	},
	
	"LOG_BOX_REPEAT":{
		"value":"Round $1 : $2 roll the dice again",
		"label":"Round $1 : $2 roll the dice again",
		"description":"Text log when player roll the dice again because the special box. $1 is the round number, $2 is the player name."
	},
	
	"LOG_BOX_QUIZ":{
		"value":"Round $1 : Quiz, $2 answers the question",
		"label":"Round $1 : Quiz, $2 answers the question",
		"description":"Text log when player roll the dice again because the special box. $1 is the round number, $2 is the player name."
	},
	
	"LOG_WINS":{
		"value":"$1 WINS!!!",
		"label":"$1 WINS!!!",
		"description":"Text log when player wins $1 is the player name."
	},
	
	"QUESTION_TIMER":{
		"value":"Remaining Time: $1 sec.",
		"label":"Remaining Time: $1 sec.",
		"description":"This is the text of the time on the question windows. $1 is the number of remaining seconds."
	}
	
}

Go To Table of Contents




“Deploying the Game”

Deploying of the game is very easy, you have only to copy all files on your server.
Let's suppose you wish to deploy the game on www.mydomain.com/quizGoose/, so, copy all files inside /quizGoose folder inside your server using your favorite FTP client.
That's all, now you should be able to play the game from the URL.

Saving leaderboard on your server

If you wish to enable leaderboard on your server, you need a Linux server supporting PHP, that is the most common kind of hosting servers you find on the Internet.
If you server meet the requirements you have to change some lines on index file.

Open data/quizDB/prefs.json with your favored text editor and Change the parameter at line 138 to true:

	"LEADERBOARD":{
		"value":"true",
		"type":"bool",
		"properties":{
			"label":"Leaderboard",
			"description":"Enables or disables leaderboard",
			"group":"preferences"
		}
	},

Fill the URL where the leaderboard php script is located at line 148
	"LEADERBOARD_URL":{
		"value":"http://www.mydomain.com/quizGoose/leaderboard.php",
		"type":"url",
		"properties":{
			"label":"Leaderboard URL",
			"description":"the URL where is located the leaderboard php script",
			"group":"preferences"
		}
	},

With your FTP client select the leaderboard folder and give it the write permissions (typically 777).

That's all, now you should be able to play the game from the URL and saving the winner name to the leaderboard.


By default scores are reset each day, if you wish to change this behavior open the file leaderboard.php and scroll down to line 55 that is:

$hiscore=@file("scores/".$year.$month.$mday);
you can modify this way:
$hiscore=@file("scores/".$year.$month);
and you get the score resetting every month.
$hiscore=@file("scores/".$year);
you will get the score reset every year


Go To Table of Contents




“Add/modify Questions”

Question and answers may be stored into a json file on server disc or into a mysql database. QUESTIONS_SOURCE parameter you find into index.html file indicate what source the system will use.

JSON file

Question and answers are stored into a json file named questions.json stored inside the data/quizDB folder.
Here a sample:

[
	{
		"question": "What is Deoxyribonucleic acid commonly referred to as?",
		"image":"data/quizImg/biology.png",
		"answers": [
						{"answer":"DAC", "score":"-2"},
						{"answer":"ACD", "score":"-2"},
						{"answer":"DNA", "score":"2"}
					]
	},
	
	{
		"question": "What is Ribonucleic acid commonly referred to as?",
		"image":"data/quizImg/biology.png",
		"answers": [
						{"answer":"RNA", "score":"2"},
						{"answer":"RAC", "score":"-2"},
						{"answer":"ACR", "score":"-2"}
					]
	},
	.
	.
	.
	and so on
"question" field stores the question text.
"image" field stores the path of the image associated to that question, if no image path is set the text of the question will be centered into the blank space.
Just below "answers" groups the three answers. Don't mind about the order, the game will randomize each time it will use them.
Each answer is composed by the "answer" field that store the answer text and the "score" field that define the how many steps the player gains choosing it. Right answers should have positive values, while wrong answers should have negatives ones.

MYSQL database

You have to setup a MYSQL database using the tools available on your server, so refer to the documentation your provider gave you.
Once you created the database assign to is a user and a password and import the data from the file quiz.sql located into the data/quizDB folder.
Open file data/quizDB/config.php and fill fields matching database values.
The database have one table for storing questions and its image, one table for storing the answers.

Questions table is made by fields: Answers table is made by fields:

Go To Table of Contents




“Reskinning the Game”

You can change the appearance of the game in all its aspects by substituting the image assets. Image asets are located in the data/img/ folder and they have png extension.
For doing so, you may use your favorite image editing software or vector graphics software, if you don't have any, we warmly encourage you to use GIMP, if you prefer working with pixels, or Inkscape if you prefer working with vectors. Both are free and open source software which running on Windows, Linux, OSX.
The game comes with graphic vector sources files, so, if you wish starting from modifying existing graphic you should use Inkscape for doing that. Graphic source files are located in the assets_source folder and they have .svg extension except for the dice graphic that is done with the Blender 3D software and the file has the .blend extension.

Go To Table of Contents

“Changing Sounds Effects”


Each sound needs to be stored in 2 different file formats: mp3 and ogg, this way the game engine will load and use the right format according to the platform it's running upon.
If you are in trouble creating your new sound effects, give a try to those free programs: sfxr or Bfxr When you have generated the sound effects you like, you can edit, mix and convert them from wav to mp3 and ogg by using the free and open source software Audacity.

GUI and in-game sounds are stored in data/sfx/ folder.

Go To Table of Contents




Once again, thank you so much for purchasing this game. As I said at the beginning, I'd be glad to help you if you have any questions relating to this game. No guarantees, but I'll do my best to assist.
If you need, we can customize Quiz Goose for you! Costs vary by the kind of customization, so, contact us for inquiring.

The staff of Officine Pixel