tickgym 1.0.0__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.
- tickgym-1.0.0/LICENSE +21 -0
- tickgym-1.0.0/PKG-INFO +53 -0
- tickgym-1.0.0/README.md +33 -0
- tickgym-1.0.0/pyproject.toml +36 -0
- tickgym-1.0.0/setup.cfg +4 -0
- tickgym-1.0.0/src/tickgym/__init__.py +65 -0
- tickgym-1.0.0/src/tickgym/_generated/__init__.py +0 -0
- tickgym-1.0.0/src/tickgym/_generated/enums.py +121 -0
- tickgym-1.0.0/src/tickgym/_generated/telemetry.py +397 -0
- tickgym-1.0.0/src/tickgym/_generated/views.py +1268 -0
- tickgym-1.0.0/src/tickgym/_generated/wire.py +92 -0
- tickgym-1.0.0/src/tickgym/actions.py +129 -0
- tickgym-1.0.0/src/tickgym/client.py +330 -0
- tickgym-1.0.0/src/tickgym/errors.py +101 -0
- tickgym-1.0.0/src/tickgym/gym.py +596 -0
- tickgym-1.0.0/src/tickgym/input_text.py +243 -0
- tickgym-1.0.0/src/tickgym/lidar.py +145 -0
- tickgym-1.0.0/src/tickgym/py.typed +0 -0
- tickgym-1.0.0/src/tickgym/telemetry.py +232 -0
- tickgym-1.0.0/src/tickgym/types.py +22 -0
- tickgym-1.0.0/src/tickgym.egg-info/PKG-INFO +53 -0
- tickgym-1.0.0/src/tickgym.egg-info/SOURCES.txt +25 -0
- tickgym-1.0.0/src/tickgym.egg-info/dependency_links.txt +1 -0
- tickgym-1.0.0/src/tickgym.egg-info/requires.txt +4 -0
- tickgym-1.0.0/src/tickgym.egg-info/top_level.txt +1 -0
- tickgym-1.0.0/tests/test_exports.py +20 -0
- tickgym-1.0.0/tests/test_input_text.py +59 -0
tickgym-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 the TICK authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tickgym-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tickgym
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Drive Trackmania 2020 physics from Python through TICK: gyms for training agents on exact, restorable simulation.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Documentation, https://tm.achepta.com/tickgym/
|
|
7
|
+
Project-URL: TICK, https://github.com/trackmania-input-control-kit/TickTasTool
|
|
8
|
+
Keywords: trackmania,tas,reinforcement-learning,gym,tick
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: numpy>=1.26
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# TICKGYM
|
|
22
|
+
|
|
23
|
+
Drive Trackmania 2020 physics from Python through TICK
|
|
24
|
+
|
|
25
|
+
Open as many gyms as you want
|
|
26
|
+
and run them in parallel.
|
|
27
|
+
|
|
28
|
+
Documentation: <https://tm.achepta.com/tickgym/>
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
pip install tickgym
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
TICK 3.0 must be installed and have been run once with the game. Python 3.11+
|
|
37
|
+
|
|
38
|
+
## A first race
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from tickgym import Client, TelemetryGroup
|
|
42
|
+
|
|
43
|
+
# TICK on this machine opens the map as a session.
|
|
44
|
+
with Client().open_map(r"C:\Maps\Example.Map.Gbx") as session:
|
|
45
|
+
# One connection is one gym.
|
|
46
|
+
with session.connect(TelemetryGroup.RACE | TelemetryGroup.VEHICLE) as gym:
|
|
47
|
+
telemetry = gym.reset(seed=1)
|
|
48
|
+
telemetry = gym.step(200, accelerate=True)
|
|
49
|
+
print(telemetry.vehicle.speed, telemetry.vehicle.position)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The [quickstart](https://tm.achepta.com/tickgym/quickstart.html) continues from here: a control loop, snapshots,
|
|
53
|
+
exact inputs, saving and replaying a race, etc.
|
tickgym-1.0.0/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# TICKGYM
|
|
2
|
+
|
|
3
|
+
Drive Trackmania 2020 physics from Python through TICK
|
|
4
|
+
|
|
5
|
+
Open as many gyms as you want
|
|
6
|
+
and run them in parallel.
|
|
7
|
+
|
|
8
|
+
Documentation: <https://tm.achepta.com/tickgym/>
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
pip install tickgym
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
TICK 3.0 must be installed and have been run once with the game. Python 3.11+
|
|
17
|
+
|
|
18
|
+
## A first race
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from tickgym import Client, TelemetryGroup
|
|
22
|
+
|
|
23
|
+
# TICK on this machine opens the map as a session.
|
|
24
|
+
with Client().open_map(r"C:\Maps\Example.Map.Gbx") as session:
|
|
25
|
+
# One connection is one gym.
|
|
26
|
+
with session.connect(TelemetryGroup.RACE | TelemetryGroup.VEHICLE) as gym:
|
|
27
|
+
telemetry = gym.reset(seed=1)
|
|
28
|
+
telemetry = gym.step(200, accelerate=True)
|
|
29
|
+
print(telemetry.vehicle.speed, telemetry.vehicle.position)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The [quickstart](https://tm.achepta.com/tickgym/quickstart.html) continues from here: a control loop, snapshots,
|
|
33
|
+
exact inputs, saving and replaying a race, etc.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tickgym"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Drive Trackmania 2020 physics from Python through TICK: gyms for training agents on exact, restorable simulation."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
dependencies = ["numpy>=1.26"]
|
|
14
|
+
keywords = ["trackmania", "tas", "reinforcement-learning", "gym", "tick"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: Microsoft :: Windows",
|
|
18
|
+
"Operating System :: POSIX :: Linux",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.urls]
|
|
23
|
+
Documentation = "https://tm.achepta.com/tickgym/"
|
|
24
|
+
TICK = "https://github.com/trackmania-input-control-kit/TickTasTool"
|
|
25
|
+
|
|
26
|
+
[project.optional-dependencies]
|
|
27
|
+
dev = ["pytest>=8"]
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["src"]
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.package-data]
|
|
33
|
+
tickgym = ["py.typed"]
|
|
34
|
+
|
|
35
|
+
[tool.pytest.ini_options]
|
|
36
|
+
testpaths = ["tests"]
|
tickgym-1.0.0/setup.cfg
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from ._generated.enums import (
|
|
2
|
+
Effect,
|
|
3
|
+
ErrorCode,
|
|
4
|
+
GearShiftState,
|
|
5
|
+
HeldInput,
|
|
6
|
+
InputActionKind,
|
|
7
|
+
LidarHitFlag,
|
|
8
|
+
RaceFlag,
|
|
9
|
+
RayFrame,
|
|
10
|
+
TelemetryGroup,
|
|
11
|
+
VehicleType,
|
|
12
|
+
WaypointKind,
|
|
13
|
+
WheelFlag,
|
|
14
|
+
)
|
|
15
|
+
from .actions import Action
|
|
16
|
+
from .client import (
|
|
17
|
+
Client,
|
|
18
|
+
Endpoint,
|
|
19
|
+
GameResourcePaths,
|
|
20
|
+
HostStatus,
|
|
21
|
+
GymSummary,
|
|
22
|
+
MapSummary,
|
|
23
|
+
Session,
|
|
24
|
+
SessionDetail,
|
|
25
|
+
SessionInfo,
|
|
26
|
+
SessionSummary,
|
|
27
|
+
)
|
|
28
|
+
from .errors import (
|
|
29
|
+
BadActionError,
|
|
30
|
+
BadEntryError,
|
|
31
|
+
CapacityError,
|
|
32
|
+
TickError,
|
|
33
|
+
GymError,
|
|
34
|
+
InternalError,
|
|
35
|
+
ProtocolError,
|
|
36
|
+
ProtocolVersionError,
|
|
37
|
+
SchemaMismatchError,
|
|
38
|
+
SessionUnknownError,
|
|
39
|
+
SnapshotLimitError,
|
|
40
|
+
SnapshotUnknownError,
|
|
41
|
+
TickGymError,
|
|
42
|
+
TransportError,
|
|
43
|
+
)
|
|
44
|
+
from .gym import Checkpoint, ExportedRace, Gym, GymInfo, MapInfo, Snapshot, Waypoint
|
|
45
|
+
from .input_text import InputText, InputTextError
|
|
46
|
+
from .lidar import Lidar, Ray
|
|
47
|
+
from .telemetry import Drivetrain, Effects, Ellipsoid, LidarScan, Race, Runtime, Telemetry, Vehicle, Wheels
|
|
48
|
+
from .types import BoolArray, FloatArray, IntArray, Quat, Vec3
|
|
49
|
+
|
|
50
|
+
__version__ = "1.0.0"
|
|
51
|
+
|
|
52
|
+
__all__ = [
|
|
53
|
+
"Client", "Session", "Gym", "GymInfo", "MapInfo", "Waypoint", "Checkpoint", "Snapshot", "ExportedRace",
|
|
54
|
+
"Endpoint", "MapSummary", "SessionInfo", "SessionSummary", "SessionDetail", "GymSummary", "HostStatus",
|
|
55
|
+
"GameResourcePaths",
|
|
56
|
+
"Telemetry", "Race", "Vehicle", "Drivetrain", "Wheels", "Effects", "Ellipsoid", "Runtime", "LidarScan",
|
|
57
|
+
"Vec3", "Quat", "FloatArray", "IntArray", "BoolArray",
|
|
58
|
+
"Action", "InputText", "InputTextError",
|
|
59
|
+
"Lidar", "Ray",
|
|
60
|
+
"TelemetryGroup", "RayFrame", "VehicleType", "InputActionKind", "Effect", "GearShiftState", "HeldInput", "RaceFlag",
|
|
61
|
+
"WheelFlag", "LidarHitFlag", "WaypointKind", "ErrorCode",
|
|
62
|
+
"TickGymError", "ProtocolError", "TransportError", "TickError", "GymError", "SessionUnknownError",
|
|
63
|
+
"ProtocolVersionError", "SchemaMismatchError", "CapacityError", "SnapshotUnknownError", "SnapshotLimitError",
|
|
64
|
+
"BadEntryError", "BadActionError", "InternalError",
|
|
65
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
from enum import IntEnum, IntFlag
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class MessageKind(IntEnum):
|
|
5
|
+
OPEN = 1
|
|
6
|
+
RESET = 2
|
|
7
|
+
STEP = 3
|
|
8
|
+
SNAPSHOT = 4
|
|
9
|
+
RESTORE = 5
|
|
10
|
+
DISCARD = 6
|
|
11
|
+
QUERY = 7
|
|
12
|
+
EXPORT = 8
|
|
13
|
+
CHECKPOINTS = 9
|
|
14
|
+
HELLO = 128
|
|
15
|
+
TELEMETRY = 129
|
|
16
|
+
SNAPSHOTTED = 130
|
|
17
|
+
LIDAR_SCAN = 131
|
|
18
|
+
EXPORTED = 132
|
|
19
|
+
ACK = 133
|
|
20
|
+
ERROR = 134
|
|
21
|
+
CHECKPOINT_LIST = 135
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ErrorCode(IntEnum):
|
|
25
|
+
SESSION_UNKNOWN = 1
|
|
26
|
+
PROTOCOL_VERSION = 2
|
|
27
|
+
SCHEMA_MISMATCH = 3
|
|
28
|
+
CAPACITY = 4
|
|
29
|
+
SNAPSHOT_UNKNOWN = 5
|
|
30
|
+
SNAPSHOT_LIMIT = 6
|
|
31
|
+
BAD_ENTRY = 7
|
|
32
|
+
BAD_ACTION = 8
|
|
33
|
+
INTERNAL = 9
|
|
34
|
+
BAD_MESSAGE = 10
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class TelemetryGroup(IntFlag):
|
|
38
|
+
NONE = 0
|
|
39
|
+
RACE = 1
|
|
40
|
+
VEHICLE = 2
|
|
41
|
+
DRIVETRAIN = 4
|
|
42
|
+
WHEELS = 8
|
|
43
|
+
EFFECTS = 16
|
|
44
|
+
SHAPE = 32
|
|
45
|
+
RUNTIME = 64
|
|
46
|
+
LIDAR = 128
|
|
47
|
+
ALL = 255
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class HeldInput(IntFlag):
|
|
51
|
+
NONE = 0
|
|
52
|
+
ACCELERATE = 1
|
|
53
|
+
BRAKE = 2
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class RaceFlag(IntFlag):
|
|
57
|
+
NONE = 0
|
|
58
|
+
FINISHED = 1
|
|
59
|
+
ENTERED_OFF_ZONE = 2
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class WheelFlag(IntFlag):
|
|
63
|
+
NONE = 0
|
|
64
|
+
CONTACT = 1
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class LidarHitFlag(IntFlag):
|
|
68
|
+
NONE = 0
|
|
69
|
+
HIT = 1
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class WaypointKind(IntEnum):
|
|
73
|
+
CHECKPOINT = 1
|
|
74
|
+
FINISH = 2
|
|
75
|
+
MULTILAP = 3
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class RayFrame(IntEnum):
|
|
79
|
+
CAR = 0
|
|
80
|
+
WORLD = 1
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class InputActionKind(IntEnum):
|
|
84
|
+
ACCELERATE = 1
|
|
85
|
+
BRAKE = 2
|
|
86
|
+
STEER = 3
|
|
87
|
+
SEED = 4
|
|
88
|
+
RESPAWN = 5
|
|
89
|
+
FLAGS = 6
|
|
90
|
+
STANDING_RESPAWN = 7
|
|
91
|
+
GAME_SPEED = 8
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class VehicleType(IntEnum):
|
|
95
|
+
STADIUM = 0
|
|
96
|
+
SNOW = 1
|
|
97
|
+
RALLY = 2
|
|
98
|
+
DESERT = 3
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class GearShiftState(IntEnum):
|
|
102
|
+
TAKE_OFF = 0
|
|
103
|
+
TAKE_OFF_SETTLING = 1
|
|
104
|
+
SHIFTING = 2
|
|
105
|
+
TRACKING = 3
|
|
106
|
+
REVERSE_TAKE_OFF = 4
|
|
107
|
+
BURNOUT_OVERRIDE = 5
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class Effect(IntEnum):
|
|
111
|
+
REACTOR_BOOST_UP = 0
|
|
112
|
+
REACTOR_BOOST_DOWN = 1
|
|
113
|
+
TURBO = 2
|
|
114
|
+
SUPER_TURBO = 3
|
|
115
|
+
ENGINE_OFF = 4
|
|
116
|
+
FRAGILE = 5
|
|
117
|
+
NO_STEERING = 6
|
|
118
|
+
NO_BRAKES = 7
|
|
119
|
+
NO_GRIP = 8
|
|
120
|
+
SLOW_MOTION = 9
|
|
121
|
+
CRUISE_CONTROL = 10
|