Console Commands and Variables

Gravit Home / Documentation Index

Overview

Here's a list of commands and variables. The values in the Type column below are Cmd for command and Var for variable. Some variables are actually commands that act like variables like g and autorotate. Words that are in italics refer to a command or variable.

General

CommandTypeDescription
quitCmdWill quit Gravit.
execCmdExecute a Gravit script. The path can be absolute or relative. Scripts are just text files that contain console commands. Lines starting with a # are ignored. Append ignoremissing to not warn about missing files.
helpCmdDisplays some help, like this help!
listCmdDisplays the names of every console command available

Recording and Playback

CommandTypeDescription
recordCmdRecording is when Gravit simulates gravity. The command will stop recording if it's already recording otherwise it will start recording.
autorecordVarSetting this to 1 will automatically start recording after the spawn command.
playCmdReplay's a recording that is currently in memory. It will loop the simulation over and over.
stopCmdSimply stops recording or playing.
statusCmdWill display some statistics
gVarSet the accuracy and speed of a simulation. The default value is 5. Increase it for a slower, more accurate simulation. Decrease it for the opposite. A value too low (like 1 or 2) will create a chaotic simulation. Technically this creates a small value used for the gravity calculations. The forumula for this number is G = -10 ^ -g. This is used in F = Gm1m2/d^2.
framecompressionVarWhen Gravit uses up all memory for storing particles, it can 'compress' the history by removing every second frame. The simulation then will resume half way and only save every second frame. Turning this variable on will allow this, otherwise the simulation will stop.
frameskipVarWhen playing a simulation, increase this number to skip played back frames for a faster playback. To slow down playback change this number to be negative.
frameVarJumps to a frame number in playback mode

Spawning

CommandTypeDescription
startCmdAn alias to spawn
spawnCmdWill create a new simulation with particlecount particles and will allocate memoryavailable memory.
particlecountVarNext time spawn gets executed, this is how many particles will spawn
memoryavailableVarThis is the amount of memory (in MB) that Gravit will allocate when spawning a new simulation.
spawngalcountminVarDetermines the minimum amount of galaxies to spawn. Obselete as of 0.4.0.
spawngalcountmaxVarDetermines the maximum amount of galaxies to spawn. Obselete as of 0.4.0.
spawngalmassminVarThe minimum mass of a particle. Each galaxy will pick a range between spawngalmassmin and spawngalmassmax to determine the mass of each particle within it. Obselete as of 0.4.0.
spawngalmassmaxVarThe maximum mass of a particle. Each galaxy will pick a range between spawngalmassmin and spawngalmassmax to determine the mass of each particle within it. Obselete as of 0.4.0.
spawngalsizeminVarThe minimum radius of a galaxy. Obselete as of 0.4.0.
spawngalsizemaxVarThe maximum radius of a galaxy. Obselete as of 0.4.0..
spawngalvelminVarThe minimum velocity of a galaxy. Obselete as of 0.4.0.
spawngalvelmaxVarThe maximum velocity of a galaxy. Obselete as of 0.4.0.
spawnrangeminVarThe minimum size of the universe where galaxies may spawn in. Obselete as of 0.4.0.
spawnrangemaxVarThe maximum size of the universe where galaxies may spawn in. Obselete as of 0.4.0.

Saving and Loading

CommandTypeDescription
loadCmdLoad a previously saved simulation. Most simulation settings are saved except for g.
saveCmdSaves the current simulation by the name you give it (eg. "save mysimulation"). If you have saved or loaded recently, you will have a "simulation name" which is shown on the top of your screen. If you have this, you don't need to specify a name to save -- it will automatically use the simulation name.
saveautoVarWhen set to a number bigger then 0, it will automatically save every n frames.
savelistCmdDisplays a list of each saved simulation along with some details.
savedeleteCmdThis will delete a saved simulation

Video

