Sonic Background Scrolling Screensaver

Discussion in 'Showroom Archive' started by MainMemory, May 16, 2015.

Thread Status:
Not open for further replies.
  1. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    One day, I was thinking about SonLVL and wondering if I could use it to recreate the backgrounds from Sonic levels, complete with scrolling and animations. As it turns out, I could. So I decided to make a screensaver out of it, because it seemed like the best thing to do, I guess. And then, since I had the SMPS music player for Sonic & Knuckles Collection set up so it could be used by other programs, I decided to throw that in too.

    When first running the screensaver, you will have to configure it by right clicking and choosing the "Configure" option (or using the /c argument on the command line). You can choose whether or not to play music, the volume of the music (in percent, 0 to 1000, default 100), the number of frames per second (1 to 60, default 30), the speed to scroll at (-64 to 64, default 8), which levels to show and what order to show them in, and the amount of time to display each level for (hours:minutes:seconds:centiseconds, default 5 minutes).

    It is important to not install the screensaver by copying it into the system32 folder as is common practice, instead you should right click the file and select "Install".

    When running the screensaver, there are a few keyboard commands that will perform actions other than closing the screensaver: W toggles water when applicable, M toggles music, N jumps to the next level, up/down shift the camera up or down, and left/right increase or decrease the scroll speed.

    Here is the main part: Download

    .NET 3.5 is required, and MSVC 2010 redist if you want music. The screensaver may does run on Linux, but without music.

    And the levels available so far are:

    The source code is on Sonic Retro's GitHub if you want to see how it works or contribute to development. Tech Members have access by default, anyone else may contact me for access.

    Before you all start requesting levels, keep in mind that I have to port all these by hand. I'm mostly familiar with Sonic 2, Sonic 1 I can barely understand the disassembly, Sonic CD has no disassembly (also music), Sonic 3 & Knuckles not only is poorly documented in the scrolling area, but it also has a lot of fancy tricks used to create the illusion of more layers, I could try to make them into actual layers, but I'd need some way to get full images for all the different "layers" (a similar thing applies to HTZ). Some levels have lots of animated tiles and I'm not sure how to handle that yet, I've got some ideas, I might have to try Metropolis Zone and see what works best. Levels from other games or different things entirely are possible, but I'm not likely to do it myself.

    If you look at the source code for each level, you can see that S2HPZ is closely emulating the original 68000 instructions, while LZ and EHZ are more high level but still producing identical results.

    About the framerate, I chose 30fps as the default because that's what works on my computer with minimal stuttering, and a graphics card isn't much help here, all the rendering is done in software, using a combination of my own 8bpp bitmap code from SonLVL and GDI+. If anyone has ideas for optimization, that would help a lot, possibly with SonLVL too.
     
    Last edited: Feb 27, 2016
  2. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    This is amazing! I like that you can choose from music from all the Genesis games. So far, my favorite background would be Hidden Palace. LZ and SBZ3 look repetitive and EHZ is only takes up the bottom of the screen. Also, I really like palette cycle for the water. I hope to see more to come.
     
  3. Slash

    Slash Well-Known Member Member

    Joined:
    Aug 12, 2013
    Messages:
    52
    It looks and works pretty well, and I do get the stuttering past 30fps. Maybe it's just a thing with Windows. Also: Is there a way to make your own custom levels for this?
     
    Last edited by a moderator: May 16, 2015
  4. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Yes, in exactly the same way I made the ones that were made so far (see GitHub link). If you don't know a .NET language though, you're pretty much out of luck.
     
  5. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I'm impressed with how accurate the coding seems to be (It even has the SwScrl_RippleData info in the EHZ one; now that's accuracy). Since it seems to read chunks art, palettes, etc. like the original games, the only thing it really needs to be user friendly (besides a copy of SonLVL :p) is a simple way to port or create parallax code for it. Of course, this is obviously a side project, but an easy way to edit it would be incredibly awesome.

    EDIT: I'm a little disappointed to see that the S1 styled water deformation didn't make it... Oh, well.
     
    Last edited by a moderator: May 16, 2015
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I suppose I could make a DLL that reads a list of scroll speeds for each line from setup.ini. I dunno about an editor though.

    And what do you mean, "S1 styled water deformation"? I took the code and array from S1rev01.
     
  7. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    I tried to use this on Windows 8.1m I got LZ, HPZ, EHZ, and SBZ selected.
    But, when it launches, it says there isn't a Zone selected..?
     

    LvlSSnoWork.png
     
  8. Lazarus

    Lazarus Newcomer Trialist

    Joined:
    Apr 8, 2015
    Messages:
    15
    Location:
    Splatoon Hell
    Is there any way to make HIdden Palace play Track #10?
     
  9. amphobius

    amphobius spreader of the pink text Member

    Joined:
    Feb 24, 2008
    Messages:
    970
    Location:
    United Kingdom
    This is rad.

    Any chance of LRZ1's background? That's easily one of the prettiest backgrounds I can think of and would replace my Steins;Gate Divergence Clock screensaver pretty well!
     
  10. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    This is awesome. I've been messing with the source to make my own backgrounds, and yeah, good work!

    (Perhaps I could make a tutorial on how to make a basic scrolling background?)
     
    Last edited by a moderator: May 16, 2015
  11. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    ​That's... really weird and I don't know how it could possibly happen?

    ​In S2HPZ\setup.ini change the music entry from MysticCave2P to S2HiddenPalace.

    ​That is one of those "multi-layered" backgrounds I was talking about. I would have to either try to recreate the tile reloading or split the back part into a separate layer and recreate the scrolling by hand. Also someone that knows about S3K scrolling would be helpful.
     
  12. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    ​Well, don't worry.
    It's probably just Windows 8 being Windows 8.
    I'll try it on my Windows XP computer later on. 
     
  13. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    ​On my computer, there's no swaying animations; it only statically distorts the areas underneath the water. In other words, it appears curved, but doesn't sway back and forth, making it look really out of place. I'm using Windows 7, if that helps.
     
  14. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    It definitely moves for me, also on Windows 7. Are you just not seeing it because the screen is scrolling (try setting the scroll speed to 0)?

    Also I've updated the screensaver to fix a multi-monitor bug, and updated LZ to cut the scroll speed in half.
     
  15. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Nevermind, I must have not been looking close enough; it does indeed have appropriate water deformation, I just didn't see it at first; it's a lot slower then I thought it might be :|
     
  16. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I've added a new Generic.dll file to the main download package, which can be used to make backgrounds without any programming.
    Just make a setup.ini file like the other levels have with "file=../Generic.dll" and "type=Generic.Generic", then you can either provide SonLVL-like level data settings, or a paletted bitmap file as an "image" setting.
    Then you can provide scroll speeds for each line in the image with "hscroll#" lines (above the [Level] group if you're using that) where # is the line starting at 0, and the value is a floating-point number that the camera's position is multiplied by (ie hscroll0=0.5 means line 0 scrolls at 1/2 the camera speed). If you don't have settings for all the lines, they will wrap around to the beginning of the list (so if you only have hscroll0, every line will scroll at the same speed).

    Here's an example:

    Code:
    file=../Generic.dll
    type=Generic.Generic
    name=Generic Level
    music=S3Continue
    hscroll0=2
    hscroll1=0.5
    hscroll2=-1
    hscroll3=0
    version=S2
    [Level]
    tiles=art.bin
    blocks=blocks.bin
    chunks=chunks.bin
    layout=layout.bin
    palette=SonicAndTails.bin:0:0:16|palette.bin:0:16:48
     
  17. Lazarus

    Lazarus Newcomer Trialist

    Joined:
    Apr 8, 2015
    Messages:
    15
    Location:
    Splatoon Hell
    This is awesome! How about a NO WAY one?
     
  18. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I can only imagine that being either really tiny or really pixellated.

    I've added Death Egg Zone (Sonic 2), and updated the screensaver to fix a freeze when pressing the N key with only one level loaded.
     
  19. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Do you think you could make it so that you can easily set a speed for multiple lines (in other words, make lines 1-20 scroll at speed 5), instead of defining them one at a time? It's very tedious, and makes editing and implementing new scrolling backgrounds a chore; I haven't even gotten through three blocks worth of lines, and I'm tired of it.
     
  20. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    How about this: I've modified the Generic DLL so that any line numbers missing from the hscroll list will copy from the line that was defined last, so hscroll0=5 and hscroll20=4 will set lines 0-19 at speed 5 and line 20 at speed 4.
     
Thread Status:
Not open for further replies.