ID:1133930
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Overview

Currently, when a turf cannot be seen due to opacity or low luminosity, the turf is simply not rendered at all on the screen leaving instead a black box sized according to world.icon_size. This is an undesirable scenario in a few cases: 1. When attempting to fake parallax (as in space) by rendering an image on the screen in the background (and then setting turfs to be invisible). 2. When using a sidemap perspective: not enough of the screen is obscured leading to bizarre visual artifacts.

My proposal is to add a new variable to the mob or client: obscured. This variable accepts an image object (mostly concerned about the image icon and layer) and renders that image in place of any tile that would be obscured (due to opacity, etc.). I do not know much about the BYOND back-end but a suggested implementation would be to change behaviors such that instead of not rendering obscured tiles, simply render the defined obscured image instead at that turf's position.

Example Case 1: Better Parallax Visual for Space-based games

The following link shows two images that represent the effect I am trying to accomplish. The effect works fine currently in stock BYOND when no opacity is involved. http://imgur.com/DGrjrYE,4ocAasM
Note how the player moves between the two positions but the background star-scene stays the same. This effect was achieved by setting the space tiles to be transparent while placing placing a space picture onto the screen in the background.

The illusion fails when an opaque wall is added to the scene. Adding a wall to the right-side of that floor and moving around causes pictures like this: http://imgur.com/wxdiMEI,O2Rez7H,5J2fjyh

The third image is a simulated result using the new obscured feature. By setting the layer of the obscured image greater than that the space picture, I have restored the appropriate behavior for opacity. (The icon of the obscured image was just a 32x32 completely black image.)

Example Case 2: Better Vision Blocking for Sidemap Walls
This feature will also resolve the issue brought up in http://www.byond.com/forum/?post=1130890

When moving to a sidemap perspective, tiles actually take up more visual space than the icon_size. For example, assume icon_size is 32x28. Thus, floor icons are 32x28; but, most objects will have a height. Assume walls have a height of 32 pixels (so a dense, opaque wall has an icon of size 32x60). With these parameters, a tile and all things on the tile actually affect a 32x60 'space' in the room. However, obscuring the tile with an opaque wall will only cause the default visual obscuring effect for the 32x28 tile. This leads to artifacts.

For example, consider the following images of me moving around a room: http://imgur.com/3E2P9aZ,lQqBAi2,wbKhHzH,h7hAyJ4,o8zY5Vt#2 (I apologize, Imgur duplicated 2 of the images in that album for some reason) Note the visual artifacts due to missing tiles. Note the particularly bad artifact in the one image where the lighting looks completely broken (since they were created by setting pixel_z for the lighting image).

By setting obscured equal to a 32x60 black box image, I get the simulated results which look much better in my opinion and resolve the artifacting issues: http://imgur.com/HoBpfEY,AZylXtP

As an extension, nothing prevents the player from using something other than a totally black icon. For example, in this latter example, giving the 32x60 tile a slight outline (so that it was modeled similar to the wall) could possibly help players better see what parts of their vision are obscured.
+
I actually posted a suggestion similar to this a couple of days ago. See http://www.byond.com/forum/?post=1463355

My suggestion is to modify this behavior on atom level, so that you can use this effect multiple times in your project.

Perhaps these two suggestions should be merged?
+ please, having the blank tiles opacity makes is really ugly to use in most cases