file Disabling Diagonal Movement

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
27 Mar 2013 01:31 #1
A mini-hack for removing the extra speed that you get when using diagonal movement, so that the game plays like MBO or MBU. (except not really, as I am later informed)

(You can still move diagonally, you just won't get the extra speed.)

This is like the 4th thing I've ever coded, so don't be too expecting.

Replace these move functions in default.bind.cs with these functions:
(ignore the bad indentation, copying it to the post screws it up)
Code:function isMovingDiagonally()
{
return ($mvForwardAction + $mvBackwardAction + $mvLeftAction + $mvRightAction == 2);
}

// Frublox: These are boolean values, so use them to test if user is using diagonal movement.
// Check ($mvLeftAction && $mvForwardAction), etc.
function moveleft(%val)
{
$mvLeftAction = %val;
// Frublox: Check if user is using diagonal movement every time a movement key is pressed.
if ($diagonalMovementDisabled && isMovingDiagonally())
{
DefaultMarble.angularAcceleration = 53.03;
DefaultMarble.maxRollVelocity = 10.61;
     DefaultMarble.airAcceleration = 3.54;
    
}
else
{
DefaultMarble.angularAcceleration = 75;
DefaultMarble.maxRollVelocity = 15;
     DefaultMarble.airAcceleration = 5;
}
}

function moveright(%val)
{
$mvRightAction = %val;
if ($diagonalMovementDisabled && isMovingDiagonally())
{
DefaultMarble.angularAcceleration = 53.03;
DefaultMarble.maxRollVelocity = 10.61;
     DefaultMarble.airAcceleration = 3.54;
}
else
{
DefaultMarble.angularAcceleration = 75;
DefaultMarble.maxRollVelocity = 15;
     DefaultMarble.airAcceleration = 5;
}
}


Add this variable somewhere:
Code:$diagonalMovementDisabled = true;

Set the variable to true when you want to disable diagonal movement.

I haven't tested this a ton yet, so let me know if there are any problems.


If you want to know how this works, I'll explain briefly here:

The reason you move faster diagonally is because forces are combined from two axes (I think). So, if the normal acceleration is 1, then going diagonally would give you sqrt(2) acceleration (~1.4). When it is detected that the user is moving diagonally, the normal acceleration is changed so that diagonal movement gives you a 1 again. This of course switches back and forth so the marble is always moving at 1 acceleration.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
27 Mar 2013 01:33 #2
A new coder! Yay we are starting to not become a minority!

glad to see you submited the resource. Was waiting for you to do that. For those of you who are confused, he let me have a preview of the resource before submitting.

Happy coding frublox, keep learning!

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 912
27 Mar 2013 02:08 #3
Mar 26, 2013, 6:31pm, frublox wrote:A mini-hack for removing the extra speed that you get when using diagonal movement, so that the game plays like MBO or MBU.

Actually the MBU/O code does allow for diagonal movement (in MBO it was obvious), but because the xbox360 controller was limiting, it appeared to not have diagonal movement (MBU). When they played on a different controller (non-standard x360, but something else) they found there was diagonal, and then when they destroyed their x360 controller by allowing the movement pads to go further (pushed back their circular boundaries) they too could do diagonal to match.

So the code has always been there

The idea is great though.

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

Please Log in or Create an account to join the conversation.

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
27 Mar 2013 02:43 #4
Mar 26, 2013, 7:08pm, admin wrote:
Mar 26, 2013, 6:31pm, frublox wrote:A mini-hack for removing the extra speed that you get when using diagonal movement, so that the game plays like MBO or MBU.

Actually the MBU/O code does allow for diagonal movement (in MBO it was obvious), but because the xbox360 controller was limiting, it appeared to not have diagonal movement (MBU). When they played on a different controller (non-standard x360, but something else) they found there was diagonal, and then when they destroyed their x360 controller by allowing the movement pads to go further (pushed back their circular boundaries) they too could do diagonal to match.

So the code has always been there

The idea is great though.

Yeah I forgot about that.

Guess I just haven't played in a while (never played MBU).

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 10
27 Mar 2013 02:47 #5
A bit of a sloppy way to do it, but it gets the job done.

IMO it's better to deal with the input values rather than the end velocities, and normalize the input values to never go above a total of 1, or below -1. This would also provide support for controllers (does anyone play MBG with them?)

I am assuming that input in MB works as a -1 to 1 scale on each axis (or 0 to 1 for each button), and that those values are accessible. I know nothing about MB code, so I may be assuming wrong.

Please Log in or Create an account to join the conversation.

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
27 Mar 2013 03:00 #6
Idk if those values are accessible or even exist, but this is pretty much the same thing otherwise. Instead I use the normal values of maxRollVelocity and angularAcceleration as '1', and then I do some maths to get accurate values.

You could put the values to a lot more decimal places, but it's not really worth it to me and it wouldn't make too much of a difference.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
27 Mar 2013 03:16 #7
Mar 26, 2013, 7:47pm, helpme wrote:A bit of a sloppy way to do it, but it gets the job done.

IMO it's better to deal with the input values rather than the end velocities, and normalize the input values to never go above a total of 1, or below -1. This would also provide support for controllers (does anyone play MBG with them?)

I am assuming that input in MB works as a -1 to 1 scale on each axis (or 0 to 1 for each button), and that those values are accessible. I know nothing about MB code, so I may be assuming wrong.

Not sure about the old engine, but in Torque3D the input manager works exactly how you described it don.

$movementSpeed (I think) is your scaler to adjust the values of the maximum amounts. Play around with that (defined in default.bind.cs)

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
27 Mar 2013 03:29 #8
On the note of controllers, why would it make a difference if you were playing on one? Shouldn't it work the same way as a keyboard? I've never used the controller functionality in MB (though I have used a controller), but it seems like it should work.

EDIT: Changing $movementSpeed doesn't do anything.

Please Log in or Create an account to join the conversation.

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 912
27 Mar 2013 03:51 #9
Controller code from MBP:
Code:// The following were determined after many code tests.
//
// Please note where each of them goes in the current code.
// These codes are suited to have the XBOX360 Controller to be as practically the same
// as possible as the keyboard and mouse.
//
// Change values where you want to modify the speed. The ones below are deafults.
//
// moveYAxis and moveXAxis determine marble movement speed across the two axises
// moveYawAxis is camera movement along X axis (left and right)
// movePitchAxis is camera movement along Y axis (up and down)
//
// if(mAbs(%val) < 0.23) // else the marble will roll by itself forwards/backwards. DO NOT TOUCH IT. Dead zone area (MBU).
// $mv(X)Action = -%val * (1.68); // increase the value for faster marble speed
// $mvYaw(X)Speed = -%val * (0.1); // decrease the value for faster camera movement along X axis (Left/Right)
// Don't ever touch the Pitch. It's annoying the heck out of me!
// %val = (%val * 0.35);
// %destPitch = (2 * %val) + 0.45; // together they affect the camera speed and how much you can
// look up/down. Right now it's perfect.
//          If you change it then restore to the values above if you don't like it
//
// Attempting to configure the XBOX360 Controller to match the Marble speed like the keyboard.
// Differences might occur but VERY SLIGHTLY IF ANY.

function moveXAxis(%val)
{
if(mAbs(%val) < 0.23)
%val = 0;
if(%val < 0)
{
$mvLeftAction = -%val * (1.68);
$mvRightAction = 0;
}
else
{
$mvLeftAction = 0;
$mvRightAction = %val * (1.68);
}
}

function moveYAxis(%val)
{
if(mAbs(%val) < 0.23)
%val = 0;
if(%val < 0)
{
$mvForwardAction = -%val * (1.68);
$mvBackwardAction = 0;
}
else
{
$mvForwardAction = 0;
$mvBackwardAction = %val * (1.68);
}
}

function moveYawAxis(%val)
{
if(mAbs(%val) < 0.23)
%val = 0;
if(%val < 0)
{
$mvYawRightSpeed = -%val * (0.1);
$mvYawLeftSpeed = 0;
}
else
{
$mvYawRightSpeed = 0;
$mvYawLeftSpeed = %val * (0.1);
}
}

function movePitchAxis(%val)
{
%ival = %val;
if(%val < 0)
{
if(%val < -0.23)
{
%val = (%val * 0.4);
%destPitch = (%val * 2) + 0.45;
}
else
%destPitch = 0.45;
}
else
{
if(%val > 0.23)
{
%val = (%val * 0.4);
%destPitch = (2 * %val) + 0.45;
}
else
%destPitch = 0.45;
}
$mvPitch = %destPitch - $marblePitch;
}

// Xbox360 controller specific gamepad buttons and stuff so it works perfect
// The button numbers below equal to the following triggers as if:
// gamepadMap.bind(joystick, button3, mouseFire);
// which means powerup activation is done when you press Y button
// 0 is A
// 1 is B
// 2 is X
// 3 is Y
// 4 is left bumper
// 5 is right bumper
// 6 is back
// 7 is start
// 8 is left thumbstick click
// 9 if right thumbstick click

gamepadMap.bind(joystick, xaxis, moveXAxis);
gamepadMap.bind(joystick, yaxis, moveYAxis);
gamepadMap.bind(joystick, rxaxis, moveYawAxis);
gamepadMap.bind(joystick, ryaxis, movePitchAxis);
gamepadMap.bind(joystick, button0, jump);
gamepadMap.bind(joystick, button1, mouseFire);
gamepadMap.bind(joystick, button7, escapeFromGame);

gamepadMap.push();

Sadly two or three of the buttons on the x360 controllers are not bindable in the MBG engine and you'll have to use an external program, such as joy2key, to bind them.

For diagonal movement itself, I'm sure disabling something from marble.cs (angularAcceleration/break?) will help.


Additional info from Torque references:

getDeadZone( device , action )

Purpose
Use the getDeadZone method to get the dead-zone associated with a specific device +
action pair.

Syntax
device - Name of the device to bound to a command (see 'Device Table' below).
action - Name of the action to watch for (see 'Action Table' below).

Returns
Returns a dead-zone specification, or 0 0 meaning that there is no dead-zone, or a NULL
string meaning the mapping was not found.

See Also
bind, bindCmd

Mouse Modifier:
D %x %y
Has dead zone. This is used to add a dead zone for the mouse. Motions in this zone will not be
recorded. This can be used to remove the jitter caused by a ‘nervous hand’.

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
27 Mar 2013 03:57 #10
AH!! ITS NOT A SECRET ANYMORE D=

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 912
27 Mar 2013 04:03 #11
Second post because MBU/O script source:

Code:function spewmovevars()
{
echo(yaw: SPC $mvYaw SPC pitch: SPC $mvPitch);
$Debug::spewmovesched = schedule(500,0,spewmovevars);
}

function gamepadYaw(%val)
{
if( $pref::invertXCamera )
%val *= -1.0;

// if we get a non zero val, the user must have moved the stick, so switch
// out of keyboard/mouse mode
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;

// stick events come in even when the user isn't using the gamepad, so make
// sure we don't slam the move if we don't think the user is using the gamepad
if (!$mvDeviceIsKeyboardMouse)
{
%scale = (ServerConnection.gameState $= wait) ? -0.1 : 3.14;
$mvYawRightSpeed = -(%scale * %val);
}
}

function gamepadPitch(%val)
{
if( $pref::invertYCamera )
%val *= -1.0;

// if we get a non zero val, the user must have moved the stick, so switch
// out of keyboard/mouse mode
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;

// stick events come in even when the user isn't using the gamepad, so make
// sure we don't slam the move if we don't think the user is using the gamepad
if (!$mvDeviceIsKeyboardMouse)
{
%scale = (ServerConnection.gameState $= wait) ? -0.05 : 3.14;
$mvPitchUpSpeed = %scale * %val;
}
}

function mouseYaw(%val)
{
if( $pref::invertXCamera )
%val *= -1.0;

$mvDeviceIsKeyboardMouse = true;

$mvYaw += getMouseAdjustAmount(%val);
}

function mousePitch(%val)
{
if( $pref::invertYCamera )
%val *= -1.0;

$mvDeviceIsKeyboardMouse = true;

$mvPitch += getMouseAdjustAmount(%val);
}

function jumpOrStart(%val)
{
if (%val)
$mvTriggerCount2 = 1;
else
$mvTriggerCount2 = 0;
}

function jumpOrPowerup( %val )
{
// LTrigger
if( %val > 0.0 )
$mvTriggerCount2++;
else
$mvTriggerCount0++;
}

function moveXAxisL(%val)
{
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;

$mvXAxis_L = %val;
}

function moveYAxisL(%val)
{
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;

$mvYAxis_L = %val;
}

function centercam(%val)
{
$mvTriggerCount3++;
}



// gamepad
if (isPCBuild())
{
// set up some defaults
moveMap.bind( xinput, btn_x, altTrigger );
moveMap.bind( xinput, btn_a, jumpOrStart );
moveMap.bind( xinput, btn_b, mouseFire );
moveMap.bind( xinput, trigger_r, mouseFire );
moveMap.bind( xinput, trigger_l, jumpOrStart );
//moveMap.bind( xinput, zaxis, jumpOrPowerup );
moveMap.bind( xinput, btn_rshoulder, altTrigger );
moveMap.bind( xinput, btn_lshoulder, altTrigger );

moveMap.bindCmd( xinput, btn_back, pauseToggle(1);, );
moveMap.bindCmd( xinput, btn_start, pauseToggle(0);, );
moveMap.bindCmd( xinput, btn_y, togglePlayerListLength();, );

moveMap.bind( xinput, thumb_lx, DN, -0.23 0.23, moveXAxisL );
moveMap.bind( xinput, thumb_ly, DN, -0.23 0.23, moveYAxisL );
moveMap.bind( xinput, thumb_rx, D, -0.23 0.23, gamepadYaw );
moveMap.bind( xinput, thumb_ry, D, -0.23 0.23, gamepadPitch );

// moveMap.bind(keyboard, m, spawnStupidMarble);
// moveMap.bind( gamepad, btn_y, spawnStupidMarble );

//if (strstr(getGamepadName(), Logitech) != -1)
//{
//error(Binding for SPC getGamepadName() SPC controller);
//moveMap.bind( gamepad, zaxis, D, -0.23 0.23, gamepadYaw );
//moveMap.bind( gamepad, rzaxis, D, -0.23 0.23, gamepadPitch );
//}
}
else // xbox
{
// gamepad
//GlobalActionMap.bindCmd( gamepad, lshoulder, cycleDebugPredTiles();, );

moveMap.bind( gamepad, btn_x, altTrigger );
moveMap.bind( gamepad, btn_a, jumpOrStart );
moveMap.bind( gamepad, btn_b, mouseFire );
moveMap.bind( gamepad, rtrigger, mouseFire );
moveMap.bind( gamepad, ltrigger, jumpOrStart );
moveMap.bind( gamepad, rshoulder, altTrigger );
moveMap.bind( gamepad, lshoulder, altTrigger );

moveMap.bindCmd( gamepad, back, pauseToggle(1);, );
moveMap.bindCmd( gamepad, start, pauseToggle(0);, );
moveMap.bindCmd( gamepad, btn_y, togglePlayerListLength();, );

moveMap.bind( gamepad, xaxis, DN, -0.23 0.23, moveXAxisL );
moveMap.bind( gamepad, yaxis, DN, -0.23 0.23, moveYAxisL );
moveMap.bind( gamepad, rxaxis, D, -0.23 0.23, gamepadYaw );
moveMap.bind( gamepad, ryaxis, D, -0.23 0.23, gamepadPitch );
//moveMap.bind( gamepad, zaxis, D, -0.23 0.23, gamepadYaw );
//moveMap.bind( gamepad, rzaxis, D, -0.23 0.23, gamepadPitch );

//moveMap.bind( gamepad, btn_y, spawnStupidMarble );
}

the 0.23 refers to the deadzone. xInput was removed from MBO and I suspect that's why it crapped out on the controller. Anyway you'll find a number of those inputs not possible in MBG since it's not in the engine so you'll need joy2key.

Edit: I don't remember seeing DeadZone in MBU/O anywhere else... I'll search though.

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

Please Log in or Create an account to join the conversation.

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 912
27 Mar 2013 04:09 #12
Yeah can't get anything.

From search on the nets regarding Torque and DeadZone:

Example:
%deadZone = moveMap.getDeadZone( gamepad, thumbrx);
Source (CLICK HERE) and Source 2 (CLICK HERE)

Code:function ActionMap::copyBind( %this, %otherMap, %command )
{
if ( !isObject( %otherMap ) )
{
error( ActionMap::copyBind - @ %otherMap @ is not an object! );
return;
}

%fullMapString = %otherMap.getBinding( %command );
if ( %fullMapString !$= )
{
%mapCount = getRecordCount( %fullMapString );
for ( %i = 0; %i < %mapCount; %i++ )
{
%bind = getRecord( %fullMapString, %i );
%device = getField( %bind, 0 );
%action = getField( %bind, 1 );
%flags = %otherMap.isInverted( %device, %action ) ? SDI : SD;
%deadZone = %otherMap.getDeadZone( %device, %action );
%scale = %otherMap.getScale( %device, %action );
%this.bind( %device, %action, %flags, %deadZone, %scale, %command );
}
}
}

Source (CLICK HERE)

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 10
27 Mar 2013 04:41 #13
The issue with a controller would be that with an analogue stick more movement directions are possible.


So for example with normal MB moving at 22.5 (half 45) degrees to the camera you would move at ~1.12 times normal speed. With your system I am not sure if moving at 22.5 degrees would trigger your velocity reduction or not, but either way the movement speed would be wrong. Too fast if it didn't trigger, too slow if it did. Now you could fix that by changing maxRollVelocity to 13.35 if the player is moving at 22.5 degrees, but there's an infinite number of angles the player could move.


Of course you could do the normalization on maxRollVelocity instead of on the input values as I suggested, but to me it just seems better to leave the variables that deal with the marbles actual speed alone, and do what you want with input.

So you could normalize the input something like this....


if ($inputX + $inputY > 1)
{
%normlizationFactor = mSqrt ($inputX*2 + $inputY*2);
$inputX *= normalizationFactor;
$inputY *= normalizationFactor;
}





The issue of whether the input management works like I think, or whether those values are accessible could still be an issue of course

EDIT: Everything after FruBlox's last post wasn't here when I started this post FYI (I spent a long time on it)

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
27 Mar 2013 04:45 #14
don, wouldn't it be:

if ($inputX + $inputY > 1)
{
%normalizationFactor = mSqrt (mPow($inputX,2) + mPow($inputY,2));
$inputX *= %normalizationFactor;
$inputY *= %normalizationFactor;
}

for normalization? Distance formula Square axes and take sqrt

also you made 3 syntax errors

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 10
27 Mar 2013 04:51 #15
Yeah

For some strange reason I was thinking that multiplying by two was the same as squaring. I feel dumb....

and I made up the syntax, never done TS before....

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
27 Mar 2013 05:04 #16
thats fine, just wanted to inform ya, now ya know don

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 0
27 Mar 2013 17:10 #17
Nice function Frublox! I'm sure Xelna/Sonic/Dushine wouldn't like it that much though!

Please Log in or Create an account to join the conversation.

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
27 Mar 2013 19:07 #18
Mar 27, 2013, 10:10am, mbgaddict wrote:Nice function Frublox! I'm sure Xelna/Sonic/Dushine wouldn't like it that much though!

Thanks! I personally like playing MB with some handicaps. Extra challenge modes can get the player thinking in whole new ways, IMO.

As for the issue of controllers, yeah I do see the point now. As for dealing with the issue of infinite angles to work on, it's important to note that you could just specify ranges of angles, and change the values accordingly. You don't need to define a custom value for every possible angle. Sure, it'd be a sloppier way to do it but it'd certainly work if you got specific enough with the angle ranges.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
27 Mar 2013 21:00 #19
Mar 27, 2013, 12:07pm, frublox wrote:
Mar 27, 2013, 10:10am, mbgaddict wrote:Nice function Frublox! I'm sure Xelna/Sonic/Dushine wouldn't like it that much though!

Thanks! I personally like playing MB with some handicaps. Extra challenge modes can get the player thinking in whole new ways, IMO.

As for the issue of controllers, yeah I do see the point now. As for dealing with the issue of infinite angles to work on, it's important to note that you could just specify ranges of angles, and change the values accordingly. You don't need to define a custom value for every possible angle. Sure, it'd be a sloppier way to do it but it'd certainly work if you got specific enough with the angle ranges.

Haha yep! As I say a little trig and calculus can go a long way

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • RDs.The-dts-guy
  • RDs.The-dts-guy's Avatar
  • Offline
  • Developer
  • Developer
  • Blender pls
  • Posts: 719
  • Thank you received: 188
28 Mar 2013 14:47 #20
Hmm so is there any way to make this addable in front of mis to make it a challenge for some level?

Some guy that does DTS shapes and levels.

AWESOME time HINT : When making PQ level place your custom interiors and textures in platinum/data/interiors_pq/custom
makes life easier for you and everyone else :)

Please Log in or Create an account to join the conversation.

  • Posts: 533
  • Thank you received: 14
28 Mar 2013 17:32 #21
Thanks for making it! I've wanted this for a long time. I'm gonna try this code later today (and make a levels video). I'll let you know if there seem to be any issues.

EDIT: I tried the code and it seems like the diagonal speed is still faster than the forward speed in some situations. I did a sorta-test using some levels, and I got:

Time Trial (start: bounce jump bounce jump jump, then keep jumping at and after Go!)
Forward: 2.56
Diagonal (with code): 2.43
Diagonal (without code): 2.30.

Time Trial (start: bounce roll, then keep rolling at and after Go!)
Forward: 3.14
Diagonal (with code): 3.13
Diagonal (without code): 2.59.

Learn the Time Modifier (start: bounce jump bounce jump jump, then keep jumping at and after Go!)
Forward: 0.92
Diagonal (with code): 0.85
Diagonal (without code): 0.85

Learn the Time Modifier (start: bounce jump bounce jump jump, then roll at and after Go!)
Forward: 0.85
Diagonal (with code): 0.81
Diagonal (without code): 0.80

Learn the Time Modifier (start: bounce roll, then keep rolling at Go!)
Forward: 0.96
Diagonal (with code): 0.95
Diagonal (without code): 0.89

