lunes, 31 de agosto de 2015

Track Design II - Obstacles and themes

Obstacles

  • Ramps: If traversed with enough speed will make the car jump. If the trick button is pressed at the correct moment a boost jump will happen.
  •  Bouncers: If the player collides with them it will send him rolling to a different lane and make him loose some speed. If the player uses the trick button when colliding he will go through them and get a turbo boost. If the player lands on top of one he will crash, but if he uses the trick button he will bounce upwards and make the multiplier rise by one.
  • Gates
  • Speed lines
  • Drones
  • Boost arrows
  • Turbo walls: The player must be using the turbo to be able to cross safely.
  • Switches: to activate/deactivate floors, gates, ramps...
  • Jump pads: If the player pushes the trick button he will get a boost jump.
  • Speed lights: Not an obstacle, it indicates if the lane which it´s above is free to pass or has an obstacle the player can´t currently pass because of level or anything else. They can be used to make lap 1 easier and then progressively start making them fail.
  • Shield stations: The player has a shield that protects him from environmental damage, but this shield is constantly running out, so he must pass through the shield stations to replenish it. Running out of shield will make him loose speed gradually.

Themes
Testing track
Cloud city
Dome/Stadium
Space
Wasteland

Useful Links

The Pure Advantage: Advanced Racing Game AI

40+ Fantastic Game Development Tutorials From Across the Web

Lenticular game Design

 Tools for Game Design 

The Chemistry of Game Design

Game Career Guide

 Critical-Gaming: Game Design 101

 mrBossDesign

Super Mario Bros. 3 Level Design

Game Design Forum (great in-depth SMW analysis)




lunes, 24 de agosto de 2015

Car Customization

Cars have different skills:

  1. Acceleration: How fast it accelerates and how slowly it looses speed after a turbo.
  2. Max Speed: Maximum speed attainable in every level. Care must be taken so it is in a certain range. This way levels can be designed with accesible paths for different speeds.
  3. Boost jump: How high the player can jump in every level.
  4. Agility: Lighter cars will perform tricks faster. 
  5. Style: Cars with high style will get more points when performing tricks, but the imput windows will be more demanding.
  6. Endurance: High endurance allows for faster recoveries after crashes and less speed loss dues to obstacles.


Cars are composed of 3 parts:

  1. Frame: Affects max speed and agility positively, boost jump and endurance negatively.
  2. Engine: Affects acceleration and endurance positively, max speed and style negatively.
  3. Stabilizers: Affects boost jump and style positively, accceleration and agility negatively.

Each individual part will also have an unlockable perk:

  • Trick booster: Yields more points when doing tricks.
  • Zero boost: Start the race with a turbo token.
  • Experienced: Start the race at level 1, but rising the level will require more points.
  • Safe pass: Lower the requirement of color obstacles by 1 level. Rising the level will require more points.


domingo, 23 de agosto de 2015

Turbo System

When landing after performing tricks the player will get an instant turbo. Turbos have 3 characteristics:

  1. turboSpeedIncrement: The increment of the current speed. This is applied instantly. It is always the same.
  2. turboDuration: The time the speed will be maintained at the max turbo speed.
  3. turboDecceleration: How much the speed will drop every frame after turbo duration has passed until the max speed of the currentSpeedLevel is attained.

turboSpeedIncrement and turboDecceleration are constants. However, turboDuration is directly proportional to the trickPoints achieved before landing. It is calculated with the following formula:
 turboDuration = (trickPoints/scale)*turboDurationMax;

scale has to be defined once the trick point system is balanced.

sábado, 22 de agosto de 2015

Track Design I

Main concepts
Each track will introduce one main mechanic. They may also introduce other secondary mechanics or use mechanics shown in previous tracks.
Tracks are divided in 4 main parts:

  1. Intro: The new mechanic is introduced in a safe environment. The player can experiment with it with little or no penalization. There will always be a starting safe zone to help build up speed.
  2. Challenge: Some challenge is presented with the new mechanic.
  3. Crysis: A different element is used in combination with the main mechanic. If the new element hasn´t appeared before, this part will be divided in 2 so the player has a chance to test the new element safely.
  4. Conclusion: The player´s abbility with the main mechanic will be put to test with a final challenge. There will always be a final zone free of obstacles just before the goal with special signaling to help with final overtakings.

The player must complete 3 laps to finish the race. The track will change slightly in every lap, rising the difficulty and requiring more speed to overcome obstacles. This can be done with colored obstacles.

Main mechanics
Ramps
Bouncers
Gates
Speed lines
Drones
Boost arrows
Turbo walls
Switches: to activate/deactivate floors, gates, ramps...
Jump pads


