Sonic and Sega Retro Message Board: Question about S3k's collision bug - Sonic and Sega Retro Message Board

Jump to content

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

Question about S3k's collision bug

#16 User is offline flamewing 

Posted 30 April 2018 - 02:01 PM

  • Emerald Hunter
  • Posts: 1138
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12

View PostOverlord, on 30 April 2018 - 01:37 PM, said:

A very comprehensive and well-written post - have you considered putting it somewhere on the wiki?

I thought about it, yes; I am not too sure where it would be a good place to put it: as it is, it does not fit the SCHG, and while it explains a lot of the collision physics of the originals, it does not seem to fit the Sonic Physics Guide either. I suppose that more detail could be added to tailor it to either section, maybe by giving more technical details of how to fix those bugs. Any suggestions?

Edit: added quote due to page break.
This post has been edited by flamewing: 30 April 2018 - 02:02 PM

#17 User is offline MainMemory 

Posted 30 April 2018 - 06:14 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4216
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Personally, I think it would fit very well on Neo's blog, but as for the wiki, it might even fit on a Bugs page.

#18 User is offline Brainulator 

Posted 01 May 2018 - 05:00 AM

  • Regular garden-variety user
  • Posts: 229
  • Joined: 11-October 15
  • Gender:Male

View PostMainMemory, on 30 April 2018 - 06:14 PM, said:

Personally, I think it would fit very well on Neo's blog, but as for the wiki, it might even fit on a Bugs page.

I was thinking of Neo's blog too, which actually does give me a few things I would like to mention:

  • The glitch in Sonic 3 that lets you bypass walls at certain angles is actually more heinous in Carnival Night Zone, as there are areas in which you can get stuck in a wall with no way out. Fixing this actually prevents you from backtracking through the loop in Desert Palace once you cross it, as the walkway through the loop is completely solid. (1)
  • Some interesting effects can result with top-only blocks. One is that their undersides are quite rough, which is normally unnoticeable unless two such blocks are on top of each other and you end up on the lower one. More importantly, if you reach the platforms with any upward speed, you won't touch them at all. In Hydrocity Zone, this is useful for goodies and shortcuts... and can let you access the level's sewers. The same thing happens with fully-solid level blocks when dealing with top-only collision, although this is only perceptible when the background plane moves upwards in Sandopolis's rising sand sections and Carnival Night's sign post area, as Sonic 3 & Knuckles goes. (2, 3)
  • The bug that doesn't clear your speed when you run into a floor or ceiling are apparently prevented in obvious cases by invisible collision blocks. This is less of something I learned and more of something I want to mention for everyone else's sake. (4)


#19 User is offline Lapper 

Posted 01 May 2018 - 01:24 PM

  • Posts: 1515
  • Joined: 15-June 08
  • Gender:Male
  • Location:England
  • Project:Sonic 2 HD, Sonic Studio, Kyle & Lucy: WW
  • Wiki edits:111
Oh wow. That's so in depth. I'd like to see some form of 'advanced' page on the physics guide. It's all very surface level there. It tells the what's but not the hows. I wouldn't have even considered some of the info here. the bugs parts are also interesting.

I'm curious where the sensor/bbox visuals came from.

#20 User is offline flamewing 

Posted 01 May 2018 - 03:09 PM

  • Emerald Hunter
  • Posts: 1138
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
For what is worth, I have to fix the information regarding Sonic CD: I forgot to add information about its changes to object collision code which add additional terrain collision checks to crush Sonic against walls and ceilings, as well as to prevent Sonic from being dragged into the floor.

It is also worth noting that some objects in the other games also do this, but they are few and far between.

Most of the visuals were from Gens rerecording, the versions with TAS tools (see here). I added the ray anchors a while back because they are very useful for TASing; most of the rest had been added in the past by Upthorn and Nitsuja.

The sensor rays themselves were manually; they are more qualitative than quantitative.

One thing worth mentioning is that the rays are not cast pixel by pixel, but block by block: the game just reads the data from a pair of per-block lookup tables.

#21 User is offline KingofHarts 

Posted 02 May 2018 - 03:05 AM

  • Posts: 1610
  • Joined: 07-August 10
  • Gender:Male
  • Project:Project Sonic 8x16
  • Wiki edits:1

View Postflamewing, on 30 April 2018 - 02:01 PM, said:

View PostOverlord, on 30 April 2018 - 01:37 PM, said:

A very comprehensive and well-written post - have you considered putting it somewhere on the wiki?

I thought about it, yes; I am not too sure where it would be a good place to put it: as it is, it does not fit the SCHG, and while it explains a lot of the collision physics of the originals, it does not seem to fit the Sonic Physics Guide either. I suppose that more detail could be added to tailor it to either section, maybe by giving more technical details of how to fix those bugs. Any suggestions?

Edit: added quote due to page break.


Adding to MainMemory's suggestion, this is a fine add to the Bugs page, or maybe its own section in its entirety on the wiki, since it's fairly large and encompasses all classic games. Place a link in the bugs section to it.

On another note, I'd suggest taking snippets of this, adding a little clarity where needed, and sprinkling it into the Physics Guide. It would be a fine addition.

#22 User is offline MarkeyJester 

Posted 02 May 2018 - 10:43 AM

  • It's Saturday TV Toons!! (90's Style)
  • Posts: 1860
  • Joined: 22-July 08
  • Gender:Male
  • Location:Japan
  • Wiki edits:16