CommandTypeDescription
videorestartCmdRestarts the video display with the new video settings. The settings that are applied by this command are videowidth, videoheight, videobpp, videofullscreen, videoantialiasing, fontfile and fontsize. This sometimes doesn't work on some computers.
videowidthVarVideo resolution width Gravit will use when videorestart is executed or when the program starts. This usually needs to be used with videoheight. Good combos are 800x600, 1024x768, 1280x1024 and 1600x1200 -- depending on your video capabilities
videoheightVarVideo resolution height. See videowidth.
videobppVarVideo bits per pixel. A good value for this is 16, 24, 32.
videofullscreenVarSet this value to 1 if you want Gravit to take up the whole screen. 0 for windowed mode.
videoantialiasingVarThis turns on full screen anti-aliasing. Some hardware is not compatible with this.
fontfileVarSpecifies which true type font to use. The default is Vera.ttf which comes with Gravit.
fontsizeVarUsed with fontfile to specify the font size in pixels.
recordingvideorefreshtimeVarThis setting allows the screen to update while recording a frame. The value is in milliseconds. The higher you have this value, the less often your video will update (causing video and input lag) but recording will be faster. Set this to 0 to turn off video/input updating while recording completely.
showcursorVarSet this to 0 to hide the mouse cursor, 1 to display it.
blendmodeVarThere are 5 blend modes (0 to 4). 0 disables OpenGL blending. 1,2,3,4 use different combinations of blend settings. They can be pretty and wierd effects.
fpsVarNot implemented
autocenterVarTracks the center of the simulation when set to 1. This is on by default.
maxverticesVarSets a limit to how many vertices to render. If it hits this value, tailskip will be doubled. 100000 is the default.
zoomVarThe current zoom. 0 means you're at the center of the simulation.
zoomfitVarCauses the zoom level to fit your entire simulation
zoomfitautoVarSetting this to 1 will automatically execute zoomfit when spawning a new simulation. Setting it to 2 will execute zoomfit every frame.
autorotateVarThis accepts 3 arguments for X Y and Z. Set these to 0 for no rotation.
stereoVarWhen set to 1, Gravit will render the scene twice -- one on the left and one on the right. It is used for creating stereoscopic images to see Gravit in 3D.
stereoseparationVarWhen stereo is set to 1, modify this value to determine the depth of the 3D image. Negative values are for parallel viewing, positive values are for cross-eyed viewing. Try a number like 5.
screenshotCmdCreates a bitmap (BMP) screenshot in the screenshots directory
screenshotloopVarEvery frame rendered to the screen will execute the screenshot command. This will easily fill up your hard drive with BMP files.

Screen Saver

CommandTypeDescription
screensaverVarThis is set to 1 when Gravit is running as a screensaver. It will quit on any mouse movement or keystroke.
installscreensaverCmdIn windows, this will install Gravit as a screensaver.

Particles and Effects

CommandTypeDescription
particlerendermodeVarThere are 3 rendering modes for particles. 0 for dots, 1 for fast and less compatible textured particles and 2 which looks like 1 except that it is more compatible and slower.
particlerendertextureVarRendering of the particle texture -- this was used for debugging.
particlecolourmodeVarThere are 3 particle colour modes. 0 for colour based on mass, 1 is based on current velocity and 2 is based on acceleration (which needs at least 2 frames recorded to work).
particlesizeminVarMinimum size of a particle. This has no effect in particlerendermode 0. These sizes differ between particlerendermode 1 and 2.
particlesizemaxVarMaximum size of a particle. This has no effect in particlerendermode 0. These sizes differ between particlerendermode 1 and 2.
tailskipVarChanges the resolution of the particle tail, the higher the number the less accurate the tail is. Setting it to 1 will created the smoothest tails.
tailfadedVarSetting this to 1 will make the tail increasingly transparent along the length of the tail. Set it to 0 to maintain a constant colour/opacity.
tailopacityVarSets the opacity of every tail. It ranges from 0 being invisible to 1 being opaque.
taillengthVarThe length of the tail in frames. Set it to -1 to display every step in the tail.
tailwidthVarThinkness of each tail.
drawaxisVarNot implemented
drawtreeVarWill display the octtree. 1 will show the tree using lines, 2 will show semi-transparent boxes. The tree will animate if recordingvideorefreshtime is bigger then 0.
drawosdVarSetting this to 0 will hide all text on the screen.
drawcolourschemeVarWill display or hide the colour key on the top right of the screen

Colours

CommandTypeDescription
colourschemenewCmdClears out the current colour scheme.
colourschemeaddCmdAdd a new colour to the colour scheme. It accepts 4 arguments, red green blue alpha.

Timers

CommandTypeDescription
timeraddCmdAdds a timer
timerdelCmdRemoves a timer
timerlistCmdLists all timers

Misc

CommandTypeDescription
popuptextCmdDisplays some text on the screen.
cdCmdChange directory. Not apparently useful!