Actions

Difference between revisions of "Sonic Physics Guide"

From Sonic Retro

(Recategorisation)
(New dedicated hitbox page)
 
(9 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
== Physics Guides ==
 
== Physics Guides ==
*[[SPG:Basics|Basics]]
+
'''[[SPG:Basics|Basics]]'''
A prerequisite for much of the info on this guide.
+
:A prerequisite for much of the info on this guide, including common variables, how angles work, how precise values for positions and speeds work, how object sizes are displayed, and more.
*[[SPG:Characters|Characters]]
+
:*[[SPG:Basics#Positions|''Positions'']]
Basic info about characters such as their varying sizes and jump height, and also detailing how their specific moves work.
+
:*[[SPG:Basics#Angles|''Angles'']]
 +
:*[[SPG:Basics#Variables|''Variables'']]
 +
 
 +
'''[[SPG:Characters|Characters]]'''
 +
:Information about specific characters and their constants, variables, their varying sizes and jump height, and also detailing how their specific moves work.
 +
:*[[SPG:Characters#Sonic|''Sonic'']]
 +
::*[[SPG:Characters#Drop_Dash_.28Mania.29|''Drop Dash'']]
 +
::*[[SPG:Characters#Dash_.28Super_Peel_Out.29|''Super Peel Out'']]
 +
::*[[SPG:Characters#Insta-Shield|''Insta-Shield'']]
 +
:*[[SPG:Characters#Tails|''Tails'']]
 +
::*[[SPG:Characters#Flying|''Flying'']]
 +
:*[[SPG:Characters#Knuckles|''Knuckles'']]
 +
::*[[SPG:Characters#Gliding|''Gliding'']]
 +
::*[[SPG:Characters#Climbing|''Climbing'']]
  
 
<div class="large-3 columns">
 
<div class="large-3 columns">
 
===Collision===
 
===Collision===
*[[SPG:Solid Tiles|Solid Tiles]]
+
'''[[SPG:Solid Tiles|Solid Tiles]]'''
A detailed description of how sloped terrain is constructed, and how objects use sensors to collide with it.  
+
:''Terrain Part 1:'' A detailed description of the individual building blocks of terrain and how they are processed detected.
*[[SPG:Solid Objects|Solid Objects]]
+
:*[[SPG:Solid Tiles#Sensors|''Sensors'']]
Explaining object hitboxes, solidity, the Player's hitbox, and other ways objects directly interact with them.
+
 
 +
'''[[SPG:Solid Terrain|Solid Terrain]]'''
 +
:''Terrain Part 2:'' How Solid Tiles and collison layers are used to construct slopes, loops, and other structures.
 +
:*[[SPG:Solid Terrain#Layers|''Layers'']]
 +
:*[[SPG:Solid Terrain#Loops|''Loops'']]
 +
 
 +
'''[[SPG:Slope Collision|Slope Collision]]'''
 +
:''Slopes Part 1:'' How the Player object uses its sensor arrangement to detect and react to sloped terrain.
 +
:*[[SPG:Slope Collision#The_Player.27s_Sensors|''The Player's Sensors'']]
 +
:*[[SPG:Slope Collision#Sensor_Activation|''Sensor Activation'']]
 +
:*[[SPG:Slope Collision#Floor_Sensors_.28A_and_B.29|''Floor Sensors (A and B)'']]
 +
:*[[SPG:Slope Collision#Ceiling_Sensors_.28C_and_D.29|''Ceiling Sensors (C and D)'']]
 +
:*[[SPG:Slope Collision#Wall_Sensors_.28E_and_F.29|''Wall Sensors (E and F)'']]
 +
 
 +
'''[[SPG:Hitboxes|Hitboxes]]'''
 +
:Object hitboxes, the Player's hitbox, and other ways objects directly interact with the player other than solidity.
 +
:*[[SPG:Hitboxes#The_Player.27s_Hitbox|''The Player's Hitbox'']]
 +
:*[[SPG:Hitboxes#Trigger_Areas|''Trigger Areas'']]
 +
 
 +
'''[[SPG:Solid Objects|Solid Objects]]'''
 +
:Object solidity, jump through platforms, and sloped variants of each.
 +
:*[[SPG:Solid Objects#Solid Objects|''Solid Objects'']]
 +
:*[[SPG:Solid Objects#Sloped Objects|''Sloped Objects'']]
 +
:*[[SPG:Solid Objects#Jump Through Platforms|''Jump Through Platforms'']]
 +
:*[[SPG:Solid Objects#Pushable Blocks|''Pushable Blocks'']]
 
</div>
 
</div>
 
<div class="large-3 columns">
 
<div class="large-3 columns">
 
===Physics===
 
===Physics===
*[[SPG:Slope Physics|Slope Physics]]
+
'''[[SPG:Slope Physics|Slope Physics]]'''
How the Player moves with momentum over angled surfaces, along with the specific physics for actions such as rolling.
+
:''Slopes Part 2:'' How the Player moves with momentum over angled surfaces, and 360° movement along extreme slopes such as walls and ceilings.
*[[SPG:Air State|Air State]]
+
:*[[SPG:Slope Physics#Moving At Angles|''Moving At Angles'']]
Explaining the Player's physics through the air.
+
:*[[SPG:Slope Physics#360_Degree_Movement|''360 Degree Movement'']]
*[[SPG:Running|Running]]
+
:*[[SPG:Slope Physics#Falling and Slipping Down Slopes|''Falling and Slipping Down Slopes'']]
Describing how horizontal inputs control the Player while walking/running.
+
:*[[SPG:Slope Physics#Landing On The Ground|''Landing On The Ground'']]
*[[SPG:Jumping|Jumping]]
+
 
The Player's jump physics and how variable jump height is achieved.
+
'''[[SPG:Air State|Air State]]'''
*[[SPG:Rolling|Rolling]]
+
:Horizontal input & general physics of the Player while they are in the air.
Describing how horizontal inputs control the Player while rolling.
+
 
*[[SPG:Getting Hit|Getting Hit]]
+
'''[[SPG:Running|Running]]'''
What happens when the Player gets hit.
+
:Horizontal input & general physics of the Player while walking/running.
*[[SPG:Rebound|Rebound]]
+
 
Describing how the Player bounces off enemies and other destroy-able items.
+
'''[[SPG:Jumping|Jumping]]'''
*[[SPG:Underwater|Underwater]]
+
:Jump physics, jumping at angles, and how controllable jump height is achieved.
How the Player's movements change underwater.
+
 
*[[SPG:Super Speeds|Super Speeds]]
+
'''[[SPG:Rolling|Rolling]]'''
How the Player's abilities change when super.
+
:Horizontal input & general physics of the Player while rolling.
 +
 
 +
'''[[SPG:Getting Hit|Getting Hit]]
 +
:What happens when the Player gets hit.
 +
 
 +
'''[[SPG:Rebound|Rebound]]'''
 +
:The Player's physics bouncing off enemies and other destroy-able items.
 +
 
 +
'''[[SPG:Underwater|Underwater]]'''
 +
:The Player's physics underwater.
 +
 
 +
'''[[SPG:Super Speeds|Super Speeds]]'''
 +
:The Player's abilities when super.
 
</div>
 
</div>
  
 
<div class="large-3 columns">
 
<div class="large-3 columns">
 
===Gameplay===
 
===Gameplay===
*[[SPG:Main Game Loop|Main Game Loop]]
+
'''[[SPG:Main Game Loop|Main Game Loop]]'''
The order of events for objects, including characters.
+
:The order that objects update each frame, and order of specific events like Player collision and movement.
*[[SPG:Game Objects|Game Objects]]
+
 
How objects such as rings, enemies, blocks, and springs move around, are constructed, and interact with the Player.
+
'''[[SPG:Game Objects|Game Objects]]'''
*[[SPG:Ring Loss|Ring Loss]]
+
:Mechanics and sizes for things like rings, pushable blocks, buttons, and springs. How they are constructed, function, and interact with the Player.
How rings disperse when hit.
+
 
*[[SPG:Special Abilities|Special Abilities]]
+
'''[[SPG:Game Enemies|Game Enemies]]'''
General special abilities such as spindashing and elemental shields.
+
:Badnik and bosses behaviour, collision, and specific interaction with the Player.
 +
:*[[SPG:Game Enemies#Badniks|''Badniks'']]
 +
:*[[SPG:Game Enemies#Bosses|''Bosses'']]
 +
 
 +
'''[[SPG:Ring Loss|Ring Loss]]'''
 +
:Ring dispersal mechanics and physics when lost.
 +
 
 +
'''[[SPG:Special Abilities|Special Abilities]]'''
 +
:General special abilities such as spindashing and elemental shields.
 +
:*[[SPG:Special_Abilities#Spindash_.28Sonic_2.2C_3.2C_.26_K.29|''Spindash'']]
 +
:*[[SPG:Special_Abilities#Shield_Abilities_.28Sonic_3_.26_K.29|''Shield Abilities'']]
 
</div>
 
</div>
  
 
<div class="large-3 columns">
 
<div class="large-3 columns">
===Specific===
+
===Presentation===
*[[SPG:Camera|Camera]]
+
'''[[SPG:Camera|Camera]]'''
Mechanics of the camera following the Player.
+
:Camera mechanics when following the Player.
*[[SPG:Animations|Animations]]
+
 
Covering how animations play and specific animation timings.
+
'''[[SPG:Animations|Animations]]'''
 +
:Animations system, and specific animation timings & rules.
 +
:*[[SPG:Animations#Animation_System|''Animation System'']]
 +
:*[[SPG:Animations#Variable Speed Animation Timings|''Variable Speed Animation Timings'']]
 +
:*[[SPG:Animations#Normal Animation Timings|''Normal Animation Timings'']]
 +
:*[[SPG:Animations#Animation Rules|''Animation Rules'']]
 
</div>
 
</div>
  
 
<div class="large-3 columns">
 
<div class="large-3 columns">
 
===Special===
 
===Special===
*[[SPG:Overlay Scripts|Overlay Scripts]]
+
'''[[SPG:Overlay Scripts|Overlay Scripts]]'''
Lua scripts which overlay the game in an emulator for an interactive visual of collision.
+
:Lua scripts which overlay the game in an emulator for an interactive visual of collision.
 +
:*[[SPG:Overlay_Scripts#Sonic_1_Overlay|''Sonic 1 Overlay'']]
 +
 
 +
'''[[SPG:Special Stages|Special Stages]]'''
 +
:Special stages including the rotating mazes from Sonic 1.
 +
:*[[SPG:Special Stages#Rotating Maze|''Rotating Maze'']]
 
</div>
 
</div>
 
[[Category:Sonic Physics Guide| ]]
 
[[Category:Sonic Physics Guide| ]]

Latest revision as of 06:40, 26 November 2022

ROM Hacks make the process of developing a functional Sonic game with unique art, enemies, and modifications much easier, since the game engine and basic mechanics are already functional. However, if the game requires a different game engine, modifying existing low-level assembly may be inappropriate, and some game designers might choose to program their own unique game engine. The physics of a game engine are rules that describe how to transform the Player's input (either in the form of buttons, keyboard, or even a mouse if the designer feels inclined) into appropriate changes in the position of the sprites in the game (such as the Sonic sprite, or alternatively, how enemy sprites will respond). These physics guides will hopefully make the process of simulating the rules used in Sonic games easier.

Since the rules themselves are independent of how they are implemented, many people choose programming languages such as Java, C, C++, Python, or a Lisp dialect to implement game physics. In addition, people can choose to use more specialized applications like Adobe Flash (Animate), GameMaker Studio 2, or a Clickteam program like Multimedia Fusion 2.

Hopefully, these guides will provide adequate information to facilitate implementation.

Physics Guides

Basics

A prerequisite for much of the info on this guide, including common variables, how angles work, how precise values for positions and speeds work, how object sizes are displayed, and more.

Characters

Information about specific characters and their constants, variables, their varying sizes and jump height, and also detailing how their specific moves work.

Collision

Solid Tiles

Terrain Part 1: A detailed description of the individual building blocks of terrain and how they are processed detected.

Solid Terrain

Terrain Part 2: How Solid Tiles and collison layers are used to construct slopes, loops, and other structures.

Slope Collision

Slopes Part 1: How the Player object uses its sensor arrangement to detect and react to sloped terrain.

Hitboxes

Object hitboxes, the Player's hitbox, and other ways objects directly interact with the player other than solidity.

Solid Objects

Object solidity, jump through platforms, and sloped variants of each.

Physics

Slope Physics

Slopes Part 2: How the Player moves with momentum over angled surfaces, and 360° movement along extreme slopes such as walls and ceilings.

Air State

Horizontal input & general physics of the Player while they are in the air.

Running

Horizontal input & general physics of the Player while walking/running.

Jumping

Jump physics, jumping at angles, and how controllable jump height is achieved.

Rolling

Horizontal input & general physics of the Player while rolling.

Getting Hit

What happens when the Player gets hit.

Rebound

The Player's physics bouncing off enemies and other destroy-able items.

Underwater

The Player's physics underwater.

Super Speeds

The Player's abilities when super.

Gameplay

Main Game Loop

The order that objects update each frame, and order of specific events like Player collision and movement.

Game Objects

Mechanics and sizes for things like rings, pushable blocks, buttons, and springs. How they are constructed, function, and interact with the Player.

Game Enemies

Badnik and bosses behaviour, collision, and specific interaction with the Player.

Ring Loss

Ring dispersal mechanics and physics when lost.

Special Abilities

General special abilities such as spindashing and elemental shields.

Presentation

Camera

Camera mechanics when following the Player.

Animations

Animations system, and specific animation timings & rules.

Special

Overlay Scripts

Lua scripts which overlay the game in an emulator for an interactive visual of collision.

Special Stages

Special stages including the rotating mazes from Sonic 1.