file Changing the Marble's Physical Properties

  • whirligig
  • whirligig's Avatar Topic Author
  • Offline
  • Professional Marbler
  • Professional Marbler
More
23 Dec 2009 21:26 #1 by whirligig
Ever seen videos where the marble has different physical properties than normal? Here's how it's done.

Open up marble/server/scripts/marble.cs. You should see something like this:

Code:datablock MarbleData(DefaultMarble)
{
shapeFile = ~/data/shapes/balls/ball-superball.dts;
emap = true;
renderFirstPerson = true;
// maxRollVelocity = 55;
// angularAcceleration = 120;
maxRollVelocity = 15;
angularAcceleration = 75;
brakingAcceleration = 30;
gravity = 20;
staticFriction = 1.1;
kineticFriction = 0.7;
bounceKineticFriction = 0.2;
maxDotSlide = 0.5;
bounceRestitution = 0.5;
jumpImpulse = 7.5;
maxForceRadius = 50;
...

The first part of this -- the MarbleData(DefaultMarble) part -- tells us what object this is. In MBP, this will say something slightly different. DefaultMarble is the marble's name. If you're not sure what the correct name is (e. g. in MBP, where there are a bunch of different marbles), just open the level editor, press Alt+C to switch to the camera, and look at the marble in the editor. It should say the name (plus a number) by a dot at the center of the marble.

Below the MarbleData line, you see a bunch of lines like this:
Code:(propertyname) = (value);
These are the properties of the marble. Modifying these in the script file will change the marble's default properties. Or you can open the console and type the following:
Code:(marblename).(propertyname) = (value);
Replace marblename, propertyname, and value with the marble's name (DefaultMarble in MBG), the name of the property you wish to change, and the value to change to, respectively.

Available properties:

-shapeFile: The file that the marble gets its shape from. This cannot be changed in the game, and I wouldn't advise messing with it.
-emap: Not sure; probably whether or not it uses environment mapping (if you've ever seen the marble reflect the sky, that's what it means).
-renderFirstPerson: Doesn't really seem to do anything AFAIK.
-maxRollVelocity: The maximum speed of the marble.
-angularAcceleration: How quickly the marble accelerates.
NOTE: The previous two appear twice in the file, the first time with // before them. These are commented out and have no effect. Change the non-// lines. (Interesting that the marble had those different properties at one point...)
-brakingAcceleration: How quickly the marble brakes.
-gravity: The gravity. You've probably heard of the famous defaultmarble.gravity = XX; before.
-staticFriction, kineticFriction, bounceKineticFriction, maxDotSlide: Just mess around with these to get a good idea of what they do.
-bounceRestitution: If the marble bounces, this is the factor by which each bounce decreases in height. A value of 1 means it will perpetually bounce; a value greater than 1 means it will bounce higher and higher; a value less than 1 means it will bounce lower and lower until it stops, like you would expect; a value of 0 means it acts like a Shock Absorber/Anti-Recoil; a negative value may crash the game!
-jumpImpulse: How high the marble jumps.
-maxForceRadius: Sounds like it affects how hazards work, I dunno . . .

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

More
24 Dec 2009 00:19 #2 by Pablo
Replied by Pablo on topic Changing the Marble's Physical Properties
Great tutorial, thanks!

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

More
24 Dec 2009 00:55 #3 by SonicW1
Replied by SonicW1 on topic Changing the Marble's Physical Properties
Nice tut, it has some good info

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

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
More
24 Dec 2009 02:58 #4 by IsraeliRD
Replied by IsraeliRD on topic Changing the Marble's Physical Properties
Good one

"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.

More
24 Dec 2009 03:29 #5 by Hagaroo
Replied by Hagaroo on topic Changing the Marble's Physical Properties
This'll definitely help me out if I want to try something like this.

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

More
25 Dec 2009 01:40 #6 by ridley2
Replied by ridley2 on topic Changing the Marble's Physical Properties
Great tutorial, i'll be sure to use it; thanks.

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

More
25 Dec 2009 03:42 #7 by Stal
Nice
I remember that there was an old thread where someone asked about this, but that has been deleted. Nice to have it in the MBDK

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

More
26 Dec 2009 15:08 #8 by sepulchre213
Replied by sepulchre213 on topic Changing the Marble's Physical Properties
I've messed with all those before. I almost lost MBG. I don't know what I did for it to come that far.
Thanks for the guide anyway.

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

More
26 Dec 2009 21:31 #9 by Stal
Almost happened to me to

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

More
27 Dec 2009 01:34 #10 by Stal
Good job, you can also edit particles from the same script!

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

More
27 Dec 2009 05:06 #11 by Stal
duh...

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

More
30 Dec 2009 03:32 #12 by snowbody
Replied by snowbody on topic Changing the Marble's Physical Properties
On a similar note.....

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

More
30 Dec 2009 04:00 #13 by Pablo
Replied by Pablo on topic Changing the Marble's Physical Properties
Lol, funny.

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

More
30 Dec 2009 16:36 #14 by Aayrl
Replied by Aayrl on topic Changing the Marble's Physical Properties


Video I posted almost a year and a half ago shows the speed hack client I developed for MBG and MBF, namely for testing unaligned platforms and objects.

I can upload the properties edited and show in the video sometime, I'll put up another reply if enough are interested.

~Aayrl

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

More
30 Dec 2009 18:02 #15 by Pablo
Replied by Pablo on topic Changing the Marble's Physical Properties
That vid is awesome!

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

  • IsraeliRD
  • IsraeliRD's Avatar
  • Offline
  • Project Manager
  • Project Manager
  • Dragon Power Supreme
More
30 Dec 2009 18:08 #16 by IsraeliRD
Replied by IsraeliRD on topic Changing the Marble's Physical Properties
You saw it over a year ago!

"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.

More
30 Dec 2009 18:08 #17 by Pablo
Replied by Pablo on topic Changing the Marble's Physical Properties
it's still awesome

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

More
31 Dec 2009 03:41 #18 by Stal
... but it doesn't show much variety.

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

More
31 Dec 2009 06:54 #19 by Aayrl
Replied by Aayrl on topic Changing the Marble's Physical Properties
Everyone's a Critic. =P

~Aayrl

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

More
02 Jan 2010 18:35 #20 by Stal
Btw, can you make clear marbles with any physics value changes?

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

Moderators: AayrlKalle29Regislian