ID:2407080
 
(See the best response by Ter13.)
Problem description:
as best shown in this image:

https://cdn.discordapp.com/attachments/406702610784190474/ 503750682386366476/unknown.png

Ideally - the leaves on the trees would become transparent as the player moves past them, to not cover most of the screen. is there even a viable way of doing this?

* I can set the leaves to a different plane.

* I can make the leaves their own object fairly easily.

* I can NOT have a non-per client solution. it's multiplayer.

* it Ideally would not be a major performance hit.
Best response
There's only one solution that comes even close to what you want, and I'm not sure it's going to be very performant. Further, it's going to be annoying to work with.

1) Create an override /image object per object you want to become semi-transparent.

2) store these override images in a global list, one list for each y coordinate on the map plane.

3) Notify the client every time the eye is moved. (This is harder done than said). Get the y-position of the old eye location (virtual_eye), get the y-position of the new eye location (virtual_eye). Loop over any y-tile lists that need to be removed from the client images and remove them. Loop over any y-tile lists that need to be added to the client images and add them.

This will mean that you will need to loop over a maximum of Y-1 lists per movement, and you will need to check the client's eye global z and y tile positions at maximum of once per frame per client.

You will also need to store a maximum of world.maxz*world.maxy lists of objects on the same Y tile coordinate.

If these objects can change their appearance data, you will need to update the partially-transparent override image objects too.

If these objects can move, this code becomes much more complicated, and you also need to store the global Z/Y coordinate of every client in the world and check whether an object needs to be eliminated from each, or work on some kind of subscriber notification system to keep stock of which clients need to be touched after a movement.

If these objects are destroyed, you will need to destroy the /image objects too.

It's a lot of work, and probably not worth the effect.
Urgh, Unfortunate - I knew that was an option. I was just hoping that there'd be some major fuckery possible with planesmasters or something.
I'll probably just use client images or something to make it transparent to anyone in range. Just gotta figure out the sane way to do that.
You could give mobs/objs a semi transparent overlay of themselves on a higher layer than the leaves so when they are behind them they can still be partially seen.

mob
var/tmp
obj/olay
New()
.=.()
olay = new
vis_contents += olay
proc/SetOverlay()
olay.appearance = appearance
olay.plane = 2
olay.alpha = 100


Call that anytime the atom/movables appearance changes. That only works with static icons though. Animated icons are a bit more of a problem.
Depending on how big your map is, and if you're not already using it for something else...

You could use invisibility and see_invisible to cause this effect, couldnt you?

Make a transparent version of the tree and an opaque version and layer the opaque one on top of the transparent one.

Make the opaque trees have an invisibility var which scales with their y value.

Add a line to your north and south movement procs that adjusts the user's see_invisible value. As they move farther north, their see_invisible var lowers and as they move south, it increases.

This would mean that, as the user moves north, they would lose sight of any of the opaque trees south of their position and would only see the transparent ones.

Basically your trees at Y 1 would have 100 invisibility and your trees at Y 100 would have 1. While the player is standing at Y 1, their see_invisible is 100. This causes them to see all of the trees.

As he moves north to say... Y 5, his see_invisibility would lower to 95. Then he can only see the trees at his see_invisible level which means that all the trees south of his position with the higher invisibility var wouldn't be visible anymore.