file Changing the Marble's Physical Properties

  • whirligig
  • whirligig's Avatar Topic Author
  • Offline
  • Professional Marbler
  • Professional Marbler
  • Posts: 444
  • Thank you received: 261
23 Dec 2009 21:26 #1
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.

  • Posts: 1949
  • Thank you received: 18
24 Dec 2009 00:19 #2
Great tutorial, thanks!

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

  • Posts: 473
  • Thank you received: 0
24 Dec 2009 00:55 #3
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
  • Posts: 3502
  • Thank you received: 912
24 Dec 2009 02:58 #4
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.

  • Posts: 51
  • Thank you received: 0
24 Dec 2009 03:29 #5
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.

  • Posts: 405
  • Thank you received: 0
25 Dec 2009 01:40 #6
Great tutorial, i'll be sure to use it; thanks.

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

  • Posts: 227
  • Thank you received: 0
25 Dec 2009 03:42 #7
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.

  • Posts: 18
  • Thank you received: 0
26 Dec 2009 15:08 #8
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.

  • Posts: 227
  • Thank you received: 0
26 Dec 2009 21:31 #9
Almost happened to me to

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

  • Posts: 227
  • Thank you received: 0
27 Dec 2009 01:34 #10
Good job, you can also edit particles from the same script!

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

  • Posts: 227
  • Thank you received: 0
27 Dec 2009 05:06 #11
duh...

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

  • Posts: 251
  • Thank you received: 91
30 Dec 2009 03:32 #12
On a similar note.....

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

  • Posts: 1949
  • Thank you received: 18
30 Dec 2009 04:00 #13
Lol, funny.

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

  • Posts: 1118
  • Thank you received: 368
30 Dec 2009 16:36 #14


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.

  • Posts: 1949
  • Thank you received: 18
30 Dec 2009 18:02 #15
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
  • Posts: 3502
  • Thank you received: 912
30 Dec 2009 18:08 #16
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.

  • Posts: 1949
  • Thank you received: 18
30 Dec 2009 18:08 #17
it's still awesome

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

  • Posts: 227
  • Thank you received: 0
31 Dec 2009 03:41 #18
... but it doesn't show much variety.

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

  • Posts: 1118
  • Thank you received: 368
31 Dec 2009 06:54 #19
Everyone's a Critic. =P

~Aayrl

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

  • Posts: 227
  • Thank you received: 0
02 Jan 2010 18:35 #20
Btw, can you make clear marbles with any physics value changes?

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

Moderators: Doomblah
Time to create page: 0.904 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.