FruBlox, I know nothing about codes so I can't check your code, but just from these levels it looks like rolling all the way puts the code diagonal speed essentially at the forward speed, but a jumping start puts it in between the forward speed and the normal diagonal speed, even as far as matching the normal diagonal speed for short durations.

EDIT 2: Oh, and I think your first DefaultMarble.maxRollVelocity = 10.6; should be … = 10.61;. I would also suggest going to at least 3-4 decimal places, unless the game doesn't allow more than 2 dp.

Also, the code (I installed it in /MarbleBlast.app/platinum/client/scripts/default.bind.cs) doesn't work with .rec files for me. .recs created with or without the code will run on standard Marble Blast settings. Is that because there's also a default.bind.cs.dso file in the scripts folder?

EDIT 3: Made a few clarifications.

A time can be beaten, but a path can't be rediscovered. The best path stays forever.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
28 Mar 2013 21:10 #22
Let me clarify a few things for ya Imac

1. Variables and fields with floating points are most likely stored in the memory manager with having around 5 decimal points until it rounds it off.

2. .rec files. Was the variable ever enabled that frublox provided BEFORE the .rec was played? because it won't work without setting that global variable via console or script.

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • Posts: 533
  • Thank you received: 14
29 Mar 2013 04:00 #23
Mar 28, 2013, 2:10pm, jeff wrote:2. .rec files. Was the variable ever enabled that frublox provided BEFORE the .rec was played? because it won't work without setting that global variable via console or script.I enabled the variable $diagonalMovementDisabled to true, then created the .rec, then played it back without setting it to false.

