Skip to content

jannik4/apex_flow

Repository files navigation

Apex Flow

Apex Flow is a racing game built with the Bevy game engine in Rust. Design your own cars using a node-based flow graph system to define car attributes and behaviors.

How to Run

If you have an webgpu capable browser, you can run the web version.

Otherwise, have a look at the justfile to get started.

Manual

Manual

Editor

On the left side of the screen is the flow graph editor.
At the top, you’ll find all available nodes, which can be dragged into the workspace below.
Next to them are the Import and Export buttons, as well as a “1.0” button to reset the zoom and a “[]” button to fit the graph to view.

Below is the tab bar. Create new tabs (cars) using the “+” button on the right.
To close a tab, hold Shift + Ctrl and click the “x” button. Make sure to export your work before closing a tab!

Keybindings

  • Ctrl + Z / Y: Undo / Redo
  • Right-click drag: Pan
  • Left-click drag: Box select or move selected nodes
  • Scroll: Zoom in/out
  • Click: Select node
  • Shift + Click: Multi-select
  • Left-click drag between ports: Connect nodes
  • Ctrl + Left-click from occupied port: Add additional connection

Scene

On the right side is the scene view.
At the top, you can select the track, choose the race mode (Free Play or 1–3 laps), and Play / Pause / Reset the simulation.
In the top-right corner, you can toggle car names (N), sensor visibility (S), and camera mode (C).

Keybindings

  • Space: Play / Pause
  • Right-click drag: Rotate camera
  • Scroll: Zoom in/out
  • Ctrl + Right-click drag: Move camera
  • Tab: Cycle through camera modes
  • F1: Toggle FPS display
  • F2: Toggle audio

Nodes

◀: Input port
▶: Output port

For a node to be functional, all its input ports (◀) must be connected (with the exception of the Car Input node).

Bool

out: bool Constant boolean value.

Float

out: float Constant float value.

String

out: string Constant string value.

Vec3

x: float X component.
y: float Y component.
z: float Z component.
out: vec3 Resulting vector.

Components

in: vec3 A vector.
x: float X component.
y: float Y component.
z: float Z component.

Add

left: float | vec3 Left operand.
right: float | vec3 Right operand.
out: float | vec3 Component-wise sum of the two inputs.

Sub

left: float | vec3 Left operand.
right: float | vec3 Right operand.
out: float | vec3 Component-wise difference of the two inputs.

Mul

left: float | vec3 Left operand.
right: float | vec3 Right operand.
out: float | vec3 Component-wise product of the two inputs.

Div

left: float | vec3 Left operand.
right: float | vec3 Right operand.
out: float | vec3 Component-wise quotient of the two inputs.

Min

left: float | vec3 Left operand.
right: float | vec3 Right operand.
out: float | vec3 Component-wise minimum of the two inputs.

Max

left: float | vec3 Left operand.
right: float | vec3 Right operand.
out: float | vec3 Component-wise maximum of the two inputs.

Abs

in: float | vec3 Input value.
out: float | vec3 Component-wise absolute value.

Clamp

in: float | vec3 Input value.
min: float | vec3 Minimum value.
max: float | vec3 Maximum value.
out: float | vec3 Component-wise clamped value.

Cross

left: vec3 Left operand.
right: vec3 Right operand.
out: vec3 Cross product of the two inputs.

Dot

left: vec3 Left operand.
right: vec3 Right operand.
out: float Dot product of the two inputs.

Normalize

in: vec3 Input vector.
out: vec3 Normalized vector.

Length

in: vec3 Input vector.
out: float Length of the vector.

Lerp

a: float | vec3 Start value.
b: float | vec3 End value.
t: float | vec3 Interpolation factor.
out: float | vec3 Component-wise linearly interpolated value.

And

left: bool Left operand.
right: bool Right operand.
out: bool Logical AND of the two inputs.

Or

left: bool Left operand.
right: bool Right operand.
out: bool Logical OR of the two inputs.

Not

in: bool Input value.
out: bool Logical NOT of the input.

==

left: T Left operand.
right: T Right operand.
out: bool Equality comparison of the two inputs.

!=

left: T Left operand.
right: T Right operand.
out: bool Inequality comparison of the two inputs.

>

left: T Left operand.
right: T Right operand.
out: bool Greater-than comparison of the two inputs.

<

left: T Left operand.
right: T Right operand.
out: bool Less-than comparison of the two inputs.

>=

left: T Left operand.
right: T Right operand.
out: bool Greater-than-or-equal comparison of the two inputs.

<=

left: T Left operand.
right: T Right operand.
out: bool Less-than-or-equal comparison of the two inputs.

Select

condition: bool Condition to evaluate.
true: T Value if condition is true.
false: T Value if condition is false.
out: T Selected value based on the condition.

Manual Input

throttle: f32 Throttle input (0.0–1.0). Arrow up or gamepad.
brake: f32 Brake input (0.0–1.0). Arrow down or gamepad.
steer: f32 Steering input (-1.0–1.0). Arrow left/right or gamepad.
reset: bool Steering input (-1.0–1.0). Enter key or gamepad.

Delay

input: T Input value.
delayed: T Input value delayed by one tick.

Timer

reset: bool Reset the timer.
time: f32 Elapsed time in seconds since last reset.

Debug

in: T Input value.
out: T Output value (same as input).

Displays the input value.

Sensor

angle: f32 Angle of the sensor in degrees.
hit: bool Whether the sensor is hitting the wall.
distance: f32 Distance to the wall.
normal: vec3 The normal of the wall hit.

Car Output

velocity: vec3 Velocity of the car.
forward: vec3 Forward direction of the car.
up: vec3 Up direction of the car.
wrong way: bool Whether the car is going the wrong way.

Car Input

throttle: f32 Throttle input (0.0–1.0).
brake: f32 Brake input (0.0–1.0).
steer: f32 Steering input (-1.0–1.0).
reset: bool Reset input.
color: vec3 Color of the car.
name: string Name of the car.

Car Setup

Configure the setup of the car. Points can be assigned to speed, acceleration, downforce and tyre grip. Assign a maximum of 5 points per category and a maximum of 10 points in total.

Car

Choose a car model. Different car models have different base stats and handling characteristics.

License

The source code in this repository is licensed under any of the following at your option:

Credits

  • Most of the 3D assets are either based on or directly sourced from the asset packs from Kenney.nl.
  • Project idea inspired by AIA from this video.

About

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages