Environment Construction

This is an advanced guide to constructing ARDI environments by directly editing the text-files involved in producing the environment information.

Warning

Incorrectly altering these files may cause significant issues for the server and clients, so please be extremely careful in making modifications.

Folder

Environment data is stored in <site folder>/media/layouts/<environment asset id>

Here you will find all of the media files (ie. PNG images, SVG files, FBX 3D models), as well as details.inc, which is the master file that describes your environment layers.

The file is in PHP format. A sample file showing the layers of a building appears below…

A Sample File

<?php
$envinfo = array();
$envinfo["bounds"]["x"]=0;
$envinfo["bounds"]["y"]=0;
$envinfo["bounds"]["width"]=25;
$envinfo["bounds"]["height"]=25;
$envinfo["yaxis"] = "down";
$levels = array();


$lev = array();
$lev["name"] = "Ground";
$lev["path"] = "1.png";
$lev["options"] = "photo";
$lev["id"] = 1;
$lev["z"] = -1;
$levels[] = $lev;

$lev = array();
$lev["name"] = "Level 2";
$lev["path"] = "2.png";
$lev["options"] = "photo";
$lev["id"] = 2;
$lev["z"] = 1;
$levels[] = $lev;

$lev = array();
$lev["name"] = "Level 3";
$lev["path"] = "3.png";
$lev["options"] = "photo";
$lev["id"] = 3;
$lev["z"] = 3;
$levels[] = $lev;

$lev = array();
$lev["name"] = "Rooftop";
$lev["path"] = "4.png";
$lev["options"] = "photo";
$lev["id"] = 4;
$lev["z"] = 7;
$levels[] = $lev;

$lev = array();
$lev["name"] = "Basement";
$lev["path"] = "5.png";
$lev["options"] = "photo";
$lev["id"] = 5;
$lev["z"] = -3;
$levels[] = $lev;
?>

Notes

You must retain the leading “<?php ” tag, or you may cause significant issues for mapping in your site.

Layer Definitions

Each layer looks something like this…

$lev = array();
$lev["name"] = "Basement";
$lev["path"] = "5.png";
$lev["options"] = "photo";
$lev["id"] = 5;
$lev["z"] = -3;
$levels[] = $lev;

The first line creates a new level.

The next set the options for the level. It's critical to at least have…. * Name * Path * Options * ID * Z (depth)

The last line adds the layer to the list of layers.

The Options section contains what type of layer you are working with. These can include…

OptionMeaning
photoA raster image or photograph (PNG or JPG)
mapA 3D OBJ file with optional colour information
svgmapA 2D SVG vector image
plyA 3D PLY model containing additional data