FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 26, 2013 23:31:23 GMT
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) 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: $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.
|
|
|
Post by Jeff on Mar 26, 2013 23:33:53 GMT
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!
|
|
|
Post by IsraeliRD on Mar 27, 2013 0:08:20 GMT
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.
|
|
FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 27, 2013 0:43:30 GMT
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).
|
|
|
Post by Don.Gato on Mar 27, 2013 0:47:43 GMT
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.
|
|
FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 27, 2013 1:00:51 GMT
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.
|
|
|
Post by Jeff on Mar 27, 2013 1:16:43 GMT
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)
|
|
FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 27, 2013 1:29:14 GMT
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.
|
|
|
Post by IsraeliRD on Mar 27, 2013 1:51:35 GMT
Controller code from MBP:
// 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’.
|
|
|
Post by Jeff on Mar 27, 2013 1:57:20 GMT
AH!! ITS NOT A SECRET ANYMORE D=
|
|
|
Post by IsraeliRD on Mar 27, 2013 2:03:07 GMT
Second post because MBU/O script source:
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.
|
|
|
Post by IsraeliRD on Mar 27, 2013 2:09:25 GMT
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)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)
|
|
|
Post by Don.Gato on Mar 27, 2013 2:41:09 GMT
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)
|
|
|
Post by Jeff on Mar 27, 2013 2:45:53 GMT
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
|
|
|
Post by Don.Gato on Mar 27, 2013 2:51:11 GMT
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....
|
|
|
Post by Jeff on Mar 27, 2013 3:04:33 GMT
thats fine, just wanted to inform ya, now ya know don
|
|
๖ۣۜAddict™
Advanced Marbler
[ss:Resurrection]
ツ ツ ツ ツ ツ ツ ツ ツ ツ ツ ツ
Posts: 312
|
Post by ๖ۣۜAddict™ on Mar 27, 2013 15:10:51 GMT
Nice function Frublox! I'm sure Xelna/Sonic/Dushine wouldn't like it that much though!
|
|
FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 27, 2013 17:07:44 GMT
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.
|
|
|
Post by Jeff on Mar 27, 2013 19:00:32 GMT
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
|
|
|
Post by [DWARF] RDs.empire on Mar 28, 2013 12:47:23 GMT
Hmm so is there any way to make this addable in front of mis to make it a challenge for some level?
|
|
|
Post by PHAIL maan on Mar 28, 2013 15:32:02 GMT
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.
|
|
|
Post by Jeff on Mar 28, 2013 19:10:54 GMT
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.
|
|
|
Post by PHAIL maan on Mar 29, 2013 2:00:42 GMT
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."
|
|
|
Post by Jeff on Mar 29, 2013 2:13:01 GMT
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. :\
|
|
FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 29, 2013 22:51:53 GMT
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.
|
|
|
Post by Don.Gato on Mar 30, 2013 2:07:45 GMT
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
|
|
FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 30, 2013 3:31:27 GMT
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.
|
|
|
Post by IsraeliRD on Mar 30, 2013 4:19:28 GMT
jumping always increases speed lol
|
|
FruBlox
Advanced Marbler
[ss:Default Skin (DO NOT TOUCH)]
It's marbling time!
Posts: 338
|
Post by FruBlox on Mar 30, 2013 5:10:11 GMT
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.
|
|
|
Post by IsraeliRD on Mar 30, 2013 9:13:03 GMT
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.
|
|