Sonic and Sega Retro Message Board: [S1] Considerably speeding up level loading - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

[S1] Considerably speeding up level loading Gotta go fast, right?

#1 User is offline Green Snake 

  Posted 10 November 2014 - 11:02 AM

  • Posts: 45
  • Joined: 08-February 12
  • Gender:Female
  • Location:0x00
  • Project:SoniPlane
So, the other day as I was browsing through my old projects, I found a project that I had been working on but never completed, and since I came up with ways to considerably speed up level loading, I thought I could share with you. Why you'd want to use this? Well, I don't... Gotta go fast, right??!!
Bear in mind I will use Sonic 1 HiveBrain disassembly, so for SVN/Hg/Git, reference only. I am unsure whether or not will it work with Sonic 2 or Sonic 3/Knuckles/3 and Knuckles. Most of these are compatible with each other and can be applied fairly easily, however if its not the case, and is known, will be stated in the description

Method 1: Title card art optimization
Spoiler


Method 2: Comper compressed level graphics
Spoiler


Method 3: Not waiting for PLC's being loaded
Spoiler

Misc
Spoiler


If you find any bugs, or have other suggestions, post them in the comments!
This post has been edited by Green Snake: 11 November 2014 - 09:28 AM

#2 User is online MainMemory 

Posted 10 November 2014 - 11:36 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3380
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I have an idea to speed up reloading the level after dying or loading the next act, based on what I did for level transitions in Sonic 2 Adventure Edition.
Basically, you take a single RAM byte and set it to -1 in before it switches to level mode (like in the title screen and S2 2P level select).
Then you load the level normally, and when it finishes loading, you set the byte to the current zone number. The next time a level loads, it will check the variable and find a match for the current zone number, and skip loading the main art tiles, blocks and chunks.
One could potentially skip reloading the level layout as well after dying, but that would require an extra byte, and anything that alters the layout would be problematic.

#3 User is offline Green Snake 

Posted 10 November 2014 - 11:40 AM

  • Posts: 45
  • Joined: 08-February 12
  • Gender:Female
  • Location:0x00
  • Project:SoniPlane
I actually was going to do that, but completely forgot. I had done this before, by setting the level restart flag to 2 instead of 1. However I need to check very closely that I don't make the code a bloated mess while doing it, so I'll look into it later. Thanks for the suggestion anyway

#4 User is offline Clownacy 

Posted 10 November 2014 - 12:29 PM

  • Needs to make an avatar
  • Posts: 316
  • Joined: 06-July 13
  • Gender:Male
  • Location:Englandland
Hey! :U
This post has been edited by Clownacy: 10 November 2014 - 12:47 PM

#5 User is offline Green Snake 

Posted 10 November 2014 - 02:02 PM

  • Posts: 45
  • Joined: 08-February 12
  • Gender:Female
  • Location:0x00
  • Project:SoniPlane

View PostClownacy, on 10 November 2014 - 12:29 PM, said:

Hi!

#6 User is offline Hivebrain 

Posted 10 November 2014 - 04:50 PM

  • Posts: 2508
  • Joined: 15-January 03
  • Gender:Male
  • Location:53.4N, 1.5W
  • Project:HivePal 2.0
  • Wiki edits:6,176
Might as well only load the bits of the title card you're actually using.

#7 User is offline Hitaxas 

Posted 10 November 2014 - 06:21 PM

  • SEGA: Sorry Classic Sonic, we are sending you back to 1994
  • Posts: 1432
  • Joined: 30-September 07
  • Gender:Male
  • Location:Back in Litchfield,CT
  • Project:Sonic: Super Deformed (head director) - Slowly working on it.
  • Wiki edits:196
I actually did something similar like this guide to my S2 hack a few weeks back. Nice guide though, will help out a bit for those hacking Sonic 1!

#8 User is offline KingofHarts 

Posted 11 November 2014 - 01:00 PM

  • Call me back when people stop shitting in the punch bowl...
  • Posts: 1480
  • Joined: 07-August 10
  • Gender:Male
  • Wiki edits:1

