Sonic Background Scrolling Screensaver

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, May 16, 2015.

  1. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    The file paths are only relevant to the build process for the SMPSOUT DLL, which is where they're from, the screensaver only uses them to get the song names. Custom songs are supported the same way they are in S&KC, by adding a songs_cust.ini file with the same format as the other two.
     
  2. Hitaxas

    Hitaxas

    Retro 80's themed Paladins Twich streamer Member
    I still cannot get it to work. I created the songs_cust.ini file and followed the correct format for the track, however it ends up being skipped when the screensaver runs. I know that it will skip tracks with missing files, but that's not the issue here. I am using a track that was made for stock S1 (using only the DAC from S1).

    [TestTrack]
    Type=S1
    Offset=0000
    File=Z:\SonicBGScrollSaver\TestTrack.bin

    Is the file path not setup correctly here? If not, how should I call this file?
     
  3. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    Backslashes must be escaped, so either double all the backslashes or use forward slashes. Also, you can use a relative path, which if I'm understanding your directory structure, would leave the path as simply "File=TestTrack.bin".
     
  4. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    I've added Green Hill Zone, which is unfortunately limited vertically like EHZ and S2CNZ.

    I've also fixed the screensaver so that custom music works.
     
  5. JansenM

    JansenM

    Member
    117
    0
    16
    Devon, UK
    Generations mods
    EHZ, HPZ and DEZ's backgrounds have become white for me after the most recent update.
     
  6. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    Redownload them, I changed how background colors are handled.
     
  7. Overlord

    Overlord

    Aros gartref, diogelu'r GIG, achub bywydau Moderator
    17,818
    133
    43
    Berkshire, England
    Learning Cymraeg
    Interesting. GHZ is noticeably more laggy than the others are.
     
  8. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    Two new zones today: Marble Zone and Spring Yard Zone. Marble Zone won't display animated torches properly unless you update the screensaver (it's actually a bug in SonLVLAPI.dll).

    Edit: added Star Light Zone because why not.
     
  9. Infiniti

    Infiniti

    ↑ & ↓ & ↻ Member
    476
    0
    0
    UK
    Excellent, I'm gonna go try out these and the one's I missed. Also, regarding my earlier post on Death Egg....Thank's a million for porting it. That was the one I was after. ;)
     
  10. Woofmute

    Woofmute

    Y and -Y and XYZ-X-Y-Z. Member
    184
    0
    16
    Hacking and researching Rez.
    Marble Zone seems to be the laggiest for me, but thanks for this.
     
  11. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    With Scrap Brain Zone Act 1 and Scrap Brain Zone Act 2, I've finished all the levels in Sonic 1.

    I've also updated LZ/SBZ3 to allow three settings for water: None, Partial, and Full. GHZ has been updated to add an option for the Title Screen palette (you should delete the GHZ folder before updating it). I've also made the level list in the config dialog a bit larger.
     
  12. Josh

    Josh

    Oldbie
    1,549
    168
    43
    USA
    Just updated everything, it looks awesome! Shame about the vertical level height. I use the CNZ background for my intro on YouTube, and when I designed the newest version, I noticed there was a black strip at the top. So I copied the video, flipped it upside down, and reversed it to fill out the sky.

    Mushroom Hill and _especially_ Star Light are my favorites so far.
     
  13. Covarr

    Covarr

    Sentient Cash Register Member
    4,233
    2
    18
    Trapped in my own thoughts.
    Two stageplays, a screenplay, and an album
    Does it need to be hard capped at 60fps? My display (and more and more gaming monitors these days) runs natively at 144, and it'd be nice to at least run at 72 to eliminate microstutter.
     
  14. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    The problem with running at more than 60fps is that everything that's not strictly camera-based would move faster, unless I rewrote a whole lot of code. I could do it, yes, but I'm not sure if it would be worthwhile.
    Also would your CPU even be able to handle that?

    Josh: Maybe someday I'll go back and figure out a way to extend these levels vertically in a way that looks natural.
     
  15. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    So, funny story: I wanted to see what framerate I was actually getting, so I added an FPS display, and even though I had it set to 60fps, it wasn't going over 32fps. When I looked at the documentation for the Timer class, it said "Because the Timer class depends on the system clock, it has the same resolution as the system clock. This means that the Elapsed event will fire at an interval defined by the resolution of the system clock if the Interval property is less than the resolution of the system clock. The following example sets the Interval property to 5 milliseconds. When run on a Windows 7 system whose system clock has a resolution of approximately 15 milliseconds, the event fires approximately every 15 milliseconds rather than every 5 milliseconds." Guess how many milliseconds a frame lasts at 32fps.

    So, I ditched the timer for a loop with a high-resolution Stopwatch, and now I get 62fps on every level... except Marble Zone, for some reason.

    The FPS counter is now an option in the config dialog, though it may be a bit glitchy at first fixed. I've received a report that the screensaver now runs slower on Linux, so sorry to any Linux users.
     
  16. ICEknight

    ICEknight

    Researcher Researcher
    I hadn't found about this until today, and I must say it's really cool!

    My suggestions:
    -Option for x2 or x3 (pixellated) zoom. Perhaps it could also autodetect the needed zoom for making the shortest map go full screen?
    -Option for making it also scroll up and down through the map, in a configurable wave pattern.
    -HLSL support for a "TV effect" on fast computers.
     
  17. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    On your first suggestion, allow me to quote myself:
    The second is something I have considered since the beginning, but I don't know how such a setting would be presented, and there's the issue where not every level can scroll vertically, or to the same amounts. Additionally, the screensaver program has no idea about how tall each level is. I could add an API, but then everyone would have to redownload all the levels when they update the screensaver. Furthermore, some levels tile indefinitely vertically, like SBZ2.
    For the third, HLSL would require rewriting the screensaver to use Direct3D.
     
  18. At 1080p resolutions and higher, software renderers (such as 8-bit classic mode in EDuke32) bump up against the limits of CPU speed, so you would need to rewrite it to utilize GPU acceleration (OpenGL or Direct3D, as you mentioned).

    That said, I'm thoroughly enjoying this screensaver.
     
  19. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    Well I don't know how to do any of this stuff with D3D, or anything about OGL. Maybe if the scrolling was done in software and the image rendered with 3D hardware acceleration (level backgrounds aren't usually that large, GHZ and MZ being notable exceptions)? Although, according to what I've read, GDI+/GDI might be hardware accelerated already?

    Also, I've been tweaking some levels to use a new API (that means you need to update the screensaver too) that makes GHZ and MZ a lot faster. GHZ hits 60fps now and MZ is like 55fps on my machine. Other levels were updated, but they weren't particularly suffering from slowdown. I plan on using this new method for most of the levels eventually.

    Also also, 60fps YT vid:
    http://youtu.be/uhKCxyNZ1Vs
    + - Yes, it's upscaled 800x600 video, my computer can't record at 1366x768 and maintain 60fps.  
     
  20. Blivsey

    Blivsey

    Charismatic Sonicaholic Member
    Part of the bottom of Hidden Palace Zone is misaligned. Is that something you can't do much about because of how disassemblies work, or just something that was overlooked?