One problem is that your creating an array of 0..32, 0..24 and then in the lower loops accessing it as 0 to 25 and 0 to 32. Make sure that your indexing it properly or that you have sized it properly. I'm guessing that your indexing should be 0 to 24.

You also index it as 0 to 31 (top loop).

All of this combined will give you crazy results. Instead try using constants and making sure that your indexing to value-1.

Now, as for your read char by char. Ditch that and go with a block read as your array is in order. So it goes from:[pascal]Stream:=tfilestream.Create(mapfile, fmopenread);

try
try
for y:=0 to 24 do
begin
for x := 0 to 31 do
begin
stream.ReadBuffer(C, SizeOf(C));
tempbuffer[x][y]:=c;

end;
end;
except on e:exception do
messagedlg(e.Message, mterror, [mbok], 0);
end;
finally
stream.free;
end;[/pascal]

to:[pascal]Stream:=tfilestream.Create(mapfile, fmopenread);
try
try
if stream.size <> COLS* ROWS then
raise exception.CreateFmt('Data file "%s" size incorrect!', [MapFile]);
stream.ReadBuffer(@tempbuffer[0][0], 25*32);
except on e:exception do
messagedlg(e.Message, mterror, [mbok], 0);
end;
finally
stream.free;
end;[/pascal]

A final re-work of your entire source could be (This only works if there are no line breaks in the file):[pascal]const
COLS = 25;
ROWS = 24;

procedure form22.SetupMap(MapFile:string);
var
Stream:TFilestream;
C : Char;
x, y : Word;
tempbuffer : array[ 0..COLS-1, 0..ROWS-1 ] of Char;
begin
Stream:=tfilestream.Create(mapfile, fmopenread);
try
try
if stream.size <> COLS* ROWS then
raise exception.CreateFmt('Data file "%s" size incorrect!', [MapFile]);
Stream.ReadBuffer(tempbuffer[0, 0], COLS*ROWS);
except on e:exception do
messagedlg(e.Message, mterror, [mbok], 0);
end;
finally
Stream.free
end;

for y := 0 to ROWS-1 do
for x := 0 to COLS-1 do
case tempbuffer[x][y] of
'0' : map[x][y].Tile:=0; //grass
'1' : map[x][y].Tile:=1; //path
'2' : map[x][y].Tile:=2; //Water
end;
end;[/pascal]

BTW: For the love of god will you name your forms and use some spacing .