Skip to content

V. Extra: Additional Fixes & Improvements

Triangly edited this page Mar 15, 2024 · 5 revisions

There are a few oversights in the framework so instead of re-releasing it, we'll note stuff like that here and provide information on how to fix that. Additionally, we'll share some changes you can made in the framework to make your experience of working with it even better.

We won't get into details to keep things on the page compact and provide only needed code.

OVERSIGHTS

Dust Puff object not spawning correctly

Open Step Event of the DustPuff object and replace the most top part of the code with this:

// Destroy on animation end or underwater
if image_index == 4 or Stage.WaterEnabled and y > Stage.WaterLevel
{
	instance_destroy();
	return;
}

Incorrect underwater slide deleceration (Knuckles)

Go to PlayerKnuxGlideControl() script and find this piece of code:

// Decelerate
if Xsp > 0
{
	Xsp = max(0, Xsp - AirAcc);
}
else
{
	Xsp = min(0, Xsp + AirAcc);
}

Replace AirAcc with 0.09375.

Jagged movement of inclided part of the background

If you apply a horizontal incline to a part of your background with incline height set to 1 pixel, you can notice that most bottom line of it is moving very roughly. This is happening because of incorrect rounding.

Go to ShaderMain (shadermain.fsh) and find this line:

OutX = mod(mod(floor(OutX) + CurPos.x - u_offset.y, u_width) + u_width, u_width) - CurPos.x;

Here, change floor to ceil.

IMPROVEMENTS

Accurate Super Peel Out

Super Peel Out isn't actually accurate enough in Orbinaut. Let's improve that!

Replace the entire code in PlayerPeelout() script with this:

// Exit if Dash is disabled globally or we're not Sonic
if !global.PeeloutEnabled or global.Character != CharSonic
{
	return;
}
	
// Calculate our target Dash force
var TargetForce = HighspeedBonus ? TopAcc * 1.5 : TopAcc * 2;
	
// Process peelout
if Input.Up
{
	if PeeloutRev == -1
	{
		if Animation == AnimLookup and Input.ABCPress
		{
			Animation  = AnimMove;
			PeeloutRev = 1;
				
			// Play sound
			audio_sfx_play(sfxPeeloutCharge, false);
		}
	}
	else 
	{
		PeeloutRev += 1;
		Gsp        += 0.390625 * Facing;
		Gsp	    = clamp(Gsp, -TargetForce, TargetForce);
			
		// Keep using AnimMove animation
		Animation = AnimMove;
	}
}
	
// Release peelout
else if PeeloutRev >= 30
{	
	if !global.CDCamera
	{
		Camera.ScrollDelay = 16;
	}
	PeeloutRev = -1;
		
	audio_sfx_stop(sfxPeeloutCharge);
	audio_sfx_play(sfxPeeloutRelease, false);
		
	// Same story as with the Spin Dash, so...
	if global.FixDashRelease
	{
		Xsp = Gsp *  dcos(Angle);
		Ysp = Gsp * -dsin(Angle);
	}
		
	return true;
}
	
// Cancel peelout
else if PeeloutRev != -1
{	
	PeeloutRev = -1;
	Gsp	   =  0;
	audio_sfx_stop(sfxPeeloutCharge);
}

return false;

Now open PlayerSlopeResist() script and add a check for the peelout:

// Exit if on ceiling or performing a Peel Out
if Angle <= 225 and Angle >= 136.41 or PeeloutRev != -1
{
	return;
}

Open Camera controller and find this line in Update Offsets region:

if abs(Player.Gsp) >= 6 or Player.PeeloutRev >= 6 or Player.SpindashRev >= 0

The check for PeeloutRev isn't needed anymore, so remove it! As final step, open PlayerAnimate() and remove AnimPeelout cases for Sonic and Super Sonic.

Easier background inclide setup

Open background_layer_setup() function, select everything and replace with this:

/// @function background_layer_setup(id,ofstY,nodeY,heightY,animDuration,factorX,factorY,scrollX,scaleXHeight,scaleXEndFactor,scaleY)
function background_layer_setup(id,ofstY,nodeY,heightY,animDuration,factorX,factorY,scrollX,scaleXHeight,scaleXEndFactor,scaleY)
{
	with Background
	{
		// Force-offset the background
		sprite_set_offset(BGSprites[id], 0, 0);
		
		// Get values
		BGValues[id][0] = ofstY + nodeY;
		BGValues[id][1] = nodeY;
		BGValues[id][2] = heightY;
		BGValues[id][3] = (scaleXEndFactor <= 0) ? factorX : min(factorX, scaleXEndFactor);
		BGValues[id][4] = factorY;
		BGValues[id][5] = scrollX;
		BGValues[id][6] = scaleXHeight;
		BGValues[id][7] = (scaleXEndFactor - factorX) / (round(heightY / scaleXHeight) - 1);
		BGValues[id][8] = scaleY;
		BGValues[id][9] = animDuration;
		
		// Get texel data
		BGValues[id][10] = sprite_get_height(BGSprites[id]);
		BGValues[id][11] = sprite_get_width(BGSprites[id]);
		BGValues[id][12] = 1 / texture_get_texel_width(sprite_get_texture(BGSprites[id], 0));
		
		// Initialise autoscroll offset value
		BGValues[id][13] = 0;
		
		// If we're drawing a full sprite, force-transfer height data
		if heightY == -1
		{
			BGValues[id][2] = -BGValues[id][10];
		}
	}
}

Now, instead of scaleXStep argument we have scaleXEndFactor argument, which defines final inclide speed. If any backgrounds already used previous method, they have to be updated.