ID:2392767
 
(See the best response by Kaiochao.)
Problem description: So, I was looking at the SS13 Space BG, and their parallax is pretty awesome. I know this could be accomplished with flat images layered over at each other moving at varying speeds, but is it possible to do it with some kinda tile setup?

I cant seem to find how it's done in the SS13 Github files (maybe it's a bit vague and I have pieced it together?)

At any rate, can someone show me a concept of this or send me in the right direction? It'd be much appreciated.

For people who don't know SS13, what effect are you talking about? Do you have any images or videos showing it, or can you actually explain it?

Parallax is when things far away from the "camera" move slower as the camera moves. That much is obvious, and there's an example of it in Forum_account's Sidescroller library which uses HUD objects whose screen positions are updated and wrap around as the camera moves.

If there are stars in some space background that are moving by any noticeable amount when the camera moves, and some stars move noticeably faster than others, then, realistically, you'd have to be moving at incredibly high speeds. Like, greater than the speed of light, ignoring relativistic effects. That's just how far away stars are.
In response to Kaiochao
Yeah, it isn't fully realistic, the effect is interesting to emulate though. I'd slow it down a considerable amount, but here's a video demonstrating what I'm interested in:

https://www.youtube.com/watch?v=nLAHBexJxrE

(Don't know the embed codes for the forum.)
Essentially that, though I'd slow it down a bit.
In response to Kitsueki
Best response
That's pretty much what I expected. Again, it can be achieved through HUD objects rendered before the map.
"Rendered before the map" just means the map gets rendered on top. In the past, HUD objects could simply be given a layer lower than that of your turfs to achieve this, but nowadays HUD objects are always drawn after the rest of their plane, so you'll have to give them a lower plane instead. Or maybe layer = BACKGROUND_LAYER.

The first step is to realize that HUD objects, by definition, don't move relative to the camera as the camera moves, which is the exact same effect you would want from parallax for something an infinite distance away from the camera. Here's a start for such an object:
obj/parallax_background
icon = 'whatever.dmi'
plane = -1
screen_loc = "CENTER"

Then, you may move the background as the camera moves to give the illusion of being closer to the camera.
"Move the background" means changing its screen_loc or transform. (The pixel_x/y vars don't affect where HUD objects are shown, so those can't be used in this case.)
"As the camera moves" is pretty obvious. For example, it might be whenever your player moves, but client.eye can be moved independently of the player mob, so you'll have to account for that.
A simple example:
mob/player
// Keep track of the background obj so we can move it at any point.
var obj/bg

// Show the background upon logging in.
Login()
client.screen += (bg = new/obj/parallax_background)
..()

// Update the background as the camera moves.
Move()
. = ..()
// Using the player's tile coordinates, we can move it very slowly
// (one pixel per tile) as the player moves around.
bg.transform = matrix(-x, -y, MATRIX_TRANSLATE)

However, if you move the background too far in any direction (or if the background image is simply smaller than the camera bounds), you'll end up seeing past the edge of it. The solution to this is to simply tile the background and wrap its offset e.g. using modulo.
An example of this is in Forum_account's Sidescroller library, under the "background.dm" file and the "background-demo" folder.
Hm... my space maps are pretty large, near 1000x1000. Thats a lot of HUD objects (depending on how I move them.)

Since the transform of the parallax object applies directly, there isn't really a way for me to save by using the same parallax for each player unless im missing something. If the 'closest' layer were to move a full screen size in difference between map edges (meaning the closest layer's right side will be all the way to the left if i go all the way east) and the furthest layer will move maybe.. a quarter of the screen's size, do you think I'd be generating too many objects per player? (lets estimate 100 players are on this map at once.)
In response to Kitsueki
You only need enough HUD objects to fill the screen, not the entire map.