rlbot-flatbuffers 0.18.0__tar.gz → 0.18.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/Cargo.lock +9 -9
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/Cargo.toml +1 -1
- rlbot_flatbuffers-0.18.2/PKG-INFO +139 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/pyproject.toml +1 -1
- rlbot_flatbuffers-0.18.0/PKG-INFO +0 -8
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/LICENSE +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/README.md +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/codegen/class_inject.rs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/codegen/enums.rs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/codegen/main.rs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/codegen/pyi.rs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/codegen/structs.rs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/codegen/table.rs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/codegen/unions.rs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/color.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/comms.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/corepacket.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/gamedata.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/gamestatemanip.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/interfacepacket.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/matchconfig.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/misc.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/rendering.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/rlbot.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/vector.fbs +0 -0
- {rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/src/lib.rs +0 -0
|
@@ -815,7 +815,7 @@ checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
|
|
|
815
815
|
|
|
816
816
|
[[package]]
|
|
817
817
|
name = "rlbot_flatbuffers"
|
|
818
|
-
version = "0.18.
|
|
818
|
+
version = "0.18.2"
|
|
819
819
|
dependencies = [
|
|
820
820
|
"eyre",
|
|
821
821
|
"indexmap",
|
|
@@ -858,15 +858,15 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
858
858
|
|
|
859
859
|
[[package]]
|
|
860
860
|
name = "semver"
|
|
861
|
-
version = "1.0.
|
|
861
|
+
version = "1.0.27"
|
|
862
862
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
863
|
-
checksum = "
|
|
863
|
+
checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
|
|
864
864
|
|
|
865
865
|
[[package]]
|
|
866
866
|
name = "serde"
|
|
867
|
-
version = "1.0.
|
|
867
|
+
version = "1.0.223"
|
|
868
868
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
869
|
-
checksum = "
|
|
869
|
+
checksum = "a505d71960adde88e293da5cb5eda57093379f64e61cf77bf0e6a63af07a7bac"
|
|
870
870
|
dependencies = [
|
|
871
871
|
"serde_core",
|
|
872
872
|
"serde_derive",
|
|
@@ -874,18 +874,18 @@ dependencies = [
|
|
|
874
874
|
|
|
875
875
|
[[package]]
|
|
876
876
|
name = "serde_core"
|
|
877
|
-
version = "1.0.
|
|
877
|
+
version = "1.0.223"
|
|
878
878
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
879
|
-
checksum = "
|
|
879
|
+
checksum = "20f57cbd357666aa7b3ac84a90b4ea328f1d4ddb6772b430caa5d9e1309bb9e9"
|
|
880
880
|
dependencies = [
|
|
881
881
|
"serde_derive",
|
|
882
882
|
]
|
|
883
883
|
|
|
884
884
|
[[package]]
|
|
885
885
|
name = "serde_derive"
|
|
886
|
-
version = "1.0.
|
|
886
|
+
version = "1.0.223"
|
|
887
887
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
888
|
-
checksum = "
|
|
888
|
+
checksum = "3d428d07faf17e306e699ec1e91996e5a165ba5d6bce5b5155173e91a8a01a56"
|
|
889
889
|
dependencies = [
|
|
890
890
|
"proc-macro2",
|
|
891
891
|
"quote",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "rlbot_flatbuffers"
|
|
3
|
-
version = "0.18.
|
|
3
|
+
version = "0.18.2"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
description = "A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers"
|
|
6
6
|
repository = "https://github.com/RLBot/flatbuffers-python"
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rlbot_flatbuffers
|
|
3
|
+
Version: 0.18.2
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Summary: A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
11
|
+
Project-URL: Source Code, https://github.com/RLBot/flatbuffers-python
|
|
12
|
+
|
|
13
|
+
## rlbot-flatbuffers
|
|
14
|
+
|
|
15
|
+
A Python module implemented in Rust for fast and safe serialization and deserialization of RLBot's flatbuffers
|
|
16
|
+
|
|
17
|
+
### The goal of this project
|
|
18
|
+
|
|
19
|
+
A majority of the code is auto-generated by `codegen/` upon first compile
|
|
20
|
+
using the RLBot's schema as defined by the `flatbuffers-schema` submodule.
|
|
21
|
+
|
|
22
|
+
This includes the code generated by Planus (`src/planus_flat.rs`),
|
|
23
|
+
the Python wrapper binds to the generated Rust code (`src/python/`),
|
|
24
|
+
and the Python type hints (`rlbot_flatbuffers.pyi`).
|
|
25
|
+
|
|
26
|
+
Usage of this API should not significantly differ from RLBot v4 to reduce developer confusion, while not holding back changes that would make the API easier to work with.
|
|
27
|
+
|
|
28
|
+
### Minimum support Python version
|
|
29
|
+
|
|
30
|
+
The crate used to generate Python binds (PyO3) supports all the way back to Python 3.7, however the minimum supported Python version is 3.10 for a few reasons:
|
|
31
|
+
|
|
32
|
+
1. RLBot v4 currently runs Python 3.11
|
|
33
|
+
1. The RLBot v5's [Python interface](https://github.com/RLBot/python-interface) has a minimum Python version of 3.11, but the difference between 3.10 and 3.11 doesn't mean much for these binds specifically.
|
|
34
|
+
1. Python 3.10 is the version of Python that added `match`/`case`
|
|
35
|
+
1. [Python 3.7 & 3.8 are EOL, with 3.9's EOL date being 2025-10](https://devguide.python.org/versions/)
|
|
36
|
+
|
|
37
|
+
### Dev setup
|
|
38
|
+
|
|
39
|
+
- Ensure Python 3.10+ is installed
|
|
40
|
+
- Create a virtual Python environment
|
|
41
|
+
- `python3 -m venv venv`
|
|
42
|
+
- Activate the virtual environment
|
|
43
|
+
- Windows: `venv\Scripts\activate.bat`
|
|
44
|
+
- Linux: `source venv/bin/activate`
|
|
45
|
+
- Install maturin
|
|
46
|
+
- `pip install maturin`
|
|
47
|
+
- Build & install for testing
|
|
48
|
+
- `maturin develop --release`
|
|
49
|
+
|
|
50
|
+
To use in another Python environment, like if testing [python-interface](https://github.com/RLBot/python-interface), you can build the wheel:
|
|
51
|
+
|
|
52
|
+
- `maturin build --release`
|
|
53
|
+
- (In another environment) `pip install path/to/file.whl`
|
|
54
|
+
|
|
55
|
+
The exact path of the wheel will be printed by maturin, just copy+paste it.
|
|
56
|
+
|
|
57
|
+
### Basic usage
|
|
58
|
+
|
|
59
|
+
All classes and methods should have types hints readable by your IDE, removing the guesswork of common operations.
|
|
60
|
+
|
|
61
|
+
#### Creating
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
import rlbot_flatbuffers as flat
|
|
65
|
+
|
|
66
|
+
desired_ball = flat.DesiredBallState(
|
|
67
|
+
physics=flat.Physics(
|
|
68
|
+
location=flat.Vector3Partial(z=200),
|
|
69
|
+
velocity=flat.Vector3Partial(x=1500, y=1500),
|
|
70
|
+
angular_velocity=flat.Vector3Partial(),
|
|
71
|
+
),
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
desired_game_info = flat.DesiredGameInfoState(
|
|
75
|
+
world_gravity_z=-100,
|
|
76
|
+
game_speed=2,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
desired_game_state = flat.DesiredGameState(
|
|
80
|
+
ball_state=desired_ball,
|
|
81
|
+
game_info_state=desired_game_info,
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
In the above code, we:
|
|
86
|
+
|
|
87
|
+
- Set the ball to:
|
|
88
|
+
- Location (0, 0, 200)
|
|
89
|
+
- Velocity (1500, 1500, 0)
|
|
90
|
+
- Angular velocity of (0, 0, 0)
|
|
91
|
+
- Don't set the car states
|
|
92
|
+
- Set the game info state:
|
|
93
|
+
- World gravity to -100
|
|
94
|
+
- Game speed to 2x default
|
|
95
|
+
- Don't set end match or paused
|
|
96
|
+
- Don't set any console commands
|
|
97
|
+
|
|
98
|
+
All values are optional when creating a class and have the proper defaults.
|
|
99
|
+
|
|
100
|
+
#### Reading values
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
import rlbot_flatbuffers as flat
|
|
104
|
+
|
|
105
|
+
def handle_packet(packet: flat.GamePacket):
|
|
106
|
+
if packet.match_info.match_phase not in {
|
|
107
|
+
flat.MatchPhase.Active,
|
|
108
|
+
flat.MatchPhase.Kickoff,
|
|
109
|
+
}:
|
|
110
|
+
# Return early if the game isn't active
|
|
111
|
+
return
|
|
112
|
+
|
|
113
|
+
# Print the ball's location
|
|
114
|
+
print(packet.ball.physics.location)
|
|
115
|
+
|
|
116
|
+
for car in packet.players:
|
|
117
|
+
# Print the every car's location
|
|
118
|
+
print(car.physics.location)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The goal of the above was to feel familiar to RLBot v4 while providing a more Pythonic interface.
|
|
122
|
+
|
|
123
|
+
- Unions aren't custom types, rather a normal Python variable that can be 1 of a few types.
|
|
124
|
+
- For example, previously [`BallInfo.shape` had the separate type `CollisionShape` which contained the union's data](https://github.com/RLBot/RLBot/blob/e34dd4598bc643e2b8e50b77f7ffe4ca38e335de/src/main/python/rlbot/utils/structures/game_data_struct.pyi#L65-L95) but the type is now just `BoxShape | CylinderShape | SphereShape`
|
|
125
|
+
|
|
126
|
+
- Classes implement `__match_args__` for easy destructuring via the `match`/`case` pattern.
|
|
127
|
+
- Enums can still be used to match against the type,
|
|
128
|
+
they just can't be destructured.
|
|
129
|
+
- Classes and enums properly implement `__repr__`, with `__str__` being an alias.
|
|
130
|
+
- Enums implement `__hash__`, `__int__` and `__eq__`.
|
|
131
|
+
- Lists no longer have `num_x` fields accompanying them,
|
|
132
|
+
they are just Python lists of the appropriate length.
|
|
133
|
+
- Classes implement `pack` and `unpack`,
|
|
134
|
+
which are used to serialize and deserialize data.
|
|
135
|
+
- These are public methods that can be used directly for any purpose,
|
|
136
|
+
for example saving `flat.GamePacket` to a file.
|
|
137
|
+
|
|
138
|
+
- Auto-generated python type stub (`.pyi`) generation that includes doc comments from the Flatbuffers schema
|
|
139
|
+
|
|
@@ -10,7 +10,7 @@ classifiers = [
|
|
|
10
10
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
11
11
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
12
12
|
]
|
|
13
|
-
dynamic = ["version"]
|
|
13
|
+
dynamic = ["version", "description", "urls", "readme"]
|
|
14
14
|
|
|
15
15
|
[tool.maturin]
|
|
16
16
|
features = ["pyo3/extension-module", "pyo3/abi3-py310"]
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: rlbot_flatbuffers
|
|
3
|
-
Version: 0.18.0
|
|
4
|
-
Classifier: Programming Language :: Rust
|
|
5
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
-
License-File: LICENSE
|
|
8
|
-
Requires-Python: >=3.10
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/corepacket.fbs
RENAMED
|
File without changes
|
{rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/gamedata.fbs
RENAMED
|
File without changes
|
{rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/gamestatemanip.fbs
RENAMED
|
File without changes
|
{rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/interfacepacket.fbs
RENAMED
|
File without changes
|
{rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/matchconfig.fbs
RENAMED
|
File without changes
|
|
File without changes
|
{rlbot_flatbuffers-0.18.0 → rlbot_flatbuffers-0.18.2}/flatbuffers-schema/schema/rendering.fbs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|