DDNet Lockscreen
Preface
One of the cool things about X11 is that you can do whatever the fuck you want.Some may be surprised to hear that "whatever the fuck you want" includes "draw to another program's window."
Well, unfortunately for us X proponents' stance and fortunately for my artistic expression, that is a thing that you can do! My previous lockscreen was my Rain World Background Generator with a clock thrown on top, drawn to slock's ("Simple X display locker"'s) window and regenerated every few minutes.
I have used that for a couple of years and it was time for a change. Unfortunately this one draws to its own window (booooo) and I have a small slock patch to make it ignore that window being raised to the top because drawing to slock was not technically feasible due to OpenGL :(
The Thing
I have 1500 hours in DDRaceNetwork, a cooperative 2D platformer. I have archived the demos (game format recordings) of (nearly) every time I have gotten a new personal best on a map. (For most of them, that means my one and only clear.)I spent a weekend making the game display nicely across multiple monitors, threw together an endpoint to download a random one from my server, and wala! Now I have a fish tank at work, except the fish are me and my friends.
(No, I don't have one of these massive monitors rotated at home usually.)
(These videos are of the "gores" gamemode, which is "the floor is lava" mazes. DDRace, the game's main gamemode, can be much more technical. You progress much slower however so I didn't think it was great for a quick view here.)
Challenge
I was stumped for a while before starting this project on how to keep the team onscreen. I had initially hoped to weigh players based on their proximity to me over the run and something something determine camera position. The screen moving around smoothly would be too distracting for a lockscreen and not really fit the vibe, so that got nixed.The approach I came up with was to fit only my player's movement to the shape of the monitors, and use the offset from immediately before there was no solution. There is some padding applied for the in-game algorithm. Even this took some thinking to do efficiently, and makes a good programming challenge.
My solution is below (careful, using it can be a spoiler!) and you can download a Processing template here which has controls for the below constraints and drawing out movement which your solution should fit. Right click to drag the black rectangles and drag with left click to draw.
- You only need to support one vertical and one horizontal section - most monitor setups should be representable in this way
- One of the rectangles must be aligned to a wall, the other can be free
- Hint -