A time can be beaten, but a path can't be rediscovered. The best path stays forever.

Please Log in or Create an account to join the conversation.

  • Jeff
  • Jeff's Avatar
  • Offline
  • Elite Marbler
  • Elite Marbler
  • PlatinumQuest Programmer
  • Posts: 1680
  • Thank you received: 205
29 Mar 2013 04:13 #24
So the question now becomes, does .rec actually call the movement functions or does it use its own movement system that gets streamed directly into the input manager. And we can't figure that out because would be in the engine. :\

I am a programmer. Most here know me for being one of the major contributors to Marble Blast Platinum and PlatinumQuest.

Please Log in or Create an account to join the conversation.

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
30 Mar 2013 00:51 #25
Mar 28, 2013, 10:32am, imacmatician wrote:FruBlox, I know nothing about codes so I can't check your code, but just from these levels it looks like rolling all the way puts the code diagonal speed essentially at the forward speed, but a jumping start puts it in between the forward speed and the normal diagonal speed, even as far as matching the normal diagonal speed for short durations.

EDIT 2: Oh, and I think your first DefaultMarble.maxRollVelocity = 10.6; should be … = 10.61;. I would also suggest going to at least 3-4 decimal places, unless the game doesn't allow more than 2 dp.

Also, the code (I installed it in /MarbleBlast.app/platinum/client/scripts/default.bind.cs) doesn't work with .rec files for me. .recs created with or without the code will run on standard Marble Blast settings. Is that because there's also a default.bind.cs.dso file in the scripts folder?