Absolutely outstanding flamewing! The effort you've put into explaining every detail about the issues, complete with not only screenshots, but animated shots too, is going above and beyond.

You have added to your legacy of achievements, well done~

#23 User is offline Irixion 

Posted 02 May 2018 - 03:12 PM

  • Posts: 1521
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
Fantastic explanation. Though, I wondered--why can't Knuckles 'slide' or 'land' from his glides when he's on an object? What about S2K? Does that just use S2's collision?

#24 User is offline KingofHarts 

Posted 03 May 2018 - 03:43 AM

  • Posts: 1610
  • Joined: 07-August 10
  • Gender:Male
  • Project:Project Sonic 8x16
  • Wiki edits:1

View PostIrixion, on 02 May 2018 - 03:12 PM, said:

Fantastic explanation. Though, I wondered--why can't Knuckles 'slide' or 'land' from his glides when he's on an object? What about S2K? Does that just use S2's collision?



I'm curious on whether or not Sonic 3 Unlocked has info on this. I'd reckon this is related to some of the other minor nuances Knuckles see between these different versions. The possibility of it relating to collision is certainly possible though, monitor collision was always inconsistent in the games, and in many cases totally fucked.

#25 User is offline flamewing 

Posted 03 May 2018 - 01:26 PM

  • Emerald Hunter
  • Posts: 1138
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12

View PostIrixion, on 02 May 2018 - 03:12 PM, said:

Though, I wondered--why can't Knuckles 'slide' or 'land' from his glides when he's on an object?

You mean something like this:
Posted Image

The answer is that Knuckles' sliding code only checks for terrain in regards to sliding. That, and the Player_TouchFloor routine, which is called by solid and platform object routines, kills the glide, so that it does not even have a chance to check for objects. Also, changing the Player_TouchFloor to account for these things makes several objects (such as vertical springs) not work all that well, so they also have to be modified to clear the slide/glide. There is also an issue in object collision for several objects in S3&K that makes them interact badly with a sliding Knuckles.

There is an ancient branch of S3C with a port of my glide-on-object code, and a few other things; but I seem to remember there were some issues that went unfixed, and I never had time to investigate, so it was never merged into the main branch. SCH has a lot less issues than S3&K has because S1 and S2 were always more consistent about properly setting the registers for solid object routines.

View PostIrixion, on 02 May 2018 - 03:12 PM, said:

What about S2K? Does that just use S2's collision?

I am not sure about S2&K; I never looked too closely into it (most things in SCH were ported directly from S3&K, not from S2&K). I know it is a separate ROM that uses some data from S2 and S&K ROMs, but has its own code. But I am not sure how much of this code is S2 and how much is S&K; I would guess that it is closer to S2, though, given that you cannot spindash when Knuckles is ducking after falling from a glide.

#26 User is offline MainMemory 

Posted 03 May 2018 - 01:43 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4216
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
KiS2 is basically Sonic 2, with slight modifications to accommodate Knuckles.

#27 User is offline flamewing 

Posted 04 May 2018 - 12:11 PM

  • Emerald Hunter
  • Posts: 1138
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
I edited the posts with a bug I had forgotten to mention before, as well as some exceptions to the bugs involving solid or platform objects pulling or pushing characters into terrain. Still need to do the post for platform and solid object collision.

Edit: It is now on the Wiki. If anyone has a better place for it, please move it to, or suggest, an appropriate place.
This post has been edited by flamewing: 04 May 2018 - 05:20 PM

#28 User is offline Cooljerk 

Posted 11 May 2018 - 06:57 AM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9
Thanks for that writeup Flamewing!

EDIT: To ask a follow up question -- what are the mechanisms used in hardware to do collision detection? Isn't there a bit in the VDP status Register that can detect collision of sprites on other sprites? Does this extend to sprites on planes, tiles, etc? Or are the type of collision checks you described done entirely in software on the CPU through math?
This post has been edited by Cooljerk: 11 May 2018 - 07:11 AM

#29 User is offline Natsumi 

Posted 11 May 2018 - 07:34 AM

  • Miss Fox
  • Posts: 170
  • Joined: 08-February 12
  • Gender:Female
  • Location:Otter's lap
  • Project:Being with my boyfriend
While that VDP bit can be useful in some cases, its much more difficult to pinpoint that specifically Sonic collided with a specific objects, not to mention there is no way to use multiple colliding objects (such as Tails, some other special objects). This is why its done on software despite it being notably slower, since you can be sure what object is hitting what other object.

#30 User is offline Cooljerk 

Posted 11 May 2018 - 09:17 AM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9

View PostNatsumi, on 11 May 2018 - 07:34 AM, said:

While that VDP bit can be useful in some cases, its much more difficult to pinpoint that specifically Sonic collided with a specific objects, not to mention there is no way to use multiple colliding objects (such as Tails, some other special objects). This is why its done on software despite it being notably slower, since you can be sure what object is hitting what other object.


I've tried looking through the source code to see exactly how it's done in software but I'm not sure which routines would specifically handle that sort of stuff, can you point me in the right direction?

alternatively, what sort of patterns does the software use to speed up these kinds of checks? A buckets approach to limit number of checks or what?

EDIT: Also, just checking -- does the VDP bit check for a collision on a single specific sprite against all sprites, or does it detect collision between any two sprites? I.e. if there is any collision at all, regardless of sprite?
This post has been edited by Cooljerk: 11 May 2018 - 09:29 AM

  • 3 Pages +
  • 1
  • 2
  • 3
    Locked
    Locked Forum

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