Sonic and Sega Retro Message Board: Sonic Background Scrolling Screensaver - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 5 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

Sonic Background Scrolling Screensaver it's for your computer

#1 User is online MainMemory 

Posted 15 May 2015 - 08:32 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
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 will 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.


This post has been edited by MainMemory: 27 February 2016 - 01:40 PM

#2 User is offline JansenM 

Posted 16 May 2015 - 09:55 AM

  • Posts: 115
  • Joined: 25-August 12
  • Gender:Male
  • Location:Devon, UK
  • Project:Generations mods
Brill! Functionality's top notch and it's really easy to get running.

Posted Image

Only seems to work on two outside of Eyefinity, but that may be something to do with my DVI output. Other screen savers have no issue spanning across all three though, so it may be something to look into.

Might I suggest tweaks to the Labyrinth/Scrap Brain backrounds' behaviour? I'm not sure if it's more faithful to the games as is, but the difference in speed due to the background being on a closer plane than the others is very jarring - Emerald Hill's pretty peaceful and Hidden Palace's depth works very well, but then you just have a wall zooming past a lot more excitedly than the other two. It's not fatal, but the inconsistency can be distracting.

#3 User is online MainMemory 

Posted 16 May 2015 - 11:56 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Apparently WinForms has an issue with setting negative coordinates in the form's constructor. I moved some code around and fixed the issue.

I also cut LZ's scrolling speed in half, hopefully it should be okay now. The original game actually reduces it even more, but then it hardly moves at all.

#4 User is offline MarkeyJester 

Posted 16 May 2015 - 01:36 PM

  • It's Saturday TV Toons!! (90's Style)
  • Posts: 1857
  • Joined: 22-July 08
  • Gender:Male
  • Location:Japan
  • Wiki edits:16
Oh my! This is simply divine! (there, you happy now?).

Very impressive, I finally have a screen saver worth having... The source code availability is also a plus side, I think I might just add Starry Night Zone to it!

#5 User is offline Overlord 

Posted 16 May 2015 - 02:36 PM

  • Substitute Meerkovo IT Chief
  • Posts: 17000
  • Joined: 12-January 03
  • Gender:Male
  • Location:Berkshire, England
  • Project:VGDB
  • Wiki edits:3,204
Awesome stuff, have installed it and I think I'll be using it, even though there's noticible frame drops. That's more my PC being poor than anything.

If nothing else, you now have confirmation it works properly from someone who has a dual monitor setup of both a portrait and a landscape monitor =P

#6 User is online MainMemory 

Posted 16 May 2015 - 04:07 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
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:
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



#7 User is offline Tets 

Posted 17 May 2015 - 04:56 AM

  • one rude dude
  • Posts: 744
  • Joined: 26-December 05
  • Gender:Male
Neat! I haven't been this enthused by a screensaver since the Earthbound battle background screensaver was released years ago. All I could ask for is an option to scale up the graphics, but it's pretty slick as is.

#8 User is online MainMemory 

Posted 17 May 2015 - 12:45 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
What kind of scaling? Nearest-neighbor? HQ#X? xBRZ? Something else? I can only do so much processing on the image in the time each frame lasts.

#9 User is offline Infiniti 

Posted 17 May 2015 - 01:47 PM

  • ↑ & ↓ & ↻
  • Posts: 476
  • Joined: 24-August 03
  • Gender:Male
  • Location:UK

View PostMarkeyJester, on 16 May 2015 - 01:36 PM, said:

I finally have a screen saver worth having...

Oh I can think of another...
This really is amazing! I'd be keen to see Sky Chase or Death Egg converted. For now, I'll keep it on the Labyrinth.

#10 User is online MainMemory 

Posted 17 May 2015 - 02:47 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Sky Chase is problematic, in that it was clearly designed for a 224 pixel tall screen. In order to make backgrounds work as a screensaver, they have to be able to tile horizontally, and either tile or extend with a solid color vertically. Also, which Death Egg? The only one I can see working well is S2's.

#11 User is online MainMemory 

Posted 17 May 2015 - 05:50 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
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.

Edit: 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.

Edit2: Mushroom Hill Zone, first S3K level, first multi-layered level, first level not ported from a disassembly.
This post has been edited by MainMemory: 18 May 2015 - 02:51 AM

#12 User is offline Tets 

Posted 18 May 2015 - 05:48 AM

  • one rude dude
  • Posts: 744
  • Joined: 26-December 05
  • Gender:Male

View PostMainMemory, on 17 May 2015 - 12:45 PM, said:

What kind of scaling? Nearest-neighbor? HQ#X? xBRZ? Something else? I can only do so much processing on the image in the time each frame lasts.

Nothing quite that expensive, more like simple upscaling by integer factors. Say I wanted to just double the size of each pixel, or triple it, and so forth.

On a different note, the MHZ background looks awesome at 1080p. Certainly no need to upscale that.

#13 User is online MainMemory 

Posted 18 May 2015 - 12:29 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I tried adding scaling to EHZ, and even at just 2x scale, the framerate dropped massively. I would have to come up with a much faster scaling method than the one SonLVL has currently and the one GDI+ gives me.

Edit: Casino Night Zone
This post has been edited by MainMemory: 18 May 2015 - 03:56 PM

#14 User is online MainMemory 

Posted 18 May 2015 - 06:30 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4204
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Mushroom Hill Zone has been updated to add a fourth "All Seasons" mode, which cycles through the three color palettes with a configurable delay and fade length in frames. If you want to go back to the "Early Fall" palette after the "Late Fall" palette, you can just add a copy of the palette2 line as palette4.

#15 User is offline Tets 

Posted 18 May 2015 - 08:56 PM

  • one rude dude
  • Posts: 744
  • Joined: 26-December 05
  • Gender:Male

View PostMainMemory, on 18 May 2015 - 12:29 PM, said:

I tried adding scaling to EHZ, and even at just 2x scale, the framerate dropped massively. I would have to come up with a much faster scaling method than the one SonLVL has currently and the one GDI+ gives me.

Fair enough. I was afraid that might be the case, but I can't really complain in the end.

  • 5 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users