Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

KSM (Kal Server Map) Specification

aka Reb3lzrr
Joined
Aug 23, 2006
Messages
325
Reaction score
47
Ey all,

I decided to release KSM Specifications

A little snippet for Pascal:

Definition
Code:
  TKalServerPixel = class
  private
  public
    collision : word; //Mobs spawn YES/NO
    additional_info : word; //Like town or so
  end;

  TKalServerMap = array[0..255] of array[0..256] of TKalServerPixel;

  TKSM = class
  private
  public
    map : TKalServerMap;
    procedure LoadFromFile(FileLocation:String);
    constructor Create; overload;
  end;

Addidional info:
Code:
0=nothing special
1=OneWayPortal ( THESE ARE THE PORTALS USED BY INIXSOFT)
2=TwoWayPortal (not used by engine)
4=PkFree
6=Town
16=Castle

Loading

Code:
constructor TKSM.Create;
var
  x,y:Byte;
begin
  For x:=0 to 255 do
  begin
    For y:=0 to 255 do
    begin
      Self.Map[x,y]:=TKalServerPixel.Create;
    end;
  end;
end;

procedure TKSM.LoadFromFile(FileLocation:String);
var
  MemStream:TMemoryStream;
  Buf:Word;
  x,y:Byte;
begin
  try
    MemStream:=TMemoryStream.Create;
    MemStream.LoadFromFile(FileLocation);
    MemStream.Position:=4;

    For x:=0 to 255 do
    begin
      For y:=0 to 255 do
      begin
        MemStream.ReadBuffer(Buf,SizeOf(Buf));
        Self.map[x,y].Collision:=Buf;
        MemStream.ReadBuffer(Buf,SizeOf(Buf));
        Self.map[x,y].additional_info:=Buf;
      end;
    end;
  except
    ShowMessage('error has occured');
  end;
  MemStream.Free;
end;
as you see, we skip 4 bytes, these are ALWAYS (1,0,0,0)

This is the most plain version of loading a KSM...

have fun

gz reb3lzrr
 
Back
Top