Well... sorry for me stealing your tile graphics, but as everybody here were already familiar with RoomShaker I just thought it wouldn't be a good idea to replace them with other ones.
So.. Does that make me a thief now? How about a hijacker? Now I'm a bandit!!! Call the police and issue an arrest warrant now!!!
Ok... do you want to discuss algorithms?
Well, I think your guard location and checkpoints drawing, placing routines (or whatever you call them) are a bit wrong.
This is the level "Caverns 3" loaded in your RoomShaker II (your latest release)
And this is the same level loaded in my Easy Events Assigner II, as my graphics are a 2x size of your RS II due the fact of the numbers, I just reduced the size of the image below to 50% for better fitting.
The guards of the rooms 23, 4 and 19 are misplaced in your RS II. The guard at the room 4 is behind the number 45 of that pressure plate.
Well, about Checkpoints... I think you need to add just a one (1) to the tile location. I never saw a checkpoint assigned to a wall like that in the Room 16 and in tile 11 of the Room 12.
And about Guard Location, there is a delphi object pascal subfunction inside the function called "DrawRoom" in my EEA II with the following contents.
Code: Select all
type
TGuardLoc = record
Kind: Byte;
Location: Byte;
end;
function GetGuardLocation(L, S1, S2: byte): TGuardLoc;
var
B: Byte;
begin
B := (L div 10) * 10 + Round((S2 * 256 + S1 - 144) / 32);
result.Kind := 1;
if B < (L div 10) * 10 then begin
B := (L div 10) * 10;
result.Kind := 0;
end;
if B > ((L div 10) * 10) + 9 then begin
B := ((L div 10) * 10) + 9;
result.Kind := 2;
end;
result.Location := B
end;
The "TGuardLoc" is a record similar to the typedef struct of C/C++, the "div" operator is to peform a integer division, not a float one. Another operator I really like is the "mod"
And the Round, it's the same rounding function of C/C++.
From the FormatSpecifications file, section "4.2.3.1 Static guards":
Code: Select all
Byte 0 is a UC showing the location in this room (same as explained in
3.4.4) of the current guard.
Bytes 1 and 2 are a SS with an offset in pixels to reallocate the guard in
the floor.
So, L = Location, S1 = the Offset 1, S2 = Offset 2.
The "Kind" will be 1 if the guard is in this room, 0 if he comes from the left side of the room, and 2 if he comes of the right side... I just implemented the "Kind" only because of the color change.
Just check my source!!!
Note: Everybody can steal my code, my graphics, everything!!! I don't care!!!