BLink's Multi Layered Background Hack

Apr 6, 2018 at 10:29 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
So here's some stuff I've been working on lately.

Since this is such a complicated hack I've decided to put this in it's own thread.

You can set various variables using <BKG as shown below and set how many backgrounds to draw with <BKN (setting <BKN to 0 makes ir render vanilla backgrounds). I *think* it currently supports only 8 but you can easily get more space if you're willing to replace other things and move the offsets.

Please note that the default offset of this hack's function is at balfrog's code, if you want to move it you have to change the hex of the 2nd patch and move the code of the actual function elsewhere.

Also say hello to the longest TSC command ever.

Code:
BacKGround
<BKGAAAA:BBBB:CCCC:DDDD:EEEE:FFFF:GGGG:HHHH:IIII:JJJJ:KKKK:LLLL:MMMM:NNNN:OOOO:PPPP
A = Slot number         //the draw order
B = L_framerect         //how far from the left side of the bitmap the render area is
C = U_framerect         //how far from the top of the bitmap the render area is
D = X size              //how wide the render are is
E = Y size              //how high the render are is
F = X repeat            //how many times the bitmap repeats horizontally
G = Y repeat            //how many times the bitmap repeats vertically
H = X distance          //the horizontal distance between each rendered sprite
I = Y distance          //the vertical distance between each rendered sprite
J = Scroll type         //how the background scrolls (see the list below)
K = Scroll speed X      //How fast the background scrolls (9 is how fast it moves under the "move slowly" setting in vanilla)
L = Scroll speed Y      //How fast the background scrolls (9 is how fast it moves under the "move slowly" setting in vanilla)
M = Animation sprites   // how many sprites the rendered area cycles through
N = Animation speed     // how many frames it takes for the rendered area to change
O = X_offset            // how far from the horizontal absolute corner of the render area the sprite starts rendering
P = Y_offset            // how far from the vertical absolute corner of the render area the sprite starts rendering

So here's you the scroll type works, it's in binary but you have to "set" all the bits at the same time (kinda like EQ+ but you have to do it all in one command)
Code:
Scroll type list: (in binary)
0 = fixed
1 = horizontal move with char/camera
2 = vertical move with char/camera
4 = horizontal move with timer
8 = vertical move with timer
16 = scroll with char's direction instead of away

So 9 would make it scroll horizontal with the character/camera, and vertical with a timer


<BKNXXXX
Determines how many slots the custom BK has
0000 makes it render vanilla backgrounds.


And finally here's a test hack showing off all the features in the mod.

BKG demonstration

Have fun!
 
Last edited:
Apr 7, 2018 at 5:38 AM
Senior Member
"Huzzah!"
Join Date: Jul 12, 2017
Location: <3
Posts: 204
Age: 20
.
 
Last edited:
Apr 7, 2018 at 6:15 AM
lol
Modding Community Discord Moderator
"All your forum are belong to us!"
Join Date: Oct 20, 2013
Location: Florida
Posts: 604
So, what would this hack generally be able to do in a mod? Like, try and give an example please. (If I sound stupid I'm sorry)
If you download the mod, it gives you a good example of it's capabilities. And the example he gives I think is pretty self-explanatory:
BacKGround
<BKGAAAA:BBBB:CCCC: DDDD:EEEE:FFFF:GGGG:HHHH:IIII:JJJJ:KKKK:LLLL:MMMM:NNNN:OOOO: PPPP
A = Slot number //the draw order
B = L_framerect //how far from the left side of the bitmap the render area is
C = U_framerect //how far from the top of the bitmap the render area is
D = X size //how wide the render are is
E = Y size //how high the render are is
F = X repeat //how many times the bitmap repeats horizontally
G = Y repeat //how many times the bitmap repeats vertically
H = X distance //the horizontal distance between each rendered sprite
I = Y distance //the vertical distance between each rendered sprite
J = Scroll type //how the background scrolls (see the list below)
K = Scroll speed X //How fast the background scrolls (9 is how fast it moves under the "move slowly" setting in vanilla)
L = Scroll speed Y //How fast the background scrolls (9 is how fast it moves under the "move slowly" setting in vanilla)
M = Animation sprites // how many sprites the rendered area cycles through
N = Animation speed // how many frames it takes for the rendered area to change
O = X_offset // how far from the horizontal absolute corner of the render area the sprite starts rendering
P = Y_offset // how far from the vertical absolute corner of the render area the sprite starts rendering
And if it doesn't, I totally understand; at least how I see it, this hack allows you to create various styles to a background like css to a html file. You can switch between various backgrounds, add alternating colors, make it go in either direction you wish, it's technically limitless to your imagination (at least until we get the make a mod for you tool).
p363610-0-6m1kqr1.png

I find this hack incredibly intriguing and one of the coolest things I've seen in recent memory. For the longest time when working on ACSS, I wanted to actually do a fight with the background scrolling in such a way where it can go backwards, and thus in regards to that, this is awesome! Out of curiosity though, does this permanently interfere with the way BL or CE handles background movement, like when going into a map's settings and changing the scroll option for the background? Or is this something you access via tsc once you install it into your executable?
 
Top