EDIT 3: Made a few clarifications.
oops, I made a typo in the code =p Fixed that and some other issues, as well as adding a function to make the code smaller.

Yeah I've actually noticed that (though I haven't done any official testing) it is still a little faster.

Either I did my maths wrong or there's another variable I need to change. I'm still working on this though, so I'll see what I can do.

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 10
30 Mar 2013 04:07 #26
No your math is right. Unless there's another variable the only thing that can really be done is make the numbers go to more decimal places. Strange that there's such a difference, but I suppose very small speed differences could effect where, and the way you bounce off of slopes ect. (especially on the start pad).

I'm sure you know this, but if anyone else wants to change the variables for themselves and see if it makes any real difference, the numbers are more precisely:

10.6066017178 for maxRollVelocity (that should be enough decimal places.)

and

53.033008589 for angularAcceleration

Please Log in or Create an account to join the conversation.

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
30 Mar 2013 05:31 #27
Setting them to more decimal places doesn't seem to change anything (as I thought so). After dumping the DefaultMarble object via console to find some other values that could relate to speed, I didn't really find any.

The only other one that seems to even remotely control speed is airAcceleration, but that just controls how fast the marble moves whilst in the air. I should note that if you do not jump with this mod enabled, diagonal movement and normal movement are almost the exact same. Perhaps I'll play with that and see what I get.

Please Log in or Create an account to join the conversation.

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 912
30 Mar 2013 06:19 #28
jumping always increases speed lol

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

Please Log in or Create an account to join the conversation.

  • FruBlox
  • FruBlox's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Posts: 155
  • Thank you received: 2
30 Mar 2013 07:10 #29
Mar 29, 2013, 11:19pm, admin wrote:jumping always increases speed lol

Yeah, that's why I avoided modding it. =p
It wasn't my goal to affect jumping speed, but I'm not sure what needs to be fixed now.

Please Log in or Create an account to join the conversation.

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
  • Posts: 3502
  • Thank you received: 912
30 Mar 2013 11:13 #30
If diagonal and normal movement are the same now then jumping does not matter, nor should any other value in marble.cs because you've limited the speed.

You can test better by going jumping forwards vs. jumping diagonally and check for differences and then better test for those.

If your goal was to have diagonal = forwards only speed, then you've succeeded and replicated a MBU/O player with an unmodded xbox360 controller.

"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.

Please Log in or Create an account to join the conversation.

Moderators: Doomblah
Time to create page: 1.174 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.