Sorry for double posting.. but i also noticed you /32 x.x that's wrong... graal tiles are 16x16 pixels ;x... 32x32 = 4 tiles
NPC Code:
viewx=playerx-1.5; if (viewx<0) viewx = 0;
And i think that should be what your looking for

You can work out the rest.