View PostHivebrain, on 10 November 2014 - 04:50 PM, said:

Might as well only load the bits of the title card you're actually using.


Suggesting to go the S2/S3K route of different title card art for each title card? or loading only certain tiles out of the whole tileset?

If the latter, is there a way to do that, in a way that won't slow things down at all?

#9 User is offline Hivebrain 

Posted 11 November 2014 - 01:58 PM

  • Posts: 2508
  • Joined: 15-January 03
  • Gender:Male
  • Location:53.4N, 1.5W
  • Project:HivePal 2.0
  • Wiki edits:6,176

View PostKingofHarts, on 11 November 2014 - 01:00 PM, said:

View PostHivebrain, on 10 November 2014 - 04:50 PM, said:

Might as well only load the bits of the title card you're actually using.


Suggesting to go the S2/S3K route of different title card art for each title card? or loading only certain tiles out of the whole tileset?

If the latter, is there a way to do that, in a way that won't slow things down at all?

If the art is uncompressed then selectively loading certain letters will speed things up (though perhaps not noticeably).

#10 User is offline Green Snake 

Posted 11 November 2014 - 02:51 PM

  • Posts: 45
  • Joined: 08-February 12
  • Gender:Female
  • Location:0x00
  • Project:SoniPlane
Yeah I don't think enough to be worth making a tutorial on.

Also, I updated the post with some fixes and edits.

#11 User is offline KingofHarts 

Posted 12 November 2014 - 09:28 AM

  • Call me back when people stop shitting in the punch bowl...
  • Posts: 1480
  • Joined: 07-August 10
  • Gender:Male
  • Wiki edits:1

View PostHivebrain, on 11 November 2014 - 01:58 PM, said:

View PostKingofHarts, on 11 November 2014 - 01:00 PM, said:

View PostHivebrain, on 10 November 2014 - 04:50 PM, said:

Might as well only load the bits of the title card you're actually using.


Suggesting to go the S2/S3K route of different title card art for each title card? or loading only certain tiles out of the whole tileset?

If the latter, is there a way to do that, in a way that won't slow things down at all?

If the art is uncompressed then selectively loading certain letters will speed things up (though perhaps not noticeably).


A negligible speedup perhaps, and I'd say less VRAM usage but not that it matters ALL too much... the title card art usually just gets written to the same place as the explosion and animals anyway and doesn't interfere with anything else... and 9/10 it's gone before you ever see either of the aforementioned sprites in gameplay.

#12 User is offline KingofHarts 

Posted 12 November 2014 - 10:12 AM

  • Call me back when people stop shitting in the punch bowl...
  • Posts: 1480
  • Joined: 07-August 10
  • Gender:Male
  • Wiki edits:1
Double post... to report a bug... IDK if its in the clean ROM version, but after applying this fix, my # of lives no longer appears. The hud object with Sonic's name and icon DO appear, but the number itself does not.

#13 User is offline Green Snake 

Posted 12 November 2014 - 10:38 AM

  • Posts: 45
  • Joined: 08-February 12
  • Gender:Female
  • Location:0x00
  • Project:SoniPlane
I noticed HUD numbers not loading while testing as well, but I fixed it by extending the delay above Level_TtlCard: by few frames. I am not entirely sure as to why it happens, but I'll get to it soon.

#14 User is offline KingofHarts 

Posted 12 November 2014 - 07:47 PM

  • Call me back when people stop shitting in the punch bowl...
  • Posts: 1480
  • Joined: 07-August 10
  • Gender:Male
  • Wiki edits:1
For what it's worth, it seems to update at the end of act tally. I'm at work now, but I'll check tonight regarding anytime the lives counter update flag would be set.

#15 User is offline KingofHarts 

Posted 18 February 2015 - 06:43 AM

  • Call me back when people stop shitting in the punch bowl...
  • Posts: 1480
  • Joined: 07-August 10
  • Gender:Male
  • Wiki edits:1
Curious, did you manage to fix the bug with this fix...?? I notice its easier to occur with Debug mode active.

Page 1 of 1
    Locked
    Locked Forum

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