Actions

SPG:Overlay Scripts

From Sonic Retro

Revision as of 15:35, 30 April 2021 by LapperDev (talk | contribs) (Created page "SPG:Overlay Scripts" to host scripts which help convey the physics guide explanations.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

It might not be enough to simply have collision information explained and demonstrated in images, sometimes something interactive helps a concept become fully understood. An overlay script will do just that, allowing collision information to be directly visible as you play the game. Sometimes you may see things which aren't yet explained in the guide at all. It's all on display.

Scripts like these read the data directly from the game as it is being played, to capture information about the states of the player, and of all objects currently active. This data is processed and displayed back in an intuitive way to show hitboxes, solid object collision, and other information such as the state of objects, the variables of the player, and more.

What you see using this overlay may differ to the handmade visuals on the guide. Such as:

  • Sensors are shown in colours according to their direction, rather than labelling them. So Sonic's A + B sensors will both be one colour, and when he is in wall Mode, they will change to the colour for sensors facing that side.
  • Movements of collision information by default are placed where they were executed, which is oftentimes before the object has moved, so they may "appear" to lag behind but is totally normal. To get smoother visuals, a smoothing option is available.


How to use

These scripts are specifically designed to be ran using Gens Re-Recording. When you have the game running, simply navigate to Tools > Lua Scripting > New Lua Script Window. In the window that opens, you can load the .lua file and it will run immediately. While all the classic Sonic games share a LOT of code, the scripts rely on the exact positions in the rom of lines of code, so the scripts must be specially built for each game.


Sonic 1 Overlay

This overlay shows all the collision processes going on behind the scenes in Sonic 1.

  • The special stages have been avoided since there is no useful information to be shown there.
  • This overlay is designed for use with Sonic 1 REV01 (with the moving clouds in GHZ), and will not work correctly with other games or versions.

There are various options available:

  • Q to toggle the overlay
  • W to toggle the darken layer
  • E to toggle hitboxes
  • R to toggle sensors
  • T to toggle terrain
  • Y to toggle solid boxes
  • U to toggle object size boxes
  • I to toggle object info (like name and id)
  • O to toggle player variables like speed and position
  • P to toggle "smoothing" of collision visuals
Download.svg Download SPG:Overlay Scripts
File: SPGSonic1Rev01Overlay.lua (72 kB) (info)
Current version: 1