Creating Your Own MEGG Game

This document is in two parts.
1. MEGG Game Overview
2. Building your own MEGG game

1. MEGG Game Overview

Question Banks

MEGG games are wrapped around banks of multiple choice questions.
The multiple choice questions are based on topics of your choice.

Questions are drawn at random from the question bank.
It is therefore desirable to have at least 50 questions in a bank of questions.

Players improve their position in the game by either
- answering questions and/or
- interacting with other players.

Player Interactions

You name the type of interaction between players.
For example players may 'attack' or 'race' or 'infect' other players.

MEGG Games use four game Elements.
The terms Element1-4 are generic you choose the name for each element.

For example, in BattleMaster the names of the Elements are as follows
Element 1 is 'Gold'
Element 2 is 'Men'
Element 3 is 'Skills'
Element 4 is 'Weapons'

The Elements have the following attributes

Element1 - is a unit of currency. It is used as the measure of the player's success.
A typical Element 1 would be 'Gold' or 'Space Credits'.
It is won or lost when interacting with other players.
For example, when playing BattleMaster you may lose 'Gold' if you are unsuccessful in defeating another player in Battle.
Element2 - you can purchase upgrades to this using Element 1
- values range from 1 to as many as you like
for example - more men, more spaceship shields etc
Element3 - you can purchase upgrades to this using Element 1
- allows four possible values
for example - Novice, Professional, Expert, Master
Element4 - you can purchase upgrades to this using Element 1
- allows five possible values
for example - Sword, Bow, Cavalry, Musket, Rifle

The Effect of these Elements on Game play.
The Elements are used when calculating the result of one player interacting another player.
Players strength =Element2*Element3*Element4
The two players strengths are compared and the winner then acquires Element 1 (gold, spacecredits or whatever from the other player)

2. Building your own MEGG game

'Skinning' MEGG to make your Game

Warning
This document assumes you are familar with setting up the directory structure on a web server and setting file permissions.

If you do not fall into the above category I can help you build and host your game - contact me for assistance
There are three steps to making your Game with the MEGG engine

2.1 Create the Skin files using an online form.
2.2 Create the directory structure for your game, add the files and permissions.
2.3 Add your Question bank

2.1. Create the Skin
A MEGG game's appearance is controlled by the following files
1. skin.pl- controls the text associated with the game title, the menus and text of the game.
2. engagement.css -engagement.css controls the colour schemes, images used etc.
3 Add the three image files you want

Create Game.html, skin.pl and engagement.css
Megg Maker is an online form that will build the files skin.pl and stylesheet and game.html for you.

The skin file must be named, skin.pl and be stored in the directory public_html/cgi-bin/yourgame/

The stylesheet will be stored in your games main directory, public_html/yourgame/engagement.css.
If you are proficient with stylesheets you can edit them.

The html file can be named anything with an html extension, for example, game.html, it must be stored in the directory public_html/yourgame/

Add Your Images
Load your desired images into the new images directory,public_html/yourgame/images, with the names -

menu.png for the image above the menu
background.gif - for the main tiled background image (optional)
main.png - for the small untiled background image which acts as the game logo (optional)

Images should be approximately the same dimensions as the originals

2.2 Create Directory Structure
To create a new game it is recommended that you copy an existing directory structure such as the one used for Battlemaster
Here is the directory structure for the game Battlemaster (bm) with the new directories added for your own game.
It is important you use this structure.
public_html (htdocs on a windows box)
       |---------bm (contains game.html, bm.js,battle1.js, engagement.css)
       |                |
       |                |-----images (menu.png, background.gif, main.png)
       |
       |---------cgi-bin
       |                 |-----bm (contains all the perl scripts including skin.pl)
       |                 |-----yourgame  (same scripts as above but with your version of skin.pl)
       |
       |----------yourgame (contains  game.html, bm.js,battle1.js, stylesheets)
                         |
                         |-----images (your images)
Once you have created a directory structure similar to the one above you can start configuring your game.

MEGG Files and Permissions
The following files are required in the following directories
/cgi-bin/yourgame/*.pl Executable 755 All perl scripts should have their permissions set to be executable
/cgi-bin/yourgame/login.log r/w(666) record of logins, can be an empty file but must exist
/cgi-bin/yourgame/hall.log r/w(666) log of top players, can be an empty file but must exist

2.3 Adding Your Own Question Banks
Once you have created the game to your satisfaction you can add your own question banks.

To add a new quiz battle the following files must be added.
x is the number of the new battle to be added
'yourgame' is the name of the game directory
/cgi-bin/yourgame/battle(x).txt r/w list of users details, can be empty but files must exist
/cgi-bin/yourgame/battle(x).log r/w log of battles, can be an empty files but must exist
/cgi-bin/yourgame/hall(x).log r/w each battles hall of fame, can be an empty files but must exist
/yourgame/battle(x).js r questions in a suitable format

- battle(x).js is built from comma separated value file of the form

"stem","distractor1","distractor2","distractor3","distractor4","single UPPERCASE letter"
"stem","distractor1","distractor2","distractor3","distractor4","single UPPERCASE letter"

Example
"What is a cat","feline","bovine","porcine","plant","A"

As questions are drawn at random it is recommended that a quiz contain a minimum of 50 questions.

Comma separated value question files need to can be converted into the battle(x).js file.
I have software to assist the conversion.

Once files are installed the following change needs to be made add the question bank to the drop boxes in startlogin.pl and newaccount.pl

<select name='battle' size='1' class='highlight'>
<option value='battle(x).txt'>Battle (x) - Topic Name</option> </select>