diff options
-rw-r--r-- | includes/mapoftheday.php | 2 | ||||
-rw-r--r-- | pages/achievements.php | 2 | ||||
-rw-r--r-- | pages/faq.php | 81 |
3 files changed, 82 insertions, 3 deletions
diff --git a/includes/mapoftheday.php b/includes/mapoftheday.php index ad9167f..b4b3bd8 100644 --- a/includes/mapoftheday.php +++ b/includes/mapoftheday.php @@ -1 +1 @@ -<?php
include_once('maps.php');
include_once('db.inc.php');
/**
* Returns the Map Of The Day with the given type (index)
*/
function mapOfTheDay($type = 1) {
ignore_user_abort(true);
if ($type <= 8)
$expire = 2;
if ($type <= 4)
$expire = 1;
$sql = "
SELECT
maps.ID,
maps.code
FROM `mapOfTheDay`, `maps`
WHERE `mapType` = $type AND
DATEDIFF(CURDATE(), mapOfTheDay.mapDate) < $expire AND
mapID = maps.ID
";
$result = mysql_query($sql);
//No map for today?
if (mysql_num_rows($result) != 0) {
$r['code'] = mysql_result($result, 0, 'code');
$r['map'] = GenerateMapByCode($r['code']);
$r['id'] = mysql_result($result, 0, 'ID');
return $r;
}
return generateNewMapOfTheDay($type, $sql);
}
/**
* Generates a new map of the day. DO NOT CALL OUTSIDE OF mapoftheday.php
*/
function generateNewMapOfTheDay($type, $sql)
{
// If you want to modify the maps created! This is the line
//GenerateMap($rows, $cols, $rockchance, $numBlocks = -1, $cp = -1, $tp = -1) {
switch ($type) {
case 1: //Easy
$map = GenerateMap(13, 7, 12, rand(7, 10), rand(0, 1), 0);
break;
case 2: //Normal
$map = GenerateMap(15, 9, 7, rand(11, 13), rand(1, 3) + rand(0, 1), 0);
break;
case 3: //Hard
$map = getRandomComplexMap();
break;
case 4: //Full random map
$map = getRandomSpecialMap();
break;
case 5:
// TEST MAP...
$ultraComplex[] = "soooooooooooooooooooooooooooor";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "roooooooooooooooooooooooooooof";
$ultraComplex = insertPoint($ultraComplex, 'abcde');
$ultraComplex = insertPoint($ultraComplex, 'tumngh');
$ultraComplex = insertPoint($ultraComplex, 'ppppppppppp');
$myparams['checkpoints'] = 5;
$myparams['teleports'] = 3;
$myparams['rockchance'] = 9;
$myparams['walls'] = 38;
$myparams['name'] = 'Ultra Complex';
$map = GenerateShapedMap($ultraComplex, $myparams);
break;
default:
$map = GenerateMap(rand(13, 18), rand(10, 14), rand(6, 9));
break;
}
$lock = acquireMotdLock();
try
{
//Double check... $sql is already set
$result = mysql_query($sql);
//Are you SURE there's no map?
if (mysql_num_rows($result) != 0)
{
releaseMotdLock($lock);
return mapOfTheDay($type);
}
$code = GenerateMapCode($map);
$sql = "INSERT INTO `maps` (`code`)
VALUES ('$code')";
$result = mysql_query($sql);
if (!$result)
{
releaseMotdLock($lock);
die("Error on inserting map");
}
$mapID = mysql_insert_id();
$r['code'] = $code;
$r['map'] = $map;
$r['id'] = $mapID;
$sql = "INSERT INTO `mapOfTheDay` (`mapID`, `mapType`, `mapDate`)
VALUES ('$mapID', '$type', CURDATE()) ";
$result = mysql_query($sql);
if (!$result)
{
releaseMotdLock($lock);
die("Error on insert into mapOfTheDay");
}
} catch (Exception $exc) { /* Ignore... :| */ }
releaseMotdLock($lock);
// ---------- Track statistics for 'yesterdays' map.
trackMOTDstats($type);
return $r;
}
/**
* The file locked in order to create serialize map-creations, since our DB doesn't support transactions...
*/
define('FILE_MOTD_LOCK', './motdLockFile');
/**
* Obtains the mutex used for creating the Map Of The Day, so that race-conditions cannot occur (like two threads
* creating and inserting the maps into the database at the same time, which has happened
*/
function acquireMotdLock()
{
$fileHandle = fopen(FILE_MOTD_LOCK, 'a+');
flock($fileHandle, LOCK_EX);
return $fileHandle;
}
/**
* Releases the lock acquired from acquireMotdLock
*/
function releaseMotdLock($fileHandle)
{
if($fileHandle)
flock($fileHandle, LOCK_UN);
}
//Select from yesterday
function getYesterdaysMap() {
$sql = "
select `ID`, `code` from `maps`
WHERE (
DAY(dateCreated) = DAY(NOW()) - 1
AND
MONTH(dateCreated) = MONTH(NOW())
AND
YEAR(dateCreated) = YEAR(NOW())
)
";
$result = mysql_query($sql);
//No map for today?
if (mysql_num_rows($result) == 0) {
return -1;
}
$r['code'] = mysql_result($result, 0, 'code');
$r['id'] = mysql_result($result, 0, 'ID');
return $r;
}
function getRandomComplexMap() {
$random = 1;
switch ($random) {
case 0:
$map = GenerateMap(19, 9, rand(7, 9), rand(14, 16), rand(2, 5), rand(1, 2));
break;
case 1:
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath = insertPoint($reversePath, 'abc');
$reversePath = insertPoint($reversePath, 'tu');
$myparams['checkpoints'] = 3;
$myparams['teleports'] = 0;
$myparams['rockchance'] = 7;
$myparams['walls'] = 12;
$myparams['name'] = 'Reverse Order';
$map = GenerateShapedMap($reversePath, $myparams);
break;
}
return $map;
}
function getRandomSpecialMap() {
//This can be used to add additional weight to certain maps that we like.
$random = weight(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
//TODO: !! Temporary
$random = 9;
$shape = array();
$params = array();
switch ($random) {
//=====================================
case 0:
//Thirty
$map = GenerateMap(
18, 14, 20, //width, height, rocks
weight(30), //Walls
weight(1), //Checkpoints
weight(1), //Teleports
'Thirty'
);
break;
//=====================================
case 1:
//Simple
$map = GenerateMap(
18, 9, 7, //width, height, rocks
weight(15, 16, 17), //Walls
weight(0), //Checkpoints
weight(0), //Teleports
'Finite'
);
break;
//=====================================
case 2:
//ABC's
$map = GenerateMap(
19, 11, 12, //width, height, rocks
weight(20, 21, 22, 22, 23), //Walls
weight(3), //Checkpoints
weight(0), //Teleports
"ABC's "
);
break;
//=====================================
case 3:
//Tele Madness
$map = GenerateMap(
17, 12, 10, //width, height, rocks
weight(17, 18), //Walls
weight(1), //Checkpoints
weight(5), //Teleports
'Teleport Madness'
);
break;
//=====================================
case 4: //Thursday
//Rocky Maze
$map = GenerateMap(
19, 15, 5, //width, height, rocks
weight(16, 17, 18), //Walls
weight(1, 2, 2, 2, 3, 3), //Checkpoints
weight(0), //Teleports
'Rocky Maze'
);
break;
//=====================================
case 5: //Friday
//Side to Side
$map = GenerateMap(
26, 6, 12, //width, height, rocks
weight(17, 18, 19), //Walls
weight(2, 2, 2, 3, 3), //Checkpoints
weight(3, 3, 3, 4), //Teleports
'Side to Side'
);
break;
//=====================================
case 6:
//Ultimate's Random map:
//Create shape
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
//Insert points
$shape = insertPoint($shape, "sfabcr", $target = '?');
$shape = insertPoint($shape, weight("tu", "d", "tu", "", ""), $target = '?');
//Set params
$params['rockchance'] = 10;
$params['walls'] = weight(21, 20, 22, 20, 21);
$params['name'] = 'Ultimate Random';
//Put it all together.
$map = GenerateShapedMap($shape, $params);
break;
//=====================================
//=====================================
case 7:
//Dual map
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "oqqqqqqqqqqqqqqqqqqqo";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapa = insertPoint($dualmapa, 'abc');
$dualmapb = insertPoint($dualmapb, 'abc');
$dualmap = array_merge($dualmapa, $dualmapb);
$dualmap = insertPoint($dualmap, 'tu');
$myparams['checkpoints'] = 3;
$myparams['teleports'] = 1;
$myparams['rockchance'] = 9;
$myparams['walls'] = weight(20, 20, 21, 21, 22, 23);
$myparams['name'] = 'Seeing Double';
$map = GenerateShapedMap($dualmap, $myparams);
break;
//=====================================
//=====================================
case 8:
//Centralized
$myshape[] = "ooooooooooooooooooo";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o???????fos???????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "ooooooooooooooooooo";
$myshape = insertPoint($myshape, "abc", $target = '?');
$myshape = insertPoint($myshape, weight("tu", "d", "tud", ""), $target = '?');
$myparams['rockchance'] = 7;
$myparams['walls'] = weight(17, 18, 19, 18, 17);
$myparams['name'] = 'Centralized';
$map = GenerateShapedMap($myshape, $myparams);
break;
//=====================================
//=====================================
case 9:
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'ro??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths = insertPoint($dualingPaths, 'abc');
$dualingPaths = insertPoint($dualingPaths, weight('xx', 'xxx', 'xxxx').weight('XX', 'XXX', 'XXXX'));
$myparams['checkpoints'] = 3;
$myparams['rockchance'] = 8;
$myparams['walls'] = 14;
$myparams['name'] = 'Dualing paths';
$map = GenerateShapedMap($dualingPaths, $myparams);
break;
//=====================================
}
return $map;
}
?>
\ No newline at end of file +<?php
include_once('maps.php');
include_once('db.inc.php');
/**
* Returns the Map Of The Day with the given type (index)
*/
function mapOfTheDay($type = 1) {
ignore_user_abort(true);
if ($type <= 8)
$expire = 2;
if ($type <= 4)
$expire = 1;
$sql = "
SELECT
maps.ID,
maps.code
FROM `mapOfTheDay`, `maps`
WHERE `mapType` = $type AND
DATEDIFF(CURDATE(), mapOfTheDay.mapDate) < $expire AND
mapID = maps.ID
";
$result = mysql_query($sql);
//No map for today?
if (mysql_num_rows($result) != 0) {
$r['code'] = mysql_result($result, 0, 'code');
$r['map'] = GenerateMapByCode($r['code']);
$r['id'] = mysql_result($result, 0, 'ID');
return $r;
}
return generateNewMapOfTheDay($type, $sql);
}
/**
* Generates a new map of the day. DO NOT CALL OUTSIDE OF mapoftheday.php
*/
function generateNewMapOfTheDay($type, $sql)
{
// If you want to modify the maps created! This is the line
//GenerateMap($rows, $cols, $rockchance, $numBlocks = -1, $cp = -1, $tp = -1) {
switch ($type) {
case 1: //Easy
$map = GenerateMap(13, 7, 12, rand(7, 10), rand(0, 1), 0);
break;
case 2: //Normal
$map = GenerateMap(15, 9, 7, rand(11, 13), rand(1, 3) + rand(0, 1), 0);
break;
case 3: //Hard
$map = getRandomComplexMap();
break;
case 4: //Full random map
$map = getRandomSpecialMap();
break;
case 5:
// TEST MAP...
$ultraComplex[] = "soooooooooooooooooooooooooooor";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "ro??????????????????????????of";
$ultraComplex[] = "so??????????????????????????or";
$ultraComplex[] = "roooooooooooooooooooooooooooof";
$ultraComplex = insertPoint($ultraComplex, 'abcde');
$ultraComplex = insertPoint($ultraComplex, 'tumngh');
$ultraComplex = insertPoint($ultraComplex, 'ppppppppppp');
$myparams['checkpoints'] = 5;
$myparams['teleports'] = 3;
$myparams['rockchance'] = 9;
$myparams['walls'] = 38;
$myparams['name'] = 'Ultra Complex';
$map = GenerateShapedMap($ultraComplex, $myparams);
break;
default:
$map = GenerateMap(rand(13, 18), rand(10, 14), rand(6, 9));
break;
}
$lock = acquireMotdLock();
try
{
//Double check... $sql is already set
$result = mysql_query($sql);
//Are you SURE there's no map?
if (mysql_num_rows($result) != 0)
{
releaseMotdLock($lock);
return mapOfTheDay($type);
}
$code = GenerateMapCode($map);
$sql = "INSERT INTO `maps` (`code`)
VALUES ('$code')";
$result = mysql_query($sql);
if (!$result)
{
releaseMotdLock($lock);
die("Error on inserting map");
}
$mapID = mysql_insert_id();
$r['code'] = $code;
$r['map'] = $map;
$r['id'] = $mapID;
$sql = "INSERT INTO `mapOfTheDay` (`mapID`, `mapType`, `mapDate`)
VALUES ('$mapID', '$type', CURDATE()) ";
$result = mysql_query($sql);
if (!$result)
{
releaseMotdLock($lock);
die("Error on insert into mapOfTheDay");
}
} catch (Exception $exc) { /* Ignore... :| */ }
releaseMotdLock($lock);
// ---------- Track statistics for 'yesterdays' map.
trackMOTDstats($type);
return $r;
}
/**
* The file locked in order to create serialize map-creations, since our DB doesn't support transactions...
*/
define('FILE_MOTD_LOCK', './motdLockFile');
/**
* Obtains the mutex used for creating the Map Of The Day, so that race-conditions cannot occur (like two threads
* creating and inserting the maps into the database at the same time, which has happened
*/
function acquireMotdLock()
{
$fileHandle = fopen(FILE_MOTD_LOCK, 'a+');
flock($fileHandle, LOCK_EX);
return $fileHandle;
}
/**
* Releases the lock acquired from acquireMotdLock
*/
function releaseMotdLock($fileHandle)
{
if($fileHandle)
flock($fileHandle, LOCK_UN);
}
//Select from yesterday
function getYesterdaysMap() {
$sql = "
select `ID`, `code` from `maps`
WHERE (
DAY(dateCreated) = DAY(NOW()) - 1
AND
MONTH(dateCreated) = MONTH(NOW())
AND
YEAR(dateCreated) = YEAR(NOW())
)
";
$result = mysql_query($sql);
//No map for today?
if (mysql_num_rows($result) == 0) {
return -1;
}
$r['code'] = mysql_result($result, 0, 'code');
$r['id'] = mysql_result($result, 0, 'ID');
return $r;
}
function getRandomComplexMap() {
$random = weight(0, 0, 0, 0, 0, 0, 0, 1);
switch ($random) {
case 0:
$map = GenerateMap(19, 9, rand(7, 9), rand(14, 16), rand(2, 5), rand(1, 2));
break;
case 1:
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath[] = 'fo?????????????oS';
$reversePath = insertPoint($reversePath, 'abc');
$reversePath = insertPoint($reversePath, 'tu');
$myparams['checkpoints'] = 3;
$myparams['teleports'] = 0;
$myparams['rockchance'] = 7;
$myparams['walls'] = 12;
$myparams['name'] = 'Reverse Order';
$map = GenerateShapedMap($reversePath, $myparams);
break;
}
return $map;
}
function getRandomSpecialMap() {
//This can be used to add additional weight to certain maps that we like.
$random = weight(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
$shape = array();
$params = array();
switch ($random) {
//=====================================
case 0:
//Thirty
$map = GenerateMap(
18, 14, 20, //width, height, rocks
weight(30), //Walls
weight(1), //Checkpoints
weight(1), //Teleports
'Thirty'
);
break;
//=====================================
case 1:
//Simple
$map = GenerateMap(
18, 9, 7, //width, height, rocks
weight(15, 16, 17), //Walls
weight(0), //Checkpoints
weight(0), //Teleports
'Finite'
);
break;
//=====================================
case 2:
//ABC's
$map = GenerateMap(
19, 11, 12, //width, height, rocks
weight(20, 21, 22, 22, 23), //Walls
weight(3), //Checkpoints
weight(0), //Teleports
"ABC's "
);
break;
//=====================================
case 3:
//Tele Madness
$map = GenerateMap(
17, 12, 10, //width, height, rocks
weight(17, 18), //Walls
weight(1), //Checkpoints
weight(5), //Teleports
'Teleport Madness'
);
break;
//=====================================
case 4: //Thursday
//Rocky Maze
$map = GenerateMap(
19, 15, 5, //width, height, rocks
weight(16, 17, 18), //Walls
weight(1, 2, 2, 2, 3, 3), //Checkpoints
weight(0), //Teleports
'Rocky Maze'
);
break;
//=====================================
case 5: //Friday
//Side to Side
$map = GenerateMap(
26, 6, 12, //width, height, rocks
weight(17, 18, 19), //Walls
weight(2, 2, 2, 3, 3), //Checkpoints
weight(3, 3, 3, 4), //Teleports
'Side to Side'
);
break;
//=====================================
case 6:
//Ultimate's Random map:
//Create shape
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
$shape[] = "??????????????????";
//Insert points
$shape = insertPoint($shape, "sfabcr", $target = '?');
$shape = insertPoint($shape, weight("tu", "d", "tu", "", ""), $target = '?');
//Set params
$params['rockchance'] = 10;
$params['walls'] = weight(21, 20, 22, 20, 21);
$params['name'] = 'Ultimate Random';
//Put it all together.
$map = GenerateShapedMap($shape, $params);
break;
//=====================================
//=====================================
case 7:
//Dual map
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "s???????????????????f";
$dualmapa[] = "oqqqqqqqqqqqqqqqqqqqo";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapb[] = "s???????????????????f";
$dualmapa = insertPoint($dualmapa, 'abc');
$dualmapb = insertPoint($dualmapb, 'abc');
$dualmap = array_merge($dualmapa, $dualmapb);
$dualmap = insertPoint($dualmap, 'tu');
$myparams['checkpoints'] = 3;
$myparams['teleports'] = 1;
$myparams['rockchance'] = 9;
$myparams['walls'] = weight(20, 20, 21, 21, 22, 23);
$myparams['name'] = 'Seeing Double';
$map = GenerateShapedMap($dualmap, $myparams);
break;
//=====================================
//=====================================
case 8:
//Centralized
$myshape[] = "ooooooooooooooooooo";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o???????fos???????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "o?????????????????o";
$myshape[] = "ooooooooooooooooooo";
$myshape = insertPoint($myshape, "abc", $target = '?');
$myshape = insertPoint($myshape, weight("tu", "d", "tud", ""), $target = '?');
$myparams['rockchance'] = 7;
$myparams['walls'] = weight(17, 18, 19, 18, 17);
$myparams['name'] = 'Centralized';
$map = GenerateShapedMap($myshape, $myparams);
break;
//=====================================
//=====================================
case 9:
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'so??????????????of';
$dualingPaths[] = 'ro??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths[] = 'So??????????????of';
$dualingPaths = insertPoint($dualingPaths, 'abc');
$dualingPaths = insertPoint($dualingPaths, weight('xx', 'xxx', 'xxxx').weight('XX', 'XXX', 'XXXX'));
$myparams['checkpoints'] = 3;
$myparams['rockchance'] = 8;
$myparams['walls'] = 14;
$myparams['name'] = 'Dualing paths';
$map = GenerateShapedMap($dualingPaths, $myparams);
break;
//=====================================
}
return $map;
}
?>
\ No newline at end of file diff --git a/pages/achievements.php b/pages/achievements.php index 0502198..ac7aded 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -494,7 +494,7 @@ foreach($achievements as $aType => $a) { $uStats[$aType] = str_replace(",", "", $uStats[$aType]);
$uCurrent = $uStats[$aType];
- $nUCurrent = number_format($uCurrent);
+ $nUCurrent = number_format((double)$uCurrent);
$aTypeNames[1] = "<img src='../images/Achievement_PathCareer.png' style='width:36px;height:36px;vertical-align:middle'>Path Career Level $aLevel!";
$aTypeNames[2] = "<img src='../images/Achievement_MazeCareer.png' style='width:36px;height:36px;vertical-align:middle'>Mazes Career Level $aLevel!";
diff --git a/pages/faq.php b/pages/faq.php index 0fccf4c..7b3c09c 100644 --- a/pages/faq.php +++ b/pages/faq.php @@ -4,7 +4,62 @@ htmlHeader(array(), 'FAQ', 'How does the pathing work?'); <body>
<?php
+echo soundManager2();
topbar($Links);
+
+include('./includes/maps.php');
+
+
+// Demo maps:
+//Pathing:
+
+// -------- DEMO1
+$pathing1[] = 'roooooauo';
+$pathing1[] = 'ooooooooo';
+$pathing1[] = 'soooooooo';
+$pathing1[] = 'oooooorof';
+$pathing1[] = 'booootooo';
+
+$myparams['checkpoints'] = 2;
+$myparams['teleports'] = 1;
+$myparams['rockchance'] = 999;
+$myparams['walls'] = 999;
+$myparams['name'] = 'Pathing Demo 1';
+
+$map = GenerateShapedMap($pathing1, $myparams);
+$demo1 = displaymap($map, 1, 'example');
+// --------- DEMO2
+$multi1[] = 'sooXoooooXo';
+$multi1[] = 'xxxXrrorxoo';
+$multi1[] = 'aoooxxxrooo';
+$multi1[] = 'XXXXXXorooo';
+$multi1[] = 'Sooooooroof';
+
+$myparams['checkpoints'] = 1;
+$myparams['teleports'] = 0;
+$myparams['rockchance'] = 999;
+$myparams['walls'] = 999;
+$myparams['name'] = 'Pathing Demo 2';
+
+$map = GenerateShapedMap($multi1, $myparams);
+$demo2 = displaymap($map, 2, 'example');
+// --------- DEMO3
+$greed[] = 'soooooooa';
+$greed[] = 'sooooooob';
+$greed[] = 'soooooooc';
+$greed[] = 'sorooroof';
+$greed[] = 'sraorbroo';
+
+$myparams['checkpoints'] = 1;
+$myparams['teleports'] = 0;
+$myparams['rockchance'] = 999;
+$myparams['walls'] = 999;
+$myparams['name'] = 'Pathing Demo 2';
+
+$map = GenerateShapedMap($greed, $myparams);
+$demo3 = displaymap($map, 3, 'example');
+
+
?>
<div class="wrapper">
@@ -16,6 +71,7 @@ Your question not here? Ask me via the <a href='feedback'>Feedback Page</a>. <ul>
<li><a href='#pathing'>How does the pathing work? / How does it choose which way to go?</a></li>
<li><a href='#multipath'>How does Multi-path work? (Two paths at once)</a></li>
+ <li><a href='#greed'>More than one of the same checkpoint?</a></li>
</ul>
<a name='pathing'> </a>
@@ -31,6 +87,10 @@ This means that the path will go UP as far as it can first – then right, d <br />So, BOTTOM LEFT, from TOP RIGHT? If you answer "DOWN then LEFT" you are correct!
<br />If you answered "uhhmm.. what's up with the directions in caps?" then you get a bonus point!
<br />Remember, teleports are traps and do not effect the path choice.
+<h3>Demo 1</h3>
+<? echo $demo1; ?>
+<div style='clear:both'></div>
+
</p>
<hr width='60%' />
@@ -50,7 +110,26 @@ But they can't cross Red blocks: Likewise, the Red Path noted by red in the arrow may pass over Red Allow blocks:
<div class='grid_td_rockxpath1' style='display: inline-block'></div>
<br />
-12-12-12: - I'm going to update this answer in like 8 hours with some examples... So; if you're reading this. Hi!
+<h3>Demo 2</h3>
+<? echo $demo2; ?>
+<div style='clear:both'></div>
+
+<hr width='60%' />
+
+<a name='greed'> </a>
+<h3>More than one of the same checkpoint?</h3>
+<div class='grid_td_cpa' style='display: inline-block'></div>
+<div class='grid_td_cpa' style='display: inline-block'></div>
+
+<p>The pathing is very greedy. It's only looking at it's next target.
+<b>It does not look at the big-picture</b>. You can use this to your advantage.
+When there's more than one checkpoint, you can completely wall one off.
+<br />Not many maps contain will more than one of any checkpoint.
+<br />The below demo demonstrates it's greed. - The path will actually be shorter if you wall the bottom A.
+
+<h3>Demo 3</h3>
+<? echo $demo3; ?>
+<div style='clear:both'></div>
</div>
|