
Kommari Kopterissa II Level Format (KKL)
Replaces old TRU level format.

As you can see,this format has lots of unused space for future expansions!

I've created this format to replace the old format because,i need some expansions
to make mission system.
I designed old TRU format in 30 seconds so that was just a temporaly
solution.

       Ŀ
        0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F 
Ĵ
 0000 'T''u''r''s''t'Version    RESERVED FOR FUTURE USE        
Ĵ
 0010                  RESERVED FOR FUTURE USE                       
Ĵ
 0020  Data chunks...                                                
Ĵ															   
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 
  Version....1st Byte Minor (now 00),2nd Byte Major (now 01)
 


-----------------------------------------------------

Chunks:
-----------------------

Chunk format
============
(Offsets are relative)

Offset   Length    Description
0000     4         Chunk Id String
0004     4         Chunk Length (Long Integer,Bit 31 unused)
0008     ?         Chunk Data...


Chunk Types
===========

ID:           "LTYP"
Length:       2 Bytes (Integer)
Description:  Determines the level game modes.
              Bit 0:For Deathmatch
	 		  Bit 1:For Chase
	 		  Bit 2:For Race
			  Bit 3:For CTF
			  Bit 4:For Single Player

ID:           "NAME"
Length:       1-16 Bytes (String)
Description:  Level name

ID:           "DNAM"
Lenght:       1-16 Bytes (String)
Description:  Level designer name

ID:           "BLOX"
Lenght:       4000 Bytes (Exactly)
Description:  Level block data. Level is 80*50 in size.
              This chunk has whole TRU file.
              Block offset can be calculated with following formula: x * 50 + y

ID:           "OBJD"
Lenght:       ??
Description:  Object data
              Byte 0:Number of objects
			  ...
              Byte 1:Object id
			  Byte 2:Object appearance
			  Byte 3-4:Object X position
			  Byte 5-6:Object Y position
			  ...

ID:           "TAGS"
Lenght:       4000 Bytes (Exactly)
Description:  Same as level block data but this contains tag numbers for every block in level.
              Tag numbers are used for special effects (especially for missions)
			  If player enters to the block what have the tag,it triggers every special blocks what have same
			  tag and they do something special (They create a new block or Increase mission counter,for example)
			  
ID:           "SBLO"
Lenght:       ??
Description:  Special block data.
              Byte 0:Number of special blocks
			  ...
			  Byte 1:Action ID
			  Byte 2:Data 1
			  Byte 3:Data 2
			  Byte 4:Flags
			  Byte 5-6:Block X Position data
			  Byte 7-8:Block Y Position data
			  ...

ID:           "MISC"
Lenght:       256 Bytes
Description:  Mission Counter states
              If mission counters have these states,The mission is completed.

ID:           "MISO"
Lenght:       ?? (Max.128 Chars) String
Description:  Mission Objective. In text please.
              Note:Row break happens every 40 chars!
			  
ID:           "FEND"
Lenght:       0 Bytes (Nothing)
Description:  Determines file end.

--------------------------


Object Types:
-------------

0: Player 1 Base (1)
1: Player 2 Base (1)
2: Flag position (1)
3: Little Man (2)
4: Helicopter (Red) (2)
5: Helicopter (Green) (2)
6: Flag (3)
7: Helicopter (Red) (3)
8: Helicopter (Green (3)

(1) = If not specified then use random place.
      If more than one specified,use one of the specified places

(2) = Mission object. Disappears when you touch it.

(3) = Decoration. Does nothing.

Object Appearance types:
-------------
Bit 0:Doesn't appear if Deathmatch game
Bit 1:Doesn't appear if Chase game
Bit 2:Doesn't appear if Race game
Bit 3:Doesn't appear if CTF game
Bit 4:Doesn't appear if Single Player game


Special Block Types:
---------------
Flags:
Bit 0:Can be used again and again...
Bit 1:Doesn't trigger if Deathmatch game
Bit 2:Doesn't trigger if Chase game
Bit 3:Doesn't trigger if Race game
Bit 4:Doesn't trigger if CTF game
Bit 5:Doesn't trigger if Single Player game

Action IDs:
0:Create a new block
  Data 1:  Specify the block what is created when the block was triggered.
  Data 2:  Specify the block what is created when the block was triggered again.
  Position:This is a block position not pixel!!!!
  
1:Increase Mission Counter
  Data 1:  Mission Counter Number
  Data 2:  Unused
  Position:Unused

2:Teleport
  Data 1:  Unused
  Data 2:  Unused
  Position:Destination position
    