3D CONSTRUCTION KIT4. INTRODUCTION TO FREESCAPEThe 3D CONSTRUCTION KIT uses an enhanced version of the FREESCAPE system. The system allows you to represent a virtual world that you can move around and interact with. This world is represented in three dimensions, known as X, Y and Z.
AREASThe world is divided into regions known as 'AREAS'. Each area is like a box and has a set size of 8192 (X) 4096 (Y) 8192 (Z) units. These units are an arbitrary form of measurement which could easily be thought of as being millimetres, centimetres or metres. One unit is the smallest distance that you can move through.X, Y & ZA co-ordinate of X=0 Y=0 Z=0 (View: 0000,0000,0000) represents the nearest bottom, left hand corner of an area.The world is seen from a single viewpoint which occupies one unit, looking in different directions. The direction is represented by three angles:
There can be up to 254 different AREAS defined by the user. An AREA can be used to represent a room of a house or an "outdoor" region. You can not travel beyond the boundary of an area. AREAS have no geographical relation to each other, but are tied together by ENTRANCES. An ENTRANCE has a position and view direction. The user can then be placed at an ENTRANCE position in a specific AREA by some form of trigger (ie. walking into a door. This could effectively "move" the viewer from a hall (one AREA) into a room (another AREA). OBJECTSObjects can be placed into an area to make the environment. These are solid and, as such, cannot be passed through when moving. Objects can have different sizes in X, Y and Z directions. Object position and size are measured in a different co-ordinate system to the 3D world. One unit in Object co-ordinates is equal to 64 units in the 3D world system. ie. an Object with a size of 1 unit takes up 64 units in the 3D world. Objects must be placed at 64 world unit boundaries, i.e. it is not possible to place an object at co-ordinate 32 in world units.There are several basic object types ("PRIMITIVES") which can be re-sized and combined to make larger, more complicated objects such as buildings, trees etc. The primitive objects consist of:
When editing points within these objects, the points are stored as a fraction of the total object size. This fraction is represented as a number between 0 and 63, where 0 means that the point is at one side (minimum) of the cube and 63 means it is at the opposite side (maximum). Each point has a different scale in each of the three directions (X,Y and Z) to show its position with the object's BOUNDING CUBE. For example: to make a pyramid with the apex (the pointed top) in the middle of the face of the BOUNDING CUBE, the apex would have X and Z values of 32 and a Y value of 63. OBJECT ATTRIBUTESObjects can exist in three states: VISIBLE, INVISIBLE or DESTROYED:
OBJECT COLOURS (SHADES)Each side of an object can have a different shade. A shade is made up of a mixture of the colours available on the computer used.The first shade (number 0) has a special property in that it is not drawn. This can be used to improve the speed of drawing the 3D world when used on object sides which are never seen, such as the under side of a house or the back of a door which is placed against a wall. By painting all of the sides of an object with shade 0 it is possible to have an object which cannot be seen but which is solid and cannot be moved through. Note: In this case the object's attribute will be set to VISIBLE even though it cannot be seen. This can be used to produce invisible barriers or invisible triggers on floors. GLOBALSIn order to conserve memory, common objects may be stored in a reserved area known as the GLOBALS AREA (AREA 255). These objects can be placed in any area by using the GLOBAL option in the editor. For example, a floor that would be duplicated in other areas could be defined once as an object in the GLOBALS AREA and displayed in each area that would have the same floor. However, an object that is used globally will only appear at the same co-ordinate position as it was defined in. So a tree defined in the corner of the GLOBALS AREA can only appear in the same corner of the AREAS it appears in.INTERACTION WITH OBJECTSEvents or reactions can be caused by interacting with objects within the environment. Objects may be triggered to respond to being shot, activated (touched/pressed/manipulated), collided with or walked on.In order to shoot or activate an object, a 'sight' mode is selected (by pressing the SPACE BAR) whereupon a cross-hair appears and is controlled using the normal movement keys or joystick. After targetting an object, the fire button or 0 key, when pressed, will then shoot at that object. To activate a targetted object the "A" key is pressed. However, an object will only be "activated" if the object is within a predefined distance known as the ACTIVE RANGE. SENSORSA SENSOR is a special type of object that will detect your presence if you are within a set distance from it. This allows reactions to occur when approaching an object. A Sensor can also be set to respond by firing back at you at a given rate.CONDITIONS - THE FREESCAPE COMMAND LANGUAGE (FCL)In order to interact with objects, checks and actions have to be defined in the form of short programs called CONDITIONS.CONDITIONS are written using instructions which make up the FREESCAPE COMMAND LANGUAGE (FCL). FCL has a very simple but powerful set of commands which allow you to manipulate and respond to any occurances. There is also a bank of memory which can be used by the user to store and view information relating to the environment and events. Each memory cell is called a VARIABLE. A VARIABLE can store a value between 0 and 255. There are 128 of these memory cells and are numbered 0 - 127. The first 112 (0-111) are free for the user to use for storage, whilst the last 16 (112-127) are defined and used by the system but can be viewed by the user and acted upon, if desired. There are various categories of instructions in FCL and they are as follows:
CONDITION ROUTINESCondition Routines (the short programs written in FCL), are stored as lists. Each list is given a number for identification. There are three types of groups of conditional lists. They are:
General ConditionsThese are a set of conditional lists (programs) which are executed all the time. Conditions used in this form are useful for checking for "End Game" situations, maintaining counters, and general overseeing of the whole environment. The first CONDITION in this set is only executed when the environment is reset. This allows you to initialise any variables or events at the start.Local ConditionsThese are a set of conditional lists which are also executed all the time. However, there is a set of local conditions for each AREA. Only the set of conditions associated with the current area will be executed. LOCAL CONDITIONS are useful for checking and acting upon collisions with objects in the current AREA, Sensor handling, or any other occurances that are AREA specific.ProceduresThese are a special set of conditional lists that are only executed at the request of another condition. Their main use is to replace frequently used functions by conditions, only being written once, thus preserving memory. They can also be used to extend the length of a condition list if a condition exceeds the maximum number of lines allowed.INSTRUMENTSAn Instrument is a device which displays information to the user. Instruments are not visible whilst in the editor, but are visible on the TEST screen or in a Stand-Alone environment. There are two types of Instrument: BARS and NUMERICAL.
MESSAGESMessages are a way of communicating to the user by way of printing text to the screen. They are only visible on the TEST screen or in a "Stand-Alone" environment - messages are stored in a list; each item in that list being a single line of text. Each message can be printed to the screen by referring to its message number and its position at which it should be placed. This allows frequently used messages to be stored once.LIMITATIONS TO FREESCAPEAs FREESCAPE uses extremely complex mathematical algorithms to represent the 3D world on a 2D screen, there are a few basic limitations to what you can do:
THE 3D KIT PROGRAMSOn 48K/64K machines such as the Spectrum 48K, CPC464, CPC664, CPC464+ or Commodore 64, the Kit is split up into three programs:
On 128K machines such as Spectrum 128K, +2, +2A, +3, CPC6128 or CPC6128+ (excluding Commodore 128), the Environment Editor and the Condition Editor are combined and more memory is available to create larger worlds. |