Skip to content

Complete guide of Control variables by Ten Graves

cravxx edited this page May 14, 2021 · 1 revision

Seeing as most people don't really know much about what the variables in Control do, here is a list of their functions:

Section 1 (game controls):

-- boolean left, right, up, down and handb are the variables for the arrow keys and spacebar. Used for the AI cars as well.

-- int lookback is used for looking back (shocker), when you press Z or X.

-- boolean enter is the variable for the Enter key.

-- boolean arrace is used for the A key (which changes what the arrow does). When arrace is true, the arrow points to cars, otherwise it points to the track.

-- "mutem and mutes" mute the music and sound respectively.

Section 2 (for the AI cars only):

-- int pan is used for helping the AI decide when to turn (for example when there is a turn piece, they get thrown away from the track, etc.)

-- int attack is used for wasting. When attack is greater than 0, the AI cars its applied to waste a specific car. The car it tries to waste is determined by acr (see below).

When attack is 0, the AI car races.

-- int acr determines what car is attacked when attack is above 0.

-- boolean afta is used for this if statement:

It looks complicated, so I'll try and explain it simply. The following body of code is executed IF (for every AI car):

  • A car is within the set range (l8)
  • afta is true.
  • The car's power isn't too low.

What happens when the if statement is true? It enables AI cars to attack you and other AI cars, to put it simply.

-- int fpnt is an array that determines where the cars go to start fixing (I'll update my AI tutorial soon to show how to use this variable effectively). It has 5 slots.

-- int trfix is a variable that controls how the AI behaves towards a fix. When trfix is 2, the AI start trying to fix (this is by far the most useful part of this variable).

-- boolean forget controls whether the AI go to the next checkpoint before fixing (when it's false) or just "forget" it (when it's true).

-- boolean bulistc makes the AI cars it's applied to go backwards in a stage, like on Stage 11. You also need to make sure that there is a code that makes the AI attack you when you get nearby though. For example:

Note that f2 affects aggressiveness, from 0.0 to 1.0. When it's at 1.0, the AI'll pretty much attack every car they see when they get close enough. When it's at 0.0, they race permanently.

i4 is basically all of the opposing cars from the perspective of the AI rolled into one (0 is the player).

-- int runbul is used in conjunction with bulistc. It's rather complex but really not that useful. Normally, it is used to make cars drive backwards through the stage in Stage 15 and 16. Don't worry too much about this.

-- int acuracy affects the delay of when the cars turn while racing. If it's high they'll take a long time before turning.

-- int upwait makes the AI worse (yes, really). If it's high the AI will literally stop driving forwards from time to time. On Stage 1 there is a limit which makes sure it's at least 20, which is why the AI just stop sometimes there.

Just make it 0 for all of the stages for better AI.

-- boolean aggressed affects how the cars turn. If it's true, the AI will hold up while turning. If it's false, they'll let go of up and slow down a bit.

-- float skiplev makes the AI ignore turns in a stage. If it's at 1.0, they'll always skip them. If it's at 0.0, they'll never skip them. Note that this can also be influenced by other variables.

-- int clrnce controls how precise the AI cars while driving through the track. Do NOT put this at 0, or they'll keep swerving from side to side (because they keep trying to be at exactly the centre of the road piece).

I suggest keeping this at 2 or 3, which works well when you want good racing AI.

-- int rampp affects the priority of using ramps in a stage to get power. If it's at 1, the AI will use them more. If it's at -1, they'll ignore them completely. From my experience though there really isn't a great deal of difference.

-- int turntyp also affects how the AI turn. When it's at 0, they turn normally. When it's at 1, they press down while turning. When it's at 2, they press spacebar (handbrake) while turning.

-- float aim affects (slightly) how accurate the AI are while wasting other cars, from 0 to 1.5F. Changes in this are not that noticeable, however.

-- int saftey affects how careful the AI are while landing from a stunt. It's at 30 by default. If it's high, the AI'll prepare to land from the stunt earlier.

-- boolean perfection also affects how the AI land from a stunt. When it's true, the AI'll land better and will usually not take any damage.

-- float mustland also affects how careful the AI while stunting. Sometimes, the AI can go for the extra rollspin or forward loop but risk getting a bad landing - mustland affects the decision the AI make. Keep it 0.0F if you want the AI to play it safe, or at 1.0 if you want them to push for the extra stunt all the time.

-- boolean usebounce affects whether the AI use bounces while landing from a stunt/launch to carry on driving. Don't worry too much about this - it doesn't affect much.

To be continued...