Track 1 - Trickster

  • Main mechanic: Ramps.
  • Secondary  mechanic: Red floor.
  • Description: The first track of the game. The player will learn to use ramps, boosted jumps and to change lanes.
  • Parts:
    • Intro: All the starting zone will be divided in separated lanes that don´t allow z-movement. The player will watch 2 opponents on different lanes. One of them just advances normally while the other performs repeated spins. After a while they will come to a ramp, the first one will jump normally while the second one will perform a spin and then make a boost jump. Then the player will come to a ramp so he can try to boost jump himself. After this first jump, all lanes will come together so Z-Movement becomes possible.
    • Long ramps will occupy all the lanes so the player is forced to use them.
    • Challenge: Ramps will become narrower, so the player must change lanes to take them.
    • Crysis: Red floors will appear, so the player must change lanes to avoid them. Some opponents will spinJump over them to guide the player. Then, Red floors taking all lanes will appear so the player must use ramps to jump over them.
    • Conclusion: Long red floors with very narrow and short ramps. Boost jumps are necessary to jump over the red floors. Few ramps to take.
  • Variations: In each lap the area covered by red floors will grow. There is also a superior level at some parts that can only be reached after boost jumping with enough speed and that will allow for higher jumps.
  • Notes: Allow for long parts with no ramps so the player can see the changes in speed after landing tricks.



martes, 18 de agosto de 2015

Trick System (II)

1st Input -> L1 trick (TB not allowed).
2nd Input -> L1 Trick (TB not allowed)
3rd Input:
 if TB->L2 trick
 else->L3 trick
4th Input:
 if lastTrick was L2{
  if TB->L1 trick with the not used input
  else->L3 trick
 }else (lastTrick was L3){
  if TB->L2 trick removing the oldest input of the last L3 trick
  else->L3 trick removing the oldest input of the last L3 trick
 }



Instead of basing the system in inputs, it´s better to base it in trick levels:
  • Direction = L1 trick  X
  • L1+Direction = L1 if tricks.Count == 1 X
  • L1+Direction = L3 if tricks.Count>1.
  • L1+TB = L2 if tricks.Count > 1
  • L2+Direction = L3
  • L2+TB = L1 with unused input->Resets trick chain completely
  • L3+Direction = L3 removing oldest input
  • L3+TB = L2 removing oldest input
We´ll need:
trickInputs = To keep track of inputs
trickLevels = To keep track of trick levels
Maximum size will be 2, so every time a new trick is performed all the lists are shifted one position and the data of the oldest trick is deleted.



viernes, 14 de agosto de 2015

Trick System Implementation

Performing tricks

Performing the first trick
Player must be in air. Depending on how this state is reached, there are 3 options:
  • Boost Jump: player boost jumped by pressing Trick just before leaving the ground. In this case the trickInputWindow timer will start the moment the Trick button is pushed before jumping and only a direction input must be supplied. 
  • Normal Jump/Fall: player jumps normally or falls from a cliff without jumping. The player must press the Trick button to start the trickinputWindow counter and then input a direction before the counter reaches 0.
 The 3rd option will be discussed on it´s own alongside the concepts of Chains, Links and Perfect Links.

Consecutive tricks: Chains, Link and Perfect Links
Just as the first trick ends, counter trickChain is set to trickChainMax. The user has to press the trick button before trickChain reaches 0 to perform a different trick. If the counter reaches 0 with no input no penalty will be applied, but the player will have lost the chance to score more points. Also, once the Trick button is pressed the counter trickInputWindow will be set to trickInputWindowMax and start counting: if it reaches 0 the same as for trickChain will happen. This creates the concepts of Links and Chains:
  • Chains: Chains are tricks that are performed in the same jump with no restrictions.
  • Links: If the player presses the Trick button at the correct moment as the previous trick is ending (trickChain > trickLink, set trickInputWindow=trickInputWindowMax) and inputs a direction the player will perform a Link instead of a Chain. The next trick will be performed faster and rack up more points.
  • Perfect Link: The same as Links, but the time window is much more narrower. The next trick will receive an ever bigger boost (score as well).
Pressing the trick button during a trick will not register.

Examples
TB+R=FlipF(L1)->TB+R=FlipF(L1)->TB+TB=Double FlipF (L2)
TB+R=FlipF(L1)->TB+R=FlipF(L1)->TB+U=Double FlipFSpin(L3)
TB+R=FlipF(L1)->TB+R=FlipF(L1)->TB+TB=DoubleFlipF(L2)->TB+U=Double FlipFSpin(L3)

 Implementation

