Air to air combat sandbox, created in Python 3 using the HARFANG 3D 2 framework.
Table of content
The game features :
The source code and the graphics assets are made available for studying purpose. However, you are free to fork this repository, extend the game or release anything that is based on it.
right
and left
keys
space
if you want to control the aircraft using the keyboardstart
button of the gamepad or the joystick depending on the device you want to usestart/fire
button on the gamepad, the Sandbox will automatically define this controler as the input device of the aircraft (see Aircraft keyboard Commands below for the details of the keyboard inputs)requirements.txt
files found in the source\
and Agent\
folders.
0-install-requirements.bat
source
folder (cd source
) and run python main.py
start.bat
or 1-start.bat
CTRL-F5
"OpenGL": false
in the config.json file)3
on the numpad), press F11
to calibrate the position of the headAdd user
: You can add a user. Each user has his own list of records. Users
: Use this combo boxe to selected the user. Item
: List of recordable items. Start recording
: Record the simulation. Recording FPS
: Recording frequency (Frame Per Second). Records
: Select record to replay. Enter replay mode
: Replayer.
Start play
Display selected item
: Display a sight on selected item, to identify the item in 3D view. Prev frame
, Next frame
: Backward / foreward frame by frame. You can also press -
, +
on keyboard. Hits (missiles, machine gun, crashes) are recorded and displayed as circles during replay:
Yellow circles : before the event
Red circles : after the event
The maximum size of the circle depends on the power of the collision.
The "Network" mode allows you to control the planes from a third party machine.
On the server machine:
On the client machine:
network_client_example
. client_sample.py
with a text editor.client_sample.py
Command | Key |
---|---|
Increase thrust level | Home |
Decrease thrust level | End |
Increase brake level | B |
Decrease brake level | N |
Increase flaps level | C |
Decrease flaps level | V |
Roll left | Left |
Roll right | Right |
Pitch up | Up |
Pitch down | Down |
Yaw left | Suppr |
Yaw right | PageDown |
Switch post combustion | Space |
Next target | T |
Switch gear | G |
Activate IA | I |
Activate Autopilot | A |
Switch easy steering mode | E |
Fire machine gun | Enter |
Fire missile | F1 |
Increase health level | P |
Decrease health level | M |
Rearm | F5 |
HUD on /off | H |
Command | Key |
---|---|
Roll cameras carousel (aircrafts, FPS) | 1 |
Increase FoV angle | PageUp |
Decrease FoV angle | Insert |
Command | Key |
---|---|
Back view | 2 |
Front view | 8 |
Left view | 4 |
Right view | 6 |
Satellite view | 5 |
Tactical view | 7 |
Pursuit view | 9 |
Cockpit view | 3 |
Command | Key |
---|---|
Head orientation | LMB + mouse move |
Move forward | Up, Z |
Move backward | Down, S |
Move left | left, Q |
Move right | right, D |
Fast speed 1 | Left Shift + move |
Fast speed 2 | Left Ctrl + move |
Fast speed 3 | Right Ctrl + move |
There are two types of command configuration files.
The devices_config.json
file contains the inputs parameters of the device.
Input of "axis" type
"GA_LeftX": {
"type": "axis",
"name": "Left pad horizontal",
"reset": "true",
"invert": "false",
"id": 0,
"min": -1,
"max": 1,
"zero": -0.0156,
"zero_epsilon": 0.01
}
Input of "button" type
"GB_Start": {
"type": "button",
"id": 7,
"name": "Start"
},
GA_LeftX
or GB_Start
: The input id used in XXX_inputs_mapping.json
files.type
: "axis" or "button"name
: The input name, used for displaysreset
: True if the axis returns to its "zero" position when releasedinvert
: True if you want to invert the command (returned value * -1)id
: Internal id of the axis (int)min
, max
: clamped bounds values of the axiszero
: returned value when axis is on its "reset" position.zero_epsilon
: Define an epsilon if the zero value is not stable.The XXX_inputs_mapping.json
files contains the inputs mapping for the systems commands:
For Keyboard, inputs ids are the same as HARFANG3D Keys enums
(Muhammed Murat Özbek, Süleyman Yıldırım, Muhammet Aksoy, Eric Kernin, Emre Koyuncu)
Harfang3D Dog-Fight Sandbox: A Reinforcement Learning Research Platform on arxiv.org
How to cite this publication:
@misc{2210.07282,
Author = {Muhammed Murat Özbek, Süleyman Yıldırım, Muhammet Aksoy, Eric Kernin and Emre Koyuncu},
Title = {Harfang3D Dog-Fight Sandbox: A Reinforcement Learning Research Platform for the Customized Control Tasks of Fighter Aircrafts},
publisher = {arXiv},
doi = {10.48550/ARXIV.2210.07282},
Year = {2022},
Eprint = {arXiv:2210.07282},
}
Air to air combat sandbox, created in Python 3 using the HARFANG 3D 2 framework. This project provides a rich environment for air combat simulation and has been utilized in advanced research projects, including the latest in reinforcement learning strategies for unmanned combat aerial vehicles (UCAV), developed at a leading Chinese university. For more on this innovative approach, see the HIRL4UCAV project on GitHub.