Config Programming

A "config" file is any file that contains textual commands that G-Force interprets as it runs. Configs are to G-Force as Nintendo cartridges are to the Nintendo unit. If you want to learn the language G-Force and WhiteCap use in their config files, you should have some familiarity with programming and/or script writing. The more programming or script experience you have, the easier you'll learn how G-Force works.

Submitting Your Configs
If you'd like a config you made yourself to permanently become part of G-Force, please email it in. From there, it'll be evaluated and checked for possible problems or faults. If you choose to redistribute your configs on you own and do something improperly in them, you may cause other versions of G-Force to crash or have other problems. Further, sending in your configs centralizes the entire process, guaranteeing your work to appear as soon as possible.

Documented Configs
The following are a list of configs already included with G-Force that are documented (try using a file search in your OS to find them easily). In other words, if you open a config file in a text editor or word processor, then you'll find information that will allow you to make and edit your own configs. Try looking at them in order listed, and be aware that many other configs contain documentation/comments added by the author that created them. If you see a config in G-Force you really like, don't be afraid to open it in order to see how it's doing it.

ColorWheel
Linear Spread
Rotating Corridor
Spinners
Default Sprite

 

Config/Language Reference
The following is a list of the available functions in G-Force.

Trig (all angles in radians)
sin()sine
cos()cosine
tan()tangent
atan()arctangent

Common Functions
abs()absolute value
exp()e to the x
log()natural logarithm
sqr()square
sqrt()square root

Logical
pos(x)x if x <= 0 and 0 otherwise
sgn(x)1 if x <= 0 and -1 otherwise
clip(x)0 when x < 0, 1 when x < 1, and x when 0 <= x &rt;= 1
sqwv(x)1 if abs(x) &rt;= 1.0 and 0 otherwise
trwv(x)triangle shape that passes thru (0,0), (1,1), (2,0) and repeats in both directions along the x axis
seed(x)seeds the random number generator based on the bits of x, returns x

Miscellaneous
rnd(x)a random real number from 0 to x
trnc(x)everything to the right of the decimal point in x is dropped
flor(x)the largest integer that is also less than x (ex, flor(3.2) == 3, flor(-2.7) == -3 )
wrap(x)x - flor( x ) (ex: wrap( .3 ) == .3, wrap( 4.12 ) == .12, wrap( - 2.7 ) == .3 )

Operators
An operator is a something that joins to numbers, such as '+' and '-'. Operators are used to combine two values to make a new value, and the operators available are:
+ -Add/Subtract
* /Multiply/Divide
%Modulo or "the integer remainder when A is divided by B" (ex, 8 % 4 == 0, 11 % 3 == 2)
^"A raised to the B power"

Audio Functions
mag()Accesses samples of the current audio
fft()Accesses the frequency transform/spectrum of the current audio
BASSContains a value that approximates the overall beat

Global Values
PI3.141592653
NUM_S_STEPSThe number of times the X, Y, and C expressions are evaluated per sample (ie, per frame)
NUM_FFT_BINSThe number of bins/resolution composing fft()
NUM_SAMPLE_BINSThe number of values composing mag()

 

Things to remember...

Be Patient
Don't get discouraged if the math seems like a lot. It's simply a matter of experience and it'll come much easier with just a little time--like riding a bike. As you explore existing configs, you may want to try using a graphing calculator to help see how a certain equations behave. A common way to learn config programming is to alter existing configs and observe the effects of your changes.

Testing Your Configs
When you're ready to test your config, you have to tell G-Force to load a fresh copy it from the disk. Otherwise, if you switch to a config you've been editing, G-Force won't load your changes (because it's using a cached copy). By default, the 'U' key will reload the currently displayed configs. In other words, when you save changes to a config, press the U key to make G-Force load a fresh copy from disk.