stDrive: exitingRamp
if (trickJustPressed){
  trickInputWindow = trickInputWindowMax;
  trickLink = 0;
}

stJump

if (trickInputWindow > 0) LaunchTrick();
else if (trickJustPressed){
 trickInputWindow = trickInputWindowMax;
 LaunchTrick();//This allows simultaneous presses of TB+Direction
}

LaunchTrick
if (tricks.Count < 2){
 if (rightJustPressed) StartTrick(trickNFlipF);
 else if (...)
}else{
 if (rightJustpressed){
  if (tricks(tricks.Count-2) == trickNFlipF){
   if (tricks(tricks.Count-1))==trickNFlipF) StartTrick(trickNTripleFlipF);
   else if (tricks(tricks.Count-1))==trickNSpin) StartTrick(trickNDoubleFlipFSpin);
   }else if...
  }
 }
}

StartTrick(int newTrick)

trickInputWindow = 0;
currentTrick = newTrick;
tricks.Add(currentTrick);




switch (newTrick){
case trickNFlipF:
 trickTurns[axisZ] =  1;
 trickSpeed[axisZ] = -1;//Set speed according to Chain, Link or PerfectLink
break;

}


EndTrick()
currentTrick = -1;
trickChain = trickChainMax;


jueves, 13 de agosto de 2015

Trick System

Description
The player can perform tricks when in the air. Some conditions apply:
The trick button must have been pressed recently. This starts a counter during which the game will listen for inputs to determine which trick to perform. If the counter ends without input there´s no penalty.
If the player jumps using a ramp he can press the trick button to get a jump boost and automatically start the trick window. This allows to launch tricks earlier in the air.
Tricks are executed in level order.

Option 1: Each trick being an evolution of the previous one:
  • Trick button+Left=Flip Backwards (Lvl1) -> TB+Down=RollFlip Backwards (Lvl2) -> TB+Up=Total Rotation (Lvl3).

Option 2: Each trick input is independent:
  • TB + Left = Flip Backwards (Lvl1)->TB+Left,Down = RollFlip Backwards (Lvl2) -> TB+Left, Down, Up=Total Rotation (Lvl3).

Option 1 allows for simpler controls, but doesn´t enforce variety and there are much fewer possible combinations. For example, to do a Triple Flip B the only possible sequence is L, L, L. It forces the player to plan ahead the tricks and makes it so after a Lvl3 trick only other Lvl3 tricks can be performed.
Option 2 has more complex inputs but gives more freedom to the player, as any combination can be made, even lower level tricks can be performed after a Lvl3 trick has been done. It will also allow to make longer jumps and rise the requirements to Lvl3 tricks to something like Lvl1+Lvl2+Lvl2->Lvl3.

Seeing as in the air the player can´t move and the only possible inputs are turbo (not required) and trick button (for landing, already using it to perform tricks), Option 2 seems better. Special attention must be paid to the time it takes to execute the tricks so the player can make the necessary inputs.

Option 3: Each trick is an evolution of the ones before it:
  • TB+Left=Flip B (Lvl1)->TB+Up=Spin(Lvl1)->TB+TB=SpinFlip B (Lvl2)
  • TB+Left=Flip B (Lvl1)->TB+Up=Spin(Lvl1)->TB+Down=Total Rotation (Lvl3)
  • TB+Left=Flip B (Lvl1)->TB+Up=Spin(Lvl1)->TB+TB=SpinFlip B (Lvl2)->TB+Down=Total Rotation (Lvl3)
This way combinations like Lvl1->Lvl1->Lvl2, Lvl1->Lvl1->Lvl3, Lvl1->Lvl1->Lvl2->Lvl3 can be done.This gives more flexibility as after performing 2 level 1 tricks the player can opt to go for a Lvl2 trick or a longer Lvl3 trick, while maintaining the inputs simple. At the same time, the player must plan ahead the trick inputs to reach the desired Lvl3 trick. After reaching Lvl3 the first input is discarded, so the player can do a Lvl2 or Lvl3 trick:
  • TB+Left=Flip B->TB+Up=Spin->TB+TB=SpinFlip B->TB+Down=Total Rotation->TB+TB=TotalRotation-Flip B= RollSpin (Lvl2)
  • TB+Left=Flip B->TB+Up=Spin->TB+TB=SpinFlip B->TB+Down=Total Rotation->TB+UP=TotalRotation-Flip B+Spin=DoubleSpinRoll (Lvl3)->TB+TB=DoubleSpinRoll-Spin=SpinRoll(Lvl2)->TB+TB=SpinRoll-Roll = DoubleSpin(Lvl2, we add another spin to create a level 2 trick).

 In this case the difference between Lvl2 and Lvl3 tricks must be very big because Lvl3 tricks become accessible at the same time as Lvl2 tricks.
Level 1 tricks can also be executed:
  • TB+Left=Flip B->TB+Up=Spin->TB=SpinFlip B->TB+Down=Total Rotation->TB+TB=TotalRotation-Flip B-Spin=Roll (Lvl1)
From there the whole chain can start again.
A safety timer must be set after the first TB so it doesn´t execute a Lvl2 trick instead.

Option3 has easy inputs, allows multiple combinations, has flexibility but at the same time requires a bit of planning to reach the desired Lvl3 trick.

Implementation
List<int> tricks = new List<int>();
List<int> inputs = new List<int>();
const int inpRight=0, inpUp=1, inpLeft=2, inpDown=3, inpTrick=4;

if (trickEnable){
 if (rightJustPressed){
  inputs.Add(inpRight);
  trickEnable = false;
 }else if (upJustPressed){
  inputs.Add(inpUp);
  tricEnable = false;
}else...

}




miércoles, 12 de agosto de 2015

Development Route

Basic navigation
  • Driving forward.
  • Climbing ramps: allow for turbo jump at the end.
  • Descending slopes: no cliffs.
  • Transitions.
  • Falling down if there´s no floor.
  • Z movement: check after moving in x, y and apply restrictions.
  • Power spin: restrict z movement while powerspinning.
  • Jump.
  • Turbo

Tricks

  • Trick level system: player must perform tricks in order: Level1->level1->Level2 or Level 3->Level2 or Level3.
  • Trick inputs: create trick chart and define inputs and available combinations.
  • Level 1 tricks.
  • Successful landing: update speed level gauge and turbo.
  • Speed gauge UI.
  • Failed landing: crash state.
  • Level 2 and 3 tricks.
  • Trick chains: if Trick button is pressed at the correct moment the next trick will be faster and more points will be given.
  • Trick checklist: keep track of performed tricks.
  • Full turbo system
  • Recovery: after crashing the player will bounce off the floor turning with no control and loosing speed (and one speed level). If the trick button is pressed just as he touches the ground in a bounce, the car will instantly recover and switch to the Drive state. 
  • Height Detection: When in the air, show the height relative to the landing point so the player can estimate the time he´ll be in the air and if it´s possible to launch more tricks. It can be done in 2 ways: showing a line downwards with the current height to the landing point (maybe use color to indicate the allowed trick level) or by a simple gizmo on the speed UI and /or car (for example in the stabilizers) that shows which levels are allowed. Another option is zooming out the camera so the player can always see where he is going to land, so he can decide by himself. It must be tested to see if the zoom isn´t too much though.
Extended test track
  • Adjust speeds, jump heights, jump boosts, trick speeds, turbo boosts, camera zoom...

Basic car model 
  • Create a car model with 3 parts and different materials in each part.
  • Modify car colors in runtime with the speed level.

Sample track
  • Complete sample track with 3 laps. Identify best methods in Blender to triplicate the track.
  • Start sequence: countdown & starting boost.
  • Lap counter.
  • Time counter.
  • Lap variations.
  • End scene.
  • UI overhaul.
Basic obstacles 1
  • Slowing down terrain: 
    • Implement terrain type detection
Polish 1
  • Add FX to touching an obstacle when trying to change lane.
  • FX when boost jumping.
  • FX when jumping.
  • Polish car trail renderer.
  • FX when crashing.
  • Camera zoom relative to speed.
  • Trick UI effects when landing, crashing, gaining a level... 
Basic obstacles 2
  • Color coded obstacles
  • Jump pads
  • Speed gates

Track selection screen
  • Global score.
  • Scene transitions: set spawn variables.
  • Simple scene transition effect. 
  • Scene transitions 2: return to selection screen after race, update score.
Speed lines
  • stSpeedLine: create new state.
  • Apply multiplier and speed, hold score until landing on the ground.
  • Side Jumps: boost multiplier and speed, hold score,  roll on X.

 Bouncer
  • Bouncers are in fact Speed Gates that force you to use the trick button in the correct moment.
  • Boost speed gauge and get instant turbo if powerspinning, crash otherwise.
  • Boosted jump if landing on top and trick pressed (apply multiplier, hold score), small bounce otherwise.
AI
  • Create first opponents.
  • Routes or waypoints?
  • Rubberbanding.