Closed Exxion closed 7 years ago
https://gfycat.com/UnderstatedVengefulFlounder
Sorry for the shit quality. New computer. Haven't yet fiddled with capture settings. That's what it looks like with some things scaled to 1/2 and no tiling.
Oh yeah I said this in the Discord a long-ass time ago but never posted it here To get speeds similar to current Parallax, you'd need vastly more planes than exist. This might be possible with a different approach (forcing the client window to be fucking massive and scaling up the play area rather than scaling down parallax) but even THAT'S difficult and the clientside performance would likely be absolutely awful Oh well
A change made to PLANE_MASTER
clipping in 512 has made this potentially possible, but I'm still not sure whether or not it would kill clientside performance.
Also, obviously, we couldn't use such a thing until the viewport freezes are fixed, since it requires the client to be 512
TL;DR: Just read the final two sentences if you can't be assed to read all of this
I've just had an interesting thought.
PLANE_MASTER
introduces a parallax-like visual effect when an individual moves around static objects on that plane, and does so entirely clientside. However, this only works over part of the screen.TILE_BOUND
render regardless of whether or not they're actually within view.Here's my proposal:
dmi
or programmatically on world startup./atom/movable
s with them as attached images and withoutTILE_BOUND
.PLANE_MASTER
s.I probably didn't do a great job explaining some of those steps, but oh well. Actually I'm going to elaborate on steps 5 and 6: When you apply a scale transform to a single atom, it just changes its apparent size. Nothing special. When you apply a scale transform to a
PLANE_MASTER
, though, it scales theentire canvas it draws that plane on
. So the sprites are not only smaller, but closer together. It is, again, an effect very similar to parallax. There's a catch, though: This is an effect simply applied to rendering that plane onto your screen. It still only renders the parts of sprites that would be onscreen without the transform. So if you just did this the naive way, you would only have parallax in the middle part of your screen. That's where the other transforms and multiple copies of the objects come in. Say you have a parallax speed that corresponds to a scale transform of 1/2. The central parallax object would only cover the middle half of your screen in any dimension (so middle quarter of the whole screen). So you make eight more parallax objects and apply an additional translation to their respective screen objects to tile it over the whole screen (and disallow parallax speeds low enough to get a scale below 1/3). Now you have parallax covering the whole screen, but it's a repeating tile. So you apply the opposite translations to the parallax objects themselves so that the nine tiles form a single smooth image. Now all you have to do is move the parallax objects when the mob changes Z-levels so that the objects are on the right Z-level and in the proper place to avoid a jump in the parallax.I THINK this would work, but I have a few worries:
PLANE_MASTER
s cause the icons on their plane to be drawn onto one canvas and then drawn over the scene, they may not behave well with the wacky antics we use to render parallax exclusively over space.TILE_BOUND
.I know that the lack ofI just tested it. This does work.TILE_BOUND
will allow the icon to render regardless of distance or obstruction, but I'm not 100% sure if it works for attached images. If it doesn't, then a slightly modified version of this approach would still work, but it would come at the cost of losing parallax speed settings.Unless someone else thinks this sounds like a fun project and wants to do it themselves, I intend to do this. I opened the issue because
So if anyone has any reasons not to try this, go ahead and say them. And if anyone wants to make me a fucking massive test parallax sprite (doesn't have to look good), please also do that.