zfoundry-zgame 0.1.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.
- zfoundry_zgame-0.1.0/Cargo.lock +295 -0
- zfoundry_zgame-0.1.0/Cargo.toml +37 -0
- zfoundry_zgame-0.1.0/LICENSE +21 -0
- zfoundry_zgame-0.1.0/NOTICE +200 -0
- zfoundry_zgame-0.1.0/PKG-INFO +135 -0
- zfoundry_zgame-0.1.0/README.md +102 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/Cargo.toml +16 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/attr.rs +245 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/batch.rs +396 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/damage.rs +176 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/error.rs +103 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/events.rs +181 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/lib.rs +27 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/math.rs +224 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/npgen.rs +388 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/pool.rs +191 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/registry.rs +109 -0
- zfoundry_zgame-0.1.0/crates/zgame-core/src/rng.rs +289 -0
- zfoundry_zgame-0.1.0/crates/zgame-py/Cargo.toml +33 -0
- zfoundry_zgame-0.1.0/crates/zgame-py/build.rs +97 -0
- zfoundry_zgame-0.1.0/crates/zgame-py/src/env.rs +856 -0
- zfoundry_zgame-0.1.0/crates/zgame-py/src/lib.rs +862 -0
- zfoundry_zgame-0.1.0/crates/zgame-py/src/scripted.rs +321 -0
- zfoundry_zgame-0.1.0/crates/zgame-py/src/semantics.rs +937 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/Cargo.toml +16 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/command.rs +194 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/config.rs +1944 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/data.rs +817 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/engine.rs +617 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/command.rs +398 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/features.rs +593 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/generators.rs +263 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/mask.rs +209 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/mod.rs +76 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/opponent.rs +173 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/reward.rs +133 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/rows.rs +31 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/api.rs +698 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/common.rs +180 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/list.rs +113 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/mod.rs +49 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_1c3s5z.rs +150 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_27m.rs +66 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_2c_vs_64zg.rs +164 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_2s3z.rs +109 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_2vr_vs_3sc.rs +81 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_3hl_vs_24zl.rs +68 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_3rp_vs_5zl.rs +100 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_3s5z.rs +76 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_3s_vs_3z.rs +26 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_3s_vs_4z.rs +37 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_3s_vs_5z.rs +301 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_3st_vs_5zl.rs +88 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_6h_vs_8z.rs +35 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_6m_vs_10m.rs +108 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_7q_vs_2bc.rs +63 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_8m.rs +100 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_corridor.rs +153 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_mmm.rs +191 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_mmmt.rs +255 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_mmmt_vs_zhb.rs +140 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/maps/s_mmmt_vs_zspi.rs +161 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/mod.rs +617 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/scripted/py.rs +681 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/services.rs +156 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/settle.rs +263 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/spotter.rs +133 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/tables.rs +175 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/termination.rs +158 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/env/units.rs +283 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/game.rs +77 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/kinds.rs +50 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/lib.rs +33 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/navmesh.rs +778 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/abilities.rs +401 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/attack.rs +264 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/collision.rs +453 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/commands.rs +358 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/damage.rs +1019 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/kinematics.rs +525 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/mod.rs +292 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/native.rs +3479 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/native_combat.rs +961 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/pathing.rs +200 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/steering.rs +900 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/targeting.rs +1595 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/stages/visibility.rs +285 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/terrain.rs +363 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/src/world.rs +1272 -0
- zfoundry_zgame-0.1.0/crates/zgame-smac/tests/smac.rs +2198 -0
- zfoundry_zgame-0.1.0/pyproject.toml +73 -0
- zfoundry_zgame-0.1.0/python/zgame/__init__.py +31 -0
- zfoundry_zgame-0.1.0/python/zgame/_zgame/__init__.pyi +88 -0
- zfoundry_zgame-0.1.0/python/zgame/_zgame/env.pyi +270 -0
- zfoundry_zgame-0.1.0/python/zgame/py.typed +0 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.5.1"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "crossbeam-deque"
|
|
13
|
+
version = "0.8.8"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
|
|
16
|
+
dependencies = [
|
|
17
|
+
"crossbeam-epoch",
|
|
18
|
+
"crossbeam-utils",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[[package]]
|
|
22
|
+
name = "crossbeam-epoch"
|
|
23
|
+
version = "0.9.21"
|
|
24
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
25
|
+
checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
|
|
26
|
+
dependencies = [
|
|
27
|
+
"crossbeam-utils",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[[package]]
|
|
31
|
+
name = "crossbeam-utils"
|
|
32
|
+
version = "0.8.23"
|
|
33
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
34
|
+
checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
|
|
35
|
+
|
|
36
|
+
[[package]]
|
|
37
|
+
name = "either"
|
|
38
|
+
version = "1.19.0"
|
|
39
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
40
|
+
checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
|
|
41
|
+
|
|
42
|
+
[[package]]
|
|
43
|
+
name = "heck"
|
|
44
|
+
version = "0.5.0"
|
|
45
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
46
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
47
|
+
|
|
48
|
+
[[package]]
|
|
49
|
+
name = "libc"
|
|
50
|
+
version = "0.2.191"
|
|
51
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
52
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
53
|
+
|
|
54
|
+
[[package]]
|
|
55
|
+
name = "matrixmultiply"
|
|
56
|
+
version = "0.3.11"
|
|
57
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
58
|
+
checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
|
|
59
|
+
dependencies = [
|
|
60
|
+
"autocfg",
|
|
61
|
+
"rawpointer",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[[package]]
|
|
65
|
+
name = "ndarray"
|
|
66
|
+
version = "0.17.2"
|
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
+
checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
|
|
69
|
+
dependencies = [
|
|
70
|
+
"matrixmultiply",
|
|
71
|
+
"num-complex",
|
|
72
|
+
"num-integer",
|
|
73
|
+
"num-traits",
|
|
74
|
+
"portable-atomic",
|
|
75
|
+
"portable-atomic-util",
|
|
76
|
+
"rawpointer",
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
[[package]]
|
|
80
|
+
name = "num-complex"
|
|
81
|
+
version = "0.4.6"
|
|
82
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
83
|
+
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
|
84
|
+
dependencies = [
|
|
85
|
+
"num-traits",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[[package]]
|
|
89
|
+
name = "num-integer"
|
|
90
|
+
version = "0.1.47"
|
|
91
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
92
|
+
checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
|
|
93
|
+
dependencies = [
|
|
94
|
+
"num-traits",
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[[package]]
|
|
98
|
+
name = "num-traits"
|
|
99
|
+
version = "0.2.19"
|
|
100
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
101
|
+
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
|
102
|
+
dependencies = [
|
|
103
|
+
"autocfg",
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
[[package]]
|
|
107
|
+
name = "numpy"
|
|
108
|
+
version = "0.30.0"
|
|
109
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
110
|
+
checksum = "aa0b9111761885449e894981fa8051dcf69e0bd114aecbd4bcdd830b6be4ed92"
|
|
111
|
+
dependencies = [
|
|
112
|
+
"libc",
|
|
113
|
+
"ndarray",
|
|
114
|
+
"num-complex",
|
|
115
|
+
"num-integer",
|
|
116
|
+
"num-traits",
|
|
117
|
+
"pyo3",
|
|
118
|
+
"pyo3-build-config",
|
|
119
|
+
"rustc-hash",
|
|
120
|
+
]
|
|
121
|
+
|
|
122
|
+
[[package]]
|
|
123
|
+
name = "once_cell"
|
|
124
|
+
version = "1.21.4"
|
|
125
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
126
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
127
|
+
|
|
128
|
+
[[package]]
|
|
129
|
+
name = "portable-atomic"
|
|
130
|
+
version = "1.15.0"
|
|
131
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
132
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
133
|
+
|
|
134
|
+
[[package]]
|
|
135
|
+
name = "portable-atomic-util"
|
|
136
|
+
version = "0.2.8"
|
|
137
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
138
|
+
checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
|
|
139
|
+
dependencies = [
|
|
140
|
+
"portable-atomic",
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
[[package]]
|
|
144
|
+
name = "proc-macro2"
|
|
145
|
+
version = "1.0.107"
|
|
146
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
147
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
148
|
+
dependencies = [
|
|
149
|
+
"unicode-ident",
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
[[package]]
|
|
153
|
+
name = "pyo3"
|
|
154
|
+
version = "0.30.1"
|
|
155
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
156
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
157
|
+
dependencies = [
|
|
158
|
+
"libc",
|
|
159
|
+
"once_cell",
|
|
160
|
+
"portable-atomic",
|
|
161
|
+
"pyo3-build-config",
|
|
162
|
+
"pyo3-ffi",
|
|
163
|
+
"pyo3-macros",
|
|
164
|
+
]
|
|
165
|
+
|
|
166
|
+
[[package]]
|
|
167
|
+
name = "pyo3-build-config"
|
|
168
|
+
version = "0.30.1"
|
|
169
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
170
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
171
|
+
dependencies = [
|
|
172
|
+
"target-lexicon",
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
[[package]]
|
|
176
|
+
name = "pyo3-ffi"
|
|
177
|
+
version = "0.30.1"
|
|
178
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
179
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
180
|
+
dependencies = [
|
|
181
|
+
"libc",
|
|
182
|
+
"pyo3-build-config",
|
|
183
|
+
]
|
|
184
|
+
|
|
185
|
+
[[package]]
|
|
186
|
+
name = "pyo3-macros"
|
|
187
|
+
version = "0.30.1"
|
|
188
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
189
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
190
|
+
dependencies = [
|
|
191
|
+
"proc-macro2",
|
|
192
|
+
"pyo3-macros-backend",
|
|
193
|
+
"quote",
|
|
194
|
+
"syn",
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
[[package]]
|
|
198
|
+
name = "pyo3-macros-backend"
|
|
199
|
+
version = "0.30.1"
|
|
200
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
201
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
202
|
+
dependencies = [
|
|
203
|
+
"heck",
|
|
204
|
+
"proc-macro2",
|
|
205
|
+
"quote",
|
|
206
|
+
"syn",
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
[[package]]
|
|
210
|
+
name = "quote"
|
|
211
|
+
version = "1.0.47"
|
|
212
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
213
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
214
|
+
dependencies = [
|
|
215
|
+
"proc-macro2",
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
[[package]]
|
|
219
|
+
name = "rawpointer"
|
|
220
|
+
version = "0.2.1"
|
|
221
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
222
|
+
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
|
223
|
+
|
|
224
|
+
[[package]]
|
|
225
|
+
name = "rayon"
|
|
226
|
+
version = "1.12.0"
|
|
227
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
+
checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
|
|
229
|
+
dependencies = [
|
|
230
|
+
"either",
|
|
231
|
+
"rayon-core",
|
|
232
|
+
]
|
|
233
|
+
|
|
234
|
+
[[package]]
|
|
235
|
+
name = "rayon-core"
|
|
236
|
+
version = "1.13.0"
|
|
237
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
238
|
+
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
|
|
239
|
+
dependencies = [
|
|
240
|
+
"crossbeam-deque",
|
|
241
|
+
"crossbeam-utils",
|
|
242
|
+
]
|
|
243
|
+
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "rustc-hash"
|
|
246
|
+
version = "2.1.3"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
|
249
|
+
|
|
250
|
+
[[package]]
|
|
251
|
+
name = "syn"
|
|
252
|
+
version = "3.0.10"
|
|
253
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
254
|
+
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
|
|
255
|
+
dependencies = [
|
|
256
|
+
"proc-macro2",
|
|
257
|
+
"quote",
|
|
258
|
+
"unicode-ident",
|
|
259
|
+
]
|
|
260
|
+
|
|
261
|
+
[[package]]
|
|
262
|
+
name = "target-lexicon"
|
|
263
|
+
version = "0.13.5"
|
|
264
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
265
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
266
|
+
|
|
267
|
+
[[package]]
|
|
268
|
+
name = "unicode-ident"
|
|
269
|
+
version = "1.0.27"
|
|
270
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
271
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "zgame-core"
|
|
275
|
+
version = "0.1.0"
|
|
276
|
+
dependencies = [
|
|
277
|
+
"rayon",
|
|
278
|
+
]
|
|
279
|
+
|
|
280
|
+
[[package]]
|
|
281
|
+
name = "zgame-py"
|
|
282
|
+
version = "0.1.0"
|
|
283
|
+
dependencies = [
|
|
284
|
+
"numpy",
|
|
285
|
+
"pyo3",
|
|
286
|
+
"zgame-core",
|
|
287
|
+
"zgame-smac",
|
|
288
|
+
]
|
|
289
|
+
|
|
290
|
+
[[package]]
|
|
291
|
+
name = "zgame-smac"
|
|
292
|
+
version = "0.1.0"
|
|
293
|
+
dependencies = [
|
|
294
|
+
"zgame-core",
|
|
295
|
+
]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
resolver = "3"
|
|
3
|
+
members = ["crates/zgame-core", "crates/zgame-smac", "crates/zgame-py"]
|
|
4
|
+
|
|
5
|
+
[workspace.package]
|
|
6
|
+
edition = "2024"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
rust-version = "1.85"
|
|
9
|
+
license = "MIT"
|
|
10
|
+
authors = ["Jiale Wang <jialewang@bupt.edu.cn>"]
|
|
11
|
+
repository = "https://github.com/Z-Foundry/ZGame"
|
|
12
|
+
homepage = "https://github.com/Z-Foundry/ZGame"
|
|
13
|
+
|
|
14
|
+
# Runtime dependencies are kept minimal: pyo3, numpy (rust-numpy), and rayon.
|
|
15
|
+
[workspace.dependencies]
|
|
16
|
+
pyo3 = "0.30"
|
|
17
|
+
numpy = "0.30"
|
|
18
|
+
rayon = "1.12"
|
|
19
|
+
zgame-core = { version = "0.1.0", path = "crates/zgame-core" }
|
|
20
|
+
zgame-smac = { version = "0.1.0", path = "crates/zgame-smac" }
|
|
21
|
+
|
|
22
|
+
[workspace.lints.rust]
|
|
23
|
+
unsafe_op_in_unsafe_fn = "deny"
|
|
24
|
+
|
|
25
|
+
[workspace.lints.clippy]
|
|
26
|
+
dbg_macro = "deny"
|
|
27
|
+
print_stdout = "deny"
|
|
28
|
+
print_stderr = "deny"
|
|
29
|
+
|
|
30
|
+
[profile.dev]
|
|
31
|
+
# Keep line tables only for smaller debug artifacts.
|
|
32
|
+
debug = "line-tables-only"
|
|
33
|
+
|
|
34
|
+
[profile.release]
|
|
35
|
+
opt-level = 3
|
|
36
|
+
codegen-units = 16
|
|
37
|
+
lto = false
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jiale Wang
|
|
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.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
ZGame
|
|
2
|
+
Copyright (c) 2026 Jiale Wang
|
|
3
|
+
Repository: https://github.com/Z-Foundry/ZGame
|
|
4
|
+
|
|
5
|
+
This software is licensed under the MIT License (see LICENSE).
|
|
6
|
+
|
|
7
|
+
================================================================================
|
|
8
|
+
THIRD-PARTY NOTICES AND ATTRIBUTIONS
|
|
9
|
+
================================================================================
|
|
10
|
+
|
|
11
|
+
ZGame includes Rust ports and re-implementations of benchmark environment
|
|
12
|
+
semantics, scripted opponent policies, and random distribution algorithms from
|
|
13
|
+
the following open-source projects:
|
|
14
|
+
|
|
15
|
+
--------------------------------------------------------------------------------
|
|
16
|
+
1. SMAC (StarCraft Multi-Agent Challenge)
|
|
17
|
+
Repository: https://github.com/oxwhirl/smac
|
|
18
|
+
License: MIT License
|
|
19
|
+
Scope in ZGame:
|
|
20
|
+
- crates/zgame-smac/src/env/{command,features,mask,reward,settle,tables,termination,units}.rs
|
|
21
|
+
--------------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
MIT License
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2019 whirl
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
in the Software without restriction, including without limitation the rights
|
|
30
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
furnished to do so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|
|
44
|
+
|
|
45
|
+
--------------------------------------------------------------------------------
|
|
46
|
+
2. SMACv2
|
|
47
|
+
Repository: https://github.com/oxwhirl/smacv2
|
|
48
|
+
License: MIT License
|
|
49
|
+
Scope in ZGame:
|
|
50
|
+
- crates/zgame-smac/src/env/{generators,spotter,features,mask,termination}.rs
|
|
51
|
+
--------------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
MIT License
|
|
54
|
+
|
|
55
|
+
Copyright (c) 2019 whirl
|
|
56
|
+
|
|
57
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
58
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
59
|
+
in the Software without restriction, including without limitation the rights
|
|
60
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
61
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
62
|
+
furnished to do so, subject to the following conditions:
|
|
63
|
+
|
|
64
|
+
The above copyright notice and this permission notice shall be included in all
|
|
65
|
+
copies or substantial portions of the Software.
|
|
66
|
+
|
|
67
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
68
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
69
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
70
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
71
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
72
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
73
|
+
SOFTWARE.
|
|
74
|
+
|
|
75
|
+
--------------------------------------------------------------------------------
|
|
76
|
+
3. SMAC-Hard
|
|
77
|
+
Repository: https://github.com/devindeng94/smac-hard
|
|
78
|
+
License: MIT License
|
|
79
|
+
Scope in ZGame:
|
|
80
|
+
- crates/zgame-smac/src/env/scripted/ (Rust port of 45 scripted opponents and helpers)
|
|
81
|
+
--------------------------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
MIT License
|
|
84
|
+
|
|
85
|
+
Copyright (c) 2024 devin
|
|
86
|
+
|
|
87
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
88
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
89
|
+
in the Software without restriction, including without limitation the rights
|
|
90
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
91
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
92
|
+
furnished to do so, subject to the following conditions:
|
|
93
|
+
|
|
94
|
+
The above copyright notice and this permission notice shall be included in all
|
|
95
|
+
copies or substantial portions of the Software.
|
|
96
|
+
|
|
97
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
98
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
99
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
100
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
101
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
102
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
103
|
+
SOFTWARE.
|
|
104
|
+
|
|
105
|
+
--------------------------------------------------------------------------------
|
|
106
|
+
4. NumPy (Random Generator Distribution Algorithms)
|
|
107
|
+
Repository: https://github.com/numpy/numpy
|
|
108
|
+
License: BSD-3-Clause
|
|
109
|
+
Scope in ZGame:
|
|
110
|
+
- crates/zgame-core/src/npgen.rs
|
|
111
|
+
- crates/zgame-core/src/rng.rs (Philox stream interface parity)
|
|
112
|
+
--------------------------------------------------------------------------------
|
|
113
|
+
|
|
114
|
+
Copyright (c) 2005-2025, NumPy Developers.
|
|
115
|
+
All rights reserved.
|
|
116
|
+
|
|
117
|
+
Redistribution and use in source and binary forms, with or without
|
|
118
|
+
modification, are permitted provided that the following conditions are
|
|
119
|
+
met:
|
|
120
|
+
|
|
121
|
+
* Redistributions of source code must retain the above copyright
|
|
122
|
+
notice, this list of conditions and the following disclaimer.
|
|
123
|
+
|
|
124
|
+
* Redistributions in binary form must reproduce the above
|
|
125
|
+
copyright notice, this list of conditions and the following
|
|
126
|
+
disclaimer in the documentation and/or other materials provided
|
|
127
|
+
with the distribution.
|
|
128
|
+
|
|
129
|
+
* Neither the name of the NumPy Developers nor the names of any
|
|
130
|
+
contributors may be used to endorse or promote products derived
|
|
131
|
+
from this software without specific prior written permission.
|
|
132
|
+
|
|
133
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
134
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
135
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
136
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
137
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
138
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
139
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
140
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
141
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
142
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
143
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
144
|
+
|
|
145
|
+
--------------------------------------------------------------------------------
|
|
146
|
+
5. Random123 / Philox4x64-10
|
|
147
|
+
License: BSD-3-Clause
|
|
148
|
+
Scope in ZGame:
|
|
149
|
+
- crates/zgame-core/src/rng.rs (Philox4x64-10 counter-based PRNG)
|
|
150
|
+
--------------------------------------------------------------------------------
|
|
151
|
+
|
|
152
|
+
Copyright 2010-2012, D. E. Shaw Research.
|
|
153
|
+
All rights reserved.
|
|
154
|
+
|
|
155
|
+
Redistribution and use in source and binary forms, with or without
|
|
156
|
+
modification, are permitted provided that the following conditions are
|
|
157
|
+
met:
|
|
158
|
+
|
|
159
|
+
* Redistributions of source code must retain the above copyright
|
|
160
|
+
notice, this list of conditions, and the following disclaimer.
|
|
161
|
+
|
|
162
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
163
|
+
notice, this list of conditions, and the following disclaimer in the
|
|
164
|
+
documentation and/or other materials provided with the distribution.
|
|
165
|
+
|
|
166
|
+
* Neither the name of D. E. Shaw Research nor the names of its
|
|
167
|
+
contributors may be used to endorse or promote products derived from
|
|
168
|
+
this software without specific prior written permission.
|
|
169
|
+
|
|
170
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
171
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
172
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
173
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
174
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
175
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
176
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
177
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
178
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
179
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
180
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
181
|
+
|
|
182
|
+
--------------------------------------------------------------------------------
|
|
183
|
+
6. Direct Rust Crate Dependencies
|
|
184
|
+
--------------------------------------------------------------------------------
|
|
185
|
+
|
|
186
|
+
- pyo3 (MIT OR Apache-2.0): https://github.com/PyO3/pyo3
|
|
187
|
+
- rust-numpy / numpy (BSD-2-Clause): https://github.com/PyO3/rust-numpy
|
|
188
|
+
- rayon (MIT OR Apache-2.0): https://github.com/rayon-rs/rayon
|
|
189
|
+
- ndarray (MIT OR Apache-2.0, transitive via rust-numpy): https://github.com/rust-ndarray/ndarray
|
|
190
|
+
|
|
191
|
+
================================================================================
|
|
192
|
+
TRADEMARK AND NON-AFFILIATION DISCLAIMER
|
|
193
|
+
================================================================================
|
|
194
|
+
|
|
195
|
+
StarCraft and StarCraft II are registered trademarks or trademarks of Blizzard
|
|
196
|
+
Entertainment, Inc. in the U.S. and/or other countries. ZGame is an independent
|
|
197
|
+
open-source high-throughput simulation engine and is not affiliated with,
|
|
198
|
+
endorsed by, or sponsored by Blizzard Entertainment, Inc. This repository does
|
|
199
|
+
not contain any StarCraft II binaries, proprietary game assets, or .SC2Map
|
|
200
|
+
files.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zfoundry-zgame
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Intended Audience :: Science/Research
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Operating System :: MacOS
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
17
|
+
Classifier: Programming Language :: Rust
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Dist: numpy>=1.26
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
License-File: NOTICE
|
|
22
|
+
Summary: Deterministic Rust tactical combat simulation kernel and vectorized SMAC environment services
|
|
23
|
+
Keywords: marl,smac,simulation,rust,pyo3,reinforcement-learning
|
|
24
|
+
Home-Page: https://github.com/Z-Foundry/ZGame
|
|
25
|
+
Author-email: Jiale Wang <jialewang@bupt.edu.cn>
|
|
26
|
+
License-Expression: MIT
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
29
|
+
Project-URL: Homepage, https://github.com/Z-Foundry/ZGame
|
|
30
|
+
Project-URL: Issues, https://github.com/Z-Foundry/ZGame/issues
|
|
31
|
+
Project-URL: Repository, https://github.com/Z-Foundry/ZGame
|
|
32
|
+
|
|
33
|
+
# ZGame
|
|
34
|
+
|
|
35
|
+
English | [Chinese (zh-CN)](README_zh.md)
|
|
36
|
+
|
|
37
|
+
[](LICENSE)
|
|
38
|
+
[](https://www.rust-lang.org/)
|
|
39
|
+
[](https://www.python.org/)
|
|
40
|
+
|
|
41
|
+
**ZGame** is a modular, deterministic, high-performance Rust game simulation kernel and Python extension (`zgame._zgame`, published on PyPI as `zfoundry-zgame` and imported as `zgame`) built for multi-agent reinforcement learning (MARL). It powers the fast Rust backend and accelerated environment-layer kernels of [UniSMAC](https://github.com/Z-Foundry/UniSMAC), delivering **27×–91×** single-core simulation speedups over the Python reference backend and **10×–40×** wall-clock training throughput over StarCraft II process pools — with zero StarCraft II runtime dependency.
|
|
42
|
+
|
|
43
|
+
## Highlights
|
|
44
|
+
|
|
45
|
+
- **Deterministic Batched Simulation (`zgame-core`)**: Counter-based Philox4x64-10 RNG (bitwise compatible with NumPy's `PCG`/`Philox` generator distributions via `npgen`), generational entity slot pools, layered attribute modifiers, structured event streams, stage registries, and thread-count-invariant `Batch<G>` execution (R1 reproducibility).
|
|
46
|
+
- **High-Fidelity SMAC Game Definition (`zgame-smac`)**: Ports the full UniSMAC simulation pipeline — delayed commands, Q12 fixed-point movement/steering/collision, navmesh pathing, combat targeting & assist-on-hit, damage/splash/shield/barrier/regen pipelines, multi-level terrain line-of-sight & 3D projectiles, map-gated Zealot charge, and SMAC-Hard's 45 scripted opponents — matching the Python reference implementation at **`L∞ = 0.0`** across **6,179** controlled movement/combat probes and **246** terrain/vision/charge probes.
|
|
47
|
+
- **Zero-Copy GIL-Free Python Extension (`zgame-py`)**: Exposes `zgame._zgame` (`cp310-abi3` via PyO3 + `rust-numpy` + `maturin`), stepping entire batches while releasing the GIL and writing directly into pre-allocated NumPy buffers (`write_state` / `write_rows`), plus the `zgame._zgame.env` submodule accelerating observations, masks, rewards, termination, SMACv2 procedural generation, and SMAC-Hard scripted opponents.
|
|
48
|
+
- **Explicit Cross-Package Contract**: Exports four read-only compatibility constants (`CONTRACT_VERSION`, `ENGINE_SCHEMA_VERSION`, `env.SERVICES_VERSION`, `env.SEMANTICS`) checked at runtime by downstream consumers such as `unismac`.
|
|
49
|
+
|
|
50
|
+
## Measured Performance
|
|
51
|
+
|
|
52
|
+
Single-core and batched benchmarks measured with `OMP_NUM_THREADS=1` under the `sc2-native` profile and `accel='rust'`:
|
|
53
|
+
|
|
54
|
+
| Workload | Metric | Reference / Baseline | ZGame (`accel='rust'`) | Speedup |
|
|
55
|
+
| --- | --- | ---: | ---: | ---: |
|
|
56
|
+
| 57-unit L3 suite (`sc2-native`, 128 ep/unit) | Cumulative single-core wall time | 7,067.7 s (`pyref`) | **115.1 s** | **61.4×** |
|
|
57
|
+
| `smac-portable/8m` (`sc2-native`) | Single-core throughput | 86.1 step/s (`pyref`) | **6,219 step/s** | **72.2×** |
|
|
58
|
+
| `smac-portable/2c_vs_64zg` (multi-level + 3D) | Single-core throughput | 3.9 step/s (`pyref`) | **358 step/s** | **91.4×** |
|
|
59
|
+
| `smac-portable/8m` MAPPO (`B=128`, 1T / 4T) | Full step throughput | 602 step/s (10 SC2, ~4.1 cores) | **14.4k / 24.1k step/s** | **24×–40×** |
|
|
60
|
+
| `smac-portable/2s3z` MAPPO (`B=128`, 1T / 4T) | Full step throughput | 719 step/s (10 SC2, ~4.0 cores) | **22.6k / 34.8k step/s** | **31×–48×** |
|
|
61
|
+
| `sc2-native` MAPPO (`8m` / `2s3z`, 1T) | End-to-end training wall time | 7,064 s / 2,486 s (`pyref`) | **286 s / 96 s** | **24.7× / 25.8×** |
|
|
62
|
+
|
|
63
|
+
## Installation
|
|
64
|
+
|
|
65
|
+
Most users get `zfoundry-zgame` automatically when installing `unismac` on supported platforms (Linux `x86_64`/`aarch64`, macOS `arm64`/`x86_64`, Windows `AMD64`, Python 3.10–3.14). To install it standalone (PyPI distribution name: `zfoundry-zgame`; Python import name: `import zgame`):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install zfoundry-zgame
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Prebuilt `cp310-abi3` wheels require no Rust toolchain. On unsupported architectures (e.g., RISC-V, FreeBSD, or Alpine ARM64), install from source with Rust 1.85+:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install --no-binary zfoundry-zgame zfoundry-zgame
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Quick Verification
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import zgame
|
|
81
|
+
from zgame import _zgame
|
|
82
|
+
|
|
83
|
+
print("zgame version:", zgame.__version__)
|
|
84
|
+
print("build info:", _zgame.build_info())
|
|
85
|
+
print(
|
|
86
|
+
"contract:",
|
|
87
|
+
_zgame.CONTRACT_VERSION,
|
|
88
|
+
_zgame.ENGINE_SCHEMA_VERSION,
|
|
89
|
+
_zgame.env.SERVICES_VERSION,
|
|
90
|
+
_zgame.env.SEMANTICS,
|
|
91
|
+
)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
For full RL environment usage (presets, scenarios, profiles, vectorized rollouts, and two-sided self-play), see [UniSMAC](https://github.com/Z-Foundry/UniSMAC).
|
|
95
|
+
|
|
96
|
+
## Workspace Layout
|
|
97
|
+
|
|
98
|
+
| Crate / Path | Role |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `crates/zgame-core` | Game-agnostic simulation kernel: Philox RNG + `npgen`, generational slot pool, attributes & modifiers, event stream, stage registry, `Batch<G>` parallel executor |
|
|
101
|
+
| `crates/zgame-smac` | SMAC game definition (10 simulation stages + Q12 native movement/combat, navmesh, multi-level vision, charge) and RL environment-layer kernels (`env::*`, `env::scripted`) |
|
|
102
|
+
| `crates/zgame-py` | PyO3 + `rust-numpy` extension crate compiling to `zgame._zgame` (`cdylib`, `abi3-py310`) |
|
|
103
|
+
| `python/zgame` | Python package wrapper, PEP 561 `py.typed` marker, and `.pyi` type stubs (`_zgame/__init__.pyi`, `_zgame/env.pyi`) |
|
|
104
|
+
| `tests/` | Standalone Python binding tests (`tests/test_bindings.py`) requiring no `unismac` installation |
|
|
105
|
+
|
|
106
|
+
See [docs/architecture.md](docs/architecture.md) for architectural details, determinism guarantees, and the four-dimensional cross-package contract.
|
|
107
|
+
|
|
108
|
+
## Building & Testing from Source
|
|
109
|
+
|
|
110
|
+
Requires Rust ≥ 1.85 (`edition = "2024"`), Python ≥ 3.10, and `maturin`:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Rust formatting, lints, and unit/integration tests
|
|
114
|
+
cargo fmt --all -- --check
|
|
115
|
+
PYO3_BUILD_EXTENSION_MODULE=1 cargo clippy --workspace --all-targets -- -D warnings
|
|
116
|
+
cargo test --workspace --exclude zgame-py
|
|
117
|
+
|
|
118
|
+
# Build a release abi3 wheel and test Python bindings
|
|
119
|
+
maturin build --release -o dist
|
|
120
|
+
pip install dist/zfoundry_zgame-*.whl pytest numpy
|
|
121
|
+
pytest tests/test_bindings.py
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
For local co-development with a sibling `unismac` checkout, build a wheel into `dist/` and pass `--find-links /path/to/zgame/dist` when installing or running tests in `unismac`.
|
|
125
|
+
|
|
126
|
+
## Citation
|
|
127
|
+
|
|
128
|
+
If you use ZGame in your research, please cite it using [CITATION.cff](CITATION.cff).
|
|
129
|
+
|
|
130
|
+
## License & Disclaimer
|
|
131
|
+
|
|
132
|
+
Licensed under the [MIT License](LICENSE). Third-party attributions are listed in [NOTICE](NOTICE).
|
|
133
|
+
|
|
134
|
+
StarCraft® II is a registered trademark of Blizzard Entertainment, Inc. ZGame is an independent open-source research project and is not affiliated with, endorsed by, or sponsored by Blizzard Entertainment, Inc.
|
|
135
|
+
|