Add calculated fov for the clients. Current suggestion for map_update_response:
{
"npcs": [/* list of visible npcs here */]
"x": /* x position of player */
"y": /* y position of player */
"fov": [] /* a 9x9 array of 0 or 1 values. Center of array indicates player position (see above), can extend beyond map boundaries as center is always player position. */
}
Example fov of a player standing on position (0, 0) of a map without obstacles:
0 - visible, no darkness
1 - semi-visible, darkness (this is if you can see in the dark, and the darkness spell is cast here)
2 - reserved
3 - actual fov blocking
Add calculated fov for the clients. Current suggestion for map_update_response:
Example fov of a player standing on position (0, 0) of a map without obstacles:
Array access can be determined by x + y * 9.