Main...
:. Story
:. Artwork
:: Mechanics
:. Screens
:. Download
:. Links
:. Email



:: System Mechanics


======================================================
'Explore' Mode: Evironmental Interaction - Definitions
======================================================

Updated: 14.July.2003

The basic elements of the 'Explore' Mode environment:

Environment : A network of linked Rooms 
Room : A single explorable 'screen' consisting of:
                - Blocks        (floor, wall & interactive tiles)
                - Objects       (pushable &/or collectible pieces)
                - Entities      (Characters, monsters, NPC's etc)
        Rendered using:
                - Bitmaps       (Block tile images)     
                - Sprites       (Object & Entity images)
                - Lamps         (Block lum & moving lamp(s))

A single rendering of a given room consists of ambient and dynamic
light lit tile image bitmaps overlaid with sprites.

Combat, and it's visual effects occur in a separate 'Combat' mode. 

* All Predetermined/Variable are candidates for save game data.
* All bitmaps, unless otherwise specified are TILE_W*TILE_H pixels dimension.
* All descriptor strings are ARRAY_WIDTH wide.

* There are 4 characters playable at any time, out of a maxiumum 8.

xxx = 0-255 Room #.
^   = Allegro .dat format.


=========================
Enviroment Data Structure
=========================

[GLOBALDAT]------[ROOMDAT]------[BLOCKDAT]
          |              \------[OBJECTDAT]
          |              \------[ENTITYDAT]
          |              
          \------[SPRITEDAT]
          \------[LAMPDAT]



Global Environment Data [GLOBALDAT]
===================================

Image & text data common to all Rooms.

(Predetermined/Constant)

Name            Use                     Scale
-------------------------------------------------------------------------
gobjset         256 Object bitmap set   0-255 (egobjs.dat)^
gstrset         256 Str descriptor set  0-255 (egstrs.dat) 
gpcset          Player char img set     ???                     

ROOMDAT         Room data arrays        *SEPARATE STRUCTURE*    



Room Data [ROOMDAT] 
===================

Room-specific image, text, numeric data.

(Predetermined/Constant)

Name            Use                     Scale
-------------------------------------------------------------------------
room_id         Room # index            0-255 
rtileset        256 Tile bitmap set     0-255  
rsprset         16-16frame sprites set  0-255  
rstrset         256 Str descriptor set  0-255 

BLOCKDAT        Block array (blk)       Array[ROOM_W][ROOM_H]  
OBJECTDAT       Object list (obj)       Array[MAXOBJ]
ENTITYDAT       Entity List (ent)       Array[MAXENT]

(Calculated/Variable)

Name            Use                     Scale
-------------------------------------------------------------------------
room_name       Room filename           'xxx.erd'
tileset_name    Tileset filename        'etsxxx.dat'
sprset_name     Spriteset filename      'essxxx.dat'  
strset_name     Stringset filename      'edsxxx.dat' 
change_room     PC's left this room?    (0-1)
entry_tx        PC's next room entry X  (0-ROOM_W)
entry_ty        PC's next room entry Y  (0-ROOM_H)

SPRITEDAT       Sprite list (spr)       Array[MAXSPR]
LAMPDAT         Lamp list   (lamp)      Array[MAXLAMP]



Block Data [BLOCKDAT]
=====================

Individual room block-tile, referenced by TX, TY tile
position in the blk array.
Data from 'xxx.erd' room file.

* [S] Refer to the possible block states (generally 2).
* [x][y].img_t overrides [x][y-1].img if [x][y].lev = 1


(Predetermined/Constant)

Name            Use                     Scale                        
---------------------------------------------------------
type[S]         Block function          0-9
img[S]          Tile bitmap             0-255
imgt[S]         Tile top bitmap         0-255
descrip[S]      Description str ref     0-255
trans[S]        Does light pass thru?   0-1
lev[S]          Flat/Raised?            0-2
lum[S]          Ambient light lev       0-255
trigger[S]      Activation condition    0-7
change[S]       State change condition  0-7
tid[S]          Trigger group id        0-255
ty1[S]          Tile custom value       0-255
ty2[S]          Tile custom value       0-255
ty3[S]          Tile custom value       0-255
tr1[S]          Trigger custom value    0-255
tr2[S]          Trigger custom value    0-255
ch1[S]          Change custom value     0-255
ch2[S]          Change custom value     0-255

save            Remember state w/exit?  0-1

(Predetermined/Variable)
Name            Use                     Scale                        
--------------------------------------------------
state           Current tile state S    0-1

(Calculated/Variable)
Name            Use                     Scale                        
-----------------------------------------------------------------
lum_r           RenderedLight Lev       0-255
face            Tile image type         0-4(empty/base/side/top/hi-side)

tr3[S]          Trigger custom value    0-255
ch3[S]          Change custom value     0-255


Block Function (type_) Specifics
================================

#       Type            Function        ty1_    ty2_    ty3_            
-----------------------------------------------------------------
0       Nothing         Null, void
1       Normal          Plain tile 
2       Exit            Exit to:        rid     tx      ty
3       Switch          Trigger a tile  tid
4       Pusher          Moves objects   direct  tiles
5       Director        Limits move     enter           
6       Damage          Modify CpDcp    parity  mod
7       'E' Well        Wxchange 'e'*   elev    celev
8       Sign            Displays sign   descrip          
9       Spawn           Spawns NPC/Obj  type    model  

* No armour, efficiency 1.0

Definitions:

rid             Destination Room #. (0 = Current, No Load)
tx              Destination Tile X.
ty              Destination Tile Y.
tid             Group Id for Tile(s) to be triggered.
direct          Push Up/Right/Down/Left (0-3).
tiles           Push # Tiles in Direct.
enter           Entry only from Top/Right/Bottom/Left (0-3).
parity          Heal(0) or Damage(1)?
mod             Adjustment amount.
elev            Natural tile eLev. 
celev           Current tile eLev. 
descrip         String reference to be displayed.
type            Type: PC/NPC/Obj O:empty 1:PC 2:NPC 3:Obj 
model           PC/NPC/Obj model.


Trigger/Change Condition (trigger_/Change_) Specifics
=====================================================

#       Trigger         Condition       tr/ch1_  tr/ch2_  tr/ch3_**    
-------------------------------------------------------------------------
0       None            Never Triggers
1       Touch           PC/NPC on tile  spec     id       state 
2       Operate         'Activate' it   spec     id
3       UseObj          'Use Obj' it    type     expend
4       TouchObj        Obj on tile     type     state
5       pAttack         'Attack' it     pdcp              cpdcp
6       eAttack *       'Attack' it     elev     telev    celev   
7       Timed           Every x frames  sectrig           secpass
8       Death           Death of NPC(s) npctype  snpc     enpc

*  No armour, efficiency 1.0
** Variable

Definitions:

spec            PC/NPC Specific? (1)y/(0)n.
id              PC/NPC type id (0-7/8-255) for spec.
type            Object type required.
expend          Is object destroyed when used?
state           Activate if (1)ON or (0)OFF tile?
pdcp            p damage required.
cpdcp           Current p damage (reset on state switch).
elev            Natural eLev.
telev           Trigger eLev.
celev           Current eLev.
sectrig         Seconds to trigger.
secpass         Seconds passed.
npctype		NPC death type (0)Single 'snpc'
                               (1)Range 's-enpc'
                               (2)All of type 'snpc'
snpc/enpc	NPC's #e-s 		


Object Data [OBJECTDAT]
=======================

Object (ie movable/grabbable element), referenced
by x list position in the obj list. 
Data from 'xxx.erd' room file. 

* cx,cy is only saved if cx=fx & cy=fy & save=1 
* type=0 indicates a blank, unused obj slot.
* Object movements are to be tracked in the blockdat 
  'obj' reference. tx/ty is taken from the block


  the object is currently placed on.

(Predetermined/Constant)

Name            Use                     Scale                        
--------------------------------------------------
model           Object type/model       0-255
img             Physical image          0-255
descrip         Description str ref     0-255
solid           Is obj solid?           0-1
push            Can obj be pushed?      0-1
take            Can obj be taken?       0-1
offx            Image 'base' offset X   TILE_W/2
offy            Image 'base' offset Y   TILE_H
tx              X tile origin           0-ROOM_W
ty              Y tile origin           0-ROOM_H
ftx             X tile final dest       0-ROOM_W
fty             Y tile final dest       O-ROOM_H
save            Save final dest state?  0-1

(Predetermined/Variable) 

Name            Use                     Scale 
--------------------------------------------------
ctx             X current tile position 0-ROOM_W
cty             Y current tile position O-ROOM_H
on              Object active?          0-1

(Calculated/Variable) 

Name            Use                     Scale 
--------------------------------------------------
cpx             X current pixel pos     0-SCR_W
cpy             Y current pixel pos     O-SCR_H
slid            Sprite list index       0-MAXSPR



Entity Data [ENTITYDAT]
=======================

Statistics for NPC/Monster/Player Entities,
referenced by x list position in the ent list.
Data from 'xxx.erd' room file & current party 
data. 


* PC's: Type 0-7, NPC/Monster: Type 8-255.
* type=0 indicates a blank, unused ent slot.
* NPC Sprites have 16 frames. PC have 32?

(Pretedermined/Constant)

Name            Use                     Scale
-------------------------------------------------
type            Entity Type: PC/NPC     O:empty 1:PC 2:NPC 
model           Species/model           0-255
imgset          Sprite images set #     0-7PC/0-15NPC
descrip         Description str ref     0-255
tx              X tile position         0-ROOM_W
ty              Y tile position         O-ROOM_H
dir             Facing U/R/D/L          0-3
maxvel          Maximum pixel velocity  0-255
bx              X left base clip        0-TILE_W
by              Y top base clip         0-TILE_H
bx2             X right base clip       0-TILE_W
by2             Y bottom base clip      0-TILE_H
offx            Image 'base' offset X   TILE_W/2
offy            Image 'base' offset Y   TILE_H

(Predetermined/Variable) 

Name            Use                     Scale 
--------------------------------------------------
ctx             X current tile position 0-ROOM_W
cty             Y current tile position O-ROOM_H
cdir            Current facing U/R/D/L  0-3
on              Entity active?          0-1


(Calculated/Variable)
Name            Use                      Scale                        
-----------------------------------------------------------------
cimg            Current sprite image     0-255 
cpx             X current pixel position 0-SCR_W
cpy             Y current pixel position O-SCR_H
cvx             X current pixel velocity 0-255
cvy             Y current pixel veloctiy 0-255
slid            Sprite list index        0-MAXSPR



Sprite List [SPRITEDAT]
=======================

Display list for rendering objects & entities,
referenced by x list position in the spr list.
Data derived from the obj & ent lists.
All sprites are TILE_W/H in dimension.
List size = # entities + # objs 

* Type: 0 empty, 1 PC, 2 NPC, 3 object.

(Calculated/Variable)

Name            Use                     Scale
---------------------------------------------------------
type            Sprite Type: PC/NPC/Obj 0:empty 1:PC 2:NPC 3:Obj 
id              PC/NPC/Obj list index # 0-MAXENT+MAXOBJ
img             Current sprite img      0-255
lum             rendered light lev      0-255
offx            Image 'base' offset X   TILE_W/2
offy            Image 'base' offset Y   TILE_H
tx              X tile position         0-ROOM_W
ty              Y tile position         O-ROOM_H
px              X pixel position        0-SCR_W
py              Y pixel position        O-SCR_H
on              Visibility flag         0-1



Lamp List [LAMPDAT]
===================

Display list for rendering dynamic lights,
referenced by x list position in the lamp list.
Data from 'xxx.erd' room file & current party
data (for the PC light source). 


(Calculated/Variable)

Name            Use                     Scale
-------------------------------------------------
lum             Lamp luminosity         0-255
clum		Current luminosity	0-255
type		Lighting type		0:normal 1:flicker 2:switch 3:pulse
freq		Variance frequency	0-255
amp		Variance amplitude	0-255
dir		Var. amp direction	0:UP 1:DOWN
shad            Shadow drop rate        0-255
shadmax         Maximum shadow lumin.   0-255
start           Ray angle start         0-255
end             Ray angle end           0-255
tx              X Lamp centre tile      0-ROOM_W
ty              Y Lamp centre tile      0-ROOM_H
on              Visibility flag         0-1
locked          Lock onto sprite #      0-MAXENT
spot		Quick spotlight mode?   0:no 1:yes
            

<< Back

[ Page 1 | Page 2 | Page 3 ]



Project Start: August 2001 -:- All Content © D.C.D.Moodie


Hosted by www.Geocities.